public void NewGame() { //propmt to make sure. //if yes -> delete save file .. SaveInstance.DeleteSave(); GameController.GameInit(true); }
public override void Load() { var temp = SaveInstance.LoadRecord(masterKey, key, id); if (temp != "") { _DeserializeToInfo(temp); } }
void Start() { var isHasProgress = SaveInstance.IsSaveFileExists(); btnContinue.enabled = isHasProgress; if (eventObj) { if (!eventObj.firstSelectedGameObject) { eventObj.firstSelectedGameObject = (isHasProgress) ? btnContinue.gameObject : btnNewGame.gameObject; } } }
public void MoveToScene(int id, float delay, bool needSaveCurrent = true) { if (needSaveCurrent) { SaveInstance.FireEvent_OnSave(); } GameController.loadingProgress = 0.0f; if (OnLoadingScene != null) { OnLoadingScene(); } StartCoroutine(_LoadSceneAsync(id, delay)); }
void _StartGameHandler() { if (SaveInstance.IsSaveFileExists()) { string targetSceneName = gameSaveAgent.LastActiveScene; if (targetSceneName != null) { MoveToScene(targetSceneName, 2.0f, false); } else { MoveToScene(2, 2.0f, false); } } else { MoveToScene(2, 2.0f, false); } }
public override void Save() { _SerializeToJson(); SaveInstance.InsertRecord(masterKey, key, id, json); }
void OnSceneLoaded(Scene scene, LoadSceneMode mode) { SaveInstance.FireEvent_OnLoad(); }
void Start() { _Spawn_Reuse_Object(); SaveInstance.FireEvent_OnLoad(); }
public void RestartGameFromSave() { SaveInstance.FireEvent_OnLoad(); _StartGameHandler(); }
void _SaveGame() { SaveInstance.FireEvent_OnSave(); }