コード例 #1
0
        //指定のオブジェクトのメッセージウィンドウをAdvEngineに埋め込み
        internal void EmbedWindow(IAdvMessageWindow window)
        {
            string windowName = window.gameObject.name;

            if (!AllWindows.ContainsKey(windowName))
            {
                AddWindow(window);
            }
            AllWindows[windowName].MessageWindow = window;
        }
コード例 #2
0
        //管理対象のウィンドウのUIオブジェクトを削除
        public void RemoveWindow(IAdvMessageWindow window)
        {
            string windowName = window.gameObject.name;

            if (!AllWindows.ContainsKey(windowName))
            {
                return;
            }
            AllWindows.Remove(window.gameObject.name);
        }
コード例 #3
0
        //管理対象のウィンドウ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);
            }
        }
コード例 #4
0
        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);
        }
コード例 #5
0
 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);
     }
 }
コード例 #6
0
 public AdvMessageWindow(IAdvMessageWindow messageWindow)
 {
     this.MessageWindow = messageWindow;
     Name = this.MessageWindow.gameObject.name;
     Clear();
 }