IEnumerator ClearTextDelayed() { // wait 3 seconds yield return(new WaitForSeconds(3f)); // if still the level name is shown then clear it if (textToShow == gameModel.getCurrentLevelName()) { textToShow = ""; } }
internal void init(ILevelTextModel model, TeamBrookvale.Game.IGameModel gameModel) { // initialize text guiStyle.font = model.AtwriterFont; guiStyle.alignment = TextAnchor.MiddleCenter; guiStyle.normal.textColor = Color.white; guiStyle.fontSize = TeamBrookvale.Game.TBUtil.CalcFontSize(30); // load level name this.gameModel = gameModel; // set text textToShow = gameModel.getCurrentLevelName(); }