Beispiel #1
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();
        }
Beispiel #2
0
 public void onEnterTimerEndHandle(TimerItemBase timer)
 {
     if (Ctx.m_instance.m_maze.mazeData.curSceneIdx == (int)eSceneIndex.eFirst)
     {
         Ctx.m_instance.m_maze.mazeData.mazeScene.loadSecondScene();
     }
 }
Beispiel #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();
        }
Beispiel #4
0
        // 定时释放资源
        public void onTimer(TimerItemBase time)
        {
            bool hasNoLoop = false;

            // 遍历看有没有播放完成的
            foreach (SoundItem sound in m_audioList)
            {
                if (sound.isEnd())
                {
                    m_clearList.Add(sound);
                }
                else if (!sound.m_bLoop)
                {
                    hasNoLoop = true;
                }
            }

            foreach (SoundItem sound in m_clearList)
            {
                unload(sound.m_path);
            }

            m_clearList.Clear();

            if (!hasNoLoop)
            {
                Ctx.m_instance.m_timerMgr.delObject(m_timer);
            }
        }
Beispiel #5
0
        protected void endTimer(TimerItemBase timer)
        {
            m_num.dispose();

            if(m_aniEndDisp != null)
            {
                m_aniEndDisp(this);
            }
        }
Beispiel #6
0
        protected void endTimer(TimerItemBase timer)
        {
            m_num.dispose();

            if (m_aniEndDisp != null)
            {
                m_aniEndDisp(this);
            }
        }
Beispiel #7
0
 // 隐藏 VS 图标
 public void hideVS(TimerItemBase timer)
 {
     Camera.main.transform.FindChild("vs").gameObject.SetActive(false);
     // 这个之后才开始显示播放自己第一次牌
     if(m_heroAniEndDisp != null)
     {
         m_heroAniEndDisp();
         m_heroAniEndDisp = null;
     }
 }
Beispiel #8
0
        public void addTimer()
        {
            if (m_timer == null)
            {
                m_timer               = new TimerItemBase();
                m_timer.m_internal    = 3;     // 一分钟遍历一次
                m_timer.m_bInfineLoop = true;
                m_timer.m_timerDisp   = onTimer;
            }

            // 检查是否要加入定时器
            Ctx.m_instance.m_timerMgr.addObject(m_timer);
        }
Beispiel #9
0
        public void dispose()
        {
            if(m_showCard != null)
            {
                m_showCard.dispose();
            }

            if (m_watchStage == WatchStage.eStartTimer)
            {
                stopTimer();
                m_timer = null;
            }
        }
Beispiel #10
0
        // 启动初始化定时器
        protected void startBigStartTimer()
        {
            if (m_bigStartTimer == null)
            {
                m_bigStartTimer = new TimerItemBase();
            }
            else
            {
                m_bigStartTimer.reset();        // 重置内部数据
            }

            m_bigStartTimer.m_internal  = 0.5f;
            m_bigStartTimer.m_totalTime = 0.5f;
            m_bigStartTimer.m_timerDisp = onBigStartTimerEndHandle;

            Ctx.m_instance.m_timerMgr.addObject(m_bigStartTimer);
        }
Beispiel #11
0
        protected void startSmallStar2fTimer()
        {
            if (m_smallStar2fTimer == null)
            {
                m_smallStar2fTimer = new TimerItemBase();
            }
            else
            {
                m_smallStar2fTimer.reset();        // 重置内部数据
            }

            m_smallStar2fTimer.m_internal  = 2.0f;
            m_smallStar2fTimer.m_totalTime = 2.0f;
            m_smallStar2fTimer.m_timerDisp = onSmallStar2fTimerEndHandle;

            Ctx.m_instance.m_timerMgr.addObject(m_smallStar2fTimer);
        }
Beispiel #12
0
        public void play()
        {
            // 动画
            //PosAni posAni = new PosAni();
            //m_numAni = new NumAniParallel();
            //m_numAni.addOneNumAni(posAni);
            //posAni.setTime(5);
            //posAni.setGO(m_num.getParentGo());
            //posAni.destPos = m_num.getPos() + new Vector3(0, 3, 0);
            //m_numAni.play();

            // 启动定时器
            TimerItemBase timer = new TimerItemBase();
            timer.m_internal = 1;
            timer.m_totalTime = 1;
            timer.m_timerDisp = endTimer;
            Ctx.m_instance.m_timerMgr.addObject(timer);
        }
Beispiel #13
0
        // 启动初始化定时器
        protected void startTimer()
        {
            m_watchStage = WatchStage.eStartTimer;

            if (m_timer == null)
            {
                m_timer = new TimerItemBase();
            }
            else
            {
                m_timer.reset();        // 重置内部数据
            }

            m_timer.m_internal = 0.5f;
            m_timer.m_totalTime = 0.5f;
            m_timer.m_timerDisp = onTimerEndHandle;

            Ctx.m_instance.m_timerMgr.addObject(m_timer);
        }
Beispiel #14
0
        // 开始对战定时器
        public void startDZTimer()
        {
            Ctx.m_instance.m_logSys.log(Ctx.m_instance.m_langMgr.getText(LangTypeId.eDZ4, LangItemID.eItem5));

            if (m_timer == null)
            {
                m_timer = new TimerItemBase();
            }
            else
            {
                m_timer.reset();    // 重置参数
            }

            m_timer.m_internal = m_sceneDZData.m_DZDaoJiShiXmlLimit.m_roundtime - m_sceneDZData.m_DZDaoJiShiXmlLimit.m_lastroundtime;
            m_timer.m_totalTime = m_timer.m_internal;
            m_timer.m_timerDisp = onTimerDZHandle;

            Ctx.m_instance.m_timerMgr.addObject(m_timer);
        }
Beispiel #15
0
        public void play()
        {
            // 动画
            //PosAni posAni = new PosAni();
            //m_numAni = new NumAniParallel();
            //m_numAni.addOneNumAni(posAni);
            //posAni.setTime(5);
            //posAni.setGO(m_num.getParentGo());
            //posAni.destPos = m_num.getPos() + new Vector3(0, 3, 0);
            //m_numAni.play();

            // 启动定时器
            TimerItemBase timer = new TimerItemBase();

            timer.m_internal  = 1;
            timer.m_totalTime = 1;
            timer.m_timerDisp = endTimer;
            Ctx.m_instance.m_timerMgr.addObject(timer);
        }
Beispiel #16
0
        protected void startOneAniEndTimer()
        {
            if (m_oneAniEndTimer == null)
            {
                m_oneAniEndTimer             = new TimerItemBase();
                m_oneAniEndTimer.m_timerDisp = onTimerAniEndHandle;
            }
            else
            {
                m_oneAniEndTimer.reset();
            }

            AnimatorStateInfo state = m_animator.GetCurrentAnimatorStateInfo(0);

            // 这个地方立马获取数据是获取不到的,需要等待下一帧才能获取到正确的数据
            Ctx.m_instance.m_logSys.log(string.Format("当前长度 {0}", state.length));
            m_oneAniEndTimer.m_internal  = state.length;
            m_oneAniEndTimer.m_totalTime = m_oneAniEndTimer.m_internal;

            Ctx.m_instance.m_timerMgr.addObject(m_oneAniEndTimer);
        }
Beispiel #17
0
        public void addTimer()
        {
            if (m_timer == null)
            {
                m_timer = new TimerItemBase();
                m_timer.m_internal = 3;        // 一分钟遍历一次
                m_timer.m_bInfineLoop = true;
                m_timer.m_timerDisp = onTimer;
            }

            // 检查是否要加入定时器
            Ctx.m_instance.m_timerMgr.addObject(m_timer);
        }
Beispiel #18
0
        public void psstRetNotifyHandIsFullUserCmd(stRetNotifyHandIsFullUserCmd msg)
        {
            m_sceneDZData.m_cardNpcMgr.m_selfCardFullTip.show();

            if (1 == msg.who)            // 如果是自己
            {
                m_sceneDZData.m_cardNpcMgr.m_selfCardFullTip.desc.text = "自己的卡牌已经满了";
            }
            else            // 对方
            {
                m_sceneDZData.m_cardNpcMgr.m_selfCardFullTip.desc.text = "对方的卡牌已经满了";
            }

            // 启动定时器
            TimerItemBase timer = new TimerItemBase();
            timer.m_internal = 1;
            timer.m_timerDisp = endSelfFullTip;
            Ctx.m_instance.m_timerMgr.addObject(timer);
        }
Beispiel #19
0
 public void endSelfFullTip(TimerItemBase timer)
 {
     m_sceneDZData.m_cardNpcMgr.m_selfCardFullTip.hide();
 }
Beispiel #20
0
 // 开始卡牌倒计时
 public void onTimerEndHandle(TimerItemBase timer)
 {
     m_watchStage = WatchStage.eEnd;
     stopWatch();
 }
Beispiel #21
0
 public void onEnterTimerEndHandle(TimerItemBase timer)
 {
     if (Ctx.m_instance.m_maze.mazeData.curSceneIdx == (int)eSceneIndex.eFirst)
     {
         Ctx.m_instance.m_maze.mazeData.mazeScene.loadSecondScene();
     }
 }
Beispiel #22
0
 public void onBigStartTimerEndHandle(TimerItemBase timer)
 {
     UtilApi.SetActive(m_bigStartPnl, true);
 }
Beispiel #23
0
        protected void startEnterTimer()
        {
            if (m_enterTimer == null)
            {
                m_enterTimer = new TimerItemBase();
            }
            else
            {
                m_enterTimer.reset();        // 重置内部数据
            }

            m_enterTimer.m_internal = 15.0f;
            m_enterTimer.m_totalTime = 15.0f;
            m_enterTimer.m_timerDisp = onEnterTimerEndHandle;

            Ctx.m_instance.m_timerMgr.addObject(m_enterTimer);
        }
Beispiel #24
0
 public void onBigStartTimerEndHandle(TimerItemBase timer)
 {
     UtilApi.SetActive(m_bigStartPnl, true);
 }
Beispiel #25
0
 // 定时器动画结束处理函数
 public void onTimerAniEndHandle(TimerItemBase timer)
 {
     m_oneAniPlayEndDisp.dispatchEvent(this);
     // chechParams();
 }
Beispiel #26
0
        protected void startOneAniEndTimer()
        {
            if (m_oneAniEndTimer == null)
            {
                m_oneAniEndTimer = new TimerItemBase();
                m_oneAniEndTimer.m_timerDisp = onTimerAniEndHandle;
            }
            else
            {
                m_oneAniEndTimer.reset();
            }

            AnimatorStateInfo state = m_animator.GetCurrentAnimatorStateInfo(0);
            // 这个地方立马获取数据是获取不到的,需要等待下一帧才能获取到正确的数据
            Ctx.m_instance.m_logSys.log(string.Format("当前长度 {0}", state.length));
            m_oneAniEndTimer.m_internal = state.length;
            m_oneAniEndTimer.m_totalTime = m_oneAniEndTimer.m_internal;

            Ctx.m_instance.m_timerMgr.addObject(m_oneAniEndTimer);
        }
Beispiel #27
0
 public void onSmallStar2fTimerEndHandle(TimerItemBase timer)
 {
     UtilApi.SetActive(m_smallStarPnl_2, true);
 }
Beispiel #28
0
        // 开始卡牌倒计时
        public void onTimerEndHandle(TimerItemBase timer)
        {
            m_watchStage = WatchStage.eWatching;

            if (m_showCard == null)
            {
                createCard(m_watchCard.sceneCardItem, m_watchCard.m_sceneDZData);
            }
            else
            {
                m_showCard.setIdAndPnt(m_watchCard.sceneCardItem.svrCard.dwObjectID, m_watchCard.m_sceneDZData.m_placeHolderGo.m_centerGO);
            }

            m_sceneCardItem.copyFrom(m_watchCard.sceneCardItem);
            m_sceneCardItem.cardArea = CardArea.CARDCELLTYPE_HAND;      // 总是显示手牌
            m_showCard.sceneCardItem = m_sceneCardItem;

            UtilApi.setPos(m_showCard.transform(), m_watchCard.transform().localPosition + new Vector3(SceneDZCV.COMMON_CARD_WIDTH, SceneDZCV.DRAG_YDELTA, 0));
            m_showCard.show();
        }
Beispiel #29
0
        // 定时释放资源
        public void onTimer(TimerItemBase time)
        {
            bool hasNoLoop = false;
            // 遍历看有没有播放完成的
            foreach(SoundItem sound in m_audioList)
            {
                if(sound.isEnd())
                {
                    m_clearList.Add(sound);
                }
                else if (!sound.m_bLoop)
                {
                    hasNoLoop = true;
                }
            }

            foreach(SoundItem sound in m_clearList)
            {
                unload(sound.m_path);
            }

            m_clearList.Clear();

            if (!hasNoLoop)
            {
                Ctx.m_instance.m_timerMgr.delObject(m_timer);
            }
        }
Beispiel #30
0
 public void onSmallStar2fTimerEndHandle(TimerItemBase timer)
 {
     UtilApi.SetActive(m_smallStarPnl_2, true);
 }
Beispiel #31
0
 // 定时器动画结束处理函数
 public void onTimerAniEndHandle(TimerItemBase timer)
 {
     m_oneAniPlayEndDisp.dispatchEvent(this);
     // chechParams();
 }
Beispiel #32
0
 public void onTimerHandle(TimerItemBase timer)
 {
     updateDJSNum();
 }
Beispiel #33
0
        // 开始卡牌倒计时
        public void onTimerInitCardHandle(TimerItemBase timer)
        {
            Ctx.m_instance.m_logSys.log(Ctx.m_instance.m_langMgr.getText(LangTypeId.eDZ4, LangItemID.eItem8));

            // 开始显示倒计时数据
            if (m_DJSNum == null)
            {
                m_DJSNum = new DJSNum(m_sceneDZData.m_placeHolderGo.m_timerGo);
            }

            m_DJSNum.startTimer();
        }