public StoredReferences Alive() { StoredReferences storedReferences = ScriptableObject.CreateInstance <StoredReferences>(); foreach (SaveGameManager.StoredEntry current in this.entries) { if (current.gameObject != null) { storedReferences[current.Id] = current; } } return(storedReferences); }
private void Awake() { StartCoroutine(LoadSavesAndSerializers()); Loom.Initialize(); if (Reference == null) { Reference = ScriptableObject.CreateInstance <StoredReferences>(); } if (Application.isEditor) { GetAllInactiveGameObjects(); } if (Instance != null && Instance != this) { if (Application.isEditor) { DestroyImmediate(Instance.gameObject); } else { Destroy(Instance.gameObject); } } Instance = this; hasWoken = true; if (Application.isPlaying && !hasRun) { _cached = Reference; hasRun = true; } else if (!Application.isPlaying) { hasRun = false; if (_cached != null && _cached.Count > 0) { Reference = _cached.Alive(); } } if (_initActions.Count > 0) { foreach (var a in _initActions) { a(); } _initActions.Clear(); } }
void Awake() { Loom.Initialize(); if (Reference == null) { Reference = ScriptableObject.CreateInstance <StoredReferences>(); } if (Application.isEditor) { GetAllInactiveGameObjects(); } if (Instance != null && Instance != this) { Destroy(Instance.gameObject); } Instance = this; hasWoken = true; if (Application.isPlaying && !hasRun) { _cached = Reference; hasRun = true; } else if (!Application.isPlaying) { hasRun = false; if (_cached != null && _cached.Count > 0) { Reference = _cached.Alive(); } } if (_initActions.Count > 0) { foreach (var a in _initActions) { a(); } _initActions.Clear(); } //giving errors, I don't think the previous people got saving working anyway. //I'll look into why if I have time. If not, sorry to whoever has to.************ //DontDestroyOnLoad (transform.gameObject); }
void Awake() { if (Reference == null) { Reference = ScriptableObject.CreateInstance <StoredReferences>(); } GetAllReferences(); if (Application.isEditor) { GetAllInactiveGameObjects(); } if (Instance != null && Instance != this) { Destroy(Instance.gameObject); } Instance = this; hasWoken = true; if (Application.isPlaying && !hasRun) { _cached = Reference; hasRun = true; } else if (!Application.isPlaying) { hasRun = false; if (_cached != null && _cached.Count > 0) { Reference = _cached.Alive(); } } if (_initActions.Count > 0) { foreach (var a in _initActions) { a(); } _initActions.Clear(); } }
private void Awake() { if (this.Reference == null) { this.Reference = ScriptableObject.CreateInstance <StoredReferences>(); } if (Application.isEditor) { this.GetAllInactiveGameObjects(); } if (SaveGameManager.Instance != null && SaveGameManager.Instance != this) { UnityEngine.Object.Destroy(SaveGameManager.Instance.gameObject); } SaveGameManager.Instance = this; this.hasWoken = true; if (Application.isPlaying && !SaveGameManager.hasRun) { SaveGameManager._cached = this.Reference; SaveGameManager.hasRun = true; } else if (!Application.isPlaying) { SaveGameManager.hasRun = false; if (SaveGameManager._cached != null && SaveGameManager._cached.Count > 0) { this.Reference = SaveGameManager._cached.Alive(); } } if (SaveGameManager._initActions.Count > 0) { foreach (Action current in SaveGameManager._initActions) { current(); } SaveGameManager._initActions.Clear(); } }
public static void Loaded() { SaveGameManager._cached = null; }
private void Awake() { if (this.Reference == null) { this.Reference = ScriptableObject.CreateInstance<StoredReferences>(); } if (Application.isEditor) { this.GetAllInactiveGameObjects(); } if (SaveGameManager.Instance != null && SaveGameManager.Instance != this) { UnityEngine.Object.Destroy(SaveGameManager.Instance.gameObject); } SaveGameManager.Instance = this; this.hasWoken = true; if (Application.isPlaying && !SaveGameManager.hasRun) { SaveGameManager._cached = this.Reference; SaveGameManager.hasRun = true; } else if (!Application.isPlaying) { SaveGameManager.hasRun = false; if (SaveGameManager._cached != null && SaveGameManager._cached.Count > 0) { this.Reference = SaveGameManager._cached.Alive(); } } if (SaveGameManager._initActions.Count > 0) { foreach (Action current in SaveGameManager._initActions) { current(); } SaveGameManager._initActions.Clear(); } }
void Awake() { Loom.Initialize(); if(Reference == null) Reference = ScriptableObject.CreateInstance<StoredReferences>(); if(Application.isEditor) { GetAllInactiveGameObjects(); } if(Instance != null && Instance != this) Destroy(Instance.gameObject); Instance = this; hasWoken = true; if(Application.isPlaying && !hasRun) { _cached = Reference; hasRun = true; } else if(!Application.isPlaying ) { hasRun = false; if(_cached != null && _cached.Count > 0) Reference = _cached.Alive(); } if(_initActions.Count > 0) { foreach(var a in _initActions) { a(); } _initActions.Clear(); } }
public static void Loaded() { _cached = null; }