diff --git a/Assets/AssetStoreTools/Editor/AssetStoreTools.dll.meta b/Assets/AssetStoreTools/Editor/AssetStoreTools.dll.meta
index f6ebfb64..5244b496 100644
--- a/Assets/AssetStoreTools/Editor/AssetStoreTools.dll.meta
+++ b/Assets/AssetStoreTools/Editor/AssetStoreTools.dll.meta
@@ -7,8 +7,16 @@ PluginImporter:
isPreloaded: 0
platformData:
Any:
- enabled: 1
+ enabled: 0
settings: {}
+ Editor:
+ enabled: 1
+ settings:
+ DefaultValueInitialized: true
+ WindowsStoreApps:
+ enabled: 0
+ settings:
+ CPU: AnyCPU
userData:
assetBundleName:
assetBundleVariant:
diff --git a/Assets/Fungus/Scripts/Components/SaveHelper.cs b/Assets/Fungus/Scripts/Components/GameSaver.cs
similarity index 95%
rename from Assets/Fungus/Scripts/Components/SaveHelper.cs
rename to Assets/Fungus/Scripts/Components/GameSaver.cs
index 324879a9..2a349608 100644
--- a/Assets/Fungus/Scripts/Components/SaveHelper.cs
+++ b/Assets/Fungus/Scripts/Components/GameSaver.cs
@@ -5,7 +5,7 @@ using UnityEngine.SceneManagement;
namespace Fungus
{
- public class SaveHelper : MonoBehaviour
+ public class GameSaver : MonoBehaviour
{
[SerializeField] protected string startScene = "";
diff --git a/Assets/Fungus/Scripts/Components/SaveHelper.cs.meta b/Assets/Fungus/Scripts/Components/GameSaver.cs.meta
similarity index 100%
rename from Assets/Fungus/Scripts/Components/SaveHelper.cs.meta
rename to Assets/Fungus/Scripts/Components/GameSaver.cs.meta
diff --git a/Assets/Fungus/Scripts/SavePoints/SavePointData.cs b/Assets/Fungus/Scripts/SavePoints/SavePointData.cs
index c58f1f85..22c026ab 100644
--- a/Assets/Fungus/Scripts/SavePoints/SavePointData.cs
+++ b/Assets/Fungus/Scripts/SavePoints/SavePointData.cs
@@ -7,6 +7,12 @@ namespace Fungus
[System.Serializable]
public class SavePointData
{
+ ///
+ /// Version number of current save data format.
+ ///
+ protected const int SavePointDataVersion = 0;
+
+ [SerializeField] protected int version;
[SerializeField] protected string saveKey;
[SerializeField] protected string description;
[SerializeField] protected string sceneName;
@@ -74,20 +80,21 @@ namespace Fungus
{
var savePointData = new SavePointData();
+ savePointData.version = 1;
savePointData.saveKey = _saveKey;
savePointData.description = _description;
savePointData.sceneName = _sceneName;
- var saveHelper = GameObject.FindObjectOfType();
- if (saveHelper == null)
+ var gameSaver = GameObject.FindObjectOfType();
+ if (gameSaver == null)
{
Debug.LogError("Failed to find SaveHelper object in scene");
return null;
}
- for (int i = 0; i < saveHelper.Flowcharts.Count; i++)
+ for (int i = 0; i < gameSaver.Flowcharts.Count; i++)
{
- var flowchart = saveHelper.Flowcharts[i];
+ var flowchart = gameSaver.Flowcharts[i];
var flowchartData = FlowchartData.Encode(flowchart);
savePointData.FlowchartDatas.Add(flowchartData);
}
diff --git a/Assets/FungusExamples/SaveGame/GameSaver.prefab b/Assets/FungusExamples/SaveGame/GameSaver.prefab
new file mode 100644
index 00000000..19da8add
--- /dev/null
+++ b/Assets/FungusExamples/SaveGame/GameSaver.prefab
@@ -0,0 +1,56 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!1001 &100100000
+Prefab:
+ m_ObjectHideFlags: 1
+ serializedVersion: 2
+ m_Modification:
+ m_TransformParent: {fileID: 0}
+ m_Modifications: []
+ m_RemovedComponents: []
+ m_ParentPrefab: {fileID: 0}
+ m_RootGameObject: {fileID: 1000013716579298}
+ m_IsPrefabParent: 1
+--- !u!1 &1000013716579298
+GameObject:
+ m_ObjectHideFlags: 0
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ serializedVersion: 4
+ m_Component:
+ - 4: {fileID: 4000012594529446}
+ - 114: {fileID: 114000011912982844}
+ m_Layer: 0
+ m_Name: GameSaver
+ m_TagString: Untagged
+ m_Icon: {fileID: 0}
+ m_NavMeshLayer: 0
+ m_StaticEditorFlags: 0
+ m_IsActive: 1
+--- !u!4 &4000012594529446
+Transform:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 1000013716579298}
+ m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+ m_LocalPosition: {x: 763, y: 559, z: 0}
+ m_LocalScale: {x: 1, y: 1, z: 1}
+ m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+ m_Children: []
+ m_Father: {fileID: 0}
+ m_RootOrder: 0
+--- !u!114 &114000011912982844
+MonoBehaviour:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 1000013716579298}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: abe25ebf9ddc8416ead6f30d4671fdbf, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ startScene:
+ flowcharts:
+ - {fileID: 0}
diff --git a/Assets/FungusExamples/SaveGame/GameSaver.prefab.meta b/Assets/FungusExamples/SaveGame/GameSaver.prefab.meta
new file mode 100644
index 00000000..2f1c6f74
--- /dev/null
+++ b/Assets/FungusExamples/SaveGame/GameSaver.prefab.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: ac03b2b3b2c07411da18c6ddc7c6e9ec
+timeCreated: 1479485548
+licenseType: Free
+NativeFormatImporter:
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/FungusExamples/SaveGame/Menu.unity b/Assets/FungusExamples/SaveGame/Menu.unity
index a0d1260a..38f49d0d 100644
--- a/Assets/FungusExamples/SaveGame/Menu.unity
+++ b/Assets/FungusExamples/SaveGame/Menu.unity
@@ -100,7 +100,7 @@ GameObject:
- 4: {fileID: 76757869}
- 114: {fileID: 76757868}
m_Layer: 0
- m_Name: SaveHelper
+ m_Name: GameSaver
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
@@ -118,6 +118,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
startScene: SceneA
+ flowcharts: []
--- !u!4 &76757869
Transform:
m_ObjectHideFlags: 0
diff --git a/Assets/FungusExamples/SaveGame/SceneA.unity b/Assets/FungusExamples/SaveGame/SceneA.unity
index af9061e1..d96ea5cc 100644
--- a/Assets/FungusExamples/SaveGame/SceneA.unity
+++ b/Assets/FungusExamples/SaveGame/SceneA.unity
@@ -656,6 +656,53 @@ CanvasRenderer:
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 355380714}
+--- !u!1001 &398868452
+Prefab:
+ m_ObjectHideFlags: 0
+ serializedVersion: 2
+ m_Modification:
+ m_TransformParent: {fileID: 0}
+ m_Modifications:
+ - target: {fileID: 4000012594529446, guid: ac03b2b3b2c07411da18c6ddc7c6e9ec, type: 2}
+ propertyPath: m_LocalPosition.x
+ value: 763
+ objectReference: {fileID: 0}
+ - target: {fileID: 4000012594529446, guid: ac03b2b3b2c07411da18c6ddc7c6e9ec, type: 2}
+ propertyPath: m_LocalPosition.y
+ value: 559
+ objectReference: {fileID: 0}
+ - target: {fileID: 4000012594529446, guid: ac03b2b3b2c07411da18c6ddc7c6e9ec, type: 2}
+ propertyPath: m_LocalPosition.z
+ value: 0
+ objectReference: {fileID: 0}
+ - target: {fileID: 4000012594529446, guid: ac03b2b3b2c07411da18c6ddc7c6e9ec, type: 2}
+ propertyPath: m_LocalRotation.x
+ value: 0
+ objectReference: {fileID: 0}
+ - target: {fileID: 4000012594529446, guid: ac03b2b3b2c07411da18c6ddc7c6e9ec, type: 2}
+ propertyPath: m_LocalRotation.y
+ value: 0
+ objectReference: {fileID: 0}
+ - target: {fileID: 4000012594529446, guid: ac03b2b3b2c07411da18c6ddc7c6e9ec, type: 2}
+ propertyPath: m_LocalRotation.z
+ value: 0
+ objectReference: {fileID: 0}
+ - target: {fileID: 4000012594529446, guid: ac03b2b3b2c07411da18c6ddc7c6e9ec, type: 2}
+ propertyPath: m_LocalRotation.w
+ value: 1
+ objectReference: {fileID: 0}
+ - target: {fileID: 4000012594529446, guid: ac03b2b3b2c07411da18c6ddc7c6e9ec, type: 2}
+ propertyPath: m_RootOrder
+ value: 4
+ objectReference: {fileID: 0}
+ - target: {fileID: 114000011912982844, guid: ac03b2b3b2c07411da18c6ddc7c6e9ec,
+ type: 2}
+ propertyPath: flowcharts.Array.data[0]
+ value:
+ objectReference: {fileID: 27697871}
+ m_RemovedComponents: []
+ m_ParentPrefab: {fileID: 100100000, guid: ac03b2b3b2c07411da18c6ddc7c6e9ec, type: 2}
+ m_IsPrefabParent: 0
--- !u!1 &559390319
GameObject:
m_ObjectHideFlags: 0
@@ -1034,47 +1081,12 @@ Transform:
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 3
---- !u!1 &1657224898
-GameObject:
- m_ObjectHideFlags: 0
- m_PrefabParentObject: {fileID: 0}
- m_PrefabInternal: {fileID: 0}
- serializedVersion: 4
- m_Component:
- - 4: {fileID: 1657224900}
- - 114: {fileID: 1657224899}
- m_Layer: 0
- m_Name: SaveHelper
- m_TagString: Untagged
- m_Icon: {fileID: 0}
- m_NavMeshLayer: 0
- m_StaticEditorFlags: 0
- m_IsActive: 1
---- !u!114 &1657224899
+--- !u!114 &1657224899 stripped
MonoBehaviour:
- m_ObjectHideFlags: 0
- m_PrefabParentObject: {fileID: 0}
- m_PrefabInternal: {fileID: 0}
- m_GameObject: {fileID: 1657224898}
- m_Enabled: 1
- m_EditorHideFlags: 0
+ m_PrefabParentObject: {fileID: 114000011912982844, guid: ac03b2b3b2c07411da18c6ddc7c6e9ec,
+ type: 2}
+ m_PrefabInternal: {fileID: 398868452}
m_Script: {fileID: 11500000, guid: abe25ebf9ddc8416ead6f30d4671fdbf, type: 3}
- m_Name:
- m_EditorClassIdentifier:
- startScene:
---- !u!4 &1657224900
-Transform:
- m_ObjectHideFlags: 0
- m_PrefabParentObject: {fileID: 0}
- m_PrefabInternal: {fileID: 0}
- m_GameObject: {fileID: 1657224898}
- m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
- m_LocalPosition: {x: 763, y: 559, z: 0}
- m_LocalScale: {x: 1, y: 1, z: 1}
- m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
- m_Children: []
- m_Father: {fileID: 0}
- m_RootOrder: 4
--- !u!1 &1675792274
GameObject:
m_ObjectHideFlags: 0