Ejemplo n.º 1
0
        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");
                    }
                }
            }
        }
Ejemplo n.º 2
0
        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");
                    }
                }
            }
        }
Ejemplo n.º 3
0
        public override void Update(Context c, ConditionScriptable conditionScriptable)
        {
            for (int i = 0; i < conditionScriptable.conditions.Count; i++)

            {
                if (conditionScriptable.conditions[i].name == "OnIntroStart" && conditionScriptable.conditions[i].isRaised)
                {
                    c.ChangeState(new IntroStartState());
                    conditionScriptable.Toggle("OnIntroStart");
                }
            }
        }