示例#1
0
 private void Awake()
 {
     if (Instance == null)
     {
         Instance = this;
     }
     else if (Instance != this)
     {
         Destroy(gameObject);
     }
 }
示例#2
0
    public IEnumerator Event_GameOver(TeamHandler winningTeam)
    {
        ActivateTankControls(m_ActiveCharacter, false);
        StopCoroutine(m_TimerCoroutine);
        LargeCenterText centerText = LargeCenterText.Instance;

        if (winningTeam != null)
        {
            Enum team = winningTeam.Team;
            centerText.Text = team.ToString() + " Team Won";

            switch (winningTeam.Team)
            {
            case unikincTanks.Teams.BLUE: centerText.TextColor = Color.blue; break;

            case unikincTanks.Teams.GREEN: centerText.TextColor = Color.green; break;

            case unikincTanks.Teams.RED: centerText.TextColor = Color.red; break;

            case unikincTanks.Teams.YELLOW: centerText.TextColor = Color.yellow; break;

            default: centerText.TextColor = Color.white; break;
            }
        }
        else
        {
            centerText.Text = "Game Over";
        }

        foreach (GameObject gObj in GameObject.FindGameObjectsWithTag("GameUI"))
        {
            gObj.SetActive(false);
        }

        centerText.ShowWidescreenBars(true);
        centerText.ShowText(true);

        yield return(new WaitForSeconds(3.0f));

        SceneManager.LoadScene("Main Menu");
    }