Example #1
0
 public void Handle(LevelUnloaded message)
 {
     if (_level.Name == message.Level.Name)
     {
         _level = null;
     }
 }
Example #2
0
 public void LoadLevel(LevelType levelType)
 {
     if (_currentLevel != null)
     {
         GameObject.Destroy(_currentLevel);
         LevelUnloaded?.Invoke();
     }
     _currentLevel = GameObject.Instantiate(Data.Instance.LevelData.GetPrefab(levelType));
     Services.Instance.LevelService.CurrentLevel = levelType;
     Time.timeScale = 1;
     LevelLoaded?.Invoke();
 }