示例#1
0
    private IEnumerator RoundEnding()
    {
        DisableTankControl();
        string message = "";

        switch (m_Round)
        {
        case 1:
            if (shellExplosion.getScore() >= 100)
            {
                message    = "Next Round!";
                m_RoundWin = true;
            }
            else
            {
                message    = "You Lose!";
                m_RoundWin = false;
            }
            break;

        case 2:
            if (shellExplosion.getScore() >= 240)
            {
                message    = "Next Round!";
                m_RoundWin = true;
            }
            else
            {
                message    = "You Lose!";
                m_RoundWin = false;
            }

            break;

        case 3:
            if (shellExplosion.getScore() >= 400)
            {
                message    = "You Win!";
                m_RoundWin = true;
            }
            else
            {
                message    = "You Lose!";
                m_RoundWin = false;
            }

            break;
        }
        m_MessageText.text = message;
        Debug.Log(m_Round);

        yield return(m_EndWait);
    }
示例#2
0
    void OnGUI()
    {
        m_StrTimeLeft = "Time:" + m_GameManager.m_TimeLeft.ToString();
        m_StrScore    = "Score:" + shellExplosion.getScore().ToString();

        if (m_GameManager.m_Round == 1)
        {
            m_StrTarget = "Target:100";
        }
        else if (m_GameManager.m_Round == 2)
        {
            m_StrTarget = "Target:240";
        }
        else if (m_GameManager.m_Round == 3)
        {
            m_StrTarget = "Target:400";
        }

        GUIStyle style = new GUIStyle();

        style.fontSize         = 18;
        style.normal.textColor = new Color(0, 0, 0);

        GUI.Label(new Rect(10, 10, Screen.width / 6, Screen.height / 6), m_StrTimeLeft, style);
        GUI.Label(new Rect(Screen.width - 120, 10, Screen.width / 6, Screen.height / 6), m_StrScore, style);
        GUI.Label(new Rect(Screen.width / 2, 10, Screen.width / 6, Screen.height / 6), m_StrTarget, style);
    }