Esempio n. 1
0
 void Awake()
 {
     if (mTimer != null)
     {
         mTimer.Destroy();
         mTimer = null;
     }
 }
Esempio n. 2
0
    void OnDestroy()
    {
        if (mTimer != null)
        {
            mTimer.Destroy();
            mTimer = null;
        }

        ClientEventMgr.GetInstance().UnsubscribeClientEvent((int)ClientEvent.CE_GUILD_LEAGUE_INFO_CHANGED, OnGuildLeagueInfoChanged);
        ClientEventMgr.GetInstance().UnsubscribeClientEvent((int)ClientEvent.CE_ACTIVITY_STATE_CHANGED, OnActivityStateChanged);
        ClientEventMgr.Instance.UnsubscribeClientEvent((int)xc.ClientEvent.CE_NEW_REDPOINT_SHOW, OnShowRedPoint);
        ClientEventMgr.Instance.UnsubscribeClientEvent((int)xc.ClientEvent.CE_NEW_REDPOINT_DISAPPEAR, OnDisappearRedPoint);
        ClientEventMgr.Instance.UnsubscribeClientEvent((int)ClientEvent.CE_SYS_OPEN, OnSysOpen);
    }
Esempio n. 3
0
        /// <summary>
        /// 副连接网络断开
        /// </summary>
        /// <param name="data"></param>
        void OnCrossNetDisconnect(CEventBaseArgs data)
        {
            if (m_Machine != null && Game.Instance.ForceDisconnect == false)// 网络断开分为链路断开和心跳包超时两种情况
            {
                m_DisconnectReason = DisconnectReason.Corss;
                m_Machine.React((uint)EFSMEvent.DE_NetDisconnnect);
            }

            if (mCrossHeartTimeout != null)
            {
                mCrossHeartTimeout.Destroy();
                mCrossHeartTimeout = null;
            }
            m_NextCrossHeartTime = float.MaxValue;
        }
Esempio n. 4
0
        public void ProcessLineCD(uint time)
        {
            SceneHelp.Instance.mChangeLineCDTime = time;
            mDelyLineCdTime = 0;
            ClientEventMgr.GetInstance().FireEvent((int)ClientEvent.CE_CHANGE_LINE_CD_TIME, new CEventBaseArgs());
            uint cd = 0;

            cd = GameConstHelper.GetUint("GAME_LINE_CHANGE_CD");
            if (SceneHelp.Instance.mChangeLineCDTime + cd > Game.GetInstance().ServerTime)
            {
                mDelyLineCdTime = SceneHelp.Instance.mChangeLineCDTime + cd - Game.GetInstance().ServerTime;
                mLineCDTimer    = new Utils.Timer((int)mDelyLineCdTime * 1000, false, 1000,
                                                  (dt) =>
                {
                    if (dt <= 0f)
                    {
                        mDelyLineCdTime = 0;
                        ClientEventMgr.GetInstance().FireEvent((int)ClientEvent.CE_CHANGE_LINE_CD_TIME, new CEventBaseArgs());
                        if (mLineCDTimer != null)
                        {
                            mLineCDTimer.Destroy();
                            mLineCDTimer = null;
                        }
                    }
                    else
                    {
                        mDelyLineCdTime = Mathf.Ceil(dt / 1000f);
                    }
                });
            }
        }
Esempio n. 5
0
 public override void DestroyBehaviour()
 {
     if (mUpdateTeamPosCd != null)
     {
         mUpdateTeamPosCd.Destroy();
         mUpdateTeamPosCd = null;
     }
     if (mPlayOpenSysRoutine != null)
     {
         mPlayOpenSysRoutine.Stop();
         mPlayOpenSysRoutine = null;
     }
     mNotEnterTipsTrigger.onPointerDown -= LostNotEnterTips;
     ClientEventMgr.Instance.UnsubscribeClientEvent((int)ClientEvent.CE_TEAM_INFO_CHANGED, TeamChange);
     base.DestroyBehaviour();
 }
Esempio n. 6
0
 void DestroyTimer()
 {
     if (mTimer != null)
     {
         mTimer.Destroy();
         mTimer = null;
     }
 }
Esempio n. 7
0
 /// <summary>
 /// 清除CD
 /// </summary>
 void ClearCD()
 {
     if (mCDTimer != null)
     {
         mCDTimer.Destroy();
         mCDTimer = null;
     }
 }
Esempio n. 8
0
        /// <summary>
        /// 主连接网络断开
        /// </summary>
        /// <param name="data"></param>
        void OnMainNetDisconnect(CEventBaseArgs data)
        {
            if (Game.Instance.ForceDisconnect == false)
            {
                if (m_Machine != null) // 网络断开分为链路断开和心跳包超时两种情况
                {
                    m_DisconnectReason = DisconnectReason.Main;
                    m_Machine.React((uint)EFSMEvent.DE_NetDisconnnect);
                }
                Game.Instance.Reset(true);
            }

            if (m_HeartTimeout != null)
            {
                m_HeartTimeout.Destroy();
                m_HeartTimeout = null;
            }
            m_NextHeartTime = float.MaxValue;
        }
Esempio n. 9
0
    void OnDestroy()
    {
        HideDialogBubble(0);

        if (m_hpBarScript != null)
        {
            m_hpBarScript.SetTargetActor(null);
            m_hpBarScript = null;
        }

        if (mTextObject != null)
        {
            // 取消激活VerticalLayoutGroup
            var layout_trans = mTextObject.transform.Find("Layout");
            if (layout_trans != null)
            {
                var vert_layout = layout_trans.GetComponent <VerticalLayoutGroup>();
                if (vert_layout != null)
                {
                    if (vert_layout.enabled)
                    {
                        vert_layout.enabled = false;
                    }
                }
            }

            if (mDefaultFontSize != 0)
            {
                FontSize = mDefaultFontSize;
            }

            ObjCachePoolMgr.Instance.RecyclePrefab(mTextObject, mPoolType, mPoolKey);
            mTextObject = null;
        }

        mTextString = "";

        if (timer != null)
        {
            timer.Destroy();
            timer = null;
        }
    }
Esempio n. 10
0
    public void Destroy()
    {
        if (mIsBossChip && CanPick)
        {
            OnTouchExit();
        }

        mDropInfo        = null;
        mDropType        = EDropType.None;
        mCanPick         = false;
        CanNotPickReason = 0;
        mPickSqrRadius   = 0f;
        mIsTouching      = false;

        if (mTimer != null)
        {
            mTimer.Destroy();
            mTimer = null;
        }

        if (mDisappearTimer != null)
        {
            mDisappearTimer.Destroy();
            mDisappearTimer = null;
        }

        ClearCD();

        InstanceDropManager.GetInstance().RemoveDrop(this);

        if (mDropIconRes != null)
        {
            mDropIconRes.destroy();
            mDropIconRes = null;
        }

        if (mAutoPickCoroutine != null)
        {
            mAutoPickCoroutine.Stop();
            mAutoPickCoroutine = null;
        }

        mDropGoodsSubType = 0;
        mIsBossChip       = false;
        if (mBossChipEffectGameObject != null)
        {
            GameObject.DestroyImmediate(mBossChipEffectGameObject);
            mBossChipEffectGameObject = null;
        }

        mCurLoadEffectID = 0;
        mCurLoadIconID   = 0;

        m_IsDestory = true;
    }
Esempio n. 11
0
    void ShowHPProgressBarForAWhile(float second)
    {
        if (mShowHPProgressBarTimer != null)
        {
            mShowHPProgressBarTimer.Destroy();
            mShowHPProgressBarTimer = null;
        }

        HPProgressBarIsActive = true;

        mShowHPProgressBarTimer = new Utils.Timer((int)(second * 1000f), false, second * 1000f, OnShowHPProgressBarTimer);
    }
Esempio n. 12
0
        public void ClearPoint()
        {
            mCurrentMonsterInfo = null;
            if (mUpdateTeamPosCd != null)
            {
                mUpdateTeamPosCd.Destroy();
                mUpdateTeamPosCd = null;
            }

            ClearTeamPoint();

            if (mMonsterListPointObjs.Count > 0)
            {
                foreach (var kv in mMonsterListPointObjs)
                {
                    UIResourceManager.Instance.ReturnObjectToPool(kv.Value);
                }
                mMonsterListPointObjs.Clear();
            }
            if (mTranspotListPointObjs.Count > 0)
            {
                for (int i = 0; i < mTranspotListPointObjs.Count; i++)
                {
                    UIResourceManager.Instance.ReturnObjectToPool(mTranspotListPointObjs[i]);
                }
                mTranspotListPointObjs.Clear();
            }

            if (mNpcListPointObjs.Count > 0)
            {
                foreach (var kv in mNpcListPointObjs)
                {
                    UIResourceManager.Instance.ReturnObjectToPool(kv.Value);
                }
                mNpcListPointObjs.Clear();
            }
        }
Esempio n. 13
0
        public void Reset()
        {
            if (mTimer != null)
            {
                mTimer.Destroy();
                mTimer = null;
            }

            if (UICache != null)
            {
                UICache.Reset();
            }

            mTimer = new Utils.Timer((int)(mRealDestroyWinTime * 1000), true, Mathf.Infinity, RealTimerRemove);

            IsBackMainMapShowWin = "";
        }