コード例 #1
0
 public State(GameScenario scenario)
 {
     this.scenario = scenario;
     cycle         = 0;
     index         = 0;
     Debug.Assert(scenario.waves.Length > 0, "Empty scenario!");
     wave      = scenario.waves[0].Begin();
     timeScale = 1f;
 }
コード例 #2
0
            public bool Progress()
            {
                float deltaTime = wave.Progress(timeScale * Time.deltaTime);

                while (deltaTime >= 0f)
                {
                    if (++index >= scenario.waves.Length)
                    {
                        if (++cycle >= scenario.cycles && scenario.cycles > 0)
                        {
                            return(false);
                        }
                        index      = 0;
                        timeScale += scenario.cycleSpeedUp;
                    }
                    wave      = scenario.waves[index].Begin();
                    deltaTime = wave.Progress(deltaTime);
                }
                return(true);
            }