//テキストに変更があった場合 public void OnTextChanged(AdvMessageWindow window) { //パラメーターを反映させるために、一度クリアさせてからもう一度設定 if (text) { text.text = ""; text.text = window.Text.OriginalText; //テキストの長さを設定 text.LengthOfView = window.TextLength; } if (nameText) { nameText.text = ""; nameText.text = window.NameText; } switch (readColorMode) { case ReadColorMode.Change: text.color = Engine.Page.CheckReadPage() ? readColor : defaultTextColor; if (nameText) { nameText.color = Engine.Page.CheckReadPage() ? readColor : defaultNameTextColor; } break; case ReadColorMode.None: default: break; } LinkIcon(); }
internal AdvMessageWindow FindWindow(string name) { AdvMessageWindow currentWindow = this.CurrentWindow; if (!string.IsNullOrEmpty(name) && !this.AllWindows.TryGetValue(name, out currentWindow)) { Debug.LogError(name + "is not found in all message windows"); } return(currentWindow); }
//メッセージウィンドを変更 internal void ChangeCurrentWindow(string name) { //設定なしならなにもしない if (string.IsNullOrEmpty(name)) { return; } if (CurrentWindow != null && CurrentWindow.Name == name) { //変化なし return; } else { AdvMessageWindow window; if (!ActiveWindows.TryGetValue(name, out window)) { //アクティブなウィンドウにない場合、全ウィンドウから検索 if (!AllWindows.TryGetValue(name, out window)) { //全ウィンドウにもない場合どうしようもないので、デフォルトウィンドウを Debug.LogWarning(name + "is not found in window manager"); name = DefaultActiveWindowNameList[0]; window = AllWindows[name]; } //非アクティブなウィンドウと交換 if (CurrentWindow != null) { ActiveWindows.Remove(CurrentWindow.Name); } ActiveWindows.Add(name, window); //登録されたイベントを呼ぶ CalllEventActiveWindows(); } LastWindow = CurrentWindow; CurrentWindow = window; //登録されたイベントを呼ぶ if (LastWindow != null) { LastWindow.ChangeCurrent(false); } CurrentWindow.ChangeCurrent(true); OnChangeCurrentWindow.Invoke(this); } }