Exemplo n.º 1
0
    private void Update()
    {
        if (CurrentMode != Mode.Simulate)
        {
            return;
        }

        bool finished = HasSimulationCompleted();

        if (!finished)
        {
            finishedTimer = 0;
        }
        else
        {
            finishedTimer += Time.deltaTime;
        }

        if (finishedTimer > 1)
        {
            CurrentMode = Mode.Completed;
            Debug.Log("Simulation completed");

            if (playState.destroyedBombs > CurrentLevel.highScore)
            {
                CurrentLevel.highScore = playState.destroyedBombs;
                CurrentLevel.Save();
            }

            SimulationCompletePanel.Activate();
        }
    }
 private void Awake()
 {
     instance = this;
     gameObject.SetActive(false);
 }