// 对象进入场景,在这里初始化各种数据, 资源, 模型等 // 传入数据。 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); }
/// <summary> /// 性别 /// </summary> public string GetSexString(TaskManager.DialogueRelationship relationship) { switch (relationship) { case TaskManager.DialogueRelationship.YoungerToOlder: switch (vocation) { case Vocation.Warrior: case Vocation.Archer: return LanguageData.GetContent(150006); case Vocation.Mage: case Vocation.Assassin: return LanguageData.GetContent(150007); default: return ""; } case TaskManager.DialogueRelationship.OlderToYounger: return ""; case TaskManager.DialogueRelationship.You: return ""; default: return ""; } }