private void PrepareLevel() { actorsManager = new AIActorsManager(); spawnPoints = FindObjectsOfType <SpawnPoint>(); triggersManager = new TriggersManager(FindObjectsOfType <Trigger>()); levelSettings = FindObjectOfType <LevelSettings>(); triggersManager.Init(); if (levelSettings != null) { GameController.instance.playerManager.TeleportToPoint(levelSettings.spawnPointId); levelSettings.Apply(GameController.instance); } }
private void PrepareLevel() { if (currentLevel == null) { Debug.Log(" # -LvlCntr- # Current Level Not Found or not loaded"); return; } actorsController = new AIActorsController(); triggersManager = new TriggersManager(FindObjectsOfType <Trigger>()); spawnPoints = FindObjectsOfType <SpawnPoint>(); levelSettings = FindObjectOfType <LevelSettings>(); triggersManager.Init(); if (levelSettings != null) { PlayerManager.Instance().TeleportToPoint(levelSettings.spawnPointId); levelSettings.Apply(); } OnLevelLoaded?.Invoke(); }