public void OnInit() { IsLevelFinish = false; _isCanShowEndLevelWindow = false; _currentLevel = new SaveableField <LevelId>("CurrentLevel", defaultValue: new LevelId("World_0", 0)); _currentLevel.Load(); EventManager.Subscribe <FoodsController_CreateFoodEvent>(this, OnCreateFood); EventManager.Subscribe <PlayerIntoBlockTriggerEnter>(this, OnPlayerIntoBlockTriggerEnter); }
public void OnInit() { _totalFoodCount = new SaveableField <int>("FoodCount", true); _totalFoodCount.Load(); _foods = LevelConfigController.Config.Foods; CurrentFoodCount = 0; _spawnCountFoods = 0; _targetFoodCount = LevelConfigController.Config.GetFoodsCount(LevelController.CurrentLevel.Level); EventManager.Subscribe <SpawnLevelElementEvent>(this, OnSpawnLevelElement); EventManager.Subscribe <FoodCollectEvent>(this, OnFoodCollect); }