コード例 #1
0
    /// <summary>
    ///
    /// </summary>
    void Update()
    {
        if (UmpireControl.isGameStarted && !m_isGameStarted)
        {
            for (int i = 0; i < m_bandits.Count; i++)
            {
                // show the bandit
                GameObject bandit = m_bandits[i];
                bandit.SetActive(true);

                // start the bandit's countdown
                Bandit banditScript = bandit.GetComponent <Bandit>();
                banditScript.StartFireCountdown();
            }

            m_isGameStarted = true;
        }

        if (m_bandits.Count == 0 && !m_isGameFinished)
        {
            UmpireControl umpire = FindObjectOfType <UmpireControl>();
            umpire.gameSuccess();

            float reactionTime = UmpireControl.reactionTimer;

            if (HighscoreManager.GetHighscore("Mexican Standoff") > reactionTime)
            {
                HighscoreManager.SetHighscore("Mexican Standoff", reactionTime);
            }

            umpire.ShowHighscore(HighscoreManager.GetHighscore("Mexican Standoff"));

            m_isGameFinished = true;
        }
    }
コード例 #2
0
    // Update is called once per frame
    void Update()
    {
        if (UmpireControl.isGameStarted && !flockSpawned)
        {
            spawnFlock();
            flockSpawned = true;
        }
        if (UmpireControl.isGameStarted && birdList.Count == 0)
        {
            m_umpire.gameSuccess();

            float reactionTime = UmpireControl.reactionTimer;

            if (HighscoreManager.GetHighscore("Bird in the Bush") > reactionTime)
            {
                HighscoreManager.SetHighscore("Bird in the Bush", reactionTime);
            }

            m_umpire.ShowHighscore(HighscoreManager.GetHighscore("Bird in the Bush"));
        }
    }
コード例 #3
0
    /// <summary>
    ///
    /// </summary>
    private void EvaluateEndCondition()
    {
        if (m_isDesiredCup) // right cup
        {
            float reactionTime = UmpireControl.reactionTimer;

            // update highscore
            if (HighscoreManager.GetHighscore("3 Gun Monte") > reactionTime)
            {
                HighscoreManager.SetHighscore("3 Gun Monte", reactionTime);
            }

            // show highscore
            m_umpire.ShowHighscore(HighscoreManager.GetHighscore("3 Gun Monte"));

            // win
            m_umpire.gameSuccess();
        }
        else // wrong cup
        {
            // fail
            m_umpire.gameFailed();
        }
    }