// Update is called once per frame void Update() { // Listens in on GameState for the number of rounds if ((GameState.Singleton.CurrentState == State.Win || GameState.Singleton.CurrentState == State.Lose) && (!drawGUI && surveyRoundState != SurveyRoundState.SurveyResultsSent)) { // That last clause fixes a bug where the score window can pop up again by accident. drawGUI = true; if (totalScore == 0) { totalScore = (int)GameState.Singleton.score + GameRoundCounter.GetTotalScore(); } } if (surveyObject != null) { LikertGUI lc2 = surveyObject.GetComponent <LikertGUI>(); string results = lc2.GetResults(); if (results != null && !surveySent) { // SEND THE SURVEY RESULTS OFF.... this.gameObject.GetComponent <DBGameStateManager>().SendSurveyResults(results); surveyRoundState = SurveyRoundState.SurveyResultsSent; surveySent = true; } } }
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(); }