fix SetButtonActive NRE

This commit is contained in:
_nebula 2023-05-07 03:54:08 +01:00
parent bf5e8a013c
commit 55e2898c97

View File

@ -438,9 +438,13 @@ internal class MenuManager : MonoBehaviour, IAddComponentOnStart
return;
}
var titleAnimationController = QSBWorldSync.GetUnityObject<TitleScreenManager>()._gfxController;
var activeAlpha = 1;
var activeAlpha = titleAnimationController.IsTitleAnimationComplete() ? 1 : 0;
if (QSBSceneManager.CurrentScene == OWScene.TitleScreen)
{
var titleAnimationController = QSBWorldSync.GetUnityObject<TitleScreenManager>()._gfxController;
activeAlpha = titleAnimationController.IsTitleAnimationComplete() ? 1 : 0;
}
button.SetActive(active);
button.GetComponent<CanvasGroup>().alpha = active ? activeAlpha : 0;