Exemplo n.º 1
0
        public void DestroyUI(CUIWindowBase UI)
        {
            Debug.Log("UIManager DestroyUI " + UI.name);

            CUIManagerHelper.RemoveUIFromCache(UI, HiddenDict);
            CUIManagerHelper.RemoveUIFromCache(UI, ActiveDict);

            Destroy(UI.gameObject);
        }
Exemplo n.º 2
0
        private void InternalOpenUI(CUIWindowBase window, UICallBack callback, params object[] objs)
        {
            if (window == null)
            {
                throw new Exception("UIManager: InternalOpenUI window is null");
            }

            CUIManagerHelper.RemoveUIFromCache(window, HiddenDict);
            CUIManagerHelper.AddUIToCache(window, ActiveDict);

            StackManager.OnUIOpen(window);
            try
            {
                window.OnOpen(objs);
            }
            catch (Exception e)
            {
                Debug.LogError(window.UIName + " OnOpen Exception: " + e);
            }

            AnimManager.StartEnterAnim(window, callback);             //播放动画
        }
Exemplo n.º 3
0
        /// <summary>
        /// 关闭传入的ui实例
        /// </summary>
        public void CloseUI(CUIWindowBase window, bool isPlayAnim = true, UICallBack callback = null,
                            params object[] objs)
        {
            CUIManagerHelper.RemoveUIFromCache(window, ActiveDict);

            if (callback != null)
            {
                callback += InternalCloseUI;
            }
            else
            {
                callback = InternalCloseUI;
            }

            //不播放动画直接调用回调
            if (!isPlayAnim)
            {
                callback(window, objs);
                return;
            }

            AnimManager.StartExitAnim(window, callback);
        }