示例#1
0
    public void Start()
    {
        if (GameplayState.CurrentState == GameplayState.StateType.GAME_OVER)
        {
            titleLabel.text       = "GAME OVER";
            musicAudioSource.clip = gameOverMusic;
        }
        else
        {
            titleLabel.text       = "VICTORY";
            musicAudioSource.clip = victoryMusic;
        }

        musicAudioSource.Play();

        rescuedHostagesLabel.text = GameplayState.RescuedHostages.ToString();
        killedEnemiesLabel.text   = GameplayState.KilledEnemies.ToString();

        float precisionAsPercent = GameplayState.GetShootPrecision() * 100.0f;

        shootPrecisionLabel.text = precisionAsPercent.ToString("F");
        totalShootsLabel.text    = GameplayState.TotalShoots.ToString();


        mainMenuButton.onClick.AddListener(MainMenu);
        replayButton.onClick.AddListener(Replay);

        Cursor.visible   = true;
        Cursor.lockState = CursorLockMode.None;
    }