void Awake() { if (mTimer != null) { mTimer.Destroy(); mTimer = null; } }
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); }
/// <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; }
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); } }); } }
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(); }
void DestroyTimer() { if (mTimer != null) { mTimer.Destroy(); mTimer = null; } }
/// <summary> /// 清除CD /// </summary> void ClearCD() { if (mCDTimer != null) { mCDTimer.Destroy(); mCDTimer = null; } }
/// <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; }
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; } }
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; }
void ShowHPProgressBarForAWhile(float second) { if (mShowHPProgressBarTimer != null) { mShowHPProgressBarTimer.Destroy(); mShowHPProgressBarTimer = null; } HPProgressBarIsActive = true; mShowHPProgressBarTimer = new Utils.Timer((int)(second * 1000f), false, second * 1000f, OnShowHPProgressBarTimer); }
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(); } }
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 = ""; }