Exemple #1
0
 virtual public void dispose()
 {
     if (m_bNeedPlaceHolderGo && m_placeHolderGo != null)
     {
         UtilApi.Destroy(m_placeHolderGo);
     }
 }
Exemple #2
0
 public void unloadModule(ModuleID moduleID)
 {
     if (ModuleID.LOGINMN == moduleID)
     {
         if (Ctx.m_instance.m_loginSys != null)
         {
             Ctx.m_instance.m_loginSys.unload();
         }
     }
     else if (ModuleID.AUTOUPDATEMN == moduleID)
     {
         if (Ctx.m_instance.m_autoUpdate != null)
         {
             Ctx.m_instance.m_autoUpdate.unload();
         }
     }
     if (Ctx.m_instance.m_layerMgr.m_path2Go.ContainsKey(m_type2ItemDic[moduleID].m_moduleLayerPath))
     {
         UtilApi.Destroy(Ctx.m_instance.m_layerMgr.m_path2Go[m_type2ItemDic[moduleID].m_moduleLayerPath]);
     }
     else
     {
         Ctx.m_instance.m_logSys.log("没有找到卸载的模块的 object");
     }
     Ctx.m_instance.m_layerMgr.m_path2Go.Remove(m_type2ItemDic[moduleID].m_moduleLayerPath);
     UtilApi.UnloadUnusedAssets();
 }
Exemple #3
0
        public void dispose()
        {
            if (m_controlRes != null)
            {
                Ctx.m_instance.m_controllerMgr.unload(m_controlRes.GetPath(), null);
                m_controlRes = null;
            }

            if (m_animator != null)
            {
                UtilApi.Destroy(m_animator.runtimeAnimatorController);
            }

            if (m_nextFrametimer != null)
            {
                Ctx.m_instance.m_frameTimerMgr.delObject(m_nextFrametimer);
                m_nextFrametimer = null;
            }
            if (m_idleStateFrametimer != null)
            {
                Ctx.m_instance.m_frameTimerMgr.delObject(m_idleStateFrametimer);
                m_idleStateFrametimer = null;
            }
            if (m_oneAniEndTimer != null)
            {
                Ctx.m_instance.m_timerMgr.delObject(m_oneAniEndTimer);
                m_oneAniEndTimer = null;
            }

            m_oneAniPlayEndDisp.clearEventHandle();
        }
Exemple #4
0
        // 加载 Prefab
        protected void loadPrefab()
        {
            if (m_bNeedReload)
            {
                if (m_selfGo != null)
                {
                    UtilApi.Destroy(m_selfGo);
                    m_selfGo = null;
                }
                if (m_prefabRes != null)
                {
                    Ctx.m_instance.m_uiPrefabMgr.unload(m_prefabRes.GetPath(), null);
                    m_prefabRes = null;
                }
                m_prefabRes = Ctx.m_instance.m_uiPrefabMgr.getAndSyncLoad <UIPrefabRes>(m_prefabPath);
                m_selfGo    = m_prefabRes.InstantiateObject(m_prefabPath);

                if (m_bNeedPlaceHolderGo && m_placeHolderGo != null)
                {
                    UtilApi.SetParent(m_selfGo, m_placeHolderGo, false);
                }
                else if (m_pntGo != null)
                {
                    UtilApi.SetParent(m_selfGo, m_pntGo, false);
                }

                findWidget();
                m_bImageGoChange = true;      // 设置重新更新图像
            }
            m_bNeedReload = false;
        }
Exemple #5
0
 virtual public void removeAndDestroyElem(GameObject go_, bool recalc = false)
 {
     UtilApi.Destroy(go_);
     if (recalc)
     {
         reposition();
     }
 }
Exemple #6
0
 override public void dispose()
 {
     if (m_model != null)
     {
         UtilApi.Destroy(m_model);
         m_model = null;
     }
 }
Exemple #7
0
        protected Action <NumAniSeqBase> m_aniSeqEndDisp;          // 动画结束分发

        public void destroy()
        {
            m_numAniList.Clear();
            m_aniSeqEndDisp       = null;
            m_go.transform.parent = null;
            UtilApi.Destroy(m_go);

            m_go = null;
        }
Exemple #8
0
        // 关闭拖放功能
        public void disableDrag()
        {
            UIDragObject drag = m_mazeRoom.selfGo.GetComponent <UIDragObject>();

            UtilApi.Destroy(drag);
            WindowDragTilt dragTitle = m_mazeRoom.selfGo.GetComponent <WindowDragTilt>();

            UtilApi.Destroy(dragTitle);
        }
Exemple #9
0
 public virtual void unload()
 {
     if (m_selfGo != null)
     {
         UtilApi.Destroy(m_selfGo);
         m_selfGo = null;
         Ctx.m_instance.m_modelMgr.unload(m_path, null);
         m_res = null;
     }
 }
Exemple #10
0
        public IEnumerator replace()
        {
            for (int x = 0; x < 3; x++)
            {
                Transform t   = null;
                Vector3   now = t.localPosition;

                AnimationClip back = moveto(now, mycarddeap.position);
#if UNITY_5
                t.GetComponent <Animation>().AddClip(back, "back");

                //让转倒播
                t.GetComponent <Animation>()["cardxuanzhuan"].speed = -1;
                t.GetComponent <Animation>()["cardxuanzhuan"].time  = 1;

                t.GetComponent <Animation>().Play("cardxuanzhuan");
                //混合播
                t.GetComponent <Animation>().Blend("back", 60);
#elif UNITY_4_6 || UNITY_4_5
                t.animation.AddClip(back, "back");

                //让转倒播
                t.animation["cardxuanzhuan"].speed = -1;
                t.animation["cardxuanzhuan"].time  = 1;

                t.animation.Play("cardxuanzhuan");
                //混合播
                t.animation.Blend("back", 60);
#endif

                yield return(new WaitForSeconds(0.5f));

                AnimationClip come = moveto(mycarddeap.position, now);
                //实例一张
                Transform c = null;
                c.parent = dzban;
#if UNITY_5
                c.GetComponent <Animation>().AddClip(come, "come");
                //倒播
                c.GetComponent <Animation>().Play("cardxuanzhuan");
                c.GetComponent <Animation>().Blend("come", 60);
#elif UNITY_4_6 || UNITY_4_5
                c.animation.AddClip(come, "come");
                //倒播
                c.animation.Play("cardxuanzhuan");
                c.animation.Blend("come", 60);
#endif
                yield return(new WaitForSeconds(0.5f));

                UtilApi.Destroy(t.gameObject);
            }

            Ctx.m_instance.m_coroutineMgr.StartCoroutine(bancardgohand());
        }
Exemple #11
0
        // 卸载
        public override void unload()
        {
            if (bInCurState(SoundPlayState.eSS_Play))
            {
                Stop();
            }

            if (m_go != null)
            {
                UtilApi.Destroy(m_go);
                //UtilApi.UnloadUnusedAssets();
            }
        }
Exemple #12
0
        override public void dispose()
        {
            if (m_selfGo != null)
            {
                UtilApi.Destroy(m_selfGo);
            }

            base.dispose();

            if (m_prefabRes != null)
            {
                Ctx.m_instance.m_uiPrefabMgr.unload(m_prefabRes.GetPath(), null);
            }
        }
Exemple #13
0
        protected void clearEffectRes()
        {
            if (m_selfGo != null)        // 场景中的特效需要直接释放这个 GameObject
            {
                UtilApi.Destroy(m_selfGo);
                m_selfGo       = null;
                m_spriteRender = null;
            }

            if (m_effectPrefab != null)
            {
                Ctx.m_instance.m_modelMgr.unload(m_effectPrefab.GetPath(), null);
                m_effectPrefab = null;
            }
        }
Exemple #14
0
        /// <summary>
        /// 让替换的卡牌到手牌手牌区
        /// </summary>
        IEnumerator bancardgohand()
        {
            //让手牌到手牌区
            iTween.MoveTo(dzban.gameObject, new Vector3(0, 0, -2.66f), 0.5f);

            mHnadTarget = GameObject.Find("handt").transform;

            //一共共2个单位 分给所有人
            int x = 1;
            //间隔值
            float interval = 2.0f / dzban.childCount;
            float start    = -1;

            foreach (Transform t in dzban.transform)
            {
                //进行排列
                Vector3 p = t.localPosition;
                p.x             = start + x * interval;
                t.localPosition = p;
                //看向target
                t.LookAt(mHnadTarget);
                //修正
                t.Rotate(Vector3.up, 180f);
                //旋转x轴,
                t.Rotate(Vector3.forward, -8f);

                UtilApi.setScale(t, new Vector3(0.7f, 0.7f, 0.7f));
                x++;
            }
            //等待动画完成
            yield return(new WaitForSeconds(0.5f));

            //幸运币消失,
            Transform l = GameObject.Find("luckycoin").transform;

            if (true)
            {
                //先手
                myHero.SendMessage("setGameID", 1);
                enemyHero.SendMessage("setGameID", 2);

                //回合开始
                turnBegin();
            }

            UtilApi.Destroy(l.gameObject);
            clearUpHand();
        }
Exemple #15
0
        protected void exitFormInternal(UIFormID ID)
        {
            Form win = getForm(ID);

            if (win != null)
            {
                // 清理列表
                UILayer layer = win.uiLayer;
                layer.winDic.Remove(ID);
                // 释放界面资源
                win.onExit();
                UtilApi.Destroy(win.m_GUIWin.m_uiRoot);
                win.m_GUIWin.m_uiRoot = null;
                // 释放加载的资源
                //string path = m_UIAttrs.getPath(ID);
                //if (path != null)
                //{
                //    Ctx.m_instance.m_resLoadMgr.unload(path);
                //}
                UtilApi.UnloadUnusedAssets();       // 异步卸载共用资源
                m_id2FormDic.Remove(ID);
                win = null;
            }
        }
Exemple #16
0
        // 同步更新控制器
        public void syncUpdateControl()
        {
            if (m_bNeedReload)
            {
                if (m_controlRes != null)
                {
                    Ctx.m_instance.m_controllerMgr.unload(m_controlRes.GetPath(), null);
                    m_controlRes = null;

                    if (m_animator != null)
                    {
                        UtilApi.Destroy(m_animator.runtimeAnimatorController);
                    }
                }

                m_controlRes = Ctx.m_instance.m_controllerMgr.getAndSyncLoad <ControllerRes>(m_controlPath);
            }
            if (m_selfGoChanged)
            {
                UtilApi.AddAnimatorComponent(m_selfGo);
                m_animator = m_selfGo.GetComponent <Animator>();
            }

            if (m_bNeedReload || m_selfGoChanged)
            {
                m_animator.runtimeAnimatorController = m_controlRes.InstantiateController();

                if (m_stateValue == 0 && canStopIdleFrameTimer())       // 如果当前在 Idle 状态,并且已经完成到 Idle 状态的切换
                {
                    m_animator.enabled = false;
                }
            }

            m_bNeedReload   = false;
            m_selfGoChanged = false;
        }
Exemple #17
0
 public void dispose()
 {
     m_parentGo.transform.parent = null;
     disposeNum();
     UtilApi.Destroy(m_parentGo);
 }