public void Load() { var path = $"{Application.persistentDataPath}/data.json"; if (!File.Exists(path)) { StorageData = new StorageData(); } else { var json = File.ReadAllText(path); StorageData = JsonUtility.FromJson <StorageData>(json); } EventManager.Call <IStorageHandler>(x => x.OnLoad(StorageData)); }
public void Dispose() { StorageData = null; }