示例#1
0
    void OnGUI()
    {
        if (drawGUI)
        {
            if (boxStyle == null)
            {
                boxStyle = new GUIStyle(GUI.skin.box);
                boxStyle.normal.background = GUIUtils.MakeBlankTexture(width, height, fontBackground);
                buttonStyle          = new GUIStyle(GUI.skin.button);
                buttonStyle.font     = font;
                buttonStyle.fontSize = fontSize;
            }

            string scoreText = GenerateScoreText();

            if (GameRoundCounter.GetCurrentRound() < surveyRound)
            {
                // Draw continue dialogue
                GUILayout.BeginArea(new Rect((Screen.width - width) / 2.0f, (Screen.height - height) / 2.0f, width, height), GUI.skin.box);

                scrollPosition = GUILayout.BeginScrollView(scrollPosition, boxStyle);
                GUILayout.Label(scoreText, textStyle);
                GUILayout.EndScrollView();

                // BUTTONS
                if (GUILayout.Button("Continue!", buttonStyle))
                {
                    drawGUI = false;
                    GameRoundCounter.AdvanceRound();
                    GameRoundCounter.AddScore((int)GameState.Singleton.score);
                    // The following line is a hack to keep the survey from drawing after the round changes.
                    surveyRoundState = SurveyRoundState.SurveyObjectSpawned;
                    Application.LoadLevel(gameSceneName);
                }
                GUILayout.EndArea();
            }
            else
            {
                // Spawn the survey object
                switch (surveyRoundState)
                {
                case SurveyRoundState.WaitingToSpawn:
                    string text = '\n' + "Feel free to continue or finish up with the post-game survey.";
                    // Otherwise, spawn a box that lets the player quit or continue
                    DisplayContinueOrQuitDialogue(scoreText + text);
                    break;

                case SurveyRoundState.SurveyObjectSpawned:
                case SurveyRoundState.SurveyResultsSent:
                    // Draw nothing
                    break;
                }
            }
        }
    }
示例#2
0
 void OnGUI()
 {
     GUI.depth = (int)GUIDepthLevels.DISPLAY_ELEMENT;
     GUILayout.BeginArea(new Rect(origin.x, origin.y, Screen.width, Screen.height));
     GUILayout.BeginVertical(); //origin.x, origin.y);
     if (GameState.Singleton.labelTags.Count > 0)
     {
         GUILayout.Label("Your Location: " + GameState.Singleton.labelTags[0], textStyle);
     }
     GUILayout.Label("Round: " + (GameRoundCounter.GetCurrentRound() + 1), textStyle);
     GUILayout.Label("Round Score: " + GameState.Singleton.score, textStyle);
     GUILayout.Label("Total Score: " + GameRoundCounter.GetTotalScore(), textStyle);
     GUILayout.EndVertical();
     GUILayout.EndArea();
 }
示例#3
0
 public bool IsSurveyRound()
 {
     return(GameRoundCounter.GetCurrentRound() == surveyRound);
 }