public void UpdateText() { int counter = 5; string newText = ChooseText(); while (lastText == newText && counter >= 0) { newText = ChooseText(); counter--; } displayText.text = newText; lastText = newText; overrideText = ""; // reset overrideText overrideCondition = OverrideCondition.none; }
// string[] GetUniqueLevelOptions (string s) { // GameObject levelGO = GameObject.FindGameObjectWithTag("Level"); // if (levelGO != null) // { // LevelText levelText = levelGO.GetComponent<LevelText>(); // if (levelText != null) // { // if (s == "Success") // { // return levelText.bonusSuccessText; // } // if (s == "Failure") // { // return levelText.bonusFailureText; // } // } // } // // string[] blankArray = new string[]{"MISTAKE MADE"}; // // return blankArray; // return null; // } // public void SetText (string t) { // overrideText = t; // } public void SetText(string t, OverrideCondition oC) { overrideText = t; overrideCondition = oC; }