void _ME(ModuleEvent <Module_Union> e) { switch (e.moduleEvent) { case Module_Union.EventUnionCardSign: if (!actived) { return; } moduleUnion.RemoveFirstSign(); SetSignInfo(); break; case Module_Union.EventUnionCardChange: SetTimesTxt(); break; case Module_Union.EventUnionCardReward: var point = Util.Parse <int>(e.param1.ToString()); DelayEvents.Add(() => { moduleGlobal.ShowMessage(string.Format(ConfigText.GetDefalutString(629, 15), point)); }, 0.5f); SetTimesTxt(); break; } }
void _Packet(ScWorldSession p) { if (p.code == 1) { chatContentTimes++; if (chatContentTimes > 15) { DelayEvents.Remove("chat_content"); Logger.LogError("chat packet can not content !!"); } else if (chatContentTimes > 6) { DelayEvents.Add(() => { WorldSession(); }, 60f, "chat_content"); } else { DelayEvents.Add(() => { WorldSession(); }, 1f, "chat_content"); } } else if (p.code == 0) { Logger.LogChat("Connect chat server succed!"); chatContentTimes = 0; if (moduleFriend.GetAllChatInfo) { moduleChat.GetLateInfo(); moduleChat.GetServerMes(); } } else { Logger.LogError("Connect chat server info is error"); } }
void _Packet(ScLogin p) { firstEnter = p.result == 1; loggedIn = p.result < 2; if (p.result > 1) { waitLoginTimer = 0; LoginEnd(p.result); return; } moduleSelectRole.SetRoleSummary(p.roleList); var wait = Level.realTime - m_sendLoginTime; if (wait >= waitLoginTimer) { LoginEnd(p.result); } else { var result = p.result; m_waitEventHandler = DelayEvents.Add(() => { LoginEnd(result); }, (waitLoginTimer - wait) * 0.001f); } waitLoginTimer = 0; }
private void OnOtherLoadingState(Event_ e) { var show = e.param1 == null || (bool)e.param1; var window = e.param2 as string; var delay = e.param3 == null ? 0 : (float)e.param3; var mode = e.param4 == null ? 0 : (int)e.param4; DelayEvents.Remove(m_delayEventID); if (!show) { m_curLoadingWindow?.Hide(false, !m_curLoadingWindow.Equals(m_defaultLoadingWindow)); } else { if (delay <= 0f) { ShowLoadingWindow(window, mode); } else { m_delayEventID = DelayEvents.Add(() => { ShowLoadingWindow(window, mode); }, delay); } } }
protected override void OnEnterState(int oldMask, BattleStates state) { if (state == BattleStates.Ended) { PlayerPrefs.SetInt("FinishTrain", 1); m_loadTime = Time.realtimeSinceStartup - m_loadTime; DispatchEvent(Events.LAUNCH_PROCESS, Event_.Pop(LaunchProcess.ShowLevelEnd, 1)); DispatchEvent(Events.LAUNCH_PROCESS, Event_.Pop(LaunchProcess.ShowLevelTime, m_loadTime)); moduleStory.workOffline = false; DelayEvents.Add(() => { moduleGlobal.FadeIn(1.0f, 1, false, () => { Root.instance.StartCoroutine(WaitLoginLoaded()); }); }, 1.5f); return; } base.OnEnterState(oldMask, state); }
private void OnWindowSettlementVisible(Window rWindow) { DelayEvents.Add(() => { Module_PVP.instance.isInvation = false; Module_PVP.instance.isMatchAgain = false; Module_Match.instance.isbaning = true; Game.GoHome(); }, 2); }
public static ControllerEffect_ShowText Create(CombatConfig.ShowText rInfo, Transform rParent) { var controller = pool.Pop(); DelayEvents.Add(() => { controller.Initialize(rInfo, rParent); }, rInfo.delay); return(controller); }
private void OnWindowHomeVisible(Window rWindow) { if (targetRoleId <= 0) { return; } DelayEvents.Add(() => { Window.ShowAsync <Window_PVP>(); }, 10); }
private void OnFocusPointChange(Event_ e) { var id = (int)e.param1; var current = ConfigManager.Get <AwakeInfo>(id); if (!current) { return; } DelayEvents.Add(() => { if (current.nextInfoList.Count != 0) { if (!controller.isDraging) { controller.curve = null; var l = current.layer; while (Module_Awake.instance.CanEnterNextLayer(CurrentType, l)) { l += 1; } FocusLayer = l; Watch(true); } else { Refresh(); } } var currentController = GetAwakeController(current.layer, current.index); if (currentController) { currentController.RefreshState(); } var nextList = Module_Awake.NextAwakeInfo(id); foreach (var next in nextList) { var c = GetAwakeController(next.layer, next.index); if (c) { c.RefreshState(); } } }, 0.3f); }
private void ResponseMoppingUp(ScChaseMoppingUp msg) { if (msg.result != 0) { moduleGlobal.ShowMessage(9605, msg.result); return; } moduleChase.ProcessTimes(task, msg.rewards?.Length ?? 0); parentWindow.RefreshChallengeTimes(); RefreshMatrial(); PReward[] arr = null; msg.rewards.CopyTo(ref arr); waitList.AddRange(arr); DelayEvents.Add(StartShow, 0.05f); }
private void OnBossCameraAnimWhiteFadeIn() { if (!m_bossWhiteObj) { return; } DelayEvents.Remove(m_bossDelayEvent); m_bossWhiteObj.SafeSetActive(true); (m_bossWhiteObj.transform as RectTransform).SetAsLastSibling(); m_bossDelayEvent = DelayEvents.Add(() => { m_bossWhiteObj.SafeSetActive(false); }, (float)(CombatConfig.spveBossAnimWhiteFadeIn + CombatConfig.spveBossAnimWhiteFadeOut)); }
private void BeInvited(Event_ e) { if (!isStart) { return; } if (targetRoleId > 0) { return; } DelayEvents.Add(() => { var wg = Window.GetOpenedWindow <Window_Global>(); wg?.overtime(0); }, 1); }
private void InvationFailed(Event_ e) { if (!isStart) { return; } if (targetRoleId <= 0) { return; } DelayEvents.Add(() => { var wg = Window.GetOpenedWindow <Window_Global>(); wg?.overtime(2); }, 1); }
private void SetAnimation(int boxId, Image lockImg) { if (!actived) { return; } var key = "union" + modulePlayer.id_.ToString() + boxId.ToString(); var show = moduleWelfare.FrirstOpen(key, false); if (show) { DelayEvents.Add(() => { lockImg.gameObject.SetActive(true); PlayerPrefs.SetString(key, Util.GetServerLocalTime().ToString()); }, 1.5f * AnmiaDelayTimes); AnmiaDelayTimes++; } }
private void CheckDeviceKeyInput() { if (!Game.started) { return; // Do not handle key input if game not started } if (Input.GetKeyUp(KeyCode.Escape)) { var t = GeneralConfigInfo.swaitToQuit; if (m_waittingQuit || t < 0.1f) { Game.Quit(); } else { m_waittingQuit = true; DelayEvents.Add(() => m_waittingQuit = false, t); Module_Global.instance.ShowGlobalNotice(31, t * 0.65f, t * 0.35f); } } }
void _Packet(ScNpcExpLock p) { if (p == null) { return; } var npc = GetTargetNpc((NpcTypeID)p.npcId); if (npc == null) { return; } moduleGlobal.ShowMessage(Util.Format(Util.GetString(210, 10), npc.name)); var task = npc.npcInfo.tasks.Find(o => o.fetterLv == npc.fetterLv); var hintID = task.hintStoryID; if (hintID <= 0) { return; } //触发对话--引导玩家完成羁绊进阶任务 var window = Window.GetOpenedWindow <Window_NPCDatingSettlement>(); var settle = Window.GetOpenedWindow <Window_Settlement>(); if (window != null && window.actived) { DelayEvents.Remove(eventIndex); eventIndex = DelayEvents.Add(() => moduleNPCDating.DoDatingEvent(hintID), GeneralConfigInfo.defaultConfig.wstOnEngagement); } else if (settle != null && settle.actived) { DelayEvents.Remove(eventIndex); eventIndex = DelayEvents.Add(() => moduleNPCDating.DoDatingEvent(hintID), GeneralConfigInfo.defaultConfig.wstOnPve); } else { moduleNPCDating.DoDatingEvent(hintID); } }
private void RefreshMessage(string msg) { var t = m_messageRoot.AddNewChild(m_messageTemp); Util.SetText(t.gameObject, msg); t.SafeSetActive(true); m_messageList.Enqueue(t.gameObject); if (m_messageList.Count > Module_FactionBattle.MESSAGE_MAX) { Object.Destroy(m_messageList.Dequeue()); } if (m_scrollRect != null) { DelayEvents.Add(() => { DOTween.To(() => m_scrollRect.verticalNormalizedPosition, v => m_scrollRect.verticalNormalizedPosition = v, 0, 0.3f); }, 0.1f); } }
/// <summary> /// 宠物信息更新 /// </summary> public void Refresh() { if (SelectPet == null) { return; } Util.SetText(nameText, SelectPet.CPetInfo.itemNameId); RefreshSkill(); RefreshDescColor(); RefreshStar(); RefreshModule(); RefreshAttribute(); RefreshButtonState(); RefreshMood(); RefreshEvolve(); RefreshNotice(); //要等scrollView先刷新把new标签显示出来 DelayEvents.Add(() => { modulePet.NewPetList.Remove(SelectPet.ID); }, 0.2f); petSelectModule.SetItem(SelectPet); }
/// <summary> /// 送礼动画 /// </summary> private void OnPlayGift() { if (!enabled || currentNpc == null) { return; } TweenPosition target = null; if (tweenTarget && npc_Type == NpcTypeID.WishNpc) { target = tweenTarget.GetComponent <TweenPosition>(); target?.PlayReverse(); } if (!Module_Gift.instance.isGiveGift) { return; } if (target) { delayIndex = DelayEvents.Add(() => { npc_creatrue.stateMachine.TranslateTo(currentNpc.actionInfo?.sendGiftState); Logger.LogDetail("播送礼动画={0}", currentNpc.actionInfo?.sendGiftState); Module_Gift.instance.isGiveGift = false; DelayEvents.Remove(delayIndex); }, target.duration); } else { npc_creatrue.stateMachine.TranslateTo(currentNpc.actionInfo?.sendGiftState); Logger.LogDetail("播送礼动画={0}", currentNpc.actionInfo?.sendGiftState); Module_Gift.instance.isGiveGift = false; } }