Пример #1
0
 /// <summary>
 /// 传递退出游戏事件
 /// </summary>
 public void ExitGame()
 {
     isInGame = false;
     SaveGame();
     saveData = null;
     //  Messenger.
 }
Пример #2
0
    /// <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);
    }
Пример #3
0
    public SingleSave CreateSingleSave(int saveIndex)
    {
        if (saveData == null)
        {
            allSave.singleSaves[saveIndex] = new SingleSave();
            saveData = allSave.singleSaves[saveIndex];
        }

        return(saveData);
    }
Пример #4
0
    /// <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);
    }
Пример #5
0
    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);
    }
Пример #6
0
    /// <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();
    }
Пример #7
0
 /// <summary>
 /// 传递退出游戏事件
 /// </summary>
 public void ExitGame()
 {
     ExitCallBack(this, saveData);
     SaveByBin();
     saveData = null;
 }