Example #1
0
 /// <summary>
 /// Unloads this instance.
 /// </summary>
 /// <param name="save">Whether the level will be saved or not.</param>
 public void Unload(bool save = false)
 {
     OnLevelUnload.Call(this, new LevelLoadEventArgs(false), OnAllLevelsUnload);
     if (save)
     {
         SaveToBinary();
     }
     Levels.Remove(this);
 }
Example #2
0
        private void UnloadLevel()
        {
            if (currentLevel == null)
            {
                return;
            }

            OnLevelUnload?.Invoke();
            Destroy(currentLevel);
            currentLevel = null;
        }