Esempio n. 1
0
    void Update()
    {
        handleInput();
        if (playerHealth <= 0)
        {
            Debug.Log("Defeat!");
            BeginNewGame();
        }

        if (scenarioIsInProgress && !activeScenario.Progress() && enemies.IsEmpty)
        {
            Debug.Log("Victory!");
            BeginNewGame();
        }
        else if (scenarioIsInProgress && !activeScenario.WaveIsInProgress() && enemies.IsEmpty)
        {
            if (!isBuildPhase)
            {
                isBuildPhase    = true;
                availableBuilds = 5;
            }
        }

        nonEnemies.GameUpdate();
        enemies.GameUpdate();
        Physics.SyncTransforms();
        board.GameUpdate();
    }