Started making main menu

This commit is contained in:
Pasha Bibko
2026-04-28 14:19:12 +01:00
parent 43d27a6657
commit 4fe2965a09
8 changed files with 861 additions and 18 deletions

View File

@@ -21,15 +21,20 @@ namespace Fruitomation.Game
}
Instance = this;
Canvas canvas = gameObject.AddComponent<Canvas>();
canvas.renderMode = RenderMode.ScreenSpaceOverlay;
GameObject overlayGo = new("Overlay");
overlayGo.transform.SetParent(canvas.transform);
Transition = overlayGo.AddComponent<SceneControllerTransition>();
Transition.OnCreation(canvas);
#if UNITY_EDITOR
#else // Only does start transition on non editor builds
StartCoroutine(EndLoadInternal(2.5f));
#endif
}
private const float FadeMultiplier = 4f;
@@ -61,9 +66,10 @@ namespace Fruitomation.Game
operation.allowSceneActivation = true;
}
private IEnumerator EndLoadInternal()
private IEnumerator EndLoadInternal(float waitTime = 0.2f)
{
yield return new WaitForSecondsRealtime(0.2f);
Transition.LerpValue = 1f;
yield return new WaitForSecondsRealtime(waitTime);
Transition.GoingUp = true;
float lerp = 0f;