Exemple #1
0
 public void CacheMsg(UIMsgBase dialog, bool isOk)
 {
     if (null != dialog && !cacheMsgList.Contains(dialog))
     {
         cacheMsgList.Add(dialog);
     }
 }
Exemple #2
0
        public void LoadMsg(string key, System.Action <UIMsgBase> callback)
        {
            UIMsgBase dialog = FindMsgInCache(key);

            if (dialog == null)
            {
                string assetName = key + "Msg";
                string abName    = AppConst.ResDir + "Prefabs/UI/Msg/" + assetName + ".prefab";
                ResManager.LoadPrefab(abName, delegate(UnityEngine.Object[] objs)
                {
                    if (objs.Length == 0)
                    {
                        return;
                    }
                    GameObject newSceneGameObject = objs[0] as GameObject;
                    if (newSceneGameObject != null)
                    {
                        newSceneGameObject = UIUtils.AddChild(MsgRoot, newSceneGameObject);
                        if (newSceneGameObject.activeSelf == true)
                        {
                            Debug.Log("newSceneGameObject activity true:" + newSceneGameObject.name);
                        }
                        else
                        {
                            Debug.Log("newSceneGameObject activity false:" + newSceneGameObject.name);
                        }
                        if (newSceneGameObject != null)
                        {
                            dialog = newSceneGameObject.GetComponent <UIMsgBase>();
                            dialog.InitializeScene();
                            callback(dialog);
                        }
                        else
                        {
                            Debug.LogWarning("UISystem::LoadDialog() Failed to add new scene to parent UISystem with name: " + key);
                        }
                    }
                    else
                    {
                        Debug.LogWarning("UISystem::LoadDialog() Failed to load new scene with name: " + key);
                    }
                });
            }
            else
            {
                callback(dialog);
            }
        }
Exemple #3
0
        public void PopMsg(string msg)
        {
            UIMsgBase dialog = FindMsgInCache(msg);

            dialog.OnSceneActivated();
        }