/// <summary> /// 开启更新 /// </summary> private void StartUpdateTimer() { CleanupUpdateTimer(); UpdateGuideObject(0); m_UpdateTimer = new Utils.Timer(1000, true, 10, UpdateGuideObject); }
public void Invite(List <uint> uuids) { if (mInviteAllCD == null) { C2STeamInvite data = new C2STeamInvite(); foreach (uint uuid in uuids) { if (GetInviteCD(uuid) == 0) { data.uuids.Add(uuid); } } NetClient.BaseClient.SendData <C2STeamInvite>(NetMsg.MSG_TEAM_INVITE, data); mInviteAllCD = new Utils.Timer((int)mInviteInterval * 1000, false, 1000, (dt) => { if (dt <= 0f) { mInviteAllCD.Destroy(); mInviteAllCD = null; } ClientEventMgr.Instance.FireEvent((int)ClientEvent.CE_TEAM_INVITE_ALL_CD_CHANGED, null); }); ClientEventMgr.Instance.FireEvent((int)ClientEvent.CE_TEAM_INVITE_ALL_CD_CHANGED, null); } else { UINotice.Instance.ShowMessage(string.Format(DBConstText.GetText("TEAM_INVITE_IN_CD"), (int)(mInviteAllCD.Remain / 1000f))); } }
public void OnPostRoleInfoFinished(string url, string error, string reply, System.Object userData) { int result = 0; Hashtable hashtable = MiniJSON.JsonDecode(reply) as Hashtable; if (hashtable != null) { result = DBTextResource.ParseI(hashtable["result"].ToString()); } if (result != 1) { if (mPostRoleInfoTimer != null) { mPostRoleInfoTimer.Destroy(); mPostRoleInfoTimer = null; } // 超过10次就不要再尝试了 if (mPostRoleInfoTimes <= 10) { mPostRoleInfoTimer = new Utils.Timer(3000, false, 3000, PostRoleInfoWithDelay); mPostRoleInfoTimes++; } else { mPostRoleInfoTimes = 0; } } else { mPostRoleInfoTimes = 0; } }
public Actor(Game game) : base(game) { curGame = game; actorTimer = new Utils.Timer(); worldPosition = Vector2.Zero; }
/// <summary> /// 重登之后需要重置 /// </summary> public void Reset() { if (mDisplayTips.Count > 0) { foreach (var item in mDisplayTips) { item.mLabel.text = string.Empty; } } else { mIsLoad = false; MainGame.HeartBehavior.StartCoroutine(InitLoad()); mIsInit = true; } mCacheText.Clear(); foreach (var item in mDisplayingTips) { item.gameObject.SetActive(false); item.transform.parent.gameObject.SetActive(false); } mDisplayingTips.Clear(); mDisplayingTipTransforms.Clear(); if (mTimer != null) { mTimer.Destroy(); mTimer = null; } mTimer = new Utils.Timer((int)(GameConstHelper.GetFloat("GAME_FLOAT_TIPS_INTERVAL") * 1000f), true, Mathf.Infinity, UpdateTimer); ClientEventMgr.Instance.SubscribeClientEvent((int)ClientEvent.CE_SWITCHINSTANCE, OnSwitchInstance); ClientEventMgr.Instance.SubscribeClientEvent((int)ClientEvent.CE_SHOW_ROLLING_NOTICE_END, OnShowRollingNoticeEnd); }
public void Reset(bool ignore_reconnect) { TeamId = 0; LeaderId = 0; TeamMembers = new List <PkgTeamMember>(); TeamMembers.Clear(); ApplyList = new List <PkgTeamUserIntro>(); ApplyList.Clear(); TargetType = 1; TargetId = 0; TargetMinLevel = 0; TargetMaxLevel = 0; PlatformSelectedTargetType = 0; PlatformSelectedTargetId = 0; MatchingTeamTargetId = 0; mIsAutoMatchingTeam = false; mIsAutoMatchingPlayer = false; mAutoMatchTeamElapsedTime = 0f; mInviteInfoCDs = new Dictionary <uint, Utils.Timer>(); mInviteInfoCDs.Clear(); if (mInviteAllCD != null) { mInviteAllCD.Destroy(); mInviteAllCD = null; } if (ignore_reconnect == false) { BeInvitedInfos.Clear(); } }
static void Clear() { if (mTimer != null) { mTimer.Destroy(); mTimer = null; } mSecond = 1; mText = ""; mPic = ""; mInterruptCallback = null; mFinishCallback = null; var localPlayer = Game.GetInstance().GetLocalPlayer(); if (localPlayer != null) { localPlayer.UnsubscribeActorEvent(Actor.ActorEvent.EXITIDLE, OnLocalPlayerBeInterrupted); localPlayer.UnsubscribeActorEvent(Actor.ActorEvent.BEATTACK, OnLocalPlayerBeInterrupted); localPlayer.UnsubscribeActorEvent(Actor.ActorEvent.DEAD, OnLocalPlayerBeInterrupted); } ClientEventMgr.GetInstance().UnsubscribeClientEvent((int)ClientEvent.CE_PLAYERCONTROLED, OnPlayerControlled); ClientEventMgr.GetInstance().UnsubscribeClientEvent((int)ClientEvent.CE_TRIGGER_SKILL_CLICK_BUTTON, OnPlayerControlled); ClientEventMgr.GetInstance().UnsubscribeClientEvent((int)ClientEvent.CE_CLICKCOLLISION, OnPlayerControlled); ClientEventMgr.Instance.FireEvent((int)ClientEvent.CONTROL_COMMON_SLIDER, new CEventObjectArgs(false, 0f, "", "")); }
void UpdateFireState() { if (sFiresState != null) { foreach (PkgKvMin kv in sFiresState) { if (kv.k == mId) { if (mTimer != null) { mTimer.Destroy(); mTimer = null; } uint second = 0; if (Game.Instance.ServerTime <= kv.v) { second = kv.v - Game.Instance.ServerTime; } if (second > 0) { ShowFire(true); mTimer = new Utils.Timer(second * 1000, false, 1000, UpdateTimer); } else { ShowFire(false); } } } } }
public bool SetDialogBubbleText(string text, int time) { if (timer != null) { timer.Destroy(); timer = null; } if (DialogBubbleParent == null || DialogBubbleText == null) { return(false); } DialogBubbleText.text = text; LayoutMaxSize layoutMaxSize = DialogBubbleText.GetComponent <LayoutMaxSize>(); if (layoutMaxSize != null) { layoutMaxSize.OriginalText = text; } DialogBubbleParent.gameObject.SetActive(true); DialogChatMsgArrow.gameObject.SetActive(true); if (layoutMaxSize != null) { layoutMaxSize.ReCalculateText(); } timer = new Utils.Timer(time * 1000, false, time * 1000, HideDialogBubble); return(true); }
public void Reset() { m_ListeningStepDict.Clear(); m_ForceStartStepDict.Clear(); if (m_UpdateTimer != null) { m_UpdateTimer.Destroy(); m_UpdateTimer = null; } if (m_DBGuide != null) { m_DBGuide.Reset(); m_DBGuide = null; } if (m_DBGuideStep != null) { m_DBGuideStep.Reset(); m_DBGuideStep = null; } m_FinishedBranchTask.Clear(); m_TimelineStatus.Clear(); m_Dirty = false; m_IsPlayingGuideStep = false; m_PlayingGuideStep = null; mPlayingGuide = null; m_ListenerStarted = false; }
void Awake() { if (mTimer != null) { mTimer.Destroy(); mTimer = null; } }
void DestroyTimer() { if (mTimer != null) { mTimer.Destroy(); mTimer = null; } }
public void Reset() { if (mGCTimer != null) { mGCTimer.Destroy(); } mGCTimer = new Utils.Timer(GC_INTERVAL * 1000, true, GC_INTERVAL * 1000, GCTimerUpdate); }
void DestroyCancelTimer() { if (mCancelTimer != null) { mCancelTimer.Destroy(); mCancelTimer = null; } }
//-------------------------------------------------------- // 内部调用 //-------------------------------------------------------- void DestroyOKTimer() { if (mOKTimer != null) { mOKTimer.Destroy(); mOKTimer = null; } }
public void CancelQueueTime() { if (mCheckQueueTime != null) { mCheckQueueTime.Destroy(); mCheckQueueTime = null; } }
/// <summary> /// 清理更新timer /// </summary> private void CleanupUpdateTimer() { if (m_UpdateTimer != null) { m_UpdateTimer.Destroy(); m_UpdateTimer = null; } }
/// <summary> /// 清除CD /// </summary> void ClearCD() { if (mCDTimer != null) { mCDTimer.Destroy(); mCDTimer = null; } }
/// <summary> /// 清除飘字CD /// </summary> void ClearFloatTipsCD() { if (mFloatTipsTimer != null) { mFloatTipsTimer.Destroy(); mFloatTipsTimer = null; } }
private void ClearTime() { if (WaitTimer != null) { WaitTimer.Destroy(); WaitTimer = null; } }
void OnDestroy() { if (mTimer != null) { mTimer.Destroy(); mTimer = null; } Game.GetInstance().UnsubscribeNetNotify(NetMsg.MSG_DUNGEON_GUILD_BOSS_FIRE, HandleServerData); }
public void RigisterAllMessage() { QualitySetting.Instance.OnGLChanged += OnGraphicLevelChanged; // 注册客户端消息 ClientEventMgr.GetInstance().SubscribeClientEvent((int)ClientEvent.CE_LEAVEAOI, OnLeaveAOI); mUpdateTimer = new Utils.Timer(UpdateDelayInMS, true, (float)UpdateDelayInMS, OnUpdate); }
public OneClipPerTime(GameObject go, AudioMixerGroup mixerGroup) { audioSource = go.AddComponent <AudioSource>(); audioSource.outputAudioMixerGroup = mixerGroup; audioSource.loop = false; timer = new Utils.Timer(1000, true, 10, TimerCallBack); timer.Pause = true; }
void SetTimer() { DestroyTimer(); uint endTime = 0; object[] param = { }; System.Type[] returnType = { typeof(uint) }; object[] objs = LuaScriptMgr.Instance.CallLuaFunction_return(LuaScriptMgr.Instance.Lua.Global, "OnlineRewardManager_GetEndTime", param, returnType); if (objs != null && objs.Length > 0) { if (objs[0] != null) { endTime = (uint)objs[0]; } } uint countTime; if (endTime <= Game.Instance.ServerTime) { countTime = 0; } else { countTime = endTime - Game.Instance.ServerTime; } Text timerText = timerTextTrans.GetComponent <Text>(); if (countTime > 0) { StopShake(); timerText.gameObject.SetActive(true); timerText.text = Utils.Timer.GetFMTTime2(1000f * countTime); mTimer = new Utils.Timer(countTime * 1000, false, 1000, (remainTime) => { if (remainTime > 0) { timerText.text = Utils.Timer.GetFMTTime2(remainTime); } else { timerText.text = ""; timerText.gameObject.SetActive(false); DestroyTimer(); StartShake(); } }); } else { timerText.gameObject.SetActive(false); StartShake(); } }
public void PostRoleInfoWithDelay(float remainTime) { if (mPostRoleInfoTimer != null) { mPostRoleInfoTimer.Destroy(); mPostRoleInfoTimer = null; } PostRoleInfo(); }
private void InitializeEnvironment() { _generation += 1; TextBlock.GetComponent <Text>().text = "Generation: " + _generation + " Count: " + genomes.Count; GenerateFood(); GeneratePopulation(); timer = new Utils.Timer(GENERATION_LIFETIME); timer.function = DestroyEnvironment; timer.Start(); }
public override void Exit() { inst = null; ClientEventMgr.GetInstance().UnsubscribeClientEvent((int)ClientEvent.EC_ACTOR_ADD_UNDER_ATTACK, OnAddUnderAttackActor); if (mTimer != null) { mTimer.Destroy(); mTimer = null; } }
void ClearPoint() { if (m_updateTeamPosCd != null) { m_updateTeamPosCd.Destroy(); m_updateTeamPosCd = null; } ClearTeamPoint(); }
protected override void HideUI() { base.HideUI(); if (mCountDownTimer != null) { mCountDownTimer.Destroy(); mCountDownTimer = 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 GoToNextBubble(float remainTime, Utils.Timer timer) { DBDialog.DialogInfo dialogInfo = timer.UserData as DBDialog.DialogInfo; if (dialogInfo == null) { return; } uint dialogNum = (uint)dialogInfo.mDialogs.Count; uint bubbleDialogIndex = 0; if (mBubbleDialogIndexs.TryGetValue(dialogInfo.mId, out bubbleDialogIndex) && bubbleDialogIndex < (dialogNum - 1)) // 对话还没完 { bubbleDialogIndex++; mBubbleDialogIndexs[dialogInfo.mId] = bubbleDialogIndex; TriggerBubbleImpl(bubbleDialogIndex, dialogInfo); } else { if (timer != null) { timer.Destroy(); timer = null; } System.Action bubbleFinishedCallback; if (mBubbleFinishedCallbacks.TryGetValue(dialogInfo.mId, out bubbleFinishedCallback)) { if (bubbleFinishedCallback != null) { bubbleFinishedCallback(); } } if (mBubbleDialogInfos.ContainsKey(dialogInfo.mId)) { mBubbleDialogInfos.Remove(dialogInfo.mId); } if (mBubbleDialogIndexs.ContainsKey(dialogInfo.mId)) { mBubbleDialogIndexs.Remove(dialogInfo.mId); } if (mBubbleFinishedCallbacks.ContainsKey(dialogInfo.mId)) { mBubbleFinishedCallbacks.Remove(dialogInfo.mId); } if (mBubbleTimers.ContainsKey(dialogInfo.mId)) { mBubbleTimers.Remove(dialogInfo.mId); } } }
public Actor(Game game) : base(game) { actorTimer = new Utils.Timer(); mWorldTransform = Matrix.Identity; _worldScale = 1.0f; _worldPosition = Vector3.Zero; _worldRotation = Quaternion.Identity; _velocity = Vector3.Zero; fMass = 1; fTerminalVelocity = 0; vForce = Vector3.Zero; vAcceleration = Vector3.Zero; bPhysicsDriven = false; }