コード例 #1
0
    void Update()
    {
        Turn CurrentTurn = Turns[TurnIndex];

        if (CurrentTurn.CurrentStage == Turn.Stage.Start)
        {
            if (CurrentTurn.AreAllTurnStageDoneSignalsSent())
            {
                CurrentTurn.CurrentStage = Turn.Stage.Update;
                CurrentTurn.Signals.ResetSignals();
            }
        }
        else if (CurrentTurn.CurrentStage == Turn.Stage.Update)
        {
            if (CurrentTurn.AreAllTurnStageDoneSignalsSent())
            {
                CurrentTurn.CurrentStage = Turn.Stage.End;
                CurrentTurn.Signals.ResetSignals();
            }
        }
        else if (CurrentTurn.CurrentStage == Turn.Stage.End)
        {
            if (CurrentTurn.AreAllTurnStageDoneSignalsSent())
            {
                CurrentTurn.CurrentStage = Turn.Stage.Start;
                CurrentTurn.Signals.ResetSignals();
                TurnIndex++;
                if (TurnIndex >= Turns.Count)
                {
                    RanTurns.Clear();
                    TurnIndex = 0;
                }
            }
        }
    }