Exemplo n.º 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;
        }
    }
Exemplo n.º 2
0
    // Start is called before the first frame update
    void Start()
    {
        SPWNLeft_YMin  = m_spawnLeftGuide.GetComponent <Collider>().bounds.min.y;
        SPWNLeft_YMax  = m_spawnLeftGuide.GetComponent <Collider>().bounds.max.y;
        SPWNRight_YMin = m_spawnRightGuide.GetComponent <Collider>().bounds.min.y;
        SPWNRight_YMax = m_spawnRightGuide.GetComponent <Collider>().bounds.max.y;

        birdList     = new List <GameObject>();
        flockSpawned = false;
        totalFlock   = Random.Range(totalBirds_min, totalBirds_max + 1);
        m_umpire     = GetComponent <UmpireControl>();
    }
Exemplo n.º 3
0
    void Start()
    {
        m_totalDoors = 5;
        m_umpire     = GetComponent <UmpireControl>();
        m_opponents  = new List <GameObject>();
        doorList     = new List <GameObject>();
        for (int i = 1; i < m_totalDoors + 1; i++)
        {
            string doorName = "MontyDoor" + i.ToString();

            GameObject doorOBJ = GameObject.Find(doorName);
            doorList.Add(doorOBJ);
        }
        //offset = new Vector3(1.55f, 0.0f, 1.1f);
        setupMNTY(testDifficulty);
        isDrawSignalSent = false;
    }
Exemplo n.º 4
0
 public void SetUmpire(UmpireControl umpire)
 {
     m_umpire = umpire;
 }