예제 #1
0
    public bool LoadGame(string saveName)
    {
        saveName = SaveFolder + defaultName + defaultType;
        if (!File.Exists(saveName))
        {
            return(false);
        }

        string path = saveName;

        byte[]   data       = UnityEngine.Windows.File.ReadAllBytes(path);
        string   json       = Encoding.Unicode.GetString(data);
        SaveData loadedData = JsonUtility.FromJson <SaveData>(json);

        sessionCreator.StartGame(loadedData);

        return(true);
    }