public void Init(Hashtable changeStateData) { _gameMode = GameMode.COMBAT; _playerCombatSystem = _diContainer.Resolve<PlayerCombatSystem>(); _buildSystem = _diContainer.Resolve<BuildingSystem>(); _inventorySystem = _diContainer.Resolve<InventorySystem>(); _enemySystem = _diContainer.Resolve<EnemySystem>(); _lootSystem = _diContainer.Resolve<LootSystem>(); _particleGod = _diContainer.Resolve<ParticleGOD>(); _monsterGenerator = _diContainer.Resolve<MonsterGenerator>(); Singleton.instance.audioSystem.GenerateAudioLookupForLevel(); _particleGod.InitParticlePool(); //HUD _hudController = new HUDController(_gameConfig.playerConfig,_gameConfig.hudConfig); _hudController.Start(() => { _monsterGenerator.Init(_hudController, _playerCombatSystem); }); _playerCombatSystem.Init(_hudController); _buildSystem.Init(); _enemySystem.Init(); _lootSystem.Init(); _inventorySystem.Init(); // Get CombatPlayerView //_playerCombatSystem.isEnabled = true; _dispatcher.AddListener(GameplayEventType.DAMAGE_TAKEN, onDamageTaken); _dispatcher.AddListener(GameplayEventType.GAME_COMPLETE, onGameComplete); _dispatcher.AddListener(GameplayEventType.GAME_RETRY, onGameRetry); }
//初始化游戏 void InitGame() { InitGameData(); instance = this; //单例 gameOver = false; GameObjectPool.Instance.Init(); eSys.Init(); pagodaMenu.Init(); mGoldPanel.Init(); mUpgradePanel.Init(); mAgainBut.gameObject.SetActive(false); Cursor.SetCursor(cursorTexture, Vector2.zero, CursorMode.Auto); //设置鼠标图片 }