/// <summary> /// 传递退出游戏事件 /// </summary> public void ExitGame() { isInGame = false; SaveGame(); saveData = null; // Messenger. }
/// <summary> /// 读取指定序号存档游戏事件 /// </summary> /// <param name="save"></param> public SingleSave LoadGame(int saveIndex) { saveData = allSave == null?LoadByBin().singleSaves[saveIndex] : allSave.singleSaves[saveIndex]; // Debug.Log(saveData.roleId.ToString()); return(saveData); }
public SingleSave CreateSingleSave(int saveIndex) { if (saveData == null) { allSave.singleSaves[saveIndex] = new SingleSave(); saveData = allSave.singleSaves[saveIndex]; } return(saveData); }
/// <summary> /// 读取指定序号存档游戏事件 /// </summary> /// <param name="save"></param> public SingleSave LoadGame(int saveIndex) { saveData = allSave == null?LoadByBin().singleSaves[saveIndex] : allSave.singleSaves[saveIndex]; Debug.Log(saveData.roleId.ToString()); if (LoadSuccessCallBack != null) { LoadSuccessCallBack(this, saveData); } return(saveData); }
public SingleSave CreateSingleSave(int saveIndex) { if (saveData == null) { allSave.singleSaves[saveIndex] = new SingleSave(); saveData = allSave.singleSaves[saveIndex]; saveData.buildLocation = new Dictionary <string, string>(); saveData.building = new Dictionary <string, float>(); saveData.buildNodes = new Dictionary <int, Dictionary <string, bool> >(); saveData.otherData = new Dictionary <string, string>(); } return(saveData); }
/// <summary> /// 初始化获取系统信息等 /// </summary> void Init() { #if UNITY_IOS RunOS = IOSOS; #endif #if UNITY_ANDROID RunOS = ANDROIDOS; #endif #if UNITY_STANDALONE_WIN || UNITY_EDITOR RunOS = WINDOWSOS; #endif #if UNITY_EDITOR LoadAllGame(); saveData = CreateSingleSave(0); saveData.listIndex = 0; #endif GetDeviceInfo(); }
/// <summary> /// 传递退出游戏事件 /// </summary> public void ExitGame() { ExitCallBack(this, saveData); SaveByBin(); saveData = null; }