Пример #1
0
    private void DrawPlayerHUD()
    {
        GUI.BeginGroup(new Rect(10, 10, 340, 150));
        GUIStyle countdownStyle = new GUIStyle(HUDStyle);

        countdownStyle.fontSize         = 30;
        countdownStyle.fontStyle        = FontStyle.Bold;
        countdownStyle.normal.textColor = Color.white;
        // TODO: MAXDAYS should be on GameManager or somewhere else. But it's ok here for proto.
        int    MAXDAYS = 30;
        int    day     = (int)(MAXDAYS - (gametime.GetDay() - 1));
        string label   = "Days Left: ";

        if (day > 1)
        {
            label += day.ToString();
        }
        else if (day == 1)
        {
            label = "Last Day!";
        }
        else if (day == 0)
        {
            if (player0 != null)
            {
                finalScoreP0 = inventory0.money;
            }
            if (player1 != null)
            {
                finalScoreP1 = inventory1.money;
            }
            label = GetFinalScoreLabel();
        }
        else
        {
            label = GetFinalScoreLabel();
        }

        GUI.Label(new Rect(0, 0, 100, 100), label, countdownStyle);

        GUI.Label(new Rect(0, 50, 120, 100), "Day: " + gametime.GetDay());
        GUI.Label(new Rect(0, 65, 120, 100), "Hour: " + gametime.GetHour());
        GUI.Label(new Rect(0, 80, 120, 100), "Minute: " + gametime.GetMinute());
        GUI.EndGroup();
    }