Browse Source

Renamed SaveHelper to GameSaver

master
Christopher 8 years ago
parent
commit
6b16b494e6
  1. 10
      Assets/AssetStoreTools/Editor/AssetStoreTools.dll.meta
  2. 2
      Assets/Fungus/Scripts/Components/GameSaver.cs
  3. 0
      Assets/Fungus/Scripts/Components/GameSaver.cs.meta
  4. 15
      Assets/Fungus/Scripts/SavePoints/SavePointData.cs
  5. 56
      Assets/FungusExamples/SaveGame/GameSaver.prefab
  6. 8
      Assets/FungusExamples/SaveGame/GameSaver.prefab.meta
  7. 3
      Assets/FungusExamples/SaveGame/Menu.unity
  8. 90
      Assets/FungusExamples/SaveGame/SceneA.unity

10
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:

2
Assets/Fungus/Scripts/Components/SaveHelper.cs → 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 = "";

0
Assets/Fungus/Scripts/Components/SaveHelper.cs.meta → Assets/Fungus/Scripts/Components/GameSaver.cs.meta

15
Assets/Fungus/Scripts/SavePoints/SavePointData.cs

@ -7,6 +7,12 @@ namespace Fungus
[System.Serializable]
public class SavePointData
{
/// <summary>
/// Version number of current save data format.
/// </summary>
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<SaveHelper>();
if (saveHelper == null)
var gameSaver = GameObject.FindObjectOfType<GameSaver>();
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);
}

56
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}

8
Assets/FungusExamples/SaveGame/GameSaver.prefab.meta

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: ac03b2b3b2c07411da18c6ddc7c6e9ec
timeCreated: 1479485548
licenseType: Free
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

3
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

90
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

Loading…
Cancel
Save