/// <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); }
private void UnloadLevel() { if (currentLevel == null) { return; } OnLevelUnload?.Invoke(); Destroy(currentLevel); currentLevel = null; }