public virtual void UnloadFile() { if (data == null) { // Not loaded, so exit return; } data.UnloadData(); data = null; OnDataLoadCompleted_Sender?.Invoke(false); }
public virtual void LoadFile(bool forceReload = true) { if (!forceReload && data != null) { // Don't load if already loaded, so exit return; } UnloadFile(); var path = FileSettings.Instance.GetFilePath(DataFileType); if (string.IsNullOrEmpty(path)) { // No path to load from, so exit return; } data = new U(); data.SetPath(path); data.LoadData(); OnDataLoadCompleted_Sender?.Invoke(true); }