public static void Init() { MainHero = new MainHero(); MainHero.Init(); AutoMidas.GetNewInstance(MainHero); GameDispatcher.OnUpdate += GameDispatcherOnOnUpdate; UpdateManager.Subscribe(TempestUpdater, 500); var manager = new InventoryManager(new EnsageServiceContext(MainHero.Hero)); manager.CollectionChanged += (sender, args) => { if (args.Action == NotifyCollectionChangedAction.Add) { foreach (InventoryItem iitem in args.NewItems) { if (MenuManager.Items.ContainsKey(iitem.Id.ToString())) { MenuManager.AddNewItem(iitem.Id); } } } else if (args.Action == NotifyCollectionChangedAction.Remove) { foreach (InventoryItem iitem in args.OldItems) { if (MenuManager.Items.ContainsKey(iitem.Id.ToString())) { MenuManager.RemoveOldItem(iitem.Id); } } } }; }
public static void Init() { MainHero = new MainHero(); MainHero.Init(); AutoMidas.GetNewInstance(MainHero); GameDispatcher.OnUpdate += GameDispatcherOnOnUpdate; UpdateManager.Subscribe(TempestUpdater, 500); }
private static void TempestUpdater() { if (TempestManager.Tempest != null && TempestManager.Tempest.IsValid) { ItemPanel.GetItemPanel().Load(); TempestHero = new Tempest(); TempestHero.Init(); UpdateManager.Unsubscribe(TempestUpdater); AutoMidas.GetNewInstance(TempestHero); DelayAction.Add(200, () => { PushLaneSelector.GetInstance().Load(); }); } }
public static void Init() { /*Drawing.OnDraw += args => * { * Drawing.DrawText($"{OrderManager.Orders.AutoPushing.GetLane(Game.MousePosition)}", Drawing.WorldToScreen(Game.MousePosition)+new Vector2(50), Color.White, FontFlags.None); * };*/ MainHero = new MainHero(); MainHero.Init(); AutoMidas.GetNewInstance(MainHero); UpdateManager.BeginInvoke(() => { UpdateManager.Subscribe(OnUpdate, 250); }, 100); // DelayAction.Add(100,() => GameDispatcher.OnUpdate += GameDispatcherOnOnUpdate); UpdateManager.Subscribe(TempestUpdater, 500); var manager = Program.GetContext.Inventory; foreach (var item in manager.Inventory.Items) { if (MenuManager.Items.ContainsKey(item.Id.ToString())) { MenuManager.AddNewItem(item.Id); } } manager.CollectionChanged += (sender, args) => { if (args.Action == NotifyCollectionChangedAction.Add) { foreach (InventoryItem iitem in args.NewItems) { if (MenuManager.Items.ContainsKey(iitem.Id.ToString())) { MenuManager.AddNewItem(iitem.Id); } } } else if (args.Action == NotifyCollectionChangedAction.Remove) { foreach (InventoryItem iitem in args.OldItems) { if (MenuManager.Items.ContainsKey(iitem.Id.ToString())) { MenuManager.RemoveOldItem(iitem.Id); } } } }; }
public void StartBattle(List <UnitConfigData> fighterDatas) { SceneCameraManager.Instance.MoveToPos(new Vector3(62f, 40f, 1.6f)); SceneCameraManager.Instance.ForceTo(new Vector3(59.45f, 0f, 30f)); for (int i = 0; i < fighterDatas.Count; ++i) { UnitBase fighter = new UnitBase(); fighter.Init(fighterDatas [i]); mFighters.Add(fighter); mFighterDic.Add(fighter.ID, fighter); if (fighter.Data.IsAttack) { mAttackFighterList.Add(fighter); } else { mDefenderFighterList.Add(fighter); } } }