浏览代码

Fixed Game Save Manager data storage location + Updated Gameplay Ingredients

/main
Thomas ICHÉ 5 年前
当前提交
14c2d200
共有 4 个文件被更改,包括 19 次插入14 次删除
  1. 15
      Assets/Resources/GameSaveManager.prefab
  2. 6
      LocalPackages/net.peeweek.gameplay-ingredients/CHANGELOG.md
  3. 10
      LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Implementations/GameSaveManager.cs
  4. 2
      LocalPackages/net.peeweek.gameplay-ingredients/package.json

15
Assets/Resources/GameSaveManager.prefab


m_GameObject: {fileID: 4126731527077413761}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}

m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
m_FontData:
m_Font: {fileID: 12800000, guid: 1aeec05e86dac924db951076a9c01627, type: 3}
m_FontSize: 64

m_GameObject: {fileID: 4126731527289085640}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 1980459831, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3}
m_Name:
m_EditorClassIdentifier:
m_UiScaleMode: 1

m_Script: {fileID: 11500000, guid: 4a94c60800d516b4980b9f68a5ab6cb5, type: 3}
m_Name:
m_EditorClassIdentifier:
savePath: /../
savePath: /
systemSaveName: System.sav
userSaveName: User{0}.sav
OnLoad:

m_Name:
m_EditorClassIdentifier:
Name: DelayedLogic
delayMode: 0
DelayRange: {x: 3, y: 4}
OnDelayComplete:
- {fileID: 4126731527728584134}
OnCanceled: []

m_GameObject: {fileID: 7062238114280516996}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 2100000, guid: 1ab298651aa1ee743ad43b120ac2ae10, type: 2}

m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
m_Sprite: {fileID: 0}
m_Type: 0
m_PreserveAspect: 0

m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1

6
LocalPackages/net.peeweek.gameplay-ingredients/CHANGELOG.md


# Changelog
## 2019.3.4
#### Changed
* Game Save manager now saves to the Application.persistentDataPath folder
## 2019.3.3
#### Added

10
LocalPackages/net.peeweek.gameplay-ingredients/Runtime/Managers/Implementations/GameSaveManager.cs


[ManagerDefaultPrefab("GameSaveManager")]
public class GameSaveManager : Manager
{
[SerializeField, Tooltip("The path where system and user saves will be stored. Relative to the Executable_Data folder (or Assets folder for editor). Default is '/../' next to the executable or at the root of the project.")]
private string savePath = "/../";
[SerializeField, Tooltip("The path where system and user saves will be stored. Relative to the Application.persistantDataPath folder.")]
private string savePath = "/";
[SerializeField, Tooltip("The file name of the System Save.")]
private string systemSaveName = "System.sav";
[SerializeField, Tooltip("The file format for a user save, use the {0} to specify where the numbering happens.")]

Dictionary<string, object> LoadFile(string fileName)
{
if(!File.Exists(Application.dataPath + savePath + fileName))
if(!File.Exists(Application.persistentDataPath + savePath + fileName))
{
SaveFile(fileName, new Dictionary<string, object>());
}

string contents= File.ReadAllText(Application.dataPath + savePath + fileName);
string contents= File.ReadAllText(Application.persistentDataPath + savePath + fileName);
SerializableOutput data = JsonUtility.FromJson<SerializableOutput>(contents);

i++;
}
File.WriteAllText(Application.dataPath + savePath + filename, JsonUtility.ToJson(data));
File.WriteAllText(Application.persistentDataPath + savePath + filename, JsonUtility.ToJson(data));
}
[System.Serializable]

2
LocalPackages/net.peeweek.gameplay-ingredients/package.json


{
"name": "net.peeweek.gameplay-ingredients",
"displayName": "Gameplay Ingredients",
"version": "2019.3.3",
"version": "2019.3.4",
"category": "Gameplay",
"unity": "2019.3",
"description": "Gameplay ingredients - A Collection of scripts for the editor and runtime to set-up gameplay actions and logic in your games.",

正在加载...
取消
保存