示例#1
0
    void OnGUI()
    {
        GUI.backgroundColor = Color.black;
        GUI.Box(GUIUtils.CenteredNormal(0.5f, 0.05f, 0.3f, 0.1f), "", skin.box);
        skin.label.normal.textColor = settings.team1.GetColor();
        GUI.Label(GUIUtils.CenteredNormal(0.4f, 0.05f, 0.1f, 0.1f), "" + matchInfo.GetScore(1), skin.label);
        skin.label.normal.textColor = settings.team2.GetColor();
        GUI.Label(GUIUtils.CenteredNormal(0.6f, 0.05f, 0.1f, 0.1f), "" + matchInfo.GetScore(2), skin.label);
        skin.label.normal.textColor = Color.yellow;
        float remaining = Mathf.Floor(timer.GetRemainingTime());

        if (remaining < 0f)
        {
            remaining = 0f;
        }
        string timeStr = "";

        if (remaining / 100 < 1)
        {
            timeStr += "0";
        }
        if (remaining / 10 < 1)
        {
            timeStr += "0";
        }
        timeStr += remaining;
        GUI.Label(GUIUtils.CenteredNormal(0.5f, 0.05f, 0.1f, 0.1f), timeStr, skin.customStyles[0]);
    }
示例#2
0
    IEnumerator EndMatch()
    {
        GetComponent <FaceOff> ().MakeFaceOff(true);
        yield return(new WaitForSeconds(1.0f));

        MatchInfo mi = GetComponent <MatchInfo> ();

        status = 0;
        if (mi.GetScore(1) > mi.GetScore(2))
        {
            status = 1;
        }
        else if (mi.GetScore(2) > mi.GetScore(1))
        {
            status = 2;
        }
        yield return(new WaitForSeconds(4.0f));

        waitQuit = true;
    }