public override void Update(Context c, ConditionScriptable conditionScriptable) { for (int i = 0; i < conditionScriptable.conditions.Count; i++) { if (conditionScriptable.conditions[i].name == "OnGameEnd" && conditionScriptable.conditions[i].isRaised) { timer -= Time.deltaTime; Debug.Log(timer); if (!fading) { FadeUtility.FadeOut(3); fading = true; } if (timer < 0) { c.ChangeState(new GameEndState()); conditionScriptable.Toggle("OnGameEnd"); SceneManager.LoadScene("2.End"); } } } }
public override void Update(Context c, ConditionScriptable conditionScriptable) { for (int i = 0; i < conditionScriptable.conditions.Count; i++) { if (conditionScriptable.conditions[i].name == "OnExit" && conditionScriptable.conditions[i].isRaised) { c.ChangeState(new ExitState()); conditionScriptable.Toggle("OnExit"); } if (conditionScriptable.conditions[i].name == "OnGameStart" && conditionScriptable.conditions[i].isRaised) { timer -= Time.deltaTime; if (isRaised == false) { FadeUtility.FadeOut(3); } isRaised = true; if (timer < 0) { c.ChangeState(new GameStartState()); conditionScriptable.Toggle("OnGameStart"); SceneManager.LoadScene("0.main"); } } } }
void Update() { LogoTimer -= Time.deltaTime; if (LogoTimer < 0 && !isRaised) { isRaised = true; FadeUtility.FadeOut(3); } if (isRaised) { timer -= Time.deltaTime; if (timer < 0 && !isRaised2) { isRaised2 = true; OnExit.Raise(); } } }