Add scene transitions, lose sanity points

This commit is contained in:
2022-08-20 19:04:34 -07:00
parent 349c4dc4b6
commit 886b957039
21 changed files with 1178 additions and 1861 deletions

View File

@@ -7,7 +7,7 @@ namespace Scampz.GameJam
public class GameManager : MonoBehaviour
{
public static GameManager Instance;
//private LevelChanger _levelChanger;
private LevelChanger _levelChanger;
private void Awake()
{
@@ -18,7 +18,7 @@ namespace Scampz.GameJam
}
Instance = this;
//_levelChanger = GetComponentInChildren<LevelChanger>();
_levelChanger = GetComponentInChildren<LevelChanger>();
}
@@ -29,7 +29,9 @@ namespace Scampz.GameJam
private IEnumerator LoadSceneAsync(string sceneName, LoadSceneMode loadSceneMode)
{
yield return null;
_levelChanger.FadeAnimation();
yield return new WaitForSecondsRealtime(3f);
var loadSceneOperation = SceneManager.LoadSceneAsync(sceneName, loadSceneMode);
loadSceneOperation.allowSceneActivation = false;
while (!loadSceneOperation.isDone)