public void CheckBadge() { for (int i = 1; i < 11; i++) { if (this.equipPartTransDic != null && this.equipPartTransDic.ContainsKey((EquipLibType.ELT)i)) { this.equipPartTransDic.get_Item((EquipLibType.ELT)i).FindChild("ImageBadge").get_gameObject().SetActive(EquipmentManager.Instance.CheckCanChangeEquip((EquipLibType.ELT)i)); } } using (Dictionary <ActorUI.RightState, ButtonCustom> .Enumerator enumerator = this.TabBtnDic.GetEnumerator()) { while (enumerator.MoveNext()) { KeyValuePair <ActorUI.RightState, ButtonCustom> current = enumerator.get_Current(); bool active = false; switch (current.get_Key()) { case ActorUI.RightState.Property: active = EquipmentManager.Instance.CheckCanChangeEquipAllPos(); break; case ActorUI.RightState.Title: active = TitleManager.Instance.HasNewTitle(); break; case ActorUI.RightState.Wing: active = WingManager.CheckAllBadge(); break; } current.get_Value().get_transform().FindChild("btnImg").get_gameObject().SetActive(active); } } }
private void SetWingPreviewCellL() { wingLv wingLvInfoPreDifferent = WingManager.GetWingLvInfoPreDifferent(this.m_current_wingId, this.m_wingLvInfoL.lv); this.m_goBtnArrowL.SetActive(wingLvInfoPreDifferent.model != this.m_wingLvInfoL.model); this.m_WingPreviewCellCurrent.SetRawImage(this.m_wingLvInfoL.model); this.m_WingPreviewCellCurrent.SetName(TextColorMgr.GetColorByQuality(this.m_wingLvInfoL.name, this.m_wingLvInfoL.color)); if (this.m_current_winglevel == 0 || this.m_wingLvInfoL.lv > this.m_current_winglevel) { this.m_WingPreviewCellCurrent.SetCondition(true, string.Format(GameDataUtils.GetChineseContent(16301, false), this.m_wingLvInfoL.lv)); } else { this.m_WingPreviewCellCurrent.SetCondition(false, string.Empty); } if (this.m_current_winglevel == 0 && !WingManager.IsCanActiveWing(this.m_current_wingId)) { wings wingInfo = WingManager.GetWingInfo(this.m_current_wingId); this.m_WingPreviewCellCurrent.ShowButtonGet(true); this.m_WingPreviewCellCurrent.actionButtonGet = delegate { this.OnClickBtnGet(wingInfo.activation.get_Item(0).key); }; } else { this.m_WingPreviewCellCurrent.ShowButtonGet(false); } }
public static long GetCurrentWingFightingValue() { long num = 0L; if (WingManager.wingInfoDict == null) { return(num); } using (Dictionary <int, WingInfo> .Enumerator enumerator = WingManager.wingInfoDict.GetEnumerator()) { while (enumerator.MoveNext()) { KeyValuePair <int, WingInfo> current = enumerator.get_Current(); int cfgId = current.get_Value().cfgId; int lv = current.get_Value().lv; if (cfgId > 0) { wingLv wingLvInfo = WingManager.GetWingLvInfo(cfgId, lv); if (wingLvInfo != null) { int templateId = wingLvInfo.templateId; Attrs attrs = DataReader <Attrs> .Get(templateId); if (attrs != null) { num += EquipGlobal.CalculateFightingByIDAndValue(attrs.attrs, attrs.values); } } } } } return(num); }
private void OnClickUpgradeRequire(int itemId) { if (!WingManager.IsCanUpgradeWing(1)) { LinkNavigationManager.ItemNotEnoughToLink(itemId, true, null, true); } }
public void OnClickOneWing(int wingId) { if (WingManager.GetWingLv(wingId) == 0) { if (WingManager.IsCanActiveWing(wingId)) { WingManager.Instance.SendWingComposeReq(wingId); } else { WingPreviewOneUI wingPreviewOneUI = UIManagerControl.Instance.OpenUI("WingPreviewOneUI", UINodesManager.MiddleUIRoot, false, UIType.NonPush) as WingPreviewOneUI; wingPreviewOneUI.InitWithNotActive(wingId); wingPreviewOneUI.get_transform().SetAsLastSibling(); } } else { WingPreviewOneUI wingPreviewOneUI2 = UIManagerControl.Instance.OpenUI("WingPreviewOneUI", UINodesManager.MiddleUIRoot, false, UIType.NonPush) as WingPreviewOneUI; wingPreviewOneUI2.get_transform().SetAsLastSibling(); if (wingId == EntityWorld.Instance.EntSelf.Decorations.wingId) { wingPreviewOneUI2.InitWithUndress(wingId); wingPreviewOneUI2.get_transform().SetAsLastSibling(); } else { wingPreviewOneUI2.InitWithWear(wingId); wingPreviewOneUI2.get_transform().SetAsLastSibling(); } } }
public static wingLv GetWingLvInfoPreDifferent(int wingId, int wingLv) { wingLv wingLvInfo = WingManager.GetWingLvInfo(wingId, wingLv); List <wingLv> wingLvInfos = WingManager.GetWingLvInfos(wingId); int num = 0; for (int i = wingLvInfos.get_Count() - 1; i >= 0; i--) { wingLv wingLv2 = wingLvInfos.get_Item(i); if (wingLv2.lv < wingLv && wingLv2.model != wingLvInfo.model) { num = wingLv2.model; break; } } if (num > 0) { for (int j = 0; j < wingLvInfos.get_Count(); j++) { wingLv wingLv3 = wingLvInfos.get_Item(j); if (wingLv3.model == num) { return(wingLv3); } } } return(wingLvInfo); }
public void Init(int wingId) { WingGlobal.ResetRawImage(); if (this.m_WingPreviewCellCurrent != null && this.m_WingPreviewCellCurrent.get_gameObject() != null) { Object.Destroy(this.m_WingPreviewCellCurrent.get_gameObject()); } if (this.m_WingPreviewCellNext != null && this.m_WingPreviewCellNext.get_gameObject() != null) { Object.Destroy(this.m_WingPreviewCellNext.get_gameObject()); } this.m_current_wingId = wingId; this.m_current_winglevel = WingManager.GetWingLv(wingId); this.m_wingLvInfoL = WingManager.GetWingLvInfo(this.m_current_wingId, this.m_current_winglevel); this.m_wingLvInfoR = WingManager.GetWingLvInfoNextDifferent(this.m_current_wingId, this.m_current_winglevel); if (this.m_wingLvInfoL.model == this.m_wingLvInfoR.model) { this.m_wingLvInfoL = WingManager.GetWingLvInfoPreDifferent(this.m_current_wingId, this.m_current_winglevel); } this.m_WingPreviewCellCurrent = WingGlobal.GetOneWingPreview(base.get_transform()); this.m_WingPreviewCellCurrent.get_transform().set_localPosition(new Vector3(-245f, 0f)); this.m_WingPreviewCellNext = WingGlobal.GetOneWingPreview(base.get_transform()); this.m_WingPreviewCellNext.get_transform().set_localPosition(new Vector3(245f, 0f)); base.get_transform().Find("imgArrow").SetAsLastSibling(); this.SetWingPreviewCellAll(); }
private void SetAttrCurr(int wingId, bool isActivation) { int wingLv = WingManager.GetWingLv(wingId); wingLv wingLvInfo = WingManager.GetWingLvInfo(wingId, wingLv); Text component = base.get_transform().Find("txtName").GetComponent <Text>(); component.set_text(TextColorMgr.GetColorByQuality(wingLvInfo.name, wingLvInfo.color)); Image component2 = this.m_btnIcon.GetComponent <Image>(); ResourceManager.SetSprite(component2, GameDataUtils.GetIcon(wingLvInfo.icon)); ImageColorMgr.SetImageColor(component2, !isActivation); if (wingLv == 0) { this.m_attrCurr.Find("txtLv").GetComponent <Text>().set_text("激活后"); } else { this.m_attrCurr.Find("txtLv").GetComponent <Text>().set_text("Lv." + wingLv); } Attrs attrs = DataReader <Attrs> .Get(wingLvInfo.templateId); for (int i = 0; i < 6; i++) { if (i < attrs.attrs.get_Count()) { Debug.Log(attrs.attrs.get_Item(i) + "=" + (AttrType)attrs.attrs.get_Item(i)); this.m_attrCurr.Find("txtAttrName" + (i + 1)).get_gameObject().SetActive(true); this.m_attrCurr.Find("txtAttrName" + (i + 1)).GetComponent <Text>().set_text(AttrUtility.GetStandardAddDesc(attrs.attrs.get_Item(i), attrs.values.get_Item(i), "ff7d4b")); } else { this.m_attrCurr.Find("txtAttrName" + (i + 1)).get_gameObject().SetActive(false); } } }
public void PlayIconSpine() { FXSpineManager.Instance.DeleteSpine(this.m_fxIconSpine, true); if (WingManager.firstGetWingDetail && WingManager.GetWingLv(1) > 0) { this.m_fxIconSpine = FXSpineManager.Instance.PlaySpine(2203, this.m_btnIcon, "WingUpgradeUI", 2000, null, "UI", 0f, 0f, 1f, 1f, false, FXMaskLayer.MaskState.None); } }
public void InitWithMaxLv(int wingId) { this.Init(wingId); this.mWingPreviewCell.SetCondition(true, "已获得最高级"); wings wingInfo = WingManager.GetWingInfo(wingId); int wingLv = WingManager.GetWingLv(wingId); wingLv wingLvInfo = WingManager.GetWingLvInfo(wingId, wingLv); this.mWingPreviewCell.SetName(TextColorMgr.GetColorByQuality(wingLvInfo.name, wingLvInfo.color)); }
public void InitWithNotActive(int wingId) { this.Init(wingId); wings wingInfo = WingManager.GetWingInfo(wingId); this.mWingPreviewCell.ShowButtonGet(true); this.mWingPreviewCell.actionButtonGet = delegate { this.OnClickBtnGet(wingInfo.activation.get_Item(0).key); }; }
public static int GetWingModel(int wingId, int wingLv) { if (wingId == 0) { return(0); } if (wingId == 1) { return(WingManager.GetWingLvInfo(wingId, wingLv).model); } return(WingManager.GetWingInfo(wingId).model); }
private void OnClickBtnArrowL() { wingLv wingLvInfoPreDifferent = WingManager.GetWingLvInfoPreDifferent(this.m_current_wingId, this.m_wingLvInfoL.lv); if (wingLvInfoPreDifferent.model == this.m_wingLvInfoL.model) { return; } this.m_wingLvInfoR = this.m_wingLvInfoL; this.m_wingLvInfoL = wingLvInfoPreDifferent; WingGlobal.ResetRawImage(); this.SetWingPreviewCellAll(); }
private void OnClickBtnIcon(GameObject sender) { int num = 1; int wingLv = WingManager.GetWingLv(num); WingPreviewTwoUI wingPreviewTwoUI = UIManagerControl.Instance.OpenUI("WingPreviewTwoUI", UINodesManager.MiddleUIRoot, false, UIType.NonPush) as WingPreviewTwoUI; wingPreviewTwoUI.Init(num); wingPreviewTwoUI.get_transform().SetAsLastSibling(); if (WingManager.firstGetWingDetail && WingManager.GetWingLv(1) > 0) { WingManager.Instance.SendGetWingDetailReq(); } }
public static wingLv GetWingLvInfo(int id, int lv) { List <wingLv> wingLvInfos = WingManager.GetWingLvInfos(id); for (int i = 0; i < wingLvInfos.get_Count(); i++) { wingLv wingLv = wingLvInfos.get_Item(i); if (wingLv.lv == lv) { return(wingLv); } } return(null); }
public static wingLv GetWingLvInfoNextDifferent(int wingId, int wingLv) { wingLv wingLvInfo = WingManager.GetWingLvInfo(wingId, wingLv); List <wingLv> wingLvInfos = WingManager.GetWingLvInfos(wingId); for (int i = 0; i < wingLvInfos.get_Count(); i++) { wingLv wingLv2 = wingLvInfos.get_Item(i); if (wingLv2.lv > wingLv && wingLv2.model != wingLvInfo.model) { return(wingLv2); } } return(wingLvInfo); }
public static bool IsCanActiveWing(int id) { int wingLv = WingManager.GetWingLv(id); if (wingLv != 0) { return(false); } wings wingInfo = WingManager.GetWingInfo(id); int key = wingInfo.activation.get_Item(0).key; int value = wingInfo.activation.get_Item(0).value; long num = BackpackManager.Instance.OnGetGoodCount(key); return(num >= (long)value); }
private void SetActiveRequire(int wingId) { wings wingInfo = WingManager.GetWingInfo(wingId); int key = wingInfo.activation.get_Item(0).key; int value = wingInfo.activation.get_Item(0).value; long num = BackpackManager.Instance.OnGetGoodCount(key); int icon = DataReader <Items> .Get(key).icon; float num2 = Mathf.Min(1f, (float)num / (float)value); this.m_activeRequire.Find("imgProgress").GetComponent <RectTransform>().set_sizeDelta(new Vector2(205f * num2, 18.9f)); string text = num + "/" + value; this.m_activeRequire.Find("txtProgress").GetComponent <Text>().set_text(text); }
private void Init(int wingId) { WingGlobal.ResetRawImage(); if (this.mWingPreviewCell != null && this.mWingPreviewCell.get_gameObject() != null) { Object.Destroy(this.mWingPreviewCell.get_gameObject()); } wings wingInfo = WingManager.GetWingInfo(wingId); int wingLv = WingManager.GetWingLv(wingId); int wingModel = WingManager.GetWingModel(wingId, wingLv); this.mWingPreviewCell = WingGlobal.GetOneWingPreview(base.get_transform()); this.mWingPreviewCell.SetRawImage(wingModel); this.mWingPreviewCell.SetName(TextColorMgr.GetColorByQuality(wingInfo.name, wingInfo.color)); }
private void SetWingPreviewCellR() { wingLv wingLvInfoNextDifferent = WingManager.GetWingLvInfoNextDifferent(this.m_current_wingId, this.m_wingLvInfoR.lv); this.m_goBtnArrowR.SetActive(wingLvInfoNextDifferent.model != this.m_wingLvInfoR.model); this.m_WingPreviewCellNext.SetRawImage(this.m_wingLvInfoR.model); this.m_WingPreviewCellNext.SetName(TextColorMgr.GetColorByQuality(this.m_wingLvInfoR.name, this.m_wingLvInfoR.color)); if (wingLvInfoNextDifferent.model == this.m_wingLvInfoR.model && WingManager.IsMaxWingLv(this.m_current_wingId, this.m_current_winglevel)) { this.m_WingPreviewCellNext.SetCondition(true, "已获得最高级"); } else { this.m_WingPreviewCellNext.SetCondition(this.m_wingLvInfoR.lv > this.m_current_winglevel, string.Format(GameDataUtils.GetChineseContent(16301, false), this.m_wingLvInfoR.lv)); } this.m_WingPreviewCellNext.ShowButtonGet(false); }
public void ShowRoleModel(int profession, List <WearEquipInfo> equipInfos, List <string> fashionInfos, WearWingInfo wearWingInfo) { this.m_profession = profession; this.m_equipInfos = equipInfos; this.m_fashionInfos = fashionInfos; this.m_wingInfo = wearWingInfo; int wingID = (this.m_wingInfo == null) ? 0 : this.m_wingInfo.wingId; int wingLv = (this.m_wingInfo == null) ? 0 : this.m_wingInfo.lv; bool wingHide = this.m_wingInfo != null && this.m_wingInfo.wingHidden; if (DataReader <RoleCreate> .Get(profession) == null) { return; } if (this.m_equipInfos == null) { return; } this.equipIDs.Clear(); for (int i = 0; i < equipInfos.get_Count(); i++) { this.equipIDs.Add(equipInfos.get_Item(i).id); } this.ExteriorUnit.WrapSetData(delegate { this.ExteriorUnit.SetType(this.m_profession); this.ExteriorUnit.EquipIDs = this.equipIDs; this.ExteriorUnit.FashionIDs = fashionInfos; this.ExteriorUnit.WingID = WingManager.GetWingModel(wingID, wingLv); this.ExteriorUnit.IsHideWing = wingHide; }); ModelDisplayManager.Instance.ShowModel(this.ExteriorUnit.FinalModelID, true, ModelDisplayManager.OFFSET_TO_ROLESHOWUI, delegate(int uid) { this.roleModel = ModelDisplayManager.Instance.GetUIModel(uid); if (this.roleModel != null) { this.roleModel.get_transform().set_localEulerAngles(Vector3.get_zero()); this.roleModel.EquipOn(this.ExteriorUnit.FinalWeaponID, this.ExteriorUnit.FinalWeaponGogok); this.roleModel.EquipOn(this.ExteriorUnit.FinalClothesID, 0); this.roleModel.EquipWingOn(this.ExteriorUnit.FinalWingID); LayerSystem.SetGameObjectLayer(this.roleModel.get_gameObject(), "CameraRange", 2); this.roleModel.PreciseSetAction("idle_city"); } }); }
public void RefreshWing(wings dataWings) { this.wingId = dataWings.id; base.get_transform().set_name(dataWings.id.ToString()); this.ResetAll(); this.PlayCanActiveSpine(); wings wingInfo = WingManager.GetWingInfo(this.wingId); this.m_lblWingName.set_text(TextColorMgr.GetColorByQuality(wingInfo.name, wingInfo.color)); ResourceManager.SetSprite(this.m_spWingIcon, GameDataUtils.GetIcon(wingInfo.icon)); if (WingManager.GetWingLv(this.wingId) == 0) { ImageColorMgr.SetImageColor(this.m_spWingIcon, true); int key = wingInfo.activation.get_Item(0).key; int value = wingInfo.activation.get_Item(0).value; long num = BackpackManager.Instance.OnGetGoodCount(key); int icon = DataReader <Items> .Get(key).icon; ResourceManager.SetSprite(this.m_spimgIcon, GameDataUtils.GetItemIcon(key)); this.m_spimgIcon.SetNativeSize(); this.m_activeRequire.get_gameObject().SetActive(true); this.m_lblProgress.set_text(num + "/" + value); float num2 = Mathf.Clamp01((float)num / (float)value); this.m_imgProgress.set_sizeDelta(new Vector2(180f * num2, 18.9f)); if (WingSelectUI.IsTimeLimitWing(this.wingId)) { this.m_imgTimeLimit.get_gameObject().SetActive(true); } } else { ImageColorMgr.SetImageColor(this.m_spBackground, false); ImageColorMgr.SetImageColor(this.m_spWingIcon, false); if (this.wingId == EntityWorld.Instance.EntSelf.Decorations.wingId) { this.m_imgHighlight.get_gameObject().SetActive(true); } if (WingSelectUI.IsTimeLimitWing(this.wingId)) { this.m_imgTimeLimit.get_gameObject().SetActive(true); this.m_txtTimeLimit.get_gameObject().SetActive(true); this.m_txtTimeLimit.set_text(WingSelectUI.GetWingRemainTime(this.wingId)); } } }
public static bool IsCanUpgradeWing(int wingId) { int wingLv = WingManager.GetWingLv(wingId); if (wingLv == 0) { return(false); } if (WingManager.IsMaxWingLv(wingId, wingLv)) { return(false); } wingLv wingLvInfo = WingManager.GetWingLvInfo(wingId, wingLv + 1); int key = wingLvInfo.update.get_Item(0).key; int value = wingLvInfo.update.get_Item(0).value; long num = BackpackManager.Instance.OnGetGoodCount(key); return(num >= (long)value); }
private void SortWingList() { this.m_listDataWings = WingManager.GetSelectWingInfos(); this.m_listDataWings.Sort(delegate(wings a, wings b) { int wingLv = WingManager.GetWingLv(a.id); int wingLv2 = WingManager.GetWingLv(b.id); if (wingLv != wingLv2) { return(-wingLv.CompareTo(wingLv2)); } bool flag = WingSelectUI.IsTimeLimitWing(a.id); bool flag2 = WingSelectUI.IsTimeLimitWing(b.id); if (flag != flag2) { return(-flag.CompareTo(flag2)); } return(a.id.CompareTo(b.id)); }); }
public static bool CheckPage2Badge() { if (!WingManager.IsSystemOn()) { return(false); } List <wings> selectWingInfos = WingManager.GetSelectWingInfos(); using (List <wings> .Enumerator enumerator = selectWingInfos.GetEnumerator()) { while (enumerator.MoveNext()) { wings current = enumerator.get_Current(); if (WingManager.IsCanActiveWing(current.id)) { return(true); } } } return(false); }
private void SetAttrNext(int wingId) { wings wingInfo = WingManager.GetWingInfo(wingId); int num = WingManager.GetWingLv(wingId) + 1; wingLv wingLvInfo = WingManager.GetWingLvInfo(wingId, num); this.m_attrNext.Find("txtLv").GetComponent <Text>().set_text("Lv." + num); Attrs attrs = DataReader <Attrs> .Get(wingLvInfo.templateId); for (int i = 0; i < 6; i++) { if (i < attrs.attrs.get_Count()) { this.m_attrNext.Find("txtAttrVal" + (i + 1)).get_gameObject().SetActive(true); this.m_attrNext.Find("txtAttrVal" + (i + 1)).GetComponent <Text>().set_text(this.GetFormatAttrValue(attrs.attrs.get_Item(i), (float)attrs.values.get_Item(i))); } else { this.m_attrNext.Find("txtAttrVal" + (i + 1)).get_gameObject().SetActive(false); } } }
public void Refresh() { this.ResetAll(); int wingLv = WingManager.GetWingLv(1); this.SetAttrCurr(1, wingLv > 0); if (wingLv == 0) { this.m_activeRequire.get_gameObject().SetActive(true); this.m_btnActive.get_gameObject().SetActive(true); this.SetActiveRequire(1); Image component = this.m_btnActive.GetComponent <Image>(); if (WingManager.IsCanActiveWing(1)) { this.m_btnActive.GetComponent <Button>().set_enabled(true); ImageColorMgr.SetImageColor(component, false); } else { this.m_btnActive.GetComponent <Button>().set_enabled(false); ImageColorMgr.SetImageColor(component, true); } } else if (WingManager.IsMaxWingLv(1, wingLv)) { this.SetButtonWearAndButtonUndress(); this.m_maxLevelTip.get_gameObject().SetActive(true); } else { this.m_upgradeRequire.get_gameObject().SetActive(true); this.SetButtonWearAndButtonUndress(); this.m_btnUpgrade.get_gameObject().SetActive(true); this.m_attrNext.get_gameObject().SetActive(true); this.SetUpgradeRequire(1); this.SetAttrNext(1); } }
private void SetUpgradeRequire(int wingId) { int wingLv = WingManager.GetWingLv(wingId); wingLv wingLvInfo = WingManager.GetWingLvInfo(wingId, wingLv); int requireItemId = wingLvInfo.update.get_Item(0).key; int value = wingLvInfo.update.get_Item(0).value; long num = BackpackManager.Instance.OnGetGoodCount(requireItemId); int icon = DataReader <Items> .Get(requireItemId).icon; string text = num + "/" + value; this.m_upgradeRequire.Find("txtProgress").GetComponent <Text>().set_text(text); float num2 = Mathf.Min(1f, (float)num / (float)value); this.m_upgradeRequire.Find("imgProgress").GetComponent <RectTransform>().set_sizeDelta(new Vector2(205f * num2, 18.9f)); Button component = this.m_upgradeRequire.GetComponent <Button>(); component.get_onClick().RemoveAllListeners(); component.get_onClick().AddListener(delegate { this.OnClickUpgradeRequire(requireItemId); }); }
private void OnWingInfoChangeNty(short state, WingInfoChangeNty msg = null) { if (state != 0) { StateManager.Instance.StateShow(state, 0); return; } int cfgId = msg.wingInfo.cfgId; WingManager.wingInfoDict.set_Item(cfgId, msg.wingInfo); if (WingManager.wingInfoDict.get_Item(cfgId).overdueUtc == -1) { WingManager.wingInfoDict.Remove(cfgId); wings wingInfo = WingManager.GetWingInfo(cfgId); string text = string.Format(GameDataUtils.GetChineseContent(237031, false), wingInfo.name); UIManagerControl.Instance.ShowToastText(text, 2f, 2f); } WingSelectUI wingSelectUI = UIManagerControl.Instance.GetUIIfExist("WingSelectUI") as WingSelectUI; if (wingSelectUI != null) { wingSelectUI.RefreshWings(); } }
private bool IsPlayCanActiveSpine() { return(WingManager.GetWingLv(1) == 0 && WingManager.IsCanActiveWing(1)); }
// 对象进入场景,在这里初始化各种数据, 资源, 模型等 // 传入数据。 override public void OnEnterWorld() { base.OnEnterWorld(); LoggerHelper.Info("Avatar name: " + name); // 在调用该函数前, 数据已经通过EntityAttach 和 EntityCellAttach 同步完毕 CreateModel(); inventoryManager = new InventoryManager(this); bodyenhanceManager = new BodyEnhanceManager(this); skillManager = new PlayerSkillManager(this); battleManger = new PlayerBattleManager(this, skillManager as PlayerSkillManager); doorOfBurySystem = new DoorOfBurySystem(); runeManager = new RuneManager(this); towerManager = new TowerManager(this); missionManager = new MissionManager(this); taskManager = new TaskManager(this, (int)taskMain); marketManager = new MarketManager(this); friendManager = new FriendManager(this); operationSystem = new OperationSystem(this); sanctuaryManager = new SanctuaryManager(this); arenaManager = new ArenaManager(this); dailyEventSystem = new DailyEventSystem(this); rankManager = new RankManager(this); campaignSystem = new CampaignSystem(this); wingManager = new WingManager(this); rewardManager = new RewardManager(this); occupyTowerSystem = new OccupyTowerSystem(this); TipManager.Init(); DragonMatchManager.Init(); fumoManager = new FumoManager(this); MailManager.Instance.IsMailInfoDirty = true; TongManager.Instance.Init(); GuideSystem.Instance.AddListeners(); StoryManager.Instance.AddListeners(); EventDispatcher.AddEventListener(Events.UIBattleEvent.OnNormalAttack, NormalAttack); EventDispatcher.AddEventListener(Events.UIBattleEvent.OnPowerChargeStart, PowerChargeStart); EventDispatcher.AddEventListener(Events.UIBattleEvent.OnPowerChargeInterrupt, PowerChargeInterrupt); EventDispatcher.AddEventListener(Events.UIBattleEvent.OnPowerChargeComplete, PowerChargeComplete); EventDispatcher.AddEventListener(Events.UIBattleEvent.OnSpellOneAttack, SpellOneAttack); EventDispatcher.AddEventListener(Events.UIBattleEvent.OnSpellTwoAttack, SpellTwoAttack); EventDispatcher.AddEventListener(Events.UIBattleEvent.OnSpellThreeAttack, SpellThreeAttack); EventDispatcher.AddEventListener(Events.UIBattleEvent.OnSpellXPAttack, SpecialAttack); EventDispatcher.AddEventListener<int>(Events.UIBattleEvent.OnSpriteSkill, OnSpriteSkill); EventDispatcher.AddEventListener<uint>(Events.GearEvent.Teleport, Teleport); EventDispatcher.AddEventListener<uint, int, int, int>(Events.GearEvent.Damage, SetDamage); EventDispatcher.AddEventListener<int, bool>(Events.InstanceEvent.InstanceLoaded, InstanceLoaded); EventDispatcher.AddEventListener<ushort>(Events.OtherEvent.MapIdChanged, OnMapChanged); EventDispatcher.AddEventListener<ulong>(Events.OtherEvent.Withdraw, Withdraw); EventDispatcher.AddEventListener(Events.OtherEvent.DiamondMine, DiamondMine); EventDispatcher.AddEventListener(Events.OtherEvent.CheckCharge, CheckCharge); EventDispatcher.AddEventListener(Events.OtherEvent.Charge, Charge); EventDispatcher.AddEventListener(ON_TASK_GUIDE, TaskGuide); EventDispatcher.AddEventListener(ON_END_TASK_GUIDE, EndTaskGuide); EventDispatcher.AddEventListener<int, int>(ON_TASK_MISSION, MissionOpen); EventDispatcher.AddEventListener(Events.AIEvent.DummyThink, DummyThink); EventDispatcher.AddEventListener(Events.StoryEvent.CGBegin, ProcCGBegin); EventDispatcher.AddEventListener(Events.StoryEvent.CGEnd, ProcCGEnd); EventDispatcher.AddEventListener<string>(Events.GearEvent.TrapBegin, ProcTrapBegin); EventDispatcher.AddEventListener<string>(Events.GearEvent.TrapEnd, ProcTrapEnd); EventDispatcher.AddEventListener(Events.GearEvent.LiftEnter, ProcLiftEnter); EventDispatcher.AddEventListener<int>(Events.GearEvent.PathPointTrigger, PathPointTrigger); EventDispatcher.AddEventListener(Events.DirecterEvent.DirActive, DirActive); EventDispatcher.AddEventListener<int>(Events.EnergyEvent.BuyEnergy, BuyEnergy); EventDispatcher.AddEventListener(ON_VIP_REAL_STATE, OnVIPRealState); EventDispatcher.AddEventListener<int>(Events.DiamondToGoldEvent.GoldMetallurgy, GoldMetallurgy); EventDispatcher.AddEventListener(MainUIDict.MainUIEvent.AFFECTUP, OnBattleBtnPressed); EventDispatcher.AddEventListener(MainUIDict.MainUIEvent.OUTPUTUP, OnBattleBtnPressed); EventDispatcher.AddEventListener(MainUIDict.MainUIEvent.MOVEUP, OnBattleBtnPressed); EventDispatcher.AddEventListener(MainUIDict.MainUIEvent.NORMALATTACK, OnBattleBtnPressed); EventDispatcher.AddEventListener(MainUIDict.MainUIEvent.PLAYERINFOBGUP, OnBattleBtnPressed); EventDispatcher.AddEventListener("MainUIControllStickPressed", OnBattleBtnPressed); EventDispatcher.AddEventListener<Vector3>(Events.GearEvent.CrockBroken, CrockBroken); EventDispatcher.AddEventListener<bool, bool, Vector3>(Events.GearEvent.ChestBroken, ChestBroken); EventDispatcher.AddEventListener<GameObject, Vector3, float>(MogoMotor.ON_MOVE_TO_FALSE, OnMoveToFalse); EventDispatcher.AddEventListener(Events.OtherEvent.BossDie, BossDie); EventDispatcher.AddEventListener<int, bool>(Events.InstanceEvent.InstanceLoaded, SetCampControl); timerID = TimerHeap.AddTimer<bool>(1000, 100, SyncPos, true); checkDmgID = TimerHeap.AddTimer(0, 1000, CheckDmgBase); syncHpTimerID = TimerHeap.AddTimer(10000, 5000, SyncHp); skillFailoverTimer = TimerHeap.AddTimer(1000, 3000, SkillFailover); TimerHeap.AddTimer(5000, 0, GetServerTickReq); //rateTimer = TimerHeap.AddTimer(1000, 3000, CheckRate); CheckCharge(); GetWingBag(); MogoTime.Instance.InitTimeFromServer(); MogoUIManager.Instance.LoadUIResources(); TimerHeap.AddTimer(500, 0, EventDispatcher.TriggerEvent, Events.RuneEvent.GetBodyRunes); TimerHeap.AddTimer(500, 0, marketManager.GiftRecordReq); if (IsNewPlayer) { CurMissionID = 10100; CurMissionLevel = 1; missionManager.EnterMissionReq(CurMissionID, CurMissionLevel); } if (PlatformSdkManager.Instance) TimerHeap.AddTimer(1000, 60000, PlatformSdkManager.Instance.OnSetupNotification); }