//指定のオブジェクトのメッセージウィンドウをAdvEngineに埋め込み internal void EmbedWindow(IAdvMessageWindow window) { string windowName = window.gameObject.name; if (!AllWindows.ContainsKey(windowName)) { AddWindow(window); } AllWindows[windowName].MessageWindow = window; }
//管理対象のウィンドウのUIオブジェクトを削除 public void RemoveWindow(IAdvMessageWindow window) { string windowName = window.gameObject.name; if (!AllWindows.ContainsKey(windowName)) { return; } AllWindows.Remove(window.gameObject.name); }
//管理対象のウィンドウUIオブジェクトを追加 public void AddWindow(IAdvMessageWindow window) { string windowName = window.gameObject.name; if (allWindows.ContainsKey(windowName)) { Debug.LogError(windowName + ". The same name already exists. Please change to a different name."); return; } allWindows.Add(windowName, new AdvMessageWindow(window)); if (Application.isPlaying) { window.OnInit(this); } }
protected virtual void AddWindow(IAdvMessageWindow messageWindow) { string name = messageWindow.gameObject.name; //同じウィンドウが重複されて登録されていないかチェック if (allWindows.ContainsKey(name)) { if (!allWindows.ContainsValue(messageWindow)) { Debug.LogErrorFormat("{0} is already exists in windows"); } return; } allWindows.Add(name, messageWindow); }
protected virtual void InitWindows() { allWindows = new Dictionary <string, IAdvMessageWindow>(); foreach (var item in messageWindowList) { IAdvMessageWindow window = item.GetComponent <IAdvMessageWindow>(); if (window == null) { Debug.LogErrorFormat("{0} is not MessageWindow"); continue; } AddWindow(window); } foreach (var window in this.GetComponentsInChildren <IAdvMessageWindow>(true)) { AddWindow(window); } }
public AdvMessageWindow(IAdvMessageWindow messageWindow) { this.MessageWindow = messageWindow; Name = this.MessageWindow.gameObject.name; Clear(); }