From fe62bb8f9511fa55f6cd68ee45b7aed203d0b511 Mon Sep 17 00:00:00 2001 From: Christopher Date: Mon, 7 Nov 2016 16:08:12 +0000 Subject: [PATCH 01/53] Initial stab at saving flowchart variables. --- Assets/Fungus/Scripts/Commands/SavePoint.cs | 144 +++++ .../Fungus/Scripts/Commands/SavePoint.cs.meta | 12 + Assets/Tests/Save.meta | 9 + Assets/Tests/Save/SaveTests.unity | 498 ++++++++++++++++++ Assets/Tests/Save/SaveTests.unity.meta | 8 + 5 files changed, 671 insertions(+) create mode 100644 Assets/Fungus/Scripts/Commands/SavePoint.cs create mode 100644 Assets/Fungus/Scripts/Commands/SavePoint.cs.meta create mode 100644 Assets/Tests/Save.meta create mode 100644 Assets/Tests/Save/SaveTests.unity create mode 100644 Assets/Tests/Save/SaveTests.unity.meta diff --git a/Assets/Fungus/Scripts/Commands/SavePoint.cs b/Assets/Fungus/Scripts/Commands/SavePoint.cs new file mode 100644 index 00000000..50aab32e --- /dev/null +++ b/Assets/Fungus/Scripts/Commands/SavePoint.cs @@ -0,0 +1,144 @@ +// This code is part of the Fungus library (http://fungusgames.com) maintained by Chris Gregan (http://twitter.com/gofungus). +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; +using System.Collections.Generic; +using UnityEngine.SceneManagement; + +namespace Fungus +{ + [System.Serializable] + public class StringVar + { + public string key; + public string value; + } + + [System.Serializable] + public class IntVar + { + public string key; + public int value; + } + + [System.Serializable] + public class FloatVar + { + public string key; + public float value; + } + + [System.Serializable] + public class BoolVar + { + public string key; + public bool value; + } + + [System.Serializable] + public class SaveData + { + public string sceneName; + public string flowchartName; + public string blockName; + + public List stringVars = new List(); + public List intVars = new List(); + public List floatVars = new List(); + public List boolVars = new List(); + } + + [CommandInfo("Variable", + "Save Point", + "Saves current Flowchart state.")] + public class SavePoint : Command + { + [SerializeField] protected string restoreBlock; + + // Move serialization stuff into a seperate class + // Make serialize data extensible (subclassing?) + // Save key, use save profile and variable substitution + // Store scene name, flowchart name and block name to execute after load + // Show link to Block to be executed + + protected string CreateSaveData() + { + var saveData = new SaveData(); + + var flowchart = GetFlowchart(); + + // Store the + saveData.sceneName = SceneManager.GetActiveScene().name; + saveData.flowchartName = flowchart.name; + saveData.blockName = ParentBlock.BlockName; + + for (int i = 0; i < flowchart.Variables.Count; i++) + { + var v = flowchart.Variables[i]; + + // Save string + var stringVariable = v as StringVariable; + if (stringVariable != null) + { + var d = new StringVar(); + d.key = stringVariable.Key; + d.value = stringVariable.Value; + saveData.stringVars.Add(d); + } + + // Save int + var intVariable = v as IntegerVariable; + if (intVariable != null) + { + var d = new IntVar(); + d.key = intVariable.Key; + d.value = intVariable.Value; + saveData.intVars.Add(d); + } + + // Save float + var floatVariable = v as FloatVariable; + if (floatVariable != null) + { + var d = new FloatVar(); + d.key = floatVariable.Key; + d.value = floatVariable.Value; + saveData.floatVars.Add(d); + } + + // Save bool + var boolVariable = v as BooleanVariable; + if (boolVariable != null) + { + var d = new BoolVar(); + d.key = boolVariable.Key; + d.value = boolVariable.Value; + saveData.boolVars.Add(d); + } + } + + return JsonUtility.ToJson(saveData, true); + } + + #region Public members + + public override void OnEnter() + { + var saveJSON = CreateSaveData(); + + Debug.Log(saveJSON); + } + + public override string GetSummary() + { + return ""; + } + + public override Color GetButtonColor() + { + return new Color32(235, 191, 217, 255); + } + + #endregion + } +} \ No newline at end of file diff --git a/Assets/Fungus/Scripts/Commands/SavePoint.cs.meta b/Assets/Fungus/Scripts/Commands/SavePoint.cs.meta new file mode 100644 index 00000000..2178e092 --- /dev/null +++ b/Assets/Fungus/Scripts/Commands/SavePoint.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 0b115619cb83b4d6ab8047d0e9407403 +timeCreated: 1478530280 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Tests/Save.meta b/Assets/Tests/Save.meta new file mode 100644 index 00000000..de8c4546 --- /dev/null +++ b/Assets/Tests/Save.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 484192c8870014bf888a41f09c360348 +folderAsset: yes +timeCreated: 1478534797 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Tests/Save/SaveTests.unity b/Assets/Tests/Save/SaveTests.unity new file mode 100644 index 00000000..d63f70ec --- /dev/null +++ b/Assets/Tests/Save/SaveTests.unity @@ -0,0 +1,498 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +SceneSettings: + m_ObjectHideFlags: 0 + m_PVSData: + m_PVSObjectsArray: [] + m_PVSPortalsArray: [] + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 7 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 3 + m_SkyboxMaterial: {fileID: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1} +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 7 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_TemporalCoherenceThreshold: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 0 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 4 + m_Resolution: 2 + m_BakeResolution: 40 + m_TextureWidth: 1024 + m_TextureHeight: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_DirectLightInLightProbes: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_LightingDataAsset: {fileID: 0} + m_RuntimeCPUUsage: 25 +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + accuratePlacement: 0 + minRegionArea: 2 + cellSize: 0.16666667 + manualCellSize: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &596180617 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 4: {fileID: 596180621} + - 114: {fileID: 596180620} + - 114: {fileID: 596180619} + - 114: {fileID: 596180618} + m_Layer: 0 + m_Name: EventSystem + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &596180618 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 596180617} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1997211142, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_ForceModuleActive: 0 +--- !u!114 &596180619 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 596180617} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1077351063, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_HorizontalAxis: Horizontal + m_VerticalAxis: Vertical + m_SubmitButton: Submit + m_CancelButton: Cancel + m_InputActionsPerSecond: 10 + m_RepeatDelay: 0.5 + m_ForceModuleActive: 0 +--- !u!114 &596180620 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 596180617} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -619905303, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_FirstSelected: {fileID: 0} + m_sendNavigationEvents: 1 + m_DragThreshold: 5 +--- !u!4 &596180621 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 596180617} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, 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: 3 +--- !u!1 &668327051 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 4: {fileID: 668327056} + - 20: {fileID: 668327055} + - 92: {fileID: 668327054} + - 124: {fileID: 668327053} + - 81: {fileID: 668327052} + m_Layer: 0 + m_Name: Main Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!81 &668327052 +AudioListener: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 668327051} + m_Enabled: 1 +--- !u!124 &668327053 +Behaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 668327051} + m_Enabled: 1 +--- !u!92 &668327054 +Behaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 668327051} + m_Enabled: 1 +--- !u!20 &668327055 +Camera: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 668327051} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 1 + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 1000 + field of view: 60 + orthographic: 1 + orthographic size: 5 + m_Depth: -1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 + m_StereoMirrorMode: 0 +--- !u!4 &668327056 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 668327051} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -10} + 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!1 &1584700493 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 4: {fileID: 1584700495} + - 114: {fileID: 1584700494} + m_Layer: 0 + m_Name: _FungusState + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1584700494 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1584700493} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 61dddfdc5e0e44ca298d8f46f7f5a915, type: 3} + m_Name: + m_EditorClassIdentifier: + selectedFlowchart: {fileID: 1728985435} +--- !u!4 &1584700495 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1584700493} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, 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: 1 +--- !u!1 &1728985428 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 142980, guid: 5e7fbc8d4eb714b279eeeef2262c1e1a, type: 2} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 4: {fileID: 1728985436} + - 114: {fileID: 1728985435} + - 114: {fileID: 1728985434} + - 114: {fileID: 1728985433} + - 114: {fileID: 1728985432} + - 114: {fileID: 1728985431} + - 114: {fileID: 1728985430} + - 114: {fileID: 1728985429} + - 114: {fileID: 1728985437} + - 114: {fileID: 1728985438} + m_Layer: 0 + m_Name: Flowchart + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1728985429 +MonoBehaviour: + m_ObjectHideFlags: 2 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1728985428} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5d02d9822eec54c98afe95bb497211b3, type: 3} + m_Name: + m_EditorClassIdentifier: + scope: 0 + key: BoolVar + value: 1 +--- !u!114 &1728985430 +MonoBehaviour: + m_ObjectHideFlags: 2 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1728985428} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: afb91b566ceda411bad1e9d3c3243ecc, type: 3} + m_Name: + m_EditorClassIdentifier: + scope: 0 + key: IntVar + value: 2 +--- !u!114 &1728985431 +MonoBehaviour: + m_ObjectHideFlags: 2 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1728985428} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 705fa1ac97df74e3a84ff952ffd923f1, type: 3} + m_Name: + m_EditorClassIdentifier: + scope: 0 + key: FloatVar + value: 1 +--- !u!114 &1728985432 +MonoBehaviour: + m_ObjectHideFlags: 2 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1728985428} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4580f28dd8581476b810b38eea2f1316, type: 3} + m_Name: + m_EditorClassIdentifier: + scope: 0 + key: StringVar + value: One +--- !u!114 &1728985433 +MonoBehaviour: + m_ObjectHideFlags: 2 + m_PrefabParentObject: {fileID: 11462346, guid: 5e7fbc8d4eb714b279eeeef2262c1e1a, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1728985428} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d2f6487d21a03404cb21b245f0242e79, type: 3} + m_Name: + m_EditorClassIdentifier: + parentBlock: {fileID: 1728985434} + waitForFrames: 1 +--- !u!114 &1728985434 +MonoBehaviour: + m_ObjectHideFlags: 2 + m_PrefabParentObject: {fileID: 11433304, guid: 5e7fbc8d4eb714b279eeeef2262c1e1a, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1728985428} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3d3d73aef2cfc4f51abf34ac00241f60, type: 3} + m_Name: + m_EditorClassIdentifier: + nodeRect: + serializedVersion: 2 + x: 68 + y: 70 + width: 120 + height: 40 + tint: {r: 1, g: 1, b: 1, a: 1} + useCustomTint: 0 + itemId: 0 + blockName: New Block + description: + eventHandler: {fileID: 1728985433} + commandList: + - {fileID: 1728985437} +--- !u!114 &1728985435 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 11430050, guid: 5e7fbc8d4eb714b279eeeef2262c1e1a, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1728985428} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7a334fe2ffb574b3583ff3b18b4792d3, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 1 + scrollPos: {x: 1.6562496, y: 1.0743227} + variablesScrollPos: {x: 0, y: 0} + variablesExpanded: 1 + blockViewHeight: 400 + zoom: 0.98893297 + scrollViewRect: + serializedVersion: 2 + x: -343 + y: -340 + width: 1114 + height: 859 + selectedBlocks: [] + selectedCommands: [] + variables: + - {fileID: 1728985432} + - {fileID: 1728985431} + - {fileID: 1728985430} + - {fileID: 1728985429} + - {fileID: 1728985438} + description: + stepPause: 0 + colorCommands: 1 + hideComponents: 1 + saveSelection: 1 + localizationId: + showLineNumbers: 0 + hideCommands: [] + luaEnvironment: {fileID: 0} + luaBindingName: flowchart +--- !u!4 &1728985436 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 467082, guid: 5e7fbc8d4eb714b279eeeef2262c1e1a, type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1728985428} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, 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: 2 +--- !u!114 &1728985437 +MonoBehaviour: + m_ObjectHideFlags: 2 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1728985428} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0b115619cb83b4d6ab8047d0e9407403, type: 3} + m_Name: + m_EditorClassIdentifier: + itemId: 1 + indentLevel: 0 + restoreBlock: +--- !u!114 &1728985438 +MonoBehaviour: + m_ObjectHideFlags: 2 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1728985428} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4580f28dd8581476b810b38eea2f1316, type: 3} + m_Name: + m_EditorClassIdentifier: + scope: 0 + key: StringVar2 + value: Two diff --git a/Assets/Tests/Save/SaveTests.unity.meta b/Assets/Tests/Save/SaveTests.unity.meta new file mode 100644 index 00000000..30ec1ee6 --- /dev/null +++ b/Assets/Tests/Save/SaveTests.unity.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 809957b90ee744f3dbfaeafc4e8d8525 +timeCreated: 1478534797 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: From b9da6f145ef47e5ae3ae1bfe0807a4eb1c9ffd54 Mon Sep 17 00:00:00 2001 From: Christopher Date: Wed, 9 Nov 2016 13:34:50 +0000 Subject: [PATCH 02/53] Added SavePointData class --- Assets/Fungus/Scripts/Commands/SavePoint.cs | 43 +----------------- Assets/Fungus/Scripts/Utils/SavePointData.cs | 45 +++++++++++++++++++ .../Scripts/Utils/SavePointData.cs.meta | 12 +++++ 3 files changed, 58 insertions(+), 42 deletions(-) create mode 100644 Assets/Fungus/Scripts/Utils/SavePointData.cs create mode 100644 Assets/Fungus/Scripts/Utils/SavePointData.cs.meta diff --git a/Assets/Fungus/Scripts/Commands/SavePoint.cs b/Assets/Fungus/Scripts/Commands/SavePoint.cs index 50aab32e..f301e463 100644 --- a/Assets/Fungus/Scripts/Commands/SavePoint.cs +++ b/Assets/Fungus/Scripts/Commands/SavePoint.cs @@ -7,47 +7,6 @@ using UnityEngine.SceneManagement; namespace Fungus { - [System.Serializable] - public class StringVar - { - public string key; - public string value; - } - - [System.Serializable] - public class IntVar - { - public string key; - public int value; - } - - [System.Serializable] - public class FloatVar - { - public string key; - public float value; - } - - [System.Serializable] - public class BoolVar - { - public string key; - public bool value; - } - - [System.Serializable] - public class SaveData - { - public string sceneName; - public string flowchartName; - public string blockName; - - public List stringVars = new List(); - public List intVars = new List(); - public List floatVars = new List(); - public List boolVars = new List(); - } - [CommandInfo("Variable", "Save Point", "Saves current Flowchart state.")] @@ -63,7 +22,7 @@ namespace Fungus protected string CreateSaveData() { - var saveData = new SaveData(); + var saveData = new SavePointData(); var flowchart = GetFlowchart(); diff --git a/Assets/Fungus/Scripts/Utils/SavePointData.cs b/Assets/Fungus/Scripts/Utils/SavePointData.cs new file mode 100644 index 00000000..a9a2a1db --- /dev/null +++ b/Assets/Fungus/Scripts/Utils/SavePointData.cs @@ -0,0 +1,45 @@ +using System.Collections.Generic; + +namespace Fungus +{ + [System.Serializable] + public class StringVar + { + public string key; + public string value; + } + + [System.Serializable] + public class IntVar + { + public string key; + public int value; + } + + [System.Serializable] + public class FloatVar + { + public string key; + public float value; + } + + [System.Serializable] + public class BoolVar + { + public string key; + public bool value; + } + + [System.Serializable] + public class SavePointData + { + public string sceneName; + public string flowchartName; + public string blockName; + + public List stringVars = new List(); + public List intVars = new List(); + public List floatVars = new List(); + public List boolVars = new List(); + } +} \ No newline at end of file diff --git a/Assets/Fungus/Scripts/Utils/SavePointData.cs.meta b/Assets/Fungus/Scripts/Utils/SavePointData.cs.meta new file mode 100644 index 00000000..1515f351 --- /dev/null +++ b/Assets/Fungus/Scripts/Utils/SavePointData.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: d19fe746c09ac44e2bf310e6a1350b8c +timeCreated: 1478698399 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: From 6c324c5a811ce36d3da6cfb123f12ab7f00dd0bb Mon Sep 17 00:00:00 2001 From: Christopher Date: Wed, 9 Nov 2016 16:08:57 +0000 Subject: [PATCH 03/53] Save and Load flowchart state now working --- .../Fungus/Scripts/Commands/DeleteSaveKey.cs | 2 +- .../Fungus/Scripts/Commands/LoadFlowchart.cs | 89 +++ .../Scripts/Commands/LoadFlowchart.cs.meta | 12 + .../Fungus/Scripts/Commands/LoadVariable.cs | 2 +- .../Fungus/Scripts/Commands/SaveFlowchart.cs | 87 +++ ...avePoint.cs.meta => SaveFlowchart.cs.meta} | 0 Assets/Fungus/Scripts/Commands/SavePoint.cs | 103 ---- .../Fungus/Scripts/Commands/SaveVariable.cs | 2 +- .../Fungus/Scripts/Commands/SetSaveProfile.cs | 10 +- Assets/Fungus/Scripts/Editor/MenuEditor.cs | 6 +- .../Scripts/Editor/SaveFlowchartEditor.cs | 44 ++ .../Editor/SaveFlowchartEditor.cs.meta | 12 + Assets/Fungus/Scripts/Utils/SavePointData.cs | 99 +++- .../{SaveTests.unity => LoadFlowchart.unity} | 75 +-- Assets/Tests/Save/LoadFlowchart.unity.meta | 8 + Assets/Tests/Save/SaveFlowchart.unity | 554 ++++++++++++++++++ ...ts.unity.meta => SaveFlowchart.unity.meta} | 0 17 files changed, 955 insertions(+), 150 deletions(-) create mode 100644 Assets/Fungus/Scripts/Commands/LoadFlowchart.cs create mode 100644 Assets/Fungus/Scripts/Commands/LoadFlowchart.cs.meta create mode 100644 Assets/Fungus/Scripts/Commands/SaveFlowchart.cs rename Assets/Fungus/Scripts/Commands/{SavePoint.cs.meta => SaveFlowchart.cs.meta} (100%) delete mode 100644 Assets/Fungus/Scripts/Commands/SavePoint.cs create mode 100644 Assets/Fungus/Scripts/Editor/SaveFlowchartEditor.cs create mode 100644 Assets/Fungus/Scripts/Editor/SaveFlowchartEditor.cs.meta rename Assets/Tests/Save/{SaveTests.unity => LoadFlowchart.unity} (95%) create mode 100644 Assets/Tests/Save/LoadFlowchart.unity.meta create mode 100644 Assets/Tests/Save/SaveFlowchart.unity rename Assets/Tests/Save/{SaveTests.unity.meta => SaveFlowchart.unity.meta} (100%) diff --git a/Assets/Fungus/Scripts/Commands/DeleteSaveKey.cs b/Assets/Fungus/Scripts/Commands/DeleteSaveKey.cs index 28626113..6b7559ac 100644 --- a/Assets/Fungus/Scripts/Commands/DeleteSaveKey.cs +++ b/Assets/Fungus/Scripts/Commands/DeleteSaveKey.cs @@ -30,7 +30,7 @@ namespace Fungus var flowchart = GetFlowchart(); // Prepend the current save profile (if any) - string prefsKey = SetSaveProfile.saveProfile + "_" + flowchart.SubstituteVariables(key); + string prefsKey = SetSaveProfile.SaveProfile + "_" + flowchart.SubstituteVariables(key); PlayerPrefs.DeleteKey(prefsKey); diff --git a/Assets/Fungus/Scripts/Commands/LoadFlowchart.cs b/Assets/Fungus/Scripts/Commands/LoadFlowchart.cs new file mode 100644 index 00000000..05f066c5 --- /dev/null +++ b/Assets/Fungus/Scripts/Commands/LoadFlowchart.cs @@ -0,0 +1,89 @@ +// This code is part of the Fungus library (http://fungusgames.com) maintained by Chris Gregan (http://twitter.com/gofungus). +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; +using UnityEngine.SceneManagement; +using System.Collections.Generic; + +namespace Fungus +{ + [CommandInfo("Variable", + "Load Flowchart", + "Loads a previously saved Flowchart state. The original scene is loaded and the resume block is executed.")] + public class LoadFlowchart : Command + { + [Tooltip("Key for loading the saves data from PlayerPrefs. Supports variable subsitution {$VarName} and will prepend a profile name set using Set Save Profile command.")] + [SerializeField] protected StringData saveKey = new StringData("savedata"); + + protected SavePointData tempSaveData; + + protected virtual string CreateSaveKey() + { + var flowchart = GetFlowchart(); + var saveProfile = SetSaveProfile.SaveProfile; + + if (saveProfile.Length > 0) + { + return string.Format(saveProfile + "_" + flowchart.SubstituteVariables(saveKey.Value)); + } + else + { + return string.Format(flowchart.SubstituteVariables(saveKey.Value)); + } + } + + protected virtual string LoadJSONData(string key) + { + return PlayerPrefs.GetString(key); + } + + protected virtual void LoadSavedState(string jsonData) + { + tempSaveData = JsonUtility.FromJson(jsonData); + + SceneManager.sceneLoaded += OnSceneLoaded; + + // Load scene and wait + SceneManager.LoadScene(tempSaveData.sceneName); + } + + protected virtual void OnSceneLoaded(Scene scene, LoadSceneMode mode) + { + if (scene.name == tempSaveData.sceneName) + { + SavePointData.ResumeSavedState(tempSaveData); + } + + SceneManager.sceneLoaded -= OnSceneLoaded; + } + + #region Public members + + public override void OnEnter() + { + var key = CreateSaveKey(); + var jsonData = LoadJSONData(key); + + if (jsonData == "") + { + // Save data not found, continue executing block + Continue(); + return; + } + + LoadSavedState(jsonData); + } + + public override string GetSummary() + { + return saveKey.Value; + } + + public override Color GetButtonColor() + { + return new Color32(235, 191, 217, 255); + } + + #endregion + } +} \ No newline at end of file diff --git a/Assets/Fungus/Scripts/Commands/LoadFlowchart.cs.meta b/Assets/Fungus/Scripts/Commands/LoadFlowchart.cs.meta new file mode 100644 index 00000000..65916a89 --- /dev/null +++ b/Assets/Fungus/Scripts/Commands/LoadFlowchart.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 4bd5b7f5cc3944217aa05a6fa8552baf +timeCreated: 1478530280 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Fungus/Scripts/Commands/LoadVariable.cs b/Assets/Fungus/Scripts/Commands/LoadVariable.cs index 7c60e4d1..ecea1bab 100644 --- a/Assets/Fungus/Scripts/Commands/LoadVariable.cs +++ b/Assets/Fungus/Scripts/Commands/LoadVariable.cs @@ -38,7 +38,7 @@ namespace Fungus var flowchart = GetFlowchart(); // Prepend the current save profile (if any) - string prefsKey = SetSaveProfile.saveProfile + "_" + flowchart.SubstituteVariables(key); + string prefsKey = SetSaveProfile.SaveProfile + "_" + flowchart.SubstituteVariables(key); System.Type variableType = variable.GetType(); diff --git a/Assets/Fungus/Scripts/Commands/SaveFlowchart.cs b/Assets/Fungus/Scripts/Commands/SaveFlowchart.cs new file mode 100644 index 00000000..0c2be53f --- /dev/null +++ b/Assets/Fungus/Scripts/Commands/SaveFlowchart.cs @@ -0,0 +1,87 @@ +// This code is part of the Fungus library (http://fungusgames.com) maintained by Chris Gregan (http://twitter.com/gofungus). +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; +using UnityEngine.SceneManagement; +using System.Collections.Generic; + +namespace Fungus +{ + [CommandInfo("Variable", + "Save Flowchart", + "Saves the current Flowchart variable state to be loaded again in future.")] + public class SaveFlowchart : Command + { + [Tooltip("Key for storing save data in PlayerPrefs. Supports variable subsitution {$VarName} and will prepend a profile name set using Set Save Profile command.")] + [SerializeField] protected StringData saveKey = new StringData("savedata"); + + [SerializeField] protected Block resumeBlock; + + // Make serialize data extensible (subclassing?) + // Save key, use save profile and variable substitution + // Store scene name, flowchart name and block name to execute after load + // Show link to Block to be executed + + protected virtual string CreateSaveKey() + { + var flowchart = GetFlowchart(); + var saveProfile = SetSaveProfile.SaveProfile; + + if (saveProfile.Length > 0) + { + return string.Format(saveProfile + "_" + flowchart.SubstituteVariables(saveKey.Value)); + } + else + { + return string.Format(flowchart.SubstituteVariables(saveKey.Value)); + } + } + + protected virtual SavePointData CreateSaveData() + { + return SavePointData.Create(GetFlowchart(), resumeBlock.BlockName); + } + + protected virtual void StoreJSONData(string key, string jsonData) + { + if (key.Length > 0) + { + PlayerPrefs.SetString(key, jsonData); + } + } + + #region Public members + + public override void OnEnter() + { + var key = CreateSaveKey(); + + var saveData = CreateSaveData(); + var saveDataJSON = JsonUtility.ToJson(saveData, true); + + StoreJSONData(key, saveDataJSON); + + Continue(); + } + + public override string GetSummary() + { + return saveKey.Value; + } + + public override Color GetButtonColor() + { + return new Color32(235, 191, 217, 255); + } + + public override void GetConnectedBlocks(ref List connectedBlocks) + { + if (resumeBlock != null) + { + connectedBlocks.Add(resumeBlock); + } + } + + #endregion + } +} \ No newline at end of file diff --git a/Assets/Fungus/Scripts/Commands/SavePoint.cs.meta b/Assets/Fungus/Scripts/Commands/SaveFlowchart.cs.meta similarity index 100% rename from Assets/Fungus/Scripts/Commands/SavePoint.cs.meta rename to Assets/Fungus/Scripts/Commands/SaveFlowchart.cs.meta diff --git a/Assets/Fungus/Scripts/Commands/SavePoint.cs b/Assets/Fungus/Scripts/Commands/SavePoint.cs deleted file mode 100644 index f301e463..00000000 --- a/Assets/Fungus/Scripts/Commands/SavePoint.cs +++ /dev/null @@ -1,103 +0,0 @@ -// This code is part of the Fungus library (http://fungusgames.com) maintained by Chris Gregan (http://twitter.com/gofungus). -// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) - -using UnityEngine; -using System.Collections.Generic; -using UnityEngine.SceneManagement; - -namespace Fungus -{ - [CommandInfo("Variable", - "Save Point", - "Saves current Flowchart state.")] - public class SavePoint : Command - { - [SerializeField] protected string restoreBlock; - - // Move serialization stuff into a seperate class - // Make serialize data extensible (subclassing?) - // Save key, use save profile and variable substitution - // Store scene name, flowchart name and block name to execute after load - // Show link to Block to be executed - - protected string CreateSaveData() - { - var saveData = new SavePointData(); - - var flowchart = GetFlowchart(); - - // Store the - saveData.sceneName = SceneManager.GetActiveScene().name; - saveData.flowchartName = flowchart.name; - saveData.blockName = ParentBlock.BlockName; - - for (int i = 0; i < flowchart.Variables.Count; i++) - { - var v = flowchart.Variables[i]; - - // Save string - var stringVariable = v as StringVariable; - if (stringVariable != null) - { - var d = new StringVar(); - d.key = stringVariable.Key; - d.value = stringVariable.Value; - saveData.stringVars.Add(d); - } - - // Save int - var intVariable = v as IntegerVariable; - if (intVariable != null) - { - var d = new IntVar(); - d.key = intVariable.Key; - d.value = intVariable.Value; - saveData.intVars.Add(d); - } - - // Save float - var floatVariable = v as FloatVariable; - if (floatVariable != null) - { - var d = new FloatVar(); - d.key = floatVariable.Key; - d.value = floatVariable.Value; - saveData.floatVars.Add(d); - } - - // Save bool - var boolVariable = v as BooleanVariable; - if (boolVariable != null) - { - var d = new BoolVar(); - d.key = boolVariable.Key; - d.value = boolVariable.Value; - saveData.boolVars.Add(d); - } - } - - return JsonUtility.ToJson(saveData, true); - } - - #region Public members - - public override void OnEnter() - { - var saveJSON = CreateSaveData(); - - Debug.Log(saveJSON); - } - - public override string GetSummary() - { - return ""; - } - - public override Color GetButtonColor() - { - return new Color32(235, 191, 217, 255); - } - - #endregion - } -} \ No newline at end of file diff --git a/Assets/Fungus/Scripts/Commands/SaveVariable.cs b/Assets/Fungus/Scripts/Commands/SaveVariable.cs index bbdc5a1f..43933880 100644 --- a/Assets/Fungus/Scripts/Commands/SaveVariable.cs +++ b/Assets/Fungus/Scripts/Commands/SaveVariable.cs @@ -42,7 +42,7 @@ namespace Fungus var flowchart = GetFlowchart(); // Prepend the current save profile (if any) - string prefsKey = SetSaveProfile.saveProfile + "_" + flowchart.SubstituteVariables(key); + string prefsKey = SetSaveProfile.SaveProfile + "_" + flowchart.SubstituteVariables(key); System.Type variableType = variable.GetType(); diff --git a/Assets/Fungus/Scripts/Commands/SetSaveProfile.cs b/Assets/Fungus/Scripts/Commands/SetSaveProfile.cs index bd6c5d60..2fa8f357 100644 --- a/Assets/Fungus/Scripts/Commands/SetSaveProfile.cs +++ b/Assets/Fungus/Scripts/Commands/SetSaveProfile.cs @@ -19,12 +19,14 @@ namespace Fungus [Tooltip("Name of save profile to make active.")] [SerializeField] protected string saveProfileName = ""; + /// + /// Shared save profile name used by SaveVariable and LoadVariable. + /// + private static string saveProfile = ""; + #region Public members - /// - /// Shared save profile name used by SaveVariable and LoadVariable. - /// - public static string saveProfile = ""; + public static String SaveProfile { get { return saveProfile; } } public override void OnEnter() { diff --git a/Assets/Fungus/Scripts/Editor/MenuEditor.cs b/Assets/Fungus/Scripts/Editor/MenuEditor.cs index 0ca3568e..c25ff420 100644 --- a/Assets/Fungus/Scripts/Editor/MenuEditor.cs +++ b/Assets/Fungus/Scripts/Editor/MenuEditor.cs @@ -44,9 +44,9 @@ namespace Fungus.EditorUtils EditorGUILayout.PropertyField(descriptionProp); BlockEditor.BlockField(targetBlockProp, - new GUIContent("Target Block", "Block to call when option is selected"), - new GUIContent(""), - flowchart); + new GUIContent("Target Block", "Block to call when option is selected"), + new GUIContent(""), + flowchart); EditorGUILayout.PropertyField(hideIfVisitedProp); EditorGUILayout.PropertyField(interactableProp); diff --git a/Assets/Fungus/Scripts/Editor/SaveFlowchartEditor.cs b/Assets/Fungus/Scripts/Editor/SaveFlowchartEditor.cs new file mode 100644 index 00000000..125a8a90 --- /dev/null +++ b/Assets/Fungus/Scripts/Editor/SaveFlowchartEditor.cs @@ -0,0 +1,44 @@ +// This code is part of the Fungus library (http://fungusgames.com) maintained by Chris Gregan (http://twitter.com/gofungus). +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEditor; +using UnityEngine; +using Fungus; + +namespace Fungus.EditorUtils +{ + [CustomEditor(typeof(SaveFlowchart))] + public class SaveFlowchartEditor : CommandEditor + { + protected SerializedProperty saveKeyProp; + protected SerializedProperty resumeBlockProp; + + protected virtual void OnEnable() + { + if (NullTargetCheck()) // Check for an orphaned editor instance + return; + + saveKeyProp = serializedObject.FindProperty("saveKey"); + resumeBlockProp = serializedObject.FindProperty("resumeBlock"); + } + + public override void DrawCommandGUI() + { + var flowchart = FlowchartWindow.GetFlowchart(); + if (flowchart == null) + { + return; + } + + serializedObject.Update(); + + EditorGUILayout.PropertyField(saveKeyProp); + BlockEditor.BlockField(resumeBlockProp, + new GUIContent("Resume Block", "Block to call when save data is loaded again"), + new GUIContent(""), + flowchart); + + serializedObject.ApplyModifiedProperties(); + } + } +} diff --git a/Assets/Fungus/Scripts/Editor/SaveFlowchartEditor.cs.meta b/Assets/Fungus/Scripts/Editor/SaveFlowchartEditor.cs.meta new file mode 100644 index 00000000..f93633d0 --- /dev/null +++ b/Assets/Fungus/Scripts/Editor/SaveFlowchartEditor.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 84d5f60f59d254712915dd59d345e0c6 +timeCreated: 1478701789 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Fungus/Scripts/Utils/SavePointData.cs b/Assets/Fungus/Scripts/Utils/SavePointData.cs index a9a2a1db..0540c5ed 100644 --- a/Assets/Fungus/Scripts/Utils/SavePointData.cs +++ b/Assets/Fungus/Scripts/Utils/SavePointData.cs @@ -1,4 +1,6 @@ using System.Collections.Generic; +using UnityEngine; +using UnityEngine.SceneManagement; namespace Fungus { @@ -35,11 +37,106 @@ namespace Fungus { public string sceneName; public string flowchartName; - public string blockName; + public string resumeBlockName; public List stringVars = new List(); public List intVars = new List(); public List floatVars = new List(); public List boolVars = new List(); + + public static SavePointData Create(Flowchart flowchart, string resumeBlockName) + { + var saveData = new SavePointData(); + + // Store the scene, flowchart and block to execute on resume + saveData.sceneName = SceneManager.GetActiveScene().name; + saveData.flowchartName = flowchart.name; + saveData.resumeBlockName = resumeBlockName; + + for (int i = 0; i < flowchart.Variables.Count; i++) + { + var v = flowchart.Variables[i]; + + // Save string + var stringVariable = v as StringVariable; + if (stringVariable != null) + { + var d = new StringVar(); + d.key = stringVariable.Key; + d.value = stringVariable.Value; + saveData.stringVars.Add(d); + } + + // Save int + var intVariable = v as IntegerVariable; + if (intVariable != null) + { + var d = new IntVar(); + d.key = intVariable.Key; + d.value = intVariable.Value; + saveData.intVars.Add(d); + } + + // Save float + var floatVariable = v as FloatVariable; + if (floatVariable != null) + { + var d = new FloatVar(); + d.key = floatVariable.Key; + d.value = floatVariable.Value; + saveData.floatVars.Add(d); + } + + // Save bool + var boolVariable = v as BooleanVariable; + if (boolVariable != null) + { + var d = new BoolVar(); + d.key = boolVariable.Key; + d.value = boolVariable.Value; + saveData.boolVars.Add(d); + } + } + + return saveData; + } + + public static void ResumeSavedState(SavePointData saveData) + { + var go = GameObject.Find(saveData.flowchartName); + if (go == null) + { + return; + } + + var flowchart = go.GetComponent(); + if (flowchart == null) + { + return; + } + + for (int i = 0; i < saveData.boolVars.Count; i++) + { + var boolVar = saveData.boolVars[i]; + flowchart.SetBooleanVariable(boolVar.key, boolVar.value); + } + for (int i = 0; i < saveData.intVars.Count; i++) + { + var intVar = saveData.intVars[i]; + flowchart.SetIntegerVariable(intVar.key, intVar.value); + } + for (int i = 0; i < saveData.floatVars.Count; i++) + { + var floatVar = saveData.floatVars[i]; + flowchart.SetFloatVariable(floatVar.key, floatVar.value); + } + for (int i = 0; i < saveData.stringVars.Count; i++) + { + var stringVar = saveData.stringVars[i]; + flowchart.SetStringVariable(stringVar.key, stringVar.value); + } + + flowchart.ExecuteBlock(saveData.resumeBlockName); + } } } \ No newline at end of file diff --git a/Assets/Tests/Save/SaveTests.unity b/Assets/Tests/Save/LoadFlowchart.unity similarity index 95% rename from Assets/Tests/Save/SaveTests.unity rename to Assets/Tests/Save/LoadFlowchart.unity index d63f70ec..b951cc88 100644 --- a/Assets/Tests/Save/SaveTests.unity +++ b/Assets/Tests/Save/LoadFlowchart.unity @@ -302,14 +302,14 @@ GameObject: m_Component: - 4: {fileID: 1728985436} - 114: {fileID: 1728985435} - - 114: {fileID: 1728985434} - - 114: {fileID: 1728985433} - 114: {fileID: 1728985432} - 114: {fileID: 1728985431} - 114: {fileID: 1728985430} - 114: {fileID: 1728985429} - - 114: {fileID: 1728985437} - 114: {fileID: 1728985438} + - 114: {fileID: 1728985437} + - 114: {fileID: 1728985433} + - 114: {fileID: 1728985434} m_Layer: 0 m_Name: Flowchart m_TagString: Untagged @@ -376,43 +376,33 @@ MonoBehaviour: --- !u!114 &1728985433 MonoBehaviour: m_ObjectHideFlags: 2 - m_PrefabParentObject: {fileID: 11462346, guid: 5e7fbc8d4eb714b279eeeef2262c1e1a, - type: 2} + m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1728985428} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: d2f6487d21a03404cb21b245f0242e79, type: 3} + m_Script: {fileID: 11500000, guid: 000864f8e9e1748a39807861d0e60e29, type: 3} m_Name: m_EditorClassIdentifier: - parentBlock: {fileID: 1728985434} - waitForFrames: 1 + parentBlock: {fileID: 1728985437} + keyPressType: 0 + keyCode: 108 --- !u!114 &1728985434 MonoBehaviour: - m_ObjectHideFlags: 2 - m_PrefabParentObject: {fileID: 11433304, guid: 5e7fbc8d4eb714b279eeeef2262c1e1a, - type: 2} + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1728985428} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 3d3d73aef2cfc4f51abf34ac00241f60, type: 3} + m_Script: {fileID: 11500000, guid: 4bd5b7f5cc3944217aa05a6fa8552baf, type: 3} m_Name: m_EditorClassIdentifier: - nodeRect: - serializedVersion: 2 - x: 68 - y: 70 - width: 120 - height: 40 - tint: {r: 1, g: 1, b: 1, a: 1} - useCustomTint: 0 - itemId: 0 - blockName: New Block - description: - eventHandler: {fileID: 1728985433} - commandList: - - {fileID: 1728985437} + itemId: 5 + indentLevel: 0 + saveKey: + stringRef: {fileID: 0} + stringVal: savedata --- !u!114 &1728985435 MonoBehaviour: m_ObjectHideFlags: 0 @@ -433,12 +423,14 @@ MonoBehaviour: zoom: 0.98893297 scrollViewRect: serializedVersion: 2 - x: -343 - y: -340 - width: 1114 - height: 859 - selectedBlocks: [] - selectedCommands: [] + x: -368.287 + y: -369.7274 + width: 1216.2789 + height: 951.2311 + selectedBlocks: + - {fileID: 1728985437} + selectedCommands: + - {fileID: 1728985434} variables: - {fileID: 1728985432} - {fileID: 1728985431} @@ -476,12 +468,23 @@ MonoBehaviour: m_GameObject: {fileID: 1728985428} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 0b115619cb83b4d6ab8047d0e9407403, type: 3} + m_Script: {fileID: 11500000, guid: 3d3d73aef2cfc4f51abf34ac00241f60, type: 3} m_Name: m_EditorClassIdentifier: - itemId: 1 - indentLevel: 0 - restoreBlock: + nodeRect: + serializedVersion: 2 + x: 103.50756 + y: 73.75383 + width: 120 + height: 40 + tint: {r: 1, g: 1, b: 1, a: 1} + useCustomTint: 0 + itemId: 4 + blockName: Load + description: + eventHandler: {fileID: 1728985433} + commandList: + - {fileID: 1728985434} --- !u!114 &1728985438 MonoBehaviour: m_ObjectHideFlags: 2 diff --git a/Assets/Tests/Save/LoadFlowchart.unity.meta b/Assets/Tests/Save/LoadFlowchart.unity.meta new file mode 100644 index 00000000..69623015 --- /dev/null +++ b/Assets/Tests/Save/LoadFlowchart.unity.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 69eade49a291342f7a720011281fa97c +timeCreated: 1478534797 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Tests/Save/SaveFlowchart.unity b/Assets/Tests/Save/SaveFlowchart.unity new file mode 100644 index 00000000..8884fa38 --- /dev/null +++ b/Assets/Tests/Save/SaveFlowchart.unity @@ -0,0 +1,554 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +SceneSettings: + m_ObjectHideFlags: 0 + m_PVSData: + m_PVSObjectsArray: [] + m_PVSPortalsArray: [] + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 7 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 3 + m_SkyboxMaterial: {fileID: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1} +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 7 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_TemporalCoherenceThreshold: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 0 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 4 + m_Resolution: 2 + m_BakeResolution: 40 + m_TextureWidth: 1024 + m_TextureHeight: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_DirectLightInLightProbes: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_LightingDataAsset: {fileID: 0} + m_RuntimeCPUUsage: 25 +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + accuratePlacement: 0 + minRegionArea: 2 + cellSize: 0.16666667 + manualCellSize: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &596180617 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 4: {fileID: 596180621} + - 114: {fileID: 596180620} + - 114: {fileID: 596180619} + - 114: {fileID: 596180618} + m_Layer: 0 + m_Name: EventSystem + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &596180618 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 596180617} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1997211142, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_ForceModuleActive: 0 +--- !u!114 &596180619 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 596180617} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1077351063, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_HorizontalAxis: Horizontal + m_VerticalAxis: Vertical + m_SubmitButton: Submit + m_CancelButton: Cancel + m_InputActionsPerSecond: 10 + m_RepeatDelay: 0.5 + m_ForceModuleActive: 0 +--- !u!114 &596180620 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 596180617} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -619905303, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_FirstSelected: {fileID: 0} + m_sendNavigationEvents: 1 + m_DragThreshold: 5 +--- !u!4 &596180621 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 596180617} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, 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: 3 +--- !u!1 &668327051 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 4: {fileID: 668327056} + - 20: {fileID: 668327055} + - 92: {fileID: 668327054} + - 124: {fileID: 668327053} + - 81: {fileID: 668327052} + m_Layer: 0 + m_Name: Main Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!81 &668327052 +AudioListener: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 668327051} + m_Enabled: 1 +--- !u!124 &668327053 +Behaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 668327051} + m_Enabled: 1 +--- !u!92 &668327054 +Behaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 668327051} + m_Enabled: 1 +--- !u!20 &668327055 +Camera: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 668327051} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 1 + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 1000 + field of view: 60 + orthographic: 1 + orthographic size: 5 + m_Depth: -1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 + m_StereoMirrorMode: 0 +--- !u!4 &668327056 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 668327051} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -10} + 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!1 &1584700493 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 4: {fileID: 1584700495} + - 114: {fileID: 1584700494} + m_Layer: 0 + m_Name: _FungusState + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1584700494 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1584700493} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 61dddfdc5e0e44ca298d8f46f7f5a915, type: 3} + m_Name: + m_EditorClassIdentifier: + selectedFlowchart: {fileID: 1728985435} +--- !u!4 &1584700495 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1584700493} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, 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: 1 +--- !u!1 &1728985428 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 142980, guid: 5e7fbc8d4eb714b279eeeef2262c1e1a, type: 2} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 4: {fileID: 1728985436} + - 114: {fileID: 1728985435} + - 114: {fileID: 1728985434} + - 114: {fileID: 1728985432} + - 114: {fileID: 1728985431} + - 114: {fileID: 1728985430} + - 114: {fileID: 1728985429} + - 114: {fileID: 1728985438} + - 114: {fileID: 1728985439} + - 114: {fileID: 1728985441} + - 114: {fileID: 1728985440} + - 114: {fileID: 1728985437} + m_Layer: 0 + m_Name: Flowchart + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1728985429 +MonoBehaviour: + m_ObjectHideFlags: 2 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1728985428} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5d02d9822eec54c98afe95bb497211b3, type: 3} + m_Name: + m_EditorClassIdentifier: + scope: 0 + key: BoolVar + value: 1 +--- !u!114 &1728985430 +MonoBehaviour: + m_ObjectHideFlags: 2 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1728985428} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: afb91b566ceda411bad1e9d3c3243ecc, type: 3} + m_Name: + m_EditorClassIdentifier: + scope: 0 + key: IntVar + value: 2 +--- !u!114 &1728985431 +MonoBehaviour: + m_ObjectHideFlags: 2 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1728985428} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 705fa1ac97df74e3a84ff952ffd923f1, type: 3} + m_Name: + m_EditorClassIdentifier: + scope: 0 + key: FloatVar + value: 1 +--- !u!114 &1728985432 +MonoBehaviour: + m_ObjectHideFlags: 2 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1728985428} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4580f28dd8581476b810b38eea2f1316, type: 3} + m_Name: + m_EditorClassIdentifier: + scope: 0 + key: StringVar + value: One +--- !u!114 &1728985434 +MonoBehaviour: + m_ObjectHideFlags: 2 + m_PrefabParentObject: {fileID: 11433304, guid: 5e7fbc8d4eb714b279eeeef2262c1e1a, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1728985428} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3d3d73aef2cfc4f51abf34ac00241f60, type: 3} + m_Name: + m_EditorClassIdentifier: + nodeRect: + serializedVersion: 2 + x: 68 + y: 70 + width: 120 + height: 40 + tint: {r: 1, g: 1, b: 1, a: 1} + useCustomTint: 0 + itemId: 0 + blockName: Save + description: + eventHandler: {fileID: 1728985440} + commandList: + - {fileID: 1728985441} +--- !u!114 &1728985435 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 11430050, guid: 5e7fbc8d4eb714b279eeeef2262c1e1a, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1728985428} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7a334fe2ffb574b3583ff3b18b4792d3, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 1 + scrollPos: {x: 1.6562496, y: 1.0743227} + variablesScrollPos: {x: 0, y: 0} + variablesExpanded: 1 + blockViewHeight: 400 + zoom: 0.98893297 + scrollViewRect: + serializedVersion: 2 + x: -351.0967 + y: -353.54834 + width: 1199.0886 + height: 873.3693 + selectedBlocks: + - {fileID: 1728985434} + selectedCommands: [] + variables: + - {fileID: 1728985432} + - {fileID: 1728985431} + - {fileID: 1728985430} + - {fileID: 1728985429} + - {fileID: 1728985438} + description: + stepPause: 0 + colorCommands: 1 + hideComponents: 1 + saveSelection: 1 + localizationId: + showLineNumbers: 0 + hideCommands: [] + luaEnvironment: {fileID: 0} + luaBindingName: flowchart +--- !u!4 &1728985436 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 467082, guid: 5e7fbc8d4eb714b279eeeef2262c1e1a, type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1728985428} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, 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: 2 +--- !u!114 &1728985437 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1728985428} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ec422cd568a9c4a31ad7c36d0572b9da, type: 3} + m_Name: + m_EditorClassIdentifier: + itemId: 4 + indentLevel: 0 + storyText: Resumed ok! + description: + character: {fileID: 0} + portrait: {fileID: 0} + voiceOverClip: {fileID: 0} + showAlways: 1 + showCount: 1 + extendPrevious: 0 + fadeWhenDone: 1 + waitForClick: 1 + stopVoiceover: 1 + setSayDialog: {fileID: 0} +--- !u!114 &1728985438 +MonoBehaviour: + m_ObjectHideFlags: 2 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1728985428} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4580f28dd8581476b810b38eea2f1316, type: 3} + m_Name: + m_EditorClassIdentifier: + scope: 0 + key: StringVar2 + value: Two +--- !u!114 &1728985439 +MonoBehaviour: + m_ObjectHideFlags: 2 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1728985428} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3d3d73aef2cfc4f51abf34ac00241f60, type: 3} + m_Name: + m_EditorClassIdentifier: + nodeRect: + serializedVersion: 2 + x: 266.3094 + y: 70.72026 + width: 120 + height: 40 + tint: {r: 1, g: 1, b: 1, a: 1} + useCustomTint: 0 + itemId: 2 + blockName: Resume + description: + eventHandler: {fileID: 0} + commandList: + - {fileID: 1728985437} +--- !u!114 &1728985440 +MonoBehaviour: + m_ObjectHideFlags: 2 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1728985428} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 000864f8e9e1748a39807861d0e60e29, type: 3} + m_Name: + m_EditorClassIdentifier: + parentBlock: {fileID: 1728985434} + keyPressType: 0 + keyCode: 115 +--- !u!114 &1728985441 +MonoBehaviour: + m_ObjectHideFlags: 2 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1728985428} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0b115619cb83b4d6ab8047d0e9407403, type: 3} + m_Name: + m_EditorClassIdentifier: + itemId: 3 + indentLevel: 0 + saveKey: + stringRef: {fileID: 0} + stringVal: savedata + resumeBlock: {fileID: 1728985439} diff --git a/Assets/Tests/Save/SaveTests.unity.meta b/Assets/Tests/Save/SaveFlowchart.unity.meta similarity index 100% rename from Assets/Tests/Save/SaveTests.unity.meta rename to Assets/Tests/Save/SaveFlowchart.unity.meta From d52fe2ef11c106670c760a69e82bcbfb5ffdc6d1 Mon Sep 17 00:00:00 2001 From: Christopher Date: Thu, 10 Nov 2016 16:04:13 +0000 Subject: [PATCH 04/53] Option to Close Other Say Dialogs when one Say Dialog becomes active. --- Assets/Fungus/Scripts/Components/SayDialog.cs | 14 + Assets/Tests/Narrative/NarrativeTests.unity | 2337 ++++++++++++++++- 2 files changed, 2254 insertions(+), 97 deletions(-) diff --git a/Assets/Fungus/Scripts/Components/SayDialog.cs b/Assets/Fungus/Scripts/Components/SayDialog.cs index 548ff5f8..a23acc13 100644 --- a/Assets/Fungus/Scripts/Components/SayDialog.cs +++ b/Assets/Fungus/Scripts/Components/SayDialog.cs @@ -37,6 +37,9 @@ namespace Fungus [Tooltip("Adjust width of story text when Character Image is displayed (to avoid overlapping)")] [SerializeField] protected bool fitTextWithImage = true; + [Tooltip("Close any other open Say Dialogs when this one is active")] + [SerializeField] protected bool closeOtherDialogs; + protected float startStoryTextWidth; protected float startStoryTextInset; @@ -452,6 +455,17 @@ namespace Fungus } } + if (closeOtherDialogs) + { + for (int i = 0; i < activeSayDialogs.Count; i++) + { + var sd = activeSayDialogs[i]; + if (sd.gameObject != gameObject) + { + sd.SetActive(false); + } + } + } gameObject.SetActive(true); this.fadeWhenDone = fadeWhenDone; diff --git a/Assets/Tests/Narrative/NarrativeTests.unity b/Assets/Tests/Narrative/NarrativeTests.unity index cd8fd16d..379ed722 100644 --- a/Assets/Tests/Narrative/NarrativeTests.unity +++ b/Assets/Tests/Narrative/NarrativeTests.unity @@ -117,7 +117,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 61dddfdc5e0e44ca298d8f46f7f5a915, type: 3} m_Name: m_EditorClassIdentifier: - selectedFlowchart: {fileID: 891159642} + selectedFlowchart: {fileID: 415067087} --- !u!4 &11556238 Transform: m_ObjectHideFlags: 1 @@ -580,6 +580,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: parentBlock: {fileID: 24983357} + waitForFrames: 1 --- !u!114 &24983357 MonoBehaviour: m_ObjectHideFlags: 2 @@ -598,6 +599,8 @@ MonoBehaviour: y: 71 width: 120 height: 40 + tint: {r: 1, g: 1, b: 1, a: 1} + useCustomTint: 0 itemId: 0 blockName: Start description: @@ -630,7 +633,7 @@ MonoBehaviour: y: -350 width: 1289 height: 869 - selectedBlock: {fileID: 0} + selectedBlocks: [] selectedCommands: [] variables: [] description: @@ -690,6 +693,8 @@ MonoBehaviour: y: 69 width: 120 height: 40 + tint: {r: 1, g: 1, b: 1, a: 1} + useCustomTint: 0 itemId: 3 blockName: Do Input description: @@ -739,6 +744,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: parentBlock: {fileID: 24983361} + waitForFrames: 1 --- !u!114 &24983364 MonoBehaviour: m_ObjectHideFlags: 2 @@ -867,6 +873,8 @@ MonoBehaviour: y: 70 width: 120 height: 40 + tint: {r: 1, g: 1, b: 1, a: 1} + useCustomTint: 0 itemId: 11 blockName: DoTest description: @@ -1124,6 +1132,132 @@ MonoBehaviour: checkMethods: 1 m_ActionBase: {fileID: 1843909645} checksPerformed: 0 +--- !u!1 &34973467 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 180152, guid: 8a005a9e0713f4cc1b5ad29fb07657d3, type: 2} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 224: {fileID: 34973468} + - 222: {fileID: 34973470} + - 114: {fileID: 34973469} + - 114: {fileID: 34973471} + m_Layer: 5 + m_Name: Continue + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &34973468 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 22433354, guid: 8a005a9e0713f4cc1b5ad29fb07657d3, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 34973467} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: + - {fileID: 1690892828} + m_Father: {fileID: 1904568244} + m_RootOrder: 0 + m_AnchorMin: {x: 1, y: 0} + m_AnchorMax: {x: 1, y: 0} + m_AnchoredPosition: {x: -38.900024, y: 38.074993} + m_SizeDelta: {x: 77.900024, y: 77} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &34973469 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 11493918, guid: 8a005a9e0713f4cc1b5ad29fb07657d3, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 34973467} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: 226248ac6f184e448af731df91b91958, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!222 &34973470 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 22268826, guid: 8a005a9e0713f4cc1b5ad29fb07657d3, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 34973467} +--- !u!114 &34973471 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 11419088, guid: 8a005a9e0713f4cc1b5ad29fb07657d3, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 34973467} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1392445389, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 34973469} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 905215224} + m_MethodName: SetButtonClickedFlag + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 + m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null --- !u!1 &41636568 GameObject: m_ObjectHideFlags: 0 @@ -1335,6 +1469,104 @@ CanvasRenderer: type: 2} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 45801409} +--- !u!1 &54170631 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 188894, guid: 8a005a9e0713f4cc1b5ad29fb07657d3, type: 2} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 224: {fileID: 54170632} + - 222: {fileID: 54170634} + - 114: {fileID: 54170635} + - 114: {fileID: 54170633} + m_Layer: 5 + m_Name: StoryText + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &54170632 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 22488896, guid: 8a005a9e0713f4cc1b5ad29fb07657d3, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 54170631} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: + - {fileID: 356469147} + m_Father: {fileID: 118907340} + m_RootOrder: 2 + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 0.78700006} + m_AnchoredPosition: {x: 3, y: 14.130005} + m_SizeDelta: {x: -61, y: -63} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &54170633 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 11439138, guid: 8a005a9e0713f4cc1b5ad29fb07657d3, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 54170631} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1679637790, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreLayout: 0 + m_MinWidth: -1 + m_MinHeight: -1 + m_PreferredWidth: 1150 + m_PreferredHeight: 200 + m_FlexibleWidth: 1 + m_FlexibleHeight: -1 +--- !u!222 &54170634 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 22288894, guid: 8a005a9e0713f4cc1b5ad29fb07657d3, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 54170631} +--- !u!114 &54170635 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 11488896, guid: 8a005a9e0713f4cc1b5ad29fb07657d3, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 54170631} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + 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: 79197ecfbc3a4294a89ce589dac02cf2, type: 3} + m_FontSize: 45 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 4 + m_MaxSize: 50 + m_Alignment: 0 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Story text --- !u!1 &93721126 GameObject: m_ObjectHideFlags: 0 @@ -1509,6 +1741,125 @@ CanvasRenderer: type: 2} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 96381567} +--- !u!1 &118907339 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 188900, guid: 8a005a9e0713f4cc1b5ad29fb07657d3, type: 2} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 224: {fileID: 118907340} + - 222: {fileID: 118907344} + - 114: {fileID: 118907343} + - 225: {fileID: 118907342} + - 114: {fileID: 118907341} + m_Layer: 5 + m_Name: Panel + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &118907340 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 22488900, guid: 8a005a9e0713f4cc1b5ad29fb07657d3, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 118907339} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: + - {fileID: 1562044266} + - {fileID: 1863724296} + - {fileID: 54170632} + m_Father: {fileID: 1753914164} + m_RootOrder: 0 + m_AnchorMin: {x: 0.5, y: 0} + m_AnchorMax: {x: 0.5, y: 0} + m_AnchoredPosition: {x: -750.0001, y: 0} + m_SizeDelta: {x: 1500, y: 335} + m_Pivot: {x: 0, y: 0} +--- !u!114 &118907341 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 11478524, guid: 8a005a9e0713f4cc1b5ad29fb07657d3, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 118907339} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -1862395651, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Delegates: + - eventID: 4 + callback: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 1753914156} + m_MethodName: SetDialogClickedFlag + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 + m_TypeName: UnityEngine.EventSystems.EventTrigger+TriggerEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + delegates: [] +--- !u!225 &118907342 +CanvasGroup: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 22583964, guid: 8a005a9e0713f4cc1b5ad29fb07657d3, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 118907339} + m_Enabled: 1 + m_Alpha: 1 + m_Interactable: 1 + m_BlocksRaycasts: 1 + m_IgnoreParentGroups: 0 +--- !u!114 &118907343 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 11488904, guid: 8a005a9e0713f4cc1b5ad29fb07657d3, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 118907339} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: e8ab00ef0d9684dcb9deb52811d91218, type: 3} + m_Type: 1 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 0 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!222 &118907344 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 22288900, guid: 8a005a9e0713f4cc1b5ad29fb07657d3, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 118907339} --- !u!1 &131087273 GameObject: m_ObjectHideFlags: 0 @@ -2702,6 +3053,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: parentBlock: {fileID: 250457564} + waitForFrames: 1 --- !u!114 &250457564 MonoBehaviour: m_ObjectHideFlags: 2 @@ -2720,6 +3072,8 @@ MonoBehaviour: y: 69 width: 120 height: 40 + tint: {r: 1, g: 1, b: 1, a: 1} + useCustomTint: 0 itemId: 0 blockName: New Block description: @@ -2751,7 +3105,7 @@ MonoBehaviour: y: -340 width: 1114 height: 859 - selectedBlock: {fileID: 250457564} + selectedBlocks: [] selectedCommands: - {fileID: 250457562} variables: @@ -3410,6 +3764,132 @@ MonoBehaviour: platformsToIgnore: [] dynamic: 0 dynamicTypeName: +--- !u!1 &356469146 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 180152, guid: 8a005a9e0713f4cc1b5ad29fb07657d3, type: 2} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 224: {fileID: 356469147} + - 222: {fileID: 356469149} + - 114: {fileID: 356469148} + - 114: {fileID: 356469150} + m_Layer: 5 + m_Name: Continue + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &356469147 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 22433354, guid: 8a005a9e0713f4cc1b5ad29fb07657d3, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 356469146} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: + - {fileID: 1049398107} + m_Father: {fileID: 54170632} + m_RootOrder: 0 + m_AnchorMin: {x: 1, y: 0} + m_AnchorMax: {x: 1, y: 0} + m_AnchoredPosition: {x: -38.900024, y: 38.074993} + m_SizeDelta: {x: 77.900024, y: 77} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &356469148 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 11493918, guid: 8a005a9e0713f4cc1b5ad29fb07657d3, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 356469146} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: 226248ac6f184e448af731df91b91958, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!222 &356469149 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 22268826, guid: 8a005a9e0713f4cc1b5ad29fb07657d3, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 356469146} +--- !u!114 &356469150 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 11419088, guid: 8a005a9e0713f4cc1b5ad29fb07657d3, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 356469146} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1392445389, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 356469148} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 1753914156} + m_MethodName: SetButtonClickedFlag + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 + m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null --- !u!1 &362523161 GameObject: m_ObjectHideFlags: 0 @@ -3529,97 +4009,378 @@ Transform: m_RootOrder: 4 --- !u!114 &392887986 MonoBehaviour: - m_ObjectHideFlags: 0 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 392887984} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: dfa0c65e278214560ba42bc8fef024e6, type: 3} + m_Name: + m_EditorClassIdentifier: + sayDialog_LeftImage: {fileID: 538232720} + sayDialog_RightImage: {fileID: 1508308453} +--- !u!114 &400755115 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 2586c8e41f35d2f4fadde53020bf4207, type: 3} + m_Name: + m_EditorClassIdentifier: + go: {fileID: 1699319066} + thisPropertyPath: gameObject.activeSelf + compareToType: 1 + other: {fileID: 0} + otherPropertyPath: + constantValueGeneric: 1 +--- !u!1 &401634244 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 4: {fileID: 401634245} + - 114: {fileID: 401634246} + - 114: {fileID: 401634247} + m_Layer: 0 + m_Name: TestAssertions + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &401634245 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 401634244} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 642.62665, y: 110.30167, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 1731000812} + m_RootOrder: 0 +--- !u!114 &401634246 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 401634244} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8bafa54482a87ac4cbd7ff1bfd1ac93a, type: 3} + m_Name: + m_EditorClassIdentifier: + checkAfterTime: 8 + repeatCheckTime: 0 + repeatEveryTime: 1 + checkAfterFrames: 1 + repeatCheckFrame: 1 + repeatEveryFrame: 1 + hasFailed: 0 + checkMethods: 1 + m_ActionBase: {fileID: 1210810389} + checksPerformed: 0 +--- !u!114 &401634247 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 401634244} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: abf8bf8daccdf46b4afc52dcfd59a479, type: 3} + m_Name: + m_EditorClassIdentifier: + passCount: 0 +--- !u!1 &415067081 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 142980, guid: 5e7fbc8d4eb714b279eeeef2262c1e1a, type: 2} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 4: {fileID: 415067082} + - 114: {fileID: 415067087} + - 114: {fileID: 415067086} + - 114: {fileID: 415067085} + - 114: {fileID: 415067084} + - 114: {fileID: 415067083} + m_Layer: 0 + m_Name: Flowchart + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &415067082 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 467082, guid: 5e7fbc8d4eb714b279eeeef2262c1e1a, type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 415067081} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 623407733} + m_RootOrder: 2 +--- !u!114 &415067083 +MonoBehaviour: + m_ObjectHideFlags: 2 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 415067081} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ec422cd568a9c4a31ad7c36d0572b9da, type: 3} + m_Name: + m_EditorClassIdentifier: + itemId: 2 + indentLevel: 0 + storyText: Text on Say Dialogue B + description: + character: {fileID: 0} + portrait: {fileID: 0} + voiceOverClip: {fileID: 0} + showAlways: 1 + showCount: 1 + extendPrevious: 0 + fadeWhenDone: 1 + waitForClick: 1 + stopVoiceover: 1 + setSayDialog: {fileID: 905215223} +--- !u!114 &415067084 +MonoBehaviour: + m_ObjectHideFlags: 2 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 392887984} + m_GameObject: {fileID: 415067081} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: dfa0c65e278214560ba42bc8fef024e6, type: 3} + m_Script: {fileID: 11500000, guid: ec422cd568a9c4a31ad7c36d0572b9da, type: 3} m_Name: m_EditorClassIdentifier: - sayDialog_LeftImage: {fileID: 538232720} - sayDialog_RightImage: {fileID: 1508308453} ---- !u!114 &400755115 + itemId: 1 + indentLevel: 0 + storyText: Text on Say Dialogue A + description: + character: {fileID: 0} + portrait: {fileID: 0} + voiceOverClip: {fileID: 0} + showAlways: 1 + showCount: 1 + extendPrevious: 0 + fadeWhenDone: 0 + waitForClick: 0 + stopVoiceover: 1 + setSayDialog: {fileID: 1753914155} +--- !u!114 &415067085 +MonoBehaviour: + m_ObjectHideFlags: 2 + m_PrefabParentObject: {fileID: 11462346, guid: 5e7fbc8d4eb714b279eeeef2262c1e1a, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 415067081} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d2f6487d21a03404cb21b245f0242e79, type: 3} + m_Name: + m_EditorClassIdentifier: + parentBlock: {fileID: 415067086} + waitForFrames: 1 +--- !u!114 &415067086 +MonoBehaviour: + m_ObjectHideFlags: 2 + m_PrefabParentObject: {fileID: 11433304, guid: 5e7fbc8d4eb714b279eeeef2262c1e1a, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 415067081} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3d3d73aef2cfc4f51abf34ac00241f60, type: 3} + m_Name: + m_EditorClassIdentifier: + nodeRect: + serializedVersion: 2 + x: 67 + y: 70 + width: 120 + height: 40 + tint: {r: 1, g: 1, b: 1, a: 1} + useCustomTint: 0 + itemId: 0 + blockName: Start + description: + eventHandler: {fileID: 415067085} + commandList: + - {fileID: 415067084} + - {fileID: 415067083} +--- !u!114 &415067087 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_PrefabParentObject: {fileID: 11430050, guid: 5e7fbc8d4eb714b279eeeef2262c1e1a, + type: 2} m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 0} + m_GameObject: {fileID: 415067081} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 2586c8e41f35d2f4fadde53020bf4207, type: 3} + m_Script: {fileID: 11500000, guid: 7a334fe2ffb574b3583ff3b18b4792d3, type: 3} m_Name: m_EditorClassIdentifier: - go: {fileID: 1699319066} - thisPropertyPath: gameObject.activeSelf - compareToType: 1 - other: {fileID: 0} - otherPropertyPath: - constantValueGeneric: 1 ---- !u!1 &401634244 + version: 1 + scrollPos: {x: 0, y: 0} + variablesScrollPos: {x: 0, y: 0} + variablesExpanded: 1 + blockViewHeight: 400 + zoom: 1 + scrollViewRect: + serializedVersion: 2 + x: -343 + y: -340 + width: 1114 + height: 859 + selectedBlocks: + - {fileID: 415067086} + selectedCommands: [] + variables: [] + description: + stepPause: 0 + colorCommands: 1 + hideComponents: 1 + saveSelection: 1 + localizationId: + showLineNumbers: 0 + hideCommands: [] + luaEnvironment: {fileID: 0} + luaBindingName: flowchart +--- !u!1 &443952604 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_PrefabParentObject: {fileID: 188900, guid: 8a005a9e0713f4cc1b5ad29fb07657d3, type: 2} m_PrefabInternal: {fileID: 0} serializedVersion: 4 m_Component: - - 4: {fileID: 401634245} - - 114: {fileID: 401634246} - - 114: {fileID: 401634247} - m_Layer: 0 - m_Name: TestAssertions + - 224: {fileID: 443952605} + - 222: {fileID: 443952609} + - 114: {fileID: 443952608} + - 225: {fileID: 443952607} + - 114: {fileID: 443952606} + m_Layer: 5 + m_Name: Panel m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!4 &401634245 -Transform: +--- !u!224 &443952605 +RectTransform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_PrefabParentObject: {fileID: 22488900, guid: 8a005a9e0713f4cc1b5ad29fb07657d3, + type: 2} m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 401634244} + m_GameObject: {fileID: 443952604} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 642.62665, y: 110.30167, z: 0} + m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_Children: [] - m_Father: {fileID: 1731000812} + m_Children: + - {fileID: 961351885} + - {fileID: 583879098} + - {fileID: 1904568244} + m_Father: {fileID: 905215232} m_RootOrder: 0 ---- !u!114 &401634246 + m_AnchorMin: {x: 0.5, y: 0} + m_AnchorMax: {x: 0.5, y: 0} + m_AnchoredPosition: {x: -750, y: 595} + m_SizeDelta: {x: 1500, y: 335} + m_Pivot: {x: 0, y: 0} +--- !u!114 &443952606 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_PrefabParentObject: {fileID: 11478524, guid: 8a005a9e0713f4cc1b5ad29fb07657d3, + type: 2} m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 401634244} + m_GameObject: {fileID: 443952604} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 8bafa54482a87ac4cbd7ff1bfd1ac93a, type: 3} + m_Script: {fileID: -1862395651, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: - checkAfterTime: 8 - repeatCheckTime: 0 - repeatEveryTime: 1 - checkAfterFrames: 1 - repeatCheckFrame: 1 - repeatEveryFrame: 1 - hasFailed: 0 - checkMethods: 1 - m_ActionBase: {fileID: 1210810389} - checksPerformed: 0 ---- !u!114 &401634247 + m_Delegates: + - eventID: 4 + callback: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 905215224} + m_MethodName: SetDialogClickedFlag + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 + m_TypeName: UnityEngine.EventSystems.EventTrigger+TriggerEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + delegates: [] +--- !u!225 &443952607 +CanvasGroup: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 22583964, guid: 8a005a9e0713f4cc1b5ad29fb07657d3, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 443952604} + m_Enabled: 1 + m_Alpha: 1 + m_Interactable: 1 + m_BlocksRaycasts: 1 + m_IgnoreParentGroups: 0 +--- !u!114 &443952608 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_PrefabParentObject: {fileID: 11488904, guid: 8a005a9e0713f4cc1b5ad29fb07657d3, + type: 2} m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 401634244} + m_GameObject: {fileID: 443952604} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: abf8bf8daccdf46b4afc52dcfd59a479, type: 3} + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: - passCount: 0 + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: e8ab00ef0d9684dcb9deb52811d91218, type: 3} + m_Type: 1 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 0 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!222 &443952609 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 22288900, guid: 8a005a9e0713f4cc1b5ad29fb07657d3, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 443952604} --- !u!1 &458201897 GameObject: m_ObjectHideFlags: 0 @@ -3955,6 +4716,8 @@ MonoBehaviour: y: 137 width: 120 height: 40 + tint: {r: 1, g: 1, b: 1, a: 1} + useCustomTint: 0 itemId: 3 blockName: Option 2 description: @@ -3977,6 +4740,8 @@ MonoBehaviour: y: 136 width: 120 height: 40 + tint: {r: 1, g: 1, b: 1, a: 1} + useCustomTint: 0 itemId: 2 blockName: Option 1 description: @@ -4015,6 +4780,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: parentBlock: {fileID: 562609153} + waitForFrames: 1 --- !u!114 &562609152 MonoBehaviour: m_ObjectHideFlags: 2 @@ -4047,6 +4813,8 @@ MonoBehaviour: y: 71 width: 120 height: 40 + tint: {r: 1, g: 1, b: 1, a: 1} + useCustomTint: 0 itemId: 0 blockName: Start description: @@ -4081,7 +4849,7 @@ MonoBehaviour: y: -350 width: 1121 height: 934 - selectedBlock: {fileID: 562609153} + selectedBlocks: [] selectedCommands: - {fileID: 562609156} variables: [] @@ -4276,6 +5044,97 @@ Transform: m_Children: [] m_Father: {fileID: 956321189} m_RootOrder: 2 +--- !u!1 &583879094 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 148914, guid: 8a005a9e0713f4cc1b5ad29fb07657d3, type: 2} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 224: {fileID: 583879098} + - 222: {fileID: 583879097} + - 114: {fileID: 583879095} + - 114: {fileID: 583879096} + m_Layer: 5 + m_Name: Image + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &583879095 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 11448914, guid: 8a005a9e0713f4cc1b5ad29fb07657d3, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 583879094} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: ea8f56c43254d41728f5ac4e8299b6c9, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!114 &583879096 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 11439142, guid: 8a005a9e0713f4cc1b5ad29fb07657d3, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 583879094} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1679637790, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreLayout: 0 + m_MinWidth: -1 + m_MinHeight: -1 + m_PreferredWidth: 350 + m_PreferredHeight: 350 + m_FlexibleWidth: -1 + m_FlexibleHeight: -1 +--- !u!222 &583879097 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 22248914, guid: 8a005a9e0713f4cc1b5ad29fb07657d3, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 583879094} +--- !u!224 &583879098 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 22448914, guid: 8a005a9e0713f4cc1b5ad29fb07657d3, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 583879094} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 443952605} + m_RootOrder: 1 + m_AnchorMin: {x: 1, y: 0} + m_AnchorMax: {x: 1, y: 0} + m_AnchoredPosition: {x: -178.5, y: 263.13} + m_SizeDelta: {x: 357, y: 435} + m_Pivot: {x: 0.5, y: 0.5} --- !u!1 &588326334 GameObject: m_ObjectHideFlags: 0 @@ -4752,10 +5611,64 @@ MonoBehaviour: --- !u!222 &614752971 CanvasRenderer: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 22272108, guid: 9bb64c8df70904eecac3f71f81bf339b, - type: 2} + m_PrefabParentObject: {fileID: 22272108, guid: 9bb64c8df70904eecac3f71f81bf339b, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 614752968} +--- !u!1 &623407731 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 4: {fileID: 623407733} + - 114: {fileID: 623407732} + m_Layer: 0 + m_Name: CloseOtherTest + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &623407732 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 614752968} + m_GameObject: {fileID: 623407731} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b1dba0b27b0864740a8720e920aa88c0, type: 3} + m_Name: + m_EditorClassIdentifier: + timeout: 5 + ignored: 0 + succeedAfterAllAssertionsAreExecuted: 0 + expectException: 0 + expectedExceptionList: + succeedWhenExceptionIsThrown: 0 + includedPlatforms: -1 + platformsToIgnore: [] + dynamic: 0 + dynamicTypeName: +--- !u!4 &623407733 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 623407731} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: + - {fileID: 1753914164} + - {fileID: 905215232} + - {fileID: 415067082} + - {fileID: 2020093178} + m_Father: {fileID: 0} + m_RootOrder: 19 --- !u!1 &658326115 GameObject: m_ObjectHideFlags: 0 @@ -5065,6 +5978,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: parentBlock: {fileID: 670062726} + waitForFrames: 1 --- !u!114 &670062726 MonoBehaviour: m_ObjectHideFlags: 2 @@ -5083,6 +5997,8 @@ MonoBehaviour: y: 70 width: 120 height: 40 + tint: {r: 1, g: 1, b: 1, a: 1} + useCustomTint: 0 itemId: 0 blockName: Write A description: @@ -5114,7 +6030,7 @@ MonoBehaviour: y: -340 width: 1126 height: 859 - selectedBlock: {fileID: 670062726} + selectedBlocks: [] selectedCommands: - {fileID: 670062732} variables: [] @@ -5157,6 +6073,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: parentBlock: {fileID: 670062731} + waitForFrames: 1 --- !u!114 &670062730 MonoBehaviour: m_ObjectHideFlags: 2 @@ -5199,6 +6116,8 @@ MonoBehaviour: y: 72 width: 120 height: 40 + tint: {r: 1, g: 1, b: 1, a: 1} + useCustomTint: 0 itemId: 2 blockName: Write B description: @@ -5612,6 +6531,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: parentBlock: {fileID: 711866615} + waitForFrames: 1 --- !u!114 &711866615 MonoBehaviour: m_ObjectHideFlags: 2 @@ -5630,6 +6550,8 @@ MonoBehaviour: y: 71 width: 120 height: 40 + tint: {r: 1, g: 1, b: 1, a: 1} + useCustomTint: 0 itemId: 0 blockName: Start description: @@ -5663,7 +6585,7 @@ MonoBehaviour: y: -340 width: 1114 height: 859 - selectedBlock: {fileID: 711866615} + selectedBlocks: [] selectedCommands: - {fileID: 711866618} variables: [] @@ -6058,6 +6980,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: parentBlock: {fileID: 736071349} + waitForFrames: 1 --- !u!114 &736071349 MonoBehaviour: m_ObjectHideFlags: 2 @@ -6076,6 +6999,8 @@ MonoBehaviour: y: 69 width: 120 height: 40 + tint: {r: 1, g: 1, b: 1, a: 1} + useCustomTint: 0 itemId: 0 blockName: Start Saying description: @@ -6111,7 +7036,7 @@ MonoBehaviour: y: -350 width: 1121 height: 870 - selectedBlock: {fileID: 736071349} + selectedBlocks: [] selectedCommands: - {fileID: 736071366} variables: [] @@ -6225,6 +7150,8 @@ MonoBehaviour: y: 70 width: 120 height: 40 + tint: {r: 1, g: 1, b: 1, a: 1} + useCustomTint: 0 itemId: 4 blockName: Start Testing description: @@ -6295,6 +7222,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: parentBlock: {fileID: 736071355} + waitForFrames: 1 --- !u!114 &736071359 MonoBehaviour: m_ObjectHideFlags: 2 @@ -7674,7 +8602,7 @@ MonoBehaviour: y: -352 width: 1132 height: 871 - selectedBlock: {fileID: 861253875} + selectedBlocks: [] selectedCommands: [] variables: [] description: @@ -7719,6 +8647,8 @@ MonoBehaviour: y: 68 width: 120 height: 40 + tint: {r: 1, g: 1, b: 1, a: 1} + useCustomTint: 0 itemId: 0 blockName: Start description: Test interrupting a Say command while it's executing @@ -7764,6 +8694,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: parentBlock: {fileID: 861253875} + waitForFrames: 1 --- !u!114 &861253878 MonoBehaviour: m_ObjectHideFlags: 2 @@ -7781,6 +8712,8 @@ MonoBehaviour: y: 66 width: 120 height: 40 + tint: {r: 1, g: 1, b: 1, a: 1} + useCustomTint: 0 itemId: 5 blockName: Do Stop Call description: @@ -7843,6 +8776,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: parentBlock: {fileID: 861253878} + waitForFrames: 1 --- !u!1 &868000842 GameObject: m_ObjectHideFlags: 0 @@ -8161,7 +9095,7 @@ MonoBehaviour: y: -350 width: 1502 height: 989 - selectedBlock: {fileID: 891159676} + selectedBlocks: [] selectedCommands: [] variables: [] description: @@ -8192,6 +9126,8 @@ MonoBehaviour: y: 87 width: 120 height: 40 + tint: {r: 1, g: 1, b: 1, a: 1} + useCustomTint: 0 itemId: 0 blockName: Start description: @@ -8219,6 +9155,8 @@ MonoBehaviour: y: 142 width: 120 height: 40 + tint: {r: 1, g: 1, b: 1, a: 1} + useCustomTint: 0 itemId: 43 blockName: TestStage description: @@ -8345,6 +9283,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: parentBlock: {fileID: 891159643} + waitForFrames: 1 --- !u!114 &891159652 MonoBehaviour: m_ObjectHideFlags: 2 @@ -8789,8 +9728,10 @@ MonoBehaviour: serializedVersion: 2 x: 212 y: 139 - width: 122 + width: 120 height: 40 + tint: {r: 1, g: 1, b: 1, a: 1} + useCustomTint: 0 itemId: 17 blockName: TestPortraits description: @@ -8812,6 +9753,274 @@ MonoBehaviour: - {fileID: 891159662} - {fileID: 891159649} - {fileID: 891159661} +--- !u!1 &905215222 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 188902, guid: 8a005a9e0713f4cc1b5ad29fb07657d3, type: 2} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 224: {fileID: 905215232} + - 223: {fileID: 905215225} + - 114: {fileID: 905215231} + - 225: {fileID: 905215230} + - 114: {fileID: 905215229} + - 114: {fileID: 905215223} + - 114: {fileID: 905215228} + - 114: {fileID: 905215227} + - 114: {fileID: 905215224} + - 82: {fileID: 905215226} + m_Layer: 5 + m_Name: SayDialogB + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &905215223 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 11488894, guid: 8a005a9e0713f4cc1b5ad29fb07657d3, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 905215222} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3a0bbe22c246e4c78ad8e9816cbae9d5, type: 3} + m_Name: + m_EditorClassIdentifier: + fadeDuration: 0.25 + continueButton: {fileID: 34973471} + dialogCanvas: {fileID: 905215225} + nameText: {fileID: 961351887} + storyText: {fileID: 1904568247} + characterImage: {fileID: 583879095} + fitTextWithImage: 1 + closeOtherDialogs: 1 +--- !u!114 &905215224 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 11481894, guid: 8a005a9e0713f4cc1b5ad29fb07657d3, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 905215222} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 43b85556abd314f3f870c18c013fdcef, type: 3} + m_Name: + m_EditorClassIdentifier: + clickMode: 1 + nextClickDelay: 0 + cancelEnabled: 1 + ignoreMenuClicks: 1 +--- !u!223 &905215225 +Canvas: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 22388894, guid: 8a005a9e0713f4cc1b5ad29fb07657d3, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 905215222} + m_Enabled: 1 + serializedVersion: 2 + m_RenderMode: 0 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 1 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_SortingLayerID: 0 + m_SortingOrder: 1 + m_TargetDisplay: 0 +--- !u!82 &905215226 +AudioSource: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 8294266, guid: 8a005a9e0713f4cc1b5ad29fb07657d3, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 905215222} + m_Enabled: 1 + serializedVersion: 4 + OutputAudioMixerGroup: {fileID: 0} + m_audioClip: {fileID: 0} + m_PlayOnAwake: 0 + m_Volume: 1 + m_Pitch: 1 + Loop: 0 + Mute: 0 + Spatialize: 0 + Priority: 128 + DopplerLevel: 1 + MinDistance: 1 + MaxDistance: 500 + Pan2D: 0 + rolloffMode: 0 + BypassEffects: 0 + BypassListenerEffects: 0 + BypassReverbZones: 0 + rolloffCustomCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + - time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + panLevelCustomCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 0 + spreadCustomCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + reverbZoneMixCustomCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 0 +--- !u!114 &905215227 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 11404316, guid: 8a005a9e0713f4cc1b5ad29fb07657d3, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 905215222} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c4782cf42f2644447b9631f6e522160b, type: 3} + m_Name: + m_EditorClassIdentifier: + volume: 1 + loop: 1 + targetAudioSource: {fileID: 0} + audioMode: 0 + beepSounds: + - {fileID: 8300000, guid: 774486030b696474e8b3cf7f178123da, type: 3} + - {fileID: 8300000, guid: f637c5ce9d10e45c7855ed89bfc6b97e, type: 3} + - {fileID: 8300000, guid: c53b7c20372e444c6bd7f2ac0729bbe2, type: 3} + soundEffect: {fileID: 0} + inputSound: {fileID: 8300000, guid: 14a396b1562834718b2d52b9c4639264, type: 3} +--- !u!114 &905215228 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 11487070, guid: 8a005a9e0713f4cc1b5ad29fb07657d3, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 905215222} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a676940fce6344af1a70043b089a6c14, type: 3} + m_Name: + m_EditorClassIdentifier: + targetTextObject: {fileID: 1904568243} + punchObject: {fileID: 443952604} + writingSpeed: 60 + punctuationPause: 0.25 + hiddenTextColor: {r: 1, g: 1, b: 1, a: 0} + writeWholeWords: 0 + forceRichText: 1 + instantComplete: 1 +--- !u!114 &905215229 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 11486804, guid: 8a005a9e0713f4cc1b5ad29fb07657d3, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 905215222} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1301386320, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreReversedGraphics: 1 + m_BlockingObjects: 0 + m_BlockingMask: + serializedVersion: 2 + m_Bits: 4294967295 +--- !u!225 &905215230 +CanvasGroup: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 22588896, guid: 8a005a9e0713f4cc1b5ad29fb07657d3, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 905215222} + m_Enabled: 1 + m_Alpha: 1 + m_Interactable: 1 + m_BlocksRaycasts: 1 + m_IgnoreParentGroups: 0 +--- !u!114 &905215231 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 11488906, guid: 8a005a9e0713f4cc1b5ad29fb07657d3, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 905215222} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1980459831, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UiScaleMode: 1 + m_ReferencePixelsPerUnit: 32 + m_ScaleFactor: 1 + m_ReferenceResolution: {x: 1600, y: 1200} + m_ScreenMatchMode: 0 + m_MatchWidthOrHeight: 1 + m_PhysicalUnit: 3 + m_FallbackScreenDPI: 96 + m_DefaultSpriteDPI: 96 + m_DynamicPixelsPerUnit: 1 +--- !u!224 &905215232 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 22488902, guid: 8a005a9e0713f4cc1b5ad29fb07657d3, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 905215222} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0, y: 0, z: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: + - {fileID: 443952605} + m_Father: {fileID: 623407733} + m_RootOrder: 1 + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0, y: 0} --- !u!1 &927439915 GameObject: m_ObjectHideFlags: 0 @@ -9008,6 +10217,7 @@ MonoBehaviour: storyText: {fileID: 157771020} characterImage: {fileID: 2121383753} fitTextWithImage: 1 + closeOtherDialogs: 0 --- !u!114 &927439922 MonoBehaviour: m_ObjectHideFlags: 0 @@ -9153,6 +10363,83 @@ MonoBehaviour: platformsToIgnore: [] dynamic: 0 dynamicTypeName: +--- !u!1 &961351884 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 188898, guid: 8a005a9e0713f4cc1b5ad29fb07657d3, type: 2} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 224: {fileID: 961351885} + - 222: {fileID: 961351886} + - 114: {fileID: 961351887} + m_Layer: 5 + m_Name: NameText + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &961351885 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 22488894, guid: 8a005a9e0713f4cc1b5ad29fb07657d3, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 961351884} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 443952605} + m_RootOrder: 0 + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 586.5, y: -38.369995} + m_SizeDelta: {x: 1106, y: 71} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &961351886 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 22288898, guid: 8a005a9e0713f4cc1b5ad29fb07657d3, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 961351884} +--- !u!114 &961351887 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 11488900, guid: 8a005a9e0713f4cc1b5ad29fb07657d3, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 961351884} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.25882354, g: 0.25490198, b: 0.2627451, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + 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: bb145366ce7024469a5758b08d31802c, type: 3} + m_FontSize: 50 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 10 + m_MaxSize: 50 + m_Alignment: 3 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 1 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Character Name --- !u!1 &969752611 GameObject: m_ObjectHideFlags: 0 @@ -10339,6 +11626,83 @@ MonoBehaviour: portraitsFace: 0 setSayDialog: {fileID: 0} description: +--- !u!1 &1049398106 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 155030, guid: 8a005a9e0713f4cc1b5ad29fb07657d3, type: 2} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 224: {fileID: 1049398107} + - 222: {fileID: 1049398109} + - 114: {fileID: 1049398108} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1049398107 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 22443574, guid: 8a005a9e0713f4cc1b5ad29fb07657d3, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1049398106} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 356469147} + m_RootOrder: 0 + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1049398108 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 11431470, guid: 8a005a9e0713f4cc1b5ad29fb07657d3, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1049398106} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + 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: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 14 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 10 + m_MaxSize: 40 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: +--- !u!222 &1049398109 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 22257884, guid: 8a005a9e0713f4cc1b5ad29fb07657d3, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1049398106} --- !u!1 &1049860612 GameObject: m_ObjectHideFlags: 0 @@ -10623,6 +11987,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: parentBlock: {fileID: 1083081538} + waitForFrames: 1 --- !u!114 &1083081538 MonoBehaviour: m_ObjectHideFlags: 2 @@ -10641,6 +12006,8 @@ MonoBehaviour: y: 70 width: 120 height: 40 + tint: {r: 1, g: 1, b: 1, a: 1} + useCustomTint: 0 itemId: 0 blockName: Start description: @@ -10672,7 +12039,7 @@ MonoBehaviour: y: -340 width: 1114 height: 859 - selectedBlock: {fileID: 1083081538} + selectedBlocks: [] selectedCommands: - {fileID: 1083081540} variables: [] @@ -10916,6 +12283,7 @@ MonoBehaviour: storyText: {fileID: 658513473} characterImage: {fileID: 1112648895} fitTextWithImage: 1 + closeOtherDialogs: 0 --- !u!114 &1090798157 MonoBehaviour: m_ObjectHideFlags: 0 @@ -11301,6 +12669,7 @@ MonoBehaviour: storyText: {fileID: 319877267} characterImage: {fileID: 18001255} fitTextWithImage: 1 + closeOtherDialogs: 0 --- !u!114 &1125936945 MonoBehaviour: m_ObjectHideFlags: 0 @@ -11793,6 +13162,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: parentBlock: {fileID: 1196429428} + waitForFrames: 1 --- !u!114 &1196429428 MonoBehaviour: m_ObjectHideFlags: 2 @@ -11811,6 +13181,8 @@ MonoBehaviour: y: 65 width: 120 height: 40 + tint: {r: 1, g: 1, b: 1, a: 1} + useCustomTint: 0 itemId: 0 blockName: Block A description: Start a Say command in this block @@ -11843,7 +13215,7 @@ MonoBehaviour: y: -359 width: 1121 height: 878 - selectedBlock: {fileID: 1196429428} + selectedBlocks: [] selectedCommands: - {fileID: 1196429434} variables: [] @@ -11933,6 +13305,8 @@ MonoBehaviour: y: 65 width: 120 height: 40 + tint: {r: 1, g: 1, b: 1, a: 1} + useCustomTint: 0 itemId: 2 blockName: Block B description: Start another Say command in this block after a delay @@ -12051,6 +13425,7 @@ MonoBehaviour: storyText: {fileID: 572306880} characterImage: {fileID: 1176433426} fitTextWithImage: 1 + closeOtherDialogs: 0 --- !u!223 &1242507979 Canvas: m_ObjectHideFlags: 0 @@ -13260,6 +14635,8 @@ MonoBehaviour: y: 145 width: 120 height: 40 + tint: {r: 1, g: 1, b: 1, a: 1} + useCustomTint: 0 itemId: 2 blockName: DoOption description: @@ -13300,6 +14677,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: parentBlock: {fileID: 1555865766} + waitForFrames: 1 --- !u!114 &1555865766 MonoBehaviour: m_ObjectHideFlags: 2 @@ -13318,6 +14696,8 @@ MonoBehaviour: y: 70 width: 120 height: 40 + tint: {r: 1, g: 1, b: 1, a: 1} + useCustomTint: 0 itemId: 0 blockName: Start description: @@ -13348,7 +14728,7 @@ MonoBehaviour: y: -350 width: 1247 height: 936 - selectedBlock: {fileID: 0} + selectedBlocks: [] selectedCommands: [] variables: [] description: 'Test that selecting a menu button starts execution of a target block. @@ -13365,6 +14745,83 @@ MonoBehaviour: hideCommands: [] luaEnvironment: {fileID: 0} luaBindingName: flowchart +--- !u!1 &1562044265 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 188898, guid: 8a005a9e0713f4cc1b5ad29fb07657d3, type: 2} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 224: {fileID: 1562044266} + - 222: {fileID: 1562044267} + - 114: {fileID: 1562044268} + m_Layer: 5 + m_Name: NameText + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1562044266 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 22488894, guid: 8a005a9e0713f4cc1b5ad29fb07657d3, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1562044265} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 118907340} + m_RootOrder: 0 + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 586.5, y: -38.369995} + m_SizeDelta: {x: 1106, y: 71} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &1562044267 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 22288898, guid: 8a005a9e0713f4cc1b5ad29fb07657d3, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1562044265} +--- !u!114 &1562044268 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 11488900, guid: 8a005a9e0713f4cc1b5ad29fb07657d3, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1562044265} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.25882354, g: 0.25490198, b: 0.2627451, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + 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: bb145366ce7024469a5758b08d31802c, type: 3} + m_FontSize: 50 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 10 + m_MaxSize: 50 + m_Alignment: 3 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 1 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Character Name --- !u!1 &1609475067 GameObject: m_ObjectHideFlags: 0 @@ -14603,6 +16060,83 @@ RectTransform: m_AnchoredPosition: {x: 650, y: -655} m_SizeDelta: {x: 1300, y: 50} m_Pivot: {x: 0.5, y: 0.5} +--- !u!1 &1690892827 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 155030, guid: 8a005a9e0713f4cc1b5ad29fb07657d3, type: 2} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 224: {fileID: 1690892828} + - 222: {fileID: 1690892830} + - 114: {fileID: 1690892829} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1690892828 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 22443574, guid: 8a005a9e0713f4cc1b5ad29fb07657d3, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1690892827} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 34973468} + m_RootOrder: 0 + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1690892829 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 11431470, guid: 8a005a9e0713f4cc1b5ad29fb07657d3, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1690892827} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + 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: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 14 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 10 + m_MaxSize: 40 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: +--- !u!222 &1690892830 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 22257884, guid: 8a005a9e0713f4cc1b5ad29fb07657d3, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1690892827} --- !u!1 &1699319066 GameObject: m_ObjectHideFlags: 0 @@ -15205,6 +16739,7 @@ MonoBehaviour: storyText: {fileID: 93721128} characterImage: {fileID: 1999698865} fitTextWithImage: 1 + closeOtherDialogs: 0 --- !u!114 &1714427709 MonoBehaviour: m_ObjectHideFlags: 0 @@ -15297,38 +16832,306 @@ Transform: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1731000811} + m_GameObject: {fileID: 1731000811} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: + - {fileID: 401634245} + - {fileID: 24983359} + - {fileID: 1066357891} + m_Father: {fileID: 0} + m_RootOrder: 5 +--- !u!114 &1731000813 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1731000811} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b1dba0b27b0864740a8720e920aa88c0, type: 3} + m_Name: + m_EditorClassIdentifier: + timeout: 10 + ignored: 0 + succeedAfterAllAssertionsAreExecuted: 1 + expectException: 0 + expectedExceptionList: + succeedWhenExceptionIsThrown: 0 + includedPlatforms: -1 + platformsToIgnore: [] + dynamic: 0 + dynamicTypeName: +--- !u!1 &1753914154 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 188902, guid: 8a005a9e0713f4cc1b5ad29fb07657d3, type: 2} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 224: {fileID: 1753914164} + - 223: {fileID: 1753914157} + - 114: {fileID: 1753914163} + - 225: {fileID: 1753914162} + - 114: {fileID: 1753914161} + - 114: {fileID: 1753914155} + - 114: {fileID: 1753914160} + - 114: {fileID: 1753914159} + - 114: {fileID: 1753914156} + - 82: {fileID: 1753914158} + m_Layer: 5 + m_Name: SayDialogA + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1753914155 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 11488894, guid: 8a005a9e0713f4cc1b5ad29fb07657d3, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1753914154} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3a0bbe22c246e4c78ad8e9816cbae9d5, type: 3} + m_Name: + m_EditorClassIdentifier: + fadeDuration: 0.25 + continueButton: {fileID: 356469150} + dialogCanvas: {fileID: 1753914157} + nameText: {fileID: 1562044268} + storyText: {fileID: 54170635} + characterImage: {fileID: 1863724293} + fitTextWithImage: 1 + closeOtherDialogs: 0 +--- !u!114 &1753914156 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 11481894, guid: 8a005a9e0713f4cc1b5ad29fb07657d3, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1753914154} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 43b85556abd314f3f870c18c013fdcef, type: 3} + m_Name: + m_EditorClassIdentifier: + clickMode: 1 + nextClickDelay: 0 + cancelEnabled: 1 + ignoreMenuClicks: 1 +--- !u!223 &1753914157 +Canvas: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 22388894, guid: 8a005a9e0713f4cc1b5ad29fb07657d3, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1753914154} + m_Enabled: 1 + serializedVersion: 2 + m_RenderMode: 0 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 1 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_SortingLayerID: 0 + m_SortingOrder: 1 + m_TargetDisplay: 0 +--- !u!82 &1753914158 +AudioSource: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 8294266, guid: 8a005a9e0713f4cc1b5ad29fb07657d3, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1753914154} + m_Enabled: 1 + serializedVersion: 4 + OutputAudioMixerGroup: {fileID: 0} + m_audioClip: {fileID: 0} + m_PlayOnAwake: 0 + m_Volume: 1 + m_Pitch: 1 + Loop: 0 + Mute: 0 + Spatialize: 0 + Priority: 128 + DopplerLevel: 1 + MinDistance: 1 + MaxDistance: 500 + Pan2D: 0 + rolloffMode: 0 + BypassEffects: 0 + BypassListenerEffects: 0 + BypassReverbZones: 0 + rolloffCustomCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + - time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + panLevelCustomCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 0 + spreadCustomCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + reverbZoneMixCustomCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 0 +--- !u!114 &1753914159 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 11404316, guid: 8a005a9e0713f4cc1b5ad29fb07657d3, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1753914154} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c4782cf42f2644447b9631f6e522160b, type: 3} + m_Name: + m_EditorClassIdentifier: + volume: 1 + loop: 1 + targetAudioSource: {fileID: 0} + audioMode: 0 + beepSounds: + - {fileID: 8300000, guid: 774486030b696474e8b3cf7f178123da, type: 3} + - {fileID: 8300000, guid: f637c5ce9d10e45c7855ed89bfc6b97e, type: 3} + - {fileID: 8300000, guid: c53b7c20372e444c6bd7f2ac0729bbe2, type: 3} + soundEffect: {fileID: 0} + inputSound: {fileID: 8300000, guid: 14a396b1562834718b2d52b9c4639264, type: 3} +--- !u!114 &1753914160 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 11487070, guid: 8a005a9e0713f4cc1b5ad29fb07657d3, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1753914154} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a676940fce6344af1a70043b089a6c14, type: 3} + m_Name: + m_EditorClassIdentifier: + targetTextObject: {fileID: 54170631} + punchObject: {fileID: 118907339} + writingSpeed: 60 + punctuationPause: 0.25 + hiddenTextColor: {r: 1, g: 1, b: 1, a: 0} + writeWholeWords: 0 + forceRichText: 1 + instantComplete: 1 +--- !u!114 &1753914161 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 11486804, guid: 8a005a9e0713f4cc1b5ad29fb07657d3, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1753914154} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1301386320, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreReversedGraphics: 1 + m_BlockingObjects: 0 + m_BlockingMask: + serializedVersion: 2 + m_Bits: 4294967295 +--- !u!225 &1753914162 +CanvasGroup: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 22588896, guid: 8a005a9e0713f4cc1b5ad29fb07657d3, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1753914154} + m_Enabled: 1 + m_Alpha: 1 + m_Interactable: 1 + m_BlocksRaycasts: 1 + m_IgnoreParentGroups: 0 +--- !u!114 &1753914163 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 11488906, guid: 8a005a9e0713f4cc1b5ad29fb07657d3, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1753914154} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1980459831, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UiScaleMode: 1 + m_ReferencePixelsPerUnit: 32 + m_ScaleFactor: 1 + m_ReferenceResolution: {x: 1600, y: 1200} + m_ScreenMatchMode: 0 + m_MatchWidthOrHeight: 1 + m_PhysicalUnit: 3 + m_FallbackScreenDPI: 96 + m_DefaultSpriteDPI: 96 + m_DynamicPixelsPerUnit: 1 +--- !u!224 &1753914164 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 22488902, guid: 8a005a9e0713f4cc1b5ad29fb07657d3, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1753914154} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalScale: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: - - {fileID: 401634245} - - {fileID: 24983359} - - {fileID: 1066357891} - m_Father: {fileID: 0} - m_RootOrder: 5 ---- !u!114 &1731000813 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1731000811} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: b1dba0b27b0864740a8720e920aa88c0, type: 3} - m_Name: - m_EditorClassIdentifier: - timeout: 10 - ignored: 0 - succeedAfterAllAssertionsAreExecuted: 1 - expectException: 0 - expectedExceptionList: - succeedWhenExceptionIsThrown: 0 - includedPlatforms: -1 - platformsToIgnore: [] - dynamic: 0 - dynamicTypeName: + - {fileID: 118907340} + m_Father: {fileID: 623407733} + m_RootOrder: 0 + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0, y: 0} --- !u!1 &1754947672 GameObject: m_ObjectHideFlags: 0 @@ -15596,6 +17399,7 @@ MonoBehaviour: storyText: {fileID: 995680049} characterImage: {fileID: 782889245} fitTextWithImage: 1 + closeOtherDialogs: 0 --- !u!114 &1764227333 MonoBehaviour: m_ObjectHideFlags: 0 @@ -15916,6 +17720,7 @@ MonoBehaviour: storyText: {fileID: 1609475070} characterImage: {fileID: 1794226589} fitTextWithImage: 1 + closeOtherDialogs: 0 --- !u!114 &1792345323 MonoBehaviour: m_ObjectHideFlags: 0 @@ -16390,6 +18195,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: parentBlock: {fileID: 1807695778} + waitForFrames: 1 --- !u!114 &1807695778 MonoBehaviour: m_ObjectHideFlags: 2 @@ -16408,6 +18214,8 @@ MonoBehaviour: y: 71 width: 120 height: 40 + tint: {r: 1, g: 1, b: 1, a: 1} + useCustomTint: 0 itemId: 0 blockName: Start description: @@ -16441,7 +18249,7 @@ MonoBehaviour: y: -340 width: 1114 height: 859 - selectedBlock: {fileID: 1807695778} + selectedBlocks: [] selectedCommands: - {fileID: 1807695775} variables: [] @@ -16564,6 +18372,97 @@ MonoBehaviour: other: {fileID: 0} otherPropertyPath: constantValueGeneric: 0 +--- !u!1 &1863724292 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 148914, guid: 8a005a9e0713f4cc1b5ad29fb07657d3, type: 2} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 224: {fileID: 1863724296} + - 222: {fileID: 1863724295} + - 114: {fileID: 1863724293} + - 114: {fileID: 1863724294} + m_Layer: 5 + m_Name: Image + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1863724293 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 11448914, guid: 8a005a9e0713f4cc1b5ad29fb07657d3, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1863724292} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: ea8f56c43254d41728f5ac4e8299b6c9, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!114 &1863724294 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 11439142, guid: 8a005a9e0713f4cc1b5ad29fb07657d3, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1863724292} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1679637790, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreLayout: 0 + m_MinWidth: -1 + m_MinHeight: -1 + m_PreferredWidth: 350 + m_PreferredHeight: 350 + m_FlexibleWidth: -1 + m_FlexibleHeight: -1 +--- !u!222 &1863724295 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 22248914, guid: 8a005a9e0713f4cc1b5ad29fb07657d3, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1863724292} +--- !u!224 &1863724296 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 22448914, guid: 8a005a9e0713f4cc1b5ad29fb07657d3, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1863724292} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 118907340} + m_RootOrder: 1 + m_AnchorMin: {x: 1, y: 0} + m_AnchorMax: {x: 1, y: 0} + m_AnchoredPosition: {x: -178.5, y: 263.13} + m_SizeDelta: {x: 357, y: 435} + m_Pivot: {x: 0.5, y: 0.5} --- !u!1 &1895633753 GameObject: m_ObjectHideFlags: 0 @@ -16617,6 +18516,104 @@ Transform: - {fileID: 1242507976} m_Father: {fileID: 0} m_RootOrder: 9 +--- !u!1 &1904568243 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 188894, guid: 8a005a9e0713f4cc1b5ad29fb07657d3, type: 2} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 224: {fileID: 1904568244} + - 222: {fileID: 1904568246} + - 114: {fileID: 1904568247} + - 114: {fileID: 1904568245} + m_Layer: 5 + m_Name: StoryText + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1904568244 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 22488896, guid: 8a005a9e0713f4cc1b5ad29fb07657d3, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1904568243} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: + - {fileID: 34973468} + m_Father: {fileID: 443952605} + m_RootOrder: 2 + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 0.78700006} + m_AnchoredPosition: {x: 3, y: 14.130005} + m_SizeDelta: {x: -61, y: -63} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1904568245 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 11439138, guid: 8a005a9e0713f4cc1b5ad29fb07657d3, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1904568243} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1679637790, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreLayout: 0 + m_MinWidth: -1 + m_MinHeight: -1 + m_PreferredWidth: 1150 + m_PreferredHeight: 200 + m_FlexibleWidth: 1 + m_FlexibleHeight: -1 +--- !u!222 &1904568246 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 22288894, guid: 8a005a9e0713f4cc1b5ad29fb07657d3, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1904568243} +--- !u!114 &1904568247 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 11488896, guid: 8a005a9e0713f4cc1b5ad29fb07657d3, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1904568243} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + 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: 79197ecfbc3a4294a89ce589dac02cf2, type: 3} + m_FontSize: 45 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 4 + m_MaxSize: 50 + m_Alignment: 0 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Story text --- !u!1 &1913435018 GameObject: m_ObjectHideFlags: 0 @@ -16682,7 +18679,7 @@ MonoBehaviour: y: -340 width: 1114 height: 859 - selectedBlock: {fileID: 1913435022} + selectedBlocks: [] selectedCommands: [] variables: [] description: @@ -16738,6 +18735,8 @@ MonoBehaviour: y: 69 width: 120 height: 40 + tint: {r: 1, g: 1, b: 1, a: 1} + useCustomTint: 0 itemId: 0 blockName: Start description: @@ -16765,6 +18764,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: parentBlock: {fileID: 1913435022} + waitForFrames: 1 --- !u!114 &1913435024 MonoBehaviour: m_ObjectHideFlags: 2 @@ -17483,6 +19483,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: parentBlock: {fileID: 1985406184} + waitForFrames: 1 --- !u!114 &1985406184 MonoBehaviour: m_ObjectHideFlags: 2 @@ -17501,6 +19502,8 @@ MonoBehaviour: y: 70 width: 120 height: 40 + tint: {r: 1, g: 1, b: 1, a: 1} + useCustomTint: 0 itemId: 0 blockName: Start description: @@ -17531,7 +19534,7 @@ MonoBehaviour: y: -340 width: 1114 height: 859 - selectedBlock: {fileID: 1985406184} + selectedBlocks: [] selectedCommands: [] variables: [] description: @@ -18115,6 +20118,143 @@ CanvasRenderer: type: 2} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 2013319747} +--- !u!1 &2020093177 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 179118, guid: 3ddf9f33ba98e4b31ba4d2b9722bea00, type: 2} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 4: {fileID: 2020093178} + - 114: {fileID: 2020093183} + - 114: {fileID: 2020093182} + - 114: {fileID: 2020093181} + - 114: {fileID: 2020093180} + - 114: {fileID: 2020093179} + m_Layer: 0 + m_Name: Lua + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2020093178 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 466848, guid: 3ddf9f33ba98e4b31ba4d2b9722bea00, type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 2020093177} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 623407733} + m_RootOrder: 3 +--- !u!114 &2020093179 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 11437776, guid: 3ddf9f33ba98e4b31ba4d2b9722bea00, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 2020093177} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c10f0b861365b42b0928858f7b086ff3, type: 3} + m_Name: + m_EditorClassIdentifier: + fungusModule: 0 + activeLanguage: en + stringTables: [] + registerTypes: + - {fileID: 4900000, guid: 9c3ab7a98d51241bbb499643399fa761, type: 3} + - {fileID: 4900000, guid: 93fddea8208764a2dbb189cc238aed40, type: 3} +--- !u!114 &2020093180 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 11483650, guid: 3ddf9f33ba98e4b31ba4d2b9722bea00, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 2020093177} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ba19c26c1ba7243d2b57ebc4329cc7c6, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &2020093181 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 11499092, guid: 3ddf9f33ba98e4b31ba4d2b9722bea00, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 2020093177} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4cc8a659e950044b69d7c62696c36962, type: 3} + m_Name: + m_EditorClassIdentifier: + allEnvironments: 1 + luaEnvironment: {fileID: 2020093180} + tableName: + registerTypes: 1 + boundTypes: + - UnityEngine.GameObject, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + - UnityEngine.PrimitiveType, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + - UnityEngine.Component, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + - System.Type, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + - System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + - System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + - UnityEngine.SendMessageOptions, UnityEngine, Version=0.0.0.0, Culture=neutral, + PublicKeyToken=null + - UnityEngine.SceneManagement.Scene, UnityEngine, Version=0.0.0.0, Culture=neutral, + PublicKeyToken=null + - UnityEngine.Object, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + - System.Single, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + boundObjects: + - key: saydialoga + obj: {fileID: 1753914154} + component: {fileID: 0} + - key: saydialogb + obj: {fileID: 905215222} + component: {fileID: 0} + showInherited: 0 +--- !u!114 &2020093182 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 11417560, guid: 3ddf9f33ba98e4b31ba4d2b9722bea00, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 2020093177} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 446caeace65234baaacd52095d24f101, type: 3} + m_Name: + m_EditorClassIdentifier: + luaEnvironment: {fileID: 2020093180} + luaFile: {fileID: 0} + luaScript: "wait(2)\nif not saydialoga.active and saydialogb.active then\n pass()\nelse\n + \ fail()\nend\n" + runAsCoroutine: 1 +--- !u!114 &2020093183 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 11415008, guid: 3ddf9f33ba98e4b31ba4d2b9722bea00, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 2020093177} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6ee79785811ba49399c1b56d7309e3df, type: 3} + m_Name: + m_EditorClassIdentifier: + executeAfterTime: 1 + repeatExecuteTime: 1 + repeatEveryTime: 1 + executeAfterFrames: 1 + repeatExecuteFrame: 1 + repeatEveryFrame: 1 + executeMethods: 2 + executeMethodName: OnExecute --- !u!1 &2043226669 GameObject: m_ObjectHideFlags: 0 @@ -18177,7 +20317,7 @@ MonoBehaviour: y: -340 width: 1114 height: 859 - selectedBlock: {fileID: 2043226673} + selectedBlocks: [] selectedCommands: - {fileID: 2043226677} variables: [] @@ -18238,6 +20378,8 @@ MonoBehaviour: y: 69 width: 120 height: 40 + tint: {r: 1, g: 1, b: 1, a: 1} + useCustomTint: 0 itemId: 0 blockName: New Block description: @@ -18263,6 +20405,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: parentBlock: {fileID: 2043226673} + waitForFrames: 1 --- !u!114 &2043226675 MonoBehaviour: m_ObjectHideFlags: 2 @@ -18554,7 +20697,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!4 &2084461895 Transform: m_ObjectHideFlags: 0 From 0c84493c0e38103e685c83a4ee96ed90a68280fe Mon Sep 17 00:00:00 2001 From: Christopher Date: Mon, 14 Nov 2016 12:44:03 +0000 Subject: [PATCH 05/53] Updated SaveSystem --- Assets/Fungus/Scripts/Commands/Menu.cs | 4 +- .../Fungus/Scripts/Commands/SaveFlowchart.cs | 91 +- .../Scripts/Components/FungusManager.cs | 7 + .../Fungus/Scripts/Components/SaveHelper.cs | 34 + .../Scripts/Components/SaveHelper.cs.meta | 12 + .../Fungus/Scripts/Components/SaveManager.cs | 194 ++++ .../Scripts/Components/SaveManager.cs.meta | 12 + .../Scripts/Editor/SaveFlowchartEditor.cs | 6 +- Assets/Fungus/Scripts/Utils/SavePointData.cs | 57 - Assets/FungusExamples/SaveGame.meta | 9 + Assets/FungusExamples/SaveGame/Menu.unity | 1010 +++++++++++++++++ .../FungusExamples/SaveGame/Menu.unity.meta | 8 + Assets/FungusExamples/SaveGame/SceneA.unity | 976 ++++++++++++++++ .../FungusExamples/SaveGame/SceneA.unity.meta | 8 + 14 files changed, 2308 insertions(+), 120 deletions(-) create mode 100644 Assets/Fungus/Scripts/Components/SaveHelper.cs create mode 100644 Assets/Fungus/Scripts/Components/SaveHelper.cs.meta create mode 100644 Assets/Fungus/Scripts/Components/SaveManager.cs create mode 100644 Assets/Fungus/Scripts/Components/SaveManager.cs.meta create mode 100644 Assets/FungusExamples/SaveGame.meta create mode 100644 Assets/FungusExamples/SaveGame/Menu.unity create mode 100644 Assets/FungusExamples/SaveGame/Menu.unity.meta create mode 100644 Assets/FungusExamples/SaveGame/SceneA.unity create mode 100644 Assets/FungusExamples/SaveGame/SceneA.unity.meta diff --git a/Assets/Fungus/Scripts/Commands/Menu.cs b/Assets/Fungus/Scripts/Commands/Menu.cs index 8980c34f..458fd195 100644 --- a/Assets/Fungus/Scripts/Commands/Menu.cs +++ b/Assets/Fungus/Scripts/Commands/Menu.cs @@ -35,7 +35,9 @@ namespace Fungus [Tooltip("A custom Menu Dialog to use to display this menu. All subsequent Menu commands will use this dialog.")] [SerializeField] protected MenuDialog setMenuDialog; - #region Public member + #region Public members + + public MenuDialog SetMenuDialog { get { return setMenuDialog; } set { setMenuDialog = value; } } public override void OnEnter() { diff --git a/Assets/Fungus/Scripts/Commands/SaveFlowchart.cs b/Assets/Fungus/Scripts/Commands/SaveFlowchart.cs index 0c2be53f..5cca86f4 100644 --- a/Assets/Fungus/Scripts/Commands/SaveFlowchart.cs +++ b/Assets/Fungus/Scripts/Commands/SaveFlowchart.cs @@ -7,72 +7,45 @@ using System.Collections.Generic; namespace Fungus { - [CommandInfo("Variable", - "Save Flowchart", - "Saves the current Flowchart variable state to be loaded again in future.")] - public class SaveFlowchart : Command - { - [Tooltip("Key for storing save data in PlayerPrefs. Supports variable subsitution {$VarName} and will prepend a profile name set using Set Save Profile command.")] - [SerializeField] protected StringData saveKey = new StringData("savedata"); + [CommandInfo("Variable", + "Save Flowchart", + "Saves the current Flowchart variable state to be loaded again in future.")] + public class SaveFlowchart : Command + { + [SerializeField] protected Block resumeBlock; - [SerializeField] protected Block resumeBlock; + [SerializeField] protected bool saveImmediately; - // Make serialize data extensible (subclassing?) - // Save key, use save profile and variable substitution - // Store scene name, flowchart name and block name to execute after load - // Show link to Block to be executed + #region Public members - protected virtual string CreateSaveKey() - { - var flowchart = GetFlowchart(); - var saveProfile = SetSaveProfile.SaveProfile; - - if (saveProfile.Length > 0) - { - return string.Format(saveProfile + "_" + flowchart.SubstituteVariables(saveKey.Value)); - } - else - { - return string.Format(flowchart.SubstituteVariables(saveKey.Value)); - } - } - - protected virtual SavePointData CreateSaveData() - { - return SavePointData.Create(GetFlowchart(), resumeBlock.BlockName); - } - - protected virtual void StoreJSONData(string key, string jsonData) - { - if (key.Length > 0) - { - PlayerPrefs.SetString(key, jsonData); - } - } - - #region Public members + public override void OnEnter() + { + var saveManager = FungusManager.Instance.SaveManager; - public override void OnEnter() - { - var key = CreateSaveKey(); + saveManager.PopulateSaveBuffer(GetFlowchart(), resumeBlock.name); - var saveData = CreateSaveData(); - var saveDataJSON = JsonUtility.ToJson(saveData, true); + if (saveImmediately) + { + saveManager.Save(); + } - StoreJSONData(key, saveDataJSON); + Continue(); + } - Continue(); - } + public override string GetSummary() + { + if (resumeBlock == null) + { + return "Error: No resume block set"; + } - public override string GetSummary() - { - return saveKey.Value; - } + return resumeBlock.BlockName; + } - public override Color GetButtonColor() - { - return new Color32(235, 191, 217, 255); - } + public override Color GetButtonColor() + { + return new Color32(235, 191, 217, 255); + } public override void GetConnectedBlocks(ref List connectedBlocks) { @@ -82,6 +55,6 @@ namespace Fungus } } - #endregion - } + #endregion + } } \ No newline at end of file diff --git a/Assets/Fungus/Scripts/Components/FungusManager.cs b/Assets/Fungus/Scripts/Components/FungusManager.cs index 65bc0cad..7abe71f0 100644 --- a/Assets/Fungus/Scripts/Components/FungusManager.cs +++ b/Assets/Fungus/Scripts/Components/FungusManager.cs @@ -8,6 +8,7 @@ namespace Fungus /// [RequireComponent(typeof(CameraManager))] [RequireComponent(typeof(MusicManager))] + [RequireComponent(typeof(SaveManager))] public sealed class FungusManager : MonoBehaviour { static FungusManager instance; @@ -18,6 +19,7 @@ namespace Fungus { CameraManager = GetComponent(); MusicManager = GetComponent(); + SaveManager = GetComponent(); } /// @@ -45,6 +47,11 @@ namespace Fungus /// public MusicManager MusicManager { get; private set; } + /// + /// Gets the save manager singleton instance. + /// + public SaveManager SaveManager { get; private set; } + /// /// Gets the FungusManager singleton instance. /// diff --git a/Assets/Fungus/Scripts/Components/SaveHelper.cs b/Assets/Fungus/Scripts/Components/SaveHelper.cs new file mode 100644 index 00000000..5a249684 --- /dev/null +++ b/Assets/Fungus/Scripts/Components/SaveHelper.cs @@ -0,0 +1,34 @@ +using UnityEngine; +using System.Collections; +using UnityEngine.SceneManagement; + +namespace Fungus +{ + public class SaveHelper : MonoBehaviour + { + [SerializeField] protected string startScene = ""; + + public virtual void Load(int slot) + { + var saveManager = FungusManager.Instance.SaveManager; + saveManager.Load(slot, startScene); + } + + public virtual void Save() + { + var saveManager = FungusManager.Instance.SaveManager; + saveManager.Save(); + } + + public virtual void Delete(int slot) + { + var saveManager = FungusManager.Instance.SaveManager; + saveManager.Delete(slot); + } + + public virtual void LoadScene(string sceneName) + { + SceneManager.LoadScene(sceneName); + } + } +} \ No newline at end of file diff --git a/Assets/Fungus/Scripts/Components/SaveHelper.cs.meta b/Assets/Fungus/Scripts/Components/SaveHelper.cs.meta new file mode 100644 index 00000000..80115ee2 --- /dev/null +++ b/Assets/Fungus/Scripts/Components/SaveHelper.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: abe25ebf9ddc8416ead6f30d4671fdbf +timeCreated: 1478863843 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Fungus/Scripts/Components/SaveManager.cs b/Assets/Fungus/Scripts/Components/SaveManager.cs new file mode 100644 index 00000000..1bed20c3 --- /dev/null +++ b/Assets/Fungus/Scripts/Components/SaveManager.cs @@ -0,0 +1,194 @@ +using UnityEngine; +using UnityEngine.SceneManagement; + +namespace Fungus +{ + public class SaveManager : MonoBehaviour + { + const string ActiveSlotKey = "active_slot"; + + const string SlotKeyFormat = "slot{0}"; + + // Make serialize data extensible (subclassing?) + // Save key, use save profile and variable substitution + // Store scene name, flowchart name and block name to execute after load + // Show link to Block to be executed + // Handle New Save Slot case: Scene to load? + // Save command stores data in SaveManager for writing later + // If SaveImmediately is selected then save it straight away (SaveGame command) + // If not selected, then Save when a Save button is pressed + // Select / Load button - set active slot (in playerprefs) and load the state + // Get list of saved games + // Delete Save Game + // Rename SaveFlowchart to SaveGame + + protected string saveBuffer = ""; + + protected static SaveManager instance; + + protected virtual void Awake() + { + instance = this; + } + + protected virtual string FormatSaveKey(int slot) + { + return string.Format(SlotKeyFormat, slot); + } + + protected virtual bool LoadNewGame(string key, string startScene) + { + if (PlayerPrefs.HasKey(key) && + PlayerPrefs.GetString(key) != "") + { + return false; + } + + // Create a new save entry + PlayerPrefs.SetString(key, ""); + + // Load the start scene + SceneManager.LoadScene(startScene); + + return true; + } + + protected virtual string CreateSaveData(Flowchart flowchart, string resumeBlockName) + { + var saveData = new SavePointData(); + + // Store the scene, flowchart and block to execute on resume + saveData.sceneName = SceneManager.GetActiveScene().name; + saveData.flowchartName = flowchart.name; + saveData.resumeBlockName = resumeBlockName; + + for (int i = 0; i < flowchart.Variables.Count; i++) + { + var v = flowchart.Variables[i]; + + // Save string + var stringVariable = v as StringVariable; + if (stringVariable != null) + { + var d = new StringVar(); + d.key = stringVariable.Key; + d.value = stringVariable.Value; + saveData.stringVars.Add(d); + } + + // Save int + var intVariable = v as IntegerVariable; + if (intVariable != null) + { + var d = new IntVar(); + d.key = intVariable.Key; + d.value = intVariable.Value; + saveData.intVars.Add(d); + } + + // Save float + var floatVariable = v as FloatVariable; + if (floatVariable != null) + { + var d = new FloatVar(); + d.key = floatVariable.Key; + d.value = floatVariable.Value; + saveData.floatVars.Add(d); + } + + // Save bool + var boolVariable = v as BooleanVariable; + if (boolVariable != null) + { + var d = new BoolVar(); + d.key = boolVariable.Key; + d.value = boolVariable.Value; + saveData.boolVars.Add(d); + } + } + + return JsonUtility.ToJson(saveData, true); + } + + protected virtual void StoreJSONData(string key, string jsonData) + { + if (key.Length > 0) + { + PlayerPrefs.SetString(key, jsonData); + } + } + + #region Public members + + public static SaveManager Instance { get { return instance; } } + + public virtual int ActiveSlot + { + get + { + return PlayerPrefs.GetInt(ActiveSlotKey); + } + set + { + PlayerPrefs.SetInt(ActiveSlotKey, value); + } + } + + public virtual void Save() + { + if (saveBuffer == "") + { + // Nothing to save + return; + } + + var key = FormatSaveKey(ActiveSlot); + + PlayerPrefs.SetString(key, saveBuffer); + + saveBuffer = ""; + } + + public virtual void Load(int slot, string startScene = "") + { + ActiveSlot = slot; + + var key = FormatSaveKey(slot); + + if (LoadNewGame(key, startScene)) + { + return; + } + + // Load JSON data for active slot + // Convert to SavePointData + // Load scene + // Populate variables + // Execute Block and Label + } + + public virtual void Delete(int slot) + { + var key = FormatSaveKey(slot); + PlayerPrefs.DeleteKey(key); + } + + public virtual void PopulateSaveBuffer(Flowchart flowchart, string resumeBlockName) + { + var block = flowchart.GetBlock("BlockName"); + + foreach (var command in block.CommandList) + { + if (command is Menu) + { + + } + } + + + saveBuffer = CreateSaveData(flowchart, resumeBlockName); + } + + #endregion + } +} \ No newline at end of file diff --git a/Assets/Fungus/Scripts/Components/SaveManager.cs.meta b/Assets/Fungus/Scripts/Components/SaveManager.cs.meta new file mode 100644 index 00000000..e910d92a --- /dev/null +++ b/Assets/Fungus/Scripts/Components/SaveManager.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 7cbb6770b607545c4909850d54df3979 +timeCreated: 1478861365 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Fungus/Scripts/Editor/SaveFlowchartEditor.cs b/Assets/Fungus/Scripts/Editor/SaveFlowchartEditor.cs index 125a8a90..1fb9565f 100644 --- a/Assets/Fungus/Scripts/Editor/SaveFlowchartEditor.cs +++ b/Assets/Fungus/Scripts/Editor/SaveFlowchartEditor.cs @@ -10,16 +10,16 @@ namespace Fungus.EditorUtils [CustomEditor(typeof(SaveFlowchart))] public class SaveFlowchartEditor : CommandEditor { - protected SerializedProperty saveKeyProp; protected SerializedProperty resumeBlockProp; + protected SerializedProperty saveImmediatelyProp; protected virtual void OnEnable() { if (NullTargetCheck()) // Check for an orphaned editor instance return; - saveKeyProp = serializedObject.FindProperty("saveKey"); resumeBlockProp = serializedObject.FindProperty("resumeBlock"); + saveImmediatelyProp = serializedObject.FindProperty("saveImmediately"); } public override void DrawCommandGUI() @@ -32,11 +32,11 @@ namespace Fungus.EditorUtils serializedObject.Update(); - EditorGUILayout.PropertyField(saveKeyProp); BlockEditor.BlockField(resumeBlockProp, new GUIContent("Resume Block", "Block to call when save data is loaded again"), new GUIContent(""), flowchart); + EditorGUILayout.PropertyField(saveImmediatelyProp); serializedObject.ApplyModifiedProperties(); } diff --git a/Assets/Fungus/Scripts/Utils/SavePointData.cs b/Assets/Fungus/Scripts/Utils/SavePointData.cs index 0540c5ed..89dc1544 100644 --- a/Assets/Fungus/Scripts/Utils/SavePointData.cs +++ b/Assets/Fungus/Scripts/Utils/SavePointData.cs @@ -44,63 +44,6 @@ namespace Fungus public List floatVars = new List(); public List boolVars = new List(); - public static SavePointData Create(Flowchart flowchart, string resumeBlockName) - { - var saveData = new SavePointData(); - - // Store the scene, flowchart and block to execute on resume - saveData.sceneName = SceneManager.GetActiveScene().name; - saveData.flowchartName = flowchart.name; - saveData.resumeBlockName = resumeBlockName; - - for (int i = 0; i < flowchart.Variables.Count; i++) - { - var v = flowchart.Variables[i]; - - // Save string - var stringVariable = v as StringVariable; - if (stringVariable != null) - { - var d = new StringVar(); - d.key = stringVariable.Key; - d.value = stringVariable.Value; - saveData.stringVars.Add(d); - } - - // Save int - var intVariable = v as IntegerVariable; - if (intVariable != null) - { - var d = new IntVar(); - d.key = intVariable.Key; - d.value = intVariable.Value; - saveData.intVars.Add(d); - } - - // Save float - var floatVariable = v as FloatVariable; - if (floatVariable != null) - { - var d = new FloatVar(); - d.key = floatVariable.Key; - d.value = floatVariable.Value; - saveData.floatVars.Add(d); - } - - // Save bool - var boolVariable = v as BooleanVariable; - if (boolVariable != null) - { - var d = new BoolVar(); - d.key = boolVariable.Key; - d.value = boolVariable.Value; - saveData.boolVars.Add(d); - } - } - - return saveData; - } - public static void ResumeSavedState(SavePointData saveData) { var go = GameObject.Find(saveData.flowchartName); diff --git a/Assets/FungusExamples/SaveGame.meta b/Assets/FungusExamples/SaveGame.meta new file mode 100644 index 00000000..fa5b6509 --- /dev/null +++ b/Assets/FungusExamples/SaveGame.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 02853ba7546b74a7cb03cdd14f1ab055 +folderAsset: yes +timeCreated: 1478862076 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FungusExamples/SaveGame/Menu.unity b/Assets/FungusExamples/SaveGame/Menu.unity new file mode 100644 index 00000000..a0d1260a --- /dev/null +++ b/Assets/FungusExamples/SaveGame/Menu.unity @@ -0,0 +1,1010 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +SceneSettings: + m_ObjectHideFlags: 0 + m_PVSData: + m_PVSObjectsArray: [] + m_PVSPortalsArray: [] + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 7 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 3 + m_SkyboxMaterial: {fileID: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1} +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 7 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_TemporalCoherenceThreshold: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 0 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 4 + m_Resolution: 2 + m_BakeResolution: 40 + m_TextureWidth: 1024 + m_TextureHeight: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_DirectLightInLightProbes: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_LightingDataAsset: {fileID: 0} + m_RuntimeCPUUsage: 25 +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + accuratePlacement: 0 + minRegionArea: 2 + cellSize: 0.16666667 + manualCellSize: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &76757867 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 4: {fileID: 76757869} + - 114: {fileID: 76757868} + m_Layer: 0 + m_Name: SaveHelper + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &76757868 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 76757867} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: abe25ebf9ddc8416ead6f30d4671fdbf, type: 3} + m_Name: + m_EditorClassIdentifier: + startScene: SceneA +--- !u!4 &76757869 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 76757867} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 891, y: 447, 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: 2 +--- !u!1 &153708816 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 4: {fileID: 153708819} + - 114: {fileID: 153708818} + - 114: {fileID: 153708817} + m_Layer: 0 + m_Name: EventSystem + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &153708817 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 153708816} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1077351063, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_HorizontalAxis: Horizontal + m_VerticalAxis: Vertical + m_SubmitButton: Submit + m_CancelButton: Cancel + m_InputActionsPerSecond: 10 + m_RepeatDelay: 0.5 + m_ForceModuleActive: 0 +--- !u!114 &153708818 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 153708816} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -619905303, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_FirstSelected: {fileID: 0} + m_sendNavigationEvents: 1 + m_DragThreshold: 5 +--- !u!4 &153708819 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 153708816} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, 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 &274184158 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 224: {fileID: 274184159} + - 222: {fileID: 274184161} + - 114: {fileID: 274184160} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &274184159 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 274184158} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 1299738400} + m_RootOrder: 0 + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &274184160 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 274184158} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + 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: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 14 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 10 + m_MaxSize: 40 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Save slot 2 +--- !u!222 &274184161 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 274184158} +--- !u!1 &342006597 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 224: {fileID: 342006598} + - 222: {fileID: 342006600} + - 114: {fileID: 342006599} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &342006598 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 342006597} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 1185983301} + m_RootOrder: 0 + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &342006599 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 342006597} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + 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: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 14 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 10 + m_MaxSize: 40 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: 'Save slot 1 + +' +--- !u!222 &342006600 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 342006597} +--- !u!1 &554677436 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 224: {fileID: 554677437} + - 222: {fileID: 554677439} + - 114: {fileID: 554677438} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &554677437 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 554677436} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 1744305195} + m_RootOrder: 0 + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &554677438 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 554677436} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + 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: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 14 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 10 + m_MaxSize: 40 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: 'Save slot 3 + +' +--- !u!222 &554677439 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 554677436} +--- !u!1 &632429687 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 224: {fileID: 632429691} + - 223: {fileID: 632429690} + - 114: {fileID: 632429689} + - 114: {fileID: 632429688} + m_Layer: 5 + m_Name: Canvas + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &632429688 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 632429687} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1301386320, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreReversedGraphics: 1 + m_BlockingObjects: 0 + m_BlockingMask: + serializedVersion: 2 + m_Bits: 4294967295 +--- !u!114 &632429689 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 632429687} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1980459831, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UiScaleMode: 0 + m_ReferencePixelsPerUnit: 100 + m_ScaleFactor: 1 + m_ReferenceResolution: {x: 800, y: 600} + m_ScreenMatchMode: 0 + m_MatchWidthOrHeight: 0 + m_PhysicalUnit: 3 + m_FallbackScreenDPI: 96 + m_DefaultSpriteDPI: 96 + m_DynamicPixelsPerUnit: 1 +--- !u!223 &632429690 +Canvas: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 632429687} + m_Enabled: 1 + serializedVersion: 2 + m_RenderMode: 0 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_TargetDisplay: 0 +--- !u!224 &632429691 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 632429687} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0, y: 0, z: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: + - {fileID: 1185983301} + - {fileID: 1299738400} + - {fileID: 1744305195} + m_Father: {fileID: 0} + m_RootOrder: 3 + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0, y: 0} +--- !u!1 &829939242 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 4: {fileID: 829939244} + - 114: {fileID: 829939243} + m_Layer: 0 + m_Name: _FungusState + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &829939243 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 829939242} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 61dddfdc5e0e44ca298d8f46f7f5a915, type: 3} + m_Name: + m_EditorClassIdentifier: + selectedFlowchart: {fileID: 0} +--- !u!4 &829939244 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 829939242} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, 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: 1 +--- !u!1 &967041285 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 4: {fileID: 967041290} + - 20: {fileID: 967041289} + - 92: {fileID: 967041288} + - 124: {fileID: 967041287} + - 81: {fileID: 967041286} + m_Layer: 0 + m_Name: Main Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!81 &967041286 +AudioListener: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 967041285} + m_Enabled: 1 +--- !u!124 &967041287 +Behaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 967041285} + m_Enabled: 1 +--- !u!92 &967041288 +Behaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 967041285} + m_Enabled: 1 +--- !u!20 &967041289 +Camera: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 967041285} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 1 + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 1000 + field of view: 60 + orthographic: 1 + orthographic size: 5 + m_Depth: -1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 + m_StereoMirrorMode: 0 +--- !u!4 &967041290 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 967041285} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -10} + 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!1 &1185983300 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 224: {fileID: 1185983301} + - 222: {fileID: 1185983304} + - 114: {fileID: 1185983303} + - 114: {fileID: 1185983302} + m_Layer: 5 + m_Name: SaveSlot1 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1185983301 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1185983300} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: + - {fileID: 342006598} + m_Father: {fileID: 632429691} + m_RootOrder: 0 + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0, y: 112} + m_SizeDelta: {x: 160, y: 30} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1185983302 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1185983300} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1392445389, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 1185983303} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 76757868} + m_MethodName: Load + m_Mode: 3 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 1 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 + m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null +--- !u!114 &1185983303 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1185983300} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!222 &1185983304 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1185983300} +--- !u!1 &1299738399 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 224: {fileID: 1299738400} + - 222: {fileID: 1299738403} + - 114: {fileID: 1299738402} + - 114: {fileID: 1299738401} + m_Layer: 5 + m_Name: SaveSlot2 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1299738400 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1299738399} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: + - {fileID: 274184159} + m_Father: {fileID: 632429691} + m_RootOrder: 1 + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0, y: 82} + m_SizeDelta: {x: 160, y: 30} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1299738401 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1299738399} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1392445389, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 1299738402} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 76757868} + m_MethodName: Load + m_Mode: 3 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 2 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 + m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null +--- !u!114 &1299738402 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1299738399} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!222 &1299738403 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1299738399} +--- !u!1 &1744305194 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 224: {fileID: 1744305195} + - 222: {fileID: 1744305198} + - 114: {fileID: 1744305197} + - 114: {fileID: 1744305196} + m_Layer: 5 + m_Name: SaveSlot3 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1744305195 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1744305194} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: + - {fileID: 554677437} + m_Father: {fileID: 632429691} + m_RootOrder: 2 + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0, y: 52} + m_SizeDelta: {x: 160, y: 30} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1744305196 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1744305194} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1392445389, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 1744305197} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 76757868} + m_MethodName: Load + m_Mode: 3 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 3 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 + m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null +--- !u!114 &1744305197 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1744305194} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!222 &1744305198 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1744305194} diff --git a/Assets/FungusExamples/SaveGame/Menu.unity.meta b/Assets/FungusExamples/SaveGame/Menu.unity.meta new file mode 100644 index 00000000..c5bc0d89 --- /dev/null +++ b/Assets/FungusExamples/SaveGame/Menu.unity.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: dbf229e62963146f09d60e4deab20791 +timeCreated: 1478862090 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FungusExamples/SaveGame/SceneA.unity b/Assets/FungusExamples/SaveGame/SceneA.unity new file mode 100644 index 00000000..07c45bae --- /dev/null +++ b/Assets/FungusExamples/SaveGame/SceneA.unity @@ -0,0 +1,976 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +SceneSettings: + m_ObjectHideFlags: 0 + m_PVSData: + m_PVSObjectsArray: [] + m_PVSPortalsArray: [] + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 7 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 3 + m_SkyboxMaterial: {fileID: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1} +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 7 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_TemporalCoherenceThreshold: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 0 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 4 + m_Resolution: 2 + m_BakeResolution: 40 + m_TextureWidth: 1024 + m_TextureHeight: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_DirectLightInLightProbes: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_LightingDataAsset: {fileID: 0} + m_RuntimeCPUUsage: 25 +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + accuratePlacement: 0 + minRegionArea: 2 + cellSize: 0.16666667 + manualCellSize: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &27697867 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 142980, guid: 5e7fbc8d4eb714b279eeeef2262c1e1a, type: 2} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 4: {fileID: 27697872} + - 114: {fileID: 27697871} + - 114: {fileID: 27697870} + - 114: {fileID: 27697869} + - 114: {fileID: 27697868} + - 114: {fileID: 27697873} + m_Layer: 0 + m_Name: Flowchart + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &27697868 +MonoBehaviour: + m_ObjectHideFlags: 2 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 27697867} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ec422cd568a9c4a31ad7c36d0572b9da, type: 3} + m_Name: + m_EditorClassIdentifier: + itemId: 1 + indentLevel: 0 + storyText: This is the start of the game. + description: + character: {fileID: 0} + portrait: {fileID: 0} + voiceOverClip: {fileID: 0} + showAlways: 1 + showCount: 1 + extendPrevious: 0 + fadeWhenDone: 1 + waitForClick: 1 + stopVoiceover: 1 + setSayDialog: {fileID: 0} +--- !u!114 &27697869 +MonoBehaviour: + m_ObjectHideFlags: 2 + m_PrefabParentObject: {fileID: 11462346, guid: 5e7fbc8d4eb714b279eeeef2262c1e1a, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 27697867} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d2f6487d21a03404cb21b245f0242e79, type: 3} + m_Name: + m_EditorClassIdentifier: + parentBlock: {fileID: 27697870} + waitForFrames: 1 +--- !u!114 &27697870 +MonoBehaviour: + m_ObjectHideFlags: 2 + m_PrefabParentObject: {fileID: 11433304, guid: 5e7fbc8d4eb714b279eeeef2262c1e1a, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 27697867} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3d3d73aef2cfc4f51abf34ac00241f60, type: 3} + m_Name: + m_EditorClassIdentifier: + nodeRect: + serializedVersion: 2 + x: 67 + y: 70 + width: 120 + height: 40 + tint: {r: 1, g: 1, b: 1, a: 1} + useCustomTint: 0 + itemId: 0 + blockName: Start + description: + eventHandler: {fileID: 27697869} + commandList: + - {fileID: 27697868} +--- !u!114 &27697871 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 11430050, guid: 5e7fbc8d4eb714b279eeeef2262c1e1a, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 27697867} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7a334fe2ffb574b3583ff3b18b4792d3, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 1 + scrollPos: {x: 0, y: 0} + variablesScrollPos: {x: 0, y: 0} + variablesExpanded: 1 + blockViewHeight: 400 + zoom: 1 + scrollViewRect: + serializedVersion: 2 + x: -343 + y: -340 + width: 1114 + height: 859 + selectedBlocks: [] + selectedCommands: [] + variables: + - {fileID: 27697873} + description: + stepPause: 0 + colorCommands: 1 + hideComponents: 1 + saveSelection: 1 + localizationId: + showLineNumbers: 0 + hideCommands: [] + luaEnvironment: {fileID: 0} + luaBindingName: flowchart +--- !u!4 &27697872 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 467082, guid: 5e7fbc8d4eb714b279eeeef2262c1e1a, type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 27697867} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, 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: 2 +--- !u!114 &27697873 +MonoBehaviour: + m_ObjectHideFlags: 2 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 27697867} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: afb91b566ceda411bad1e9d3c3243ecc, type: 3} + m_Name: + m_EditorClassIdentifier: + scope: 0 + key: Count + value: 0 +--- !u!1 &132834842 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 224: {fileID: 132834843} + - 222: {fileID: 132834845} + - 114: {fileID: 132834844} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &132834843 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 132834842} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 355380715} + m_RootOrder: 0 + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &132834844 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 132834842} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + 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: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 14 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 10 + m_MaxSize: 40 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: 'Save + +' +--- !u!222 &132834845 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 132834842} +--- !u!1 &355380714 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 224: {fileID: 355380715} + - 222: {fileID: 355380718} + - 114: {fileID: 355380717} + - 114: {fileID: 355380716} + m_Layer: 5 + m_Name: Save + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &355380715 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 355380714} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: + - {fileID: 132834843} + m_Father: {fileID: 1186631044} + m_RootOrder: 0 + m_AnchorMin: {x: 1, y: 1} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: -110, y: -34} + m_SizeDelta: {x: 160, y: 30} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &355380716 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 355380714} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1392445389, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 355380717} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 1657224899} + m_MethodName: Save + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 + m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null +--- !u!114 &355380717 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 355380714} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!222 &355380718 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 355380714} +--- !u!1 &559390319 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 224: {fileID: 559390320} + - 222: {fileID: 559390323} + - 114: {fileID: 559390322} + - 114: {fileID: 559390321} + m_Layer: 5 + m_Name: Menu + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &559390320 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 559390319} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: + - {fileID: 1675792275} + m_Father: {fileID: 1186631044} + m_RootOrder: 1 + m_AnchorMin: {x: 1, y: 1} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: -110, y: -70} + m_SizeDelta: {x: 160, y: 30} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &559390321 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 559390319} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1392445389, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 559390322} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 1657224899} + m_MethodName: LoadScene + m_Mode: 5 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: Menu + m_BoolArgument: 0 + m_CallState: 2 + m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null +--- !u!114 &559390322 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 559390319} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!222 &559390323 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 559390319} +--- !u!1 &1186631040 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 224: {fileID: 1186631044} + - 223: {fileID: 1186631043} + - 114: {fileID: 1186631042} + - 114: {fileID: 1186631041} + m_Layer: 5 + m_Name: Canvas + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1186631041 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1186631040} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1301386320, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreReversedGraphics: 1 + m_BlockingObjects: 0 + m_BlockingMask: + serializedVersion: 2 + m_Bits: 4294967295 +--- !u!114 &1186631042 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1186631040} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1980459831, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UiScaleMode: 0 + m_ReferencePixelsPerUnit: 100 + m_ScaleFactor: 1 + m_ReferenceResolution: {x: 800, y: 600} + m_ScreenMatchMode: 0 + m_MatchWidthOrHeight: 0 + m_PhysicalUnit: 3 + m_FallbackScreenDPI: 96 + m_DefaultSpriteDPI: 96 + m_DynamicPixelsPerUnit: 1 +--- !u!223 &1186631043 +Canvas: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1186631040} + m_Enabled: 1 + serializedVersion: 2 + m_RenderMode: 0 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_TargetDisplay: 0 +--- !u!224 &1186631044 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1186631040} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0, y: 0, z: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: + - {fileID: 355380715} + - {fileID: 559390320} + m_Father: {fileID: 0} + m_RootOrder: 5 + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0, y: 0} +--- !u!1 &1277384715 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 4: {fileID: 1277384720} + - 20: {fileID: 1277384719} + - 92: {fileID: 1277384718} + - 124: {fileID: 1277384717} + - 81: {fileID: 1277384716} + m_Layer: 0 + m_Name: Main Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!81 &1277384716 +AudioListener: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1277384715} + m_Enabled: 1 +--- !u!124 &1277384717 +Behaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1277384715} + m_Enabled: 1 +--- !u!92 &1277384718 +Behaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1277384715} + m_Enabled: 1 +--- !u!20 &1277384719 +Camera: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1277384715} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 1 + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 1000 + field of view: 60 + orthographic: 1 + orthographic size: 5 + m_Depth: -1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 + m_StereoMirrorMode: 0 +--- !u!4 &1277384720 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1277384715} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -10} + 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!1 &1383952654 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 4: {fileID: 1383952658} + - 114: {fileID: 1383952657} + - 114: {fileID: 1383952656} + - 114: {fileID: 1383952655} + m_Layer: 0 + m_Name: EventSystem + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1383952655 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1383952654} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1997211142, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_ForceModuleActive: 0 +--- !u!114 &1383952656 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1383952654} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1077351063, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_HorizontalAxis: Horizontal + m_VerticalAxis: Vertical + m_SubmitButton: Submit + m_CancelButton: Cancel + m_InputActionsPerSecond: 10 + m_RepeatDelay: 0.5 + m_ForceModuleActive: 0 +--- !u!114 &1383952657 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1383952654} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -619905303, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_FirstSelected: {fileID: 0} + m_sendNavigationEvents: 1 + m_DragThreshold: 5 +--- !u!4 &1383952658 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1383952654} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, 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: 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 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1657224898} + m_Enabled: 1 + m_EditorHideFlags: 0 + 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 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 224: {fileID: 1675792275} + - 222: {fileID: 1675792277} + - 114: {fileID: 1675792276} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1675792275 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1675792274} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 559390320} + m_RootOrder: 0 + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1675792276 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1675792274} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + 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: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 14 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 10 + m_MaxSize: 40 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: 'Menu + +' +--- !u!222 &1675792277 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1675792274} +--- !u!1 &1743048769 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 4: {fileID: 1743048771} + - 114: {fileID: 1743048770} + m_Layer: 0 + m_Name: _FungusState + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1743048770 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1743048769} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 61dddfdc5e0e44ca298d8f46f7f5a915, type: 3} + m_Name: + m_EditorClassIdentifier: + selectedFlowchart: {fileID: 27697871} +--- !u!4 &1743048771 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1743048769} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, 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: 1 diff --git a/Assets/FungusExamples/SaveGame/SceneA.unity.meta b/Assets/FungusExamples/SaveGame/SceneA.unity.meta new file mode 100644 index 00000000..6bb85634 --- /dev/null +++ b/Assets/FungusExamples/SaveGame/SceneA.unity.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2365f3ac29d33498093d923ed8ef3c42 +timeCreated: 1478865289 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: From b642fb5522254a55f6af2018b680a3ea36ab2f62 Mon Sep 17 00:00:00 2001 From: Christopher Date: Mon, 14 Nov 2016 15:34:02 +0000 Subject: [PATCH 06/53] Loading of saved data --- .../Fungus/Scripts/Commands/LoadFlowchart.cs | 59 +-------- .../Fungus/Scripts/Components/SaveManager.cs | 81 +++++++++--- Assets/Fungus/Scripts/Utils/SavePointData.cs | 118 ++++++------------ 3 files changed, 109 insertions(+), 149 deletions(-) diff --git a/Assets/Fungus/Scripts/Commands/LoadFlowchart.cs b/Assets/Fungus/Scripts/Commands/LoadFlowchart.cs index 05f066c5..5800344f 100644 --- a/Assets/Fungus/Scripts/Commands/LoadFlowchart.cs +++ b/Assets/Fungus/Scripts/Commands/LoadFlowchart.cs @@ -12,71 +12,20 @@ namespace Fungus "Loads a previously saved Flowchart state. The original scene is loaded and the resume block is executed.")] public class LoadFlowchart : Command { - [Tooltip("Key for loading the saves data from PlayerPrefs. Supports variable subsitution {$VarName} and will prepend a profile name set using Set Save Profile command.")] - [SerializeField] protected StringData saveKey = new StringData("savedata"); - - protected SavePointData tempSaveData; - - protected virtual string CreateSaveKey() - { - var flowchart = GetFlowchart(); - var saveProfile = SetSaveProfile.SaveProfile; - - if (saveProfile.Length > 0) - { - return string.Format(saveProfile + "_" + flowchart.SubstituteVariables(saveKey.Value)); - } - else - { - return string.Format(flowchart.SubstituteVariables(saveKey.Value)); - } - } - - protected virtual string LoadJSONData(string key) - { - return PlayerPrefs.GetString(key); - } - - protected virtual void LoadSavedState(string jsonData) - { - tempSaveData = JsonUtility.FromJson(jsonData); - - SceneManager.sceneLoaded += OnSceneLoaded; - - // Load scene and wait - SceneManager.LoadScene(tempSaveData.sceneName); - } - - protected virtual void OnSceneLoaded(Scene scene, LoadSceneMode mode) - { - if (scene.name == tempSaveData.sceneName) - { - SavePointData.ResumeSavedState(tempSaveData); - } - - SceneManager.sceneLoaded -= OnSceneLoaded; - } + [SerializeField] protected IntegerData saveSlot = new IntegerData(0); #region Public members public override void OnEnter() { - var key = CreateSaveKey(); - var jsonData = LoadJSONData(key); - - if (jsonData == "") - { - // Save data not found, continue executing block - Continue(); - return; - } + var saveManager = FungusManager.Instance.SaveManager; - LoadSavedState(jsonData); + saveManager.Load(0); } public override string GetSummary() { - return saveKey.Value; + return saveSlot.Value.ToString(); } public override Color GetButtonColor() diff --git a/Assets/Fungus/Scripts/Components/SaveManager.cs b/Assets/Fungus/Scripts/Components/SaveManager.cs index 1bed20c3..6f9da2e9 100644 --- a/Assets/Fungus/Scripts/Components/SaveManager.cs +++ b/Assets/Fungus/Scripts/Components/SaveManager.cs @@ -26,6 +26,8 @@ namespace Fungus protected static SaveManager instance; + protected SavePointData tempSaveData; + protected virtual void Awake() { instance = this; @@ -110,6 +112,44 @@ namespace Fungus return JsonUtility.ToJson(saveData, true); } + protected virtual void RestoreSavedGame(SavePointData saveData) + { + var go = GameObject.Find(saveData.flowchartName); + if (go == null) + { + return; + } + + var flowchart = go.GetComponent(); + if (flowchart == null) + { + return; + } + + for (int i = 0; i < saveData.boolVars.Count; i++) + { + var boolVar = saveData.boolVars[i]; + flowchart.SetBooleanVariable(boolVar.key, boolVar.value); + } + for (int i = 0; i < saveData.intVars.Count; i++) + { + var intVar = saveData.intVars[i]; + flowchart.SetIntegerVariable(intVar.key, intVar.value); + } + for (int i = 0; i < saveData.floatVars.Count; i++) + { + var floatVar = saveData.floatVars[i]; + flowchart.SetFloatVariable(floatVar.key, floatVar.value); + } + for (int i = 0; i < saveData.stringVars.Count; i++) + { + var stringVar = saveData.stringVars[i]; + flowchart.SetStringVariable(stringVar.key, stringVar.value); + } + + flowchart.ExecuteBlock(saveData.resumeBlockName); + } + protected virtual void StoreJSONData(string key, string jsonData) { if (key.Length > 0) @@ -118,6 +158,26 @@ namespace Fungus } } + protected virtual string LoadJSONData(string key) + { + if (key.Length > 0) + { + return PlayerPrefs.GetString(key); + } + + return ""; + } + + protected virtual void OnSceneLoaded(Scene scene, LoadSceneMode mode) + { + if (scene.name == tempSaveData.sceneName) + { + RestoreSavedGame(tempSaveData); + } + + SceneManager.sceneLoaded -= OnSceneLoaded; + } + #region Public members public static SaveManager Instance { get { return instance; } } @@ -160,11 +220,11 @@ namespace Fungus return; } - // Load JSON data for active slot - // Convert to SavePointData - // Load scene - // Populate variables - // Execute Block and Label + var jsonData = LoadJSONData(key); + tempSaveData = JsonUtility.FromJson(jsonData); + + SceneManager.sceneLoaded += OnSceneLoaded; + SceneManager.LoadScene(tempSaveData.sceneName); } public virtual void Delete(int slot) @@ -175,17 +235,6 @@ namespace Fungus public virtual void PopulateSaveBuffer(Flowchart flowchart, string resumeBlockName) { - var block = flowchart.GetBlock("BlockName"); - - foreach (var command in block.CommandList) - { - if (command is Menu) - { - - } - } - - saveBuffer = CreateSaveData(flowchart, resumeBlockName); } diff --git a/Assets/Fungus/Scripts/Utils/SavePointData.cs b/Assets/Fungus/Scripts/Utils/SavePointData.cs index 89dc1544..45a2e889 100644 --- a/Assets/Fungus/Scripts/Utils/SavePointData.cs +++ b/Assets/Fungus/Scripts/Utils/SavePointData.cs @@ -4,82 +4,44 @@ using UnityEngine.SceneManagement; namespace Fungus { - [System.Serializable] - public class StringVar - { - public string key; - public string value; - } - - [System.Serializable] - public class IntVar - { - public string key; - public int value; - } - - [System.Serializable] - public class FloatVar - { - public string key; - public float value; - } - - [System.Serializable] - public class BoolVar - { - public string key; - public bool value; - } - - [System.Serializable] - public class SavePointData - { - public string sceneName; - public string flowchartName; - public string resumeBlockName; - - public List stringVars = new List(); - public List intVars = new List(); - public List floatVars = new List(); - public List boolVars = new List(); - - public static void ResumeSavedState(SavePointData saveData) - { - var go = GameObject.Find(saveData.flowchartName); - if (go == null) - { - return; - } - - var flowchart = go.GetComponent(); - if (flowchart == null) - { - return; - } - - for (int i = 0; i < saveData.boolVars.Count; i++) - { - var boolVar = saveData.boolVars[i]; - flowchart.SetBooleanVariable(boolVar.key, boolVar.value); - } - for (int i = 0; i < saveData.intVars.Count; i++) - { - var intVar = saveData.intVars[i]; - flowchart.SetIntegerVariable(intVar.key, intVar.value); - } - for (int i = 0; i < saveData.floatVars.Count; i++) - { - var floatVar = saveData.floatVars[i]; - flowchart.SetFloatVariable(floatVar.key, floatVar.value); - } - for (int i = 0; i < saveData.stringVars.Count; i++) - { - var stringVar = saveData.stringVars[i]; - flowchart.SetStringVariable(stringVar.key, stringVar.value); - } - - flowchart.ExecuteBlock(saveData.resumeBlockName); - } - } + [System.Serializable] + public class StringVar + { + public string key; + public string value; + } + + [System.Serializable] + public class IntVar + { + public string key; + public int value; + } + + [System.Serializable] + public class FloatVar + { + public string key; + public float value; + } + + [System.Serializable] + public class BoolVar + { + public string key; + public bool value; + } + + [System.Serializable] + public class SavePointData + { + public string sceneName; + public string flowchartName; + public string resumeBlockName; + + public List stringVars = new List(); + public List intVars = new List(); + public List floatVars = new List(); + public List boolVars = new List(); + } } \ No newline at end of file From 80f47a80ea9294d028274a1e106e71bcde4842d9 Mon Sep 17 00:00:00 2001 From: Christopher Date: Mon, 14 Nov 2016 15:38:12 +0000 Subject: [PATCH 07/53] Fixed block name not saving correctly --- Assets/Fungus/Scripts/Commands/SaveFlowchart.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Assets/Fungus/Scripts/Commands/SaveFlowchart.cs b/Assets/Fungus/Scripts/Commands/SaveFlowchart.cs index 5cca86f4..20ff7240 100644 --- a/Assets/Fungus/Scripts/Commands/SaveFlowchart.cs +++ b/Assets/Fungus/Scripts/Commands/SaveFlowchart.cs @@ -22,7 +22,7 @@ namespace Fungus { var saveManager = FungusManager.Instance.SaveManager; - saveManager.PopulateSaveBuffer(GetFlowchart(), resumeBlock.name); + saveManager.PopulateSaveBuffer(GetFlowchart(), resumeBlock.BlockName); if (saveImmediately) { From 43a8aabccfbd185ae84e02344c77e685a9816fe5 Mon Sep 17 00:00:00 2001 From: Christopher Date: Mon, 14 Nov 2016 15:46:18 +0000 Subject: [PATCH 08/53] Renamed save commands --- .../{LoadFlowchart.cs => LoadGame.cs} | 10 +-- ...LoadFlowchart.cs.meta => LoadGame.cs.meta} | 0 .../{SaveFlowchart.cs => SavePoint.cs} | 10 +-- ...aveFlowchart.cs.meta => SavePoint.cs.meta} | 0 ...eFlowchartEditor.cs => SavePointEditor.cs} | 16 ++-- ...Editor.cs.meta => SavePointEditor.cs.meta} | 0 Assets/FungusExamples/SaveGame/SceneA.unity | 85 +++++++++++++++++-- ProjectSettings/EditorBuildSettings.asset | 4 +- 8 files changed, 98 insertions(+), 27 deletions(-) rename Assets/Fungus/Scripts/Commands/{LoadFlowchart.cs => LoadGame.cs} (73%) rename Assets/Fungus/Scripts/Commands/{LoadFlowchart.cs.meta => LoadGame.cs.meta} (100%) rename Assets/Fungus/Scripts/Commands/{SaveFlowchart.cs => SavePoint.cs} (84%) rename Assets/Fungus/Scripts/Commands/{SaveFlowchart.cs.meta => SavePoint.cs.meta} (100%) rename Assets/Fungus/Scripts/Editor/{SaveFlowchartEditor.cs => SavePointEditor.cs} (67%) rename Assets/Fungus/Scripts/Editor/{SaveFlowchartEditor.cs.meta => SavePointEditor.cs.meta} (100%) diff --git a/Assets/Fungus/Scripts/Commands/LoadFlowchart.cs b/Assets/Fungus/Scripts/Commands/LoadGame.cs similarity index 73% rename from Assets/Fungus/Scripts/Commands/LoadFlowchart.cs rename to Assets/Fungus/Scripts/Commands/LoadGame.cs index 5800344f..ed661912 100644 --- a/Assets/Fungus/Scripts/Commands/LoadFlowchart.cs +++ b/Assets/Fungus/Scripts/Commands/LoadGame.cs @@ -2,15 +2,13 @@ // It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) using UnityEngine; -using UnityEngine.SceneManagement; -using System.Collections.Generic; namespace Fungus { [CommandInfo("Variable", - "Load Flowchart", - "Loads a previously saved Flowchart state. The original scene is loaded and the resume block is executed.")] - public class LoadFlowchart : Command + "Load Game", + "Loads a previously saved game. The original scene is loaded and the resume block is executed.")] + public class LoadGame : Command { [SerializeField] protected IntegerData saveSlot = new IntegerData(0); @@ -20,7 +18,7 @@ namespace Fungus { var saveManager = FungusManager.Instance.SaveManager; - saveManager.Load(0); + saveManager.Load(saveSlot.Value); } public override string GetSummary() diff --git a/Assets/Fungus/Scripts/Commands/LoadFlowchart.cs.meta b/Assets/Fungus/Scripts/Commands/LoadGame.cs.meta similarity index 100% rename from Assets/Fungus/Scripts/Commands/LoadFlowchart.cs.meta rename to Assets/Fungus/Scripts/Commands/LoadGame.cs.meta diff --git a/Assets/Fungus/Scripts/Commands/SaveFlowchart.cs b/Assets/Fungus/Scripts/Commands/SavePoint.cs similarity index 84% rename from Assets/Fungus/Scripts/Commands/SaveFlowchart.cs rename to Assets/Fungus/Scripts/Commands/SavePoint.cs index 20ff7240..bb9c67da 100644 --- a/Assets/Fungus/Scripts/Commands/SaveFlowchart.cs +++ b/Assets/Fungus/Scripts/Commands/SavePoint.cs @@ -8,13 +8,13 @@ using System.Collections.Generic; namespace Fungus { [CommandInfo("Variable", - "Save Flowchart", - "Saves the current Flowchart variable state to be loaded again in future.")] - public class SaveFlowchart : Command + "Save Point", + "Creates a save point which can be saved to persistant storage and loaded again later.")] + public class SavePoint : Command { [SerializeField] protected Block resumeBlock; - [SerializeField] protected bool saveImmediately; + [SerializeField] protected bool saveNow; #region Public members @@ -24,7 +24,7 @@ namespace Fungus saveManager.PopulateSaveBuffer(GetFlowchart(), resumeBlock.BlockName); - if (saveImmediately) + if (saveNow) { saveManager.Save(); } diff --git a/Assets/Fungus/Scripts/Commands/SaveFlowchart.cs.meta b/Assets/Fungus/Scripts/Commands/SavePoint.cs.meta similarity index 100% rename from Assets/Fungus/Scripts/Commands/SaveFlowchart.cs.meta rename to Assets/Fungus/Scripts/Commands/SavePoint.cs.meta diff --git a/Assets/Fungus/Scripts/Editor/SaveFlowchartEditor.cs b/Assets/Fungus/Scripts/Editor/SavePointEditor.cs similarity index 67% rename from Assets/Fungus/Scripts/Editor/SaveFlowchartEditor.cs rename to Assets/Fungus/Scripts/Editor/SavePointEditor.cs index 1fb9565f..a7b84753 100644 --- a/Assets/Fungus/Scripts/Editor/SaveFlowchartEditor.cs +++ b/Assets/Fungus/Scripts/Editor/SavePointEditor.cs @@ -7,11 +7,11 @@ using Fungus; namespace Fungus.EditorUtils { - [CustomEditor(typeof(SaveFlowchart))] - public class SaveFlowchartEditor : CommandEditor + [CustomEditor(typeof(SavePoint))] + public class SavePointEditor : CommandEditor { protected SerializedProperty resumeBlockProp; - protected SerializedProperty saveImmediatelyProp; + protected SerializedProperty saveNowProp; protected virtual void OnEnable() { @@ -19,7 +19,7 @@ namespace Fungus.EditorUtils return; resumeBlockProp = serializedObject.FindProperty("resumeBlock"); - saveImmediatelyProp = serializedObject.FindProperty("saveImmediately"); + saveNowProp = serializedObject.FindProperty("saveNow"); } public override void DrawCommandGUI() @@ -33,10 +33,10 @@ namespace Fungus.EditorUtils serializedObject.Update(); BlockEditor.BlockField(resumeBlockProp, - new GUIContent("Resume Block", "Block to call when save data is loaded again"), - new GUIContent(""), - flowchart); - EditorGUILayout.PropertyField(saveImmediatelyProp); + new GUIContent("Resume Block", "Block to call when save data is loaded again"), + new GUIContent(""), + flowchart); + EditorGUILayout.PropertyField(saveNowProp); serializedObject.ApplyModifiedProperties(); } diff --git a/Assets/Fungus/Scripts/Editor/SaveFlowchartEditor.cs.meta b/Assets/Fungus/Scripts/Editor/SavePointEditor.cs.meta similarity index 100% rename from Assets/Fungus/Scripts/Editor/SaveFlowchartEditor.cs.meta rename to Assets/Fungus/Scripts/Editor/SavePointEditor.cs.meta diff --git a/Assets/FungusExamples/SaveGame/SceneA.unity b/Assets/FungusExamples/SaveGame/SceneA.unity index 07c45bae..6112856c 100644 --- a/Assets/FungusExamples/SaveGame/SceneA.unity +++ b/Assets/FungusExamples/SaveGame/SceneA.unity @@ -103,6 +103,9 @@ GameObject: - 114: {fileID: 27697869} - 114: {fileID: 27697868} - 114: {fileID: 27697873} + - 114: {fileID: 27697874} + - 114: {fileID: 27697875} + - 114: {fileID: 27697876} m_Layer: 0 m_Name: Flowchart m_TagString: Untagged @@ -175,6 +178,8 @@ MonoBehaviour: eventHandler: {fileID: 27697869} commandList: - {fileID: 27697868} + - {fileID: 27697874} + - {fileID: 27697876} --- !u!114 &27697871 MonoBehaviour: m_ObjectHideFlags: 0 @@ -195,12 +200,14 @@ MonoBehaviour: zoom: 1 scrollViewRect: serializedVersion: 2 - x: -343 - y: -340 - width: 1114 - height: 859 - selectedBlocks: [] - selectedCommands: [] + x: -350 + y: -350 + width: 1121 + height: 869 + selectedBlocks: + - {fileID: 27697870} + selectedCommands: + - {fileID: 27697876} variables: - {fileID: 27697873} description: @@ -240,6 +247,72 @@ MonoBehaviour: scope: 0 key: Count value: 0 +--- !u!114 &27697874 +MonoBehaviour: + m_ObjectHideFlags: 2 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 27697867} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fb77d0ce495044f6e9feb91b31798e8c, type: 3} + m_Name: + m_EditorClassIdentifier: + itemId: 2 + indentLevel: 0 + variable: {fileID: 27697873} + setOperator: 2 + booleanData: + booleanRef: {fileID: 0} + booleanVal: 0 + integerData: + integerRef: {fileID: 0} + integerVal: 1 + floatData: + floatRef: {fileID: 0} + floatVal: 0 + stringData: + stringRef: {fileID: 0} + stringVal: +--- !u!114 &27697875 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 27697867} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3d3d73aef2cfc4f51abf34ac00241f60, type: 3} + m_Name: + m_EditorClassIdentifier: + nodeRect: + serializedVersion: 2 + x: 224 + y: 74 + width: 120 + height: 40 + tint: {r: 1, g: 1, b: 1, a: 1} + useCustomTint: 0 + itemId: 4 + blockName: New Block + description: + eventHandler: {fileID: 0} + commandList: [] +--- !u!114 &27697876 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 27697867} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0b115619cb83b4d6ab8047d0e9407403, type: 3} + m_Name: + m_EditorClassIdentifier: + itemId: 5 + indentLevel: 0 + resumeBlock: {fileID: 27697875} + saveNow: 0 --- !u!1 &132834842 GameObject: m_ObjectHideFlags: 0 diff --git a/ProjectSettings/EditorBuildSettings.asset b/ProjectSettings/EditorBuildSettings.asset index bbb972d6..20ed1e07 100644 --- a/ProjectSettings/EditorBuildSettings.asset +++ b/ProjectSettings/EditorBuildSettings.asset @@ -6,6 +6,6 @@ EditorBuildSettings: serializedVersion: 2 m_Scenes: - enabled: 1 - path: Assets/FungusExamples/Sherlock/TheExperiment.unity + path: Assets/FungusExamples/SaveGame/Menu.unity - enabled: 1 - path: Assets/Tests/Lua/SceneB.unity + path: Assets/FungusExamples/SaveGame/SceneA.unity From 74a243ad12013407ea3492146108ffb7b331587e Mon Sep 17 00:00:00 2001 From: Christopher Date: Mon, 14 Nov 2016 16:07:27 +0000 Subject: [PATCH 09/53] Start Label property in Call command --- Assets/Fungus/Scripts/Commands/Call.cs | 18 +- Assets/Fungus/Scripts/Components/Block.cs | 23 ++ Assets/Fungus/Scripts/Editor/CallEditor.cs | 4 + Assets/FungusExamples/SaveGame/SceneA.unity | 7 +- Assets/Tests/Flow/FlowTests.unity | 351 ++++++++++++++++++-- 5 files changed, 371 insertions(+), 32 deletions(-) diff --git a/Assets/Fungus/Scripts/Commands/Call.cs b/Assets/Fungus/Scripts/Commands/Call.cs index b1c37b3f..a7ed151e 100644 --- a/Assets/Fungus/Scripts/Commands/Call.cs +++ b/Assets/Fungus/Scripts/Commands/Call.cs @@ -37,6 +37,9 @@ namespace Fungus [Tooltip("Block to start executing")] [SerializeField] protected Block targetBlock; + [Tooltip("Label to start exeuction at. Takes priority over startIndex.")] + [SerializeField] protected StringData startLabel = new StringData(); + [Tooltip("Command index to start executing")] [FormerlySerializedAs("commandIndex")] [SerializeField] protected int startIndex; @@ -70,6 +73,17 @@ namespace Fungus }; } + // Find the command index to start execution at + int index = startIndex; + if (startLabel != "") + { + int labelIndex = targetBlock.GetLabelIndex(startLabel); + if (labelIndex != -1) + { + index = labelIndex; + } + } + if (targetFlowchart == null || targetFlowchart.Equals(GetFlowchart())) { @@ -80,12 +94,12 @@ namespace Fungus flowchart.SelectedBlock = targetBlock; } - StartCoroutine(targetBlock.Execute(startIndex, onComplete)); + StartCoroutine(targetBlock.Execute(index, onComplete)); } else { // Execute block in another Flowchart - targetFlowchart.ExecuteBlock(targetBlock, startIndex, onComplete); + targetFlowchart.ExecuteBlock(targetBlock, index, onComplete); } } diff --git a/Assets/Fungus/Scripts/Components/Block.cs b/Assets/Fungus/Scripts/Components/Block.cs index b181a3f0..8fba6b91 100644 --- a/Assets/Fungus/Scripts/Components/Block.cs +++ b/Assets/Fungus/Scripts/Components/Block.cs @@ -382,6 +382,29 @@ namespace Fungus } } + /// + /// Returns the index of the Label command with matching key, or -1 if not found. + /// + public virtual int GetLabelIndex(string labelKey) + { + if (labelKey.Length == 0) + { + return -1; + } + + for (int i = 0; i < commandList.Count; i++) + { + var command = commandList[i]; + var labelCommand = command as Label; + if (labelCommand != null && String.Compare(labelCommand.Key, labelKey, true) == 0) + { + return i; + } + } + + return -1; + } + #endregion } } diff --git a/Assets/Fungus/Scripts/Editor/CallEditor.cs b/Assets/Fungus/Scripts/Editor/CallEditor.cs index d2c6c4b7..2397ff19 100644 --- a/Assets/Fungus/Scripts/Editor/CallEditor.cs +++ b/Assets/Fungus/Scripts/Editor/CallEditor.cs @@ -11,6 +11,7 @@ namespace Fungus.EditorUtils { protected SerializedProperty targetFlowchartProp; protected SerializedProperty targetBlockProp; + protected SerializedProperty startLabelProp; protected SerializedProperty startIndexProp; protected SerializedProperty callModeProp; @@ -21,6 +22,7 @@ namespace Fungus.EditorUtils targetFlowchartProp = serializedObject.FindProperty("targetFlowchart"); targetBlockProp = serializedObject.FindProperty("targetBlock"); + startLabelProp = serializedObject.FindProperty("startLabel"); startIndexProp = serializedObject.FindProperty("startIndex"); callModeProp = serializedObject.FindProperty("callMode"); } @@ -50,6 +52,8 @@ namespace Fungus.EditorUtils new GUIContent(""), flowchart); + EditorGUILayout.PropertyField(startLabelProp); + EditorGUILayout.PropertyField(startIndexProp); } diff --git a/Assets/FungusExamples/SaveGame/SceneA.unity b/Assets/FungusExamples/SaveGame/SceneA.unity index 6112856c..38191696 100644 --- a/Assets/FungusExamples/SaveGame/SceneA.unity +++ b/Assets/FungusExamples/SaveGame/SceneA.unity @@ -206,8 +206,7 @@ MonoBehaviour: height: 869 selectedBlocks: - {fileID: 27697870} - selectedCommands: - - {fileID: 27697876} + selectedCommands: [] variables: - {fileID: 27697873} description: @@ -287,8 +286,8 @@ MonoBehaviour: m_EditorClassIdentifier: nodeRect: serializedVersion: 2 - x: 224 - y: 74 + x: 246 + y: 69 width: 120 height: 40 tint: {r: 1, g: 1, b: 1, a: 1} diff --git a/Assets/Tests/Flow/FlowTests.unity b/Assets/Tests/Flow/FlowTests.unity index 68a7c6ac..213135ac 100644 --- a/Assets/Tests/Flow/FlowTests.unity +++ b/Assets/Tests/Flow/FlowTests.unity @@ -13,7 +13,7 @@ SceneSettings: --- !u!104 &2 RenderSettings: m_ObjectHideFlags: 0 - serializedVersion: 6 + serializedVersion: 7 m_Fog: 0 m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} m_FogMode: 3 @@ -37,12 +37,12 @@ RenderSettings: m_ReflectionIntensity: 1 m_CustomReflection: {fileID: 0} m_Sun: {fileID: 0} + m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1} --- !u!157 &3 LightmapSettings: m_ObjectHideFlags: 0 - serializedVersion: 6 + serializedVersion: 7 m_GIWorkflowMode: 1 - m_LightmapsMode: 1 m_GISettings: serializedVersion: 2 m_BounceScale: 1 @@ -53,17 +53,22 @@ LightmapSettings: m_EnableBakedLightmaps: 0 m_EnableRealtimeLightmaps: 0 m_LightmapEditorSettings: - serializedVersion: 3 + serializedVersion: 4 m_Resolution: 2 m_BakeResolution: 40 m_TextureWidth: 1024 m_TextureHeight: 1024 + m_AO: 0 m_AOMaxDistance: 1 - m_Padding: 2 m_CompAOExponent: 0 + m_CompAOExponentDirect: 0 + m_Padding: 2 m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 m_TextureCompression: 1 + m_DirectLightInLightProbes: 1 m_FinalGather: 0 + m_FinalGatherFiltering: 1 m_FinalGatherRayCount: 1024 m_ReflectionCompression: 2 m_LightingDataAsset: {fileID: 0} @@ -244,7 +249,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!114 &730370421 MonoBehaviour: m_ObjectHideFlags: 0 @@ -442,7 +447,6 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: itemId: 4 - errorMessage: indentLevel: 0 --- !u!114 &897339007 MonoBehaviour: @@ -456,7 +460,6 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: itemId: 3 - errorMessage: indentLevel: 0 failMessage: --- !u!114 &897339008 @@ -471,10 +474,12 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: itemId: 2 - errorMessage: indentLevel: 0 targetFlowchart: {fileID: 0} targetBlock: {fileID: 897339009} + startLabel: + stringRef: {fileID: 0} + stringVal: startIndex: 1 callMode: 0 --- !u!114 &897339009 @@ -494,6 +499,8 @@ MonoBehaviour: y: 70 width: 120 height: 40 + tint: {r: 1, g: 1, b: 1, a: 1} + useCustomTint: 0 itemId: 1 blockName: OtherBlock description: @@ -514,6 +521,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: parentBlock: {fileID: 897339011} + waitForFrames: 1 --- !u!114 &897339011 MonoBehaviour: m_ObjectHideFlags: 2 @@ -532,6 +540,8 @@ MonoBehaviour: y: 70 width: 120 height: 40 + tint: {r: 1, g: 1, b: 1, a: 1} + useCustomTint: 0 itemId: 0 blockName: Start description: @@ -562,7 +572,7 @@ MonoBehaviour: y: -350 width: 1121 height: 869 - selectedBlock: {fileID: 0} + selectedBlocks: [] selectedCommands: [] variables: [] description: "Test using the call index property to call \na specific command in @@ -574,6 +584,59 @@ MonoBehaviour: localizationId: showLineNumbers: 0 hideCommands: [] + luaEnvironment: {fileID: 0} + luaBindingName: flowchart +--- !u!1 &919683558 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 4: {fileID: 919683560} + - 114: {fileID: 919683559} + m_Layer: 0 + m_Name: CallWithLabelTest + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!114 &919683559 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 919683558} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b1dba0b27b0864740a8720e920aa88c0, type: 3} + m_Name: + m_EditorClassIdentifier: + timeout: 5 + ignored: 0 + succeedAfterAllAssertionsAreExecuted: 0 + expectException: 0 + expectedExceptionList: + succeedWhenExceptionIsThrown: 0 + includedPlatforms: -1 + platformsToIgnore: [] + dynamic: 0 + dynamicTypeName: +--- !u!4 &919683560 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 919683558} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: + - {fileID: 2121984966} + m_Father: {fileID: 0} + m_RootOrder: 7 --- !u!1 &1040991508 GameObject: m_ObjectHideFlags: 0 @@ -617,7 +680,6 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: itemId: 1 - errorMessage: indentLevel: 0 --- !u!114 &1040991511 MonoBehaviour: @@ -637,6 +699,8 @@ MonoBehaviour: y: 70 width: 120 height: 40 + tint: {r: 1, g: 1, b: 1, a: 1} + useCustomTint: 0 itemId: 0 blockName: DoTest description: @@ -667,7 +731,7 @@ MonoBehaviour: y: -340 width: 1114 height: 859 - selectedBlock: {fileID: 1040991511} + selectedBlocks: [] selectedCommands: - {fileID: 1040991510} variables: [] @@ -679,6 +743,8 @@ MonoBehaviour: localizationId: showLineNumbers: 0 hideCommands: [] + luaEnvironment: {fileID: 0} + luaBindingName: flowchart --- !u!1 &1220080381 GameObject: m_ObjectHideFlags: 0 @@ -813,7 +879,6 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: itemId: 4 - errorMessage: indentLevel: 0 --- !u!114 &1253352150 MonoBehaviour: @@ -827,7 +892,6 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: itemId: 3 - errorMessage: indentLevel: 0 failMessage: --- !u!114 &1253352151 @@ -842,7 +906,6 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: itemId: 2 - errorMessage: indentLevel: 0 key: MyLabel --- !u!114 &1253352152 @@ -857,7 +920,6 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: itemId: 1 - errorMessage: indentLevel: 0 _targetLabel: stringRef: {fileID: 0} @@ -876,6 +938,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: parentBlock: {fileID: 1253352154} + waitForFrames: 1 --- !u!114 &1253352154 MonoBehaviour: m_ObjectHideFlags: 2 @@ -894,6 +957,8 @@ MonoBehaviour: y: 70 width: 120 height: 40 + tint: {r: 1, g: 1, b: 1, a: 1} + useCustomTint: 0 itemId: 0 blockName: Start description: @@ -916,18 +981,18 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: version: 1 - scrollPos: {x: 0, y: 0} + scrollPos: {x: 3.562703, y: 1.8540598} variablesScrollPos: {x: 0, y: 0} variablesExpanded: 1 blockViewHeight: 400 - zoom: 1 + zoom: 0.98802704 scrollViewRect: serializedVersion: 2 - x: -343 - y: -340 - width: 1114 - height: 859 - selectedBlock: {fileID: 0} + x: -350 + y: -350 + width: 1121 + height: 869 + selectedBlocks: [] selectedCommands: [] variables: [] description: Tests if jumping to a label works correctly @@ -938,6 +1003,8 @@ MonoBehaviour: localizationId: showLineNumbers: 0 hideCommands: [] + luaEnvironment: {fileID: 0} + luaBindingName: flowchart --- !u!1 &1501994597 GameObject: m_ObjectHideFlags: 0 @@ -1185,7 +1252,6 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: ba19c26c1ba7243d2b57ebc4329cc7c6, type: 3} m_Name: m_EditorClassIdentifier: - remoteDebugger: 0 --- !u!114 &1601427684 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1263,7 +1329,6 @@ MonoBehaviour: executeAfterFrames: 1 repeatExecuteFrame: 1 repeatEveryFrame: 1 - hasFailed: 0 executeMethods: 2 executeMethodName: OnExecute --- !u!1 &1873336849 @@ -1293,7 +1358,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 61dddfdc5e0e44ca298d8f46f7f5a915, type: 3} m_Name: m_EditorClassIdentifier: - selectedFlowchart: {fileID: 1253352155} + selectedFlowchart: {fileID: 2121984976} --- !u!4 &1873336851 Transform: m_ObjectHideFlags: 1 @@ -1360,3 +1425,237 @@ Transform: - {fileID: 1601427681} m_Father: {fileID: 0} m_RootOrder: 3 +--- !u!1 &2121984965 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 142980, guid: 5e7fbc8d4eb714b279eeeef2262c1e1a, type: 2} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 4: {fileID: 2121984966} + - 114: {fileID: 2121984976} + - 114: {fileID: 2121984975} + - 114: {fileID: 2121984974} + - 114: {fileID: 2121984973} + - 114: {fileID: 2121984972} + - 114: {fileID: 2121984971} + - 114: {fileID: 2121984970} + - 114: {fileID: 2121984969} + - 114: {fileID: 2121984968} + - 114: {fileID: 2121984967} + m_Layer: 0 + m_Name: Flowchart + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2121984966 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 467082, guid: 5e7fbc8d4eb714b279eeeef2262c1e1a, type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 2121984965} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 919683560} + m_RootOrder: 0 +--- !u!114 &2121984967 +MonoBehaviour: + m_ObjectHideFlags: 2 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 2121984965} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f1ca510a57aa47568a5e4ee558ff41f, type: 3} + m_Name: + m_EditorClassIdentifier: + itemId: 7 + indentLevel: 0 +--- !u!114 &2121984968 +MonoBehaviour: + m_ObjectHideFlags: 2 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 2121984965} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4920f47cde1a84b11ad07b7317568494, type: 3} + m_Name: + m_EditorClassIdentifier: + itemId: 6 + indentLevel: 0 +--- !u!114 &2121984969 +MonoBehaviour: + m_ObjectHideFlags: 2 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 2121984965} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 2dcb71131f45b47fead560a97ef55f1c, type: 3} + m_Name: + m_EditorClassIdentifier: + itemId: 5 + indentLevel: 0 + failMessage: +--- !u!114 &2121984970 +MonoBehaviour: + m_ObjectHideFlags: 2 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 2121984965} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ea4da378c47144a86979765ac5e9690c, type: 3} + m_Name: + m_EditorClassIdentifier: + itemId: 4 + indentLevel: 0 + key: LabelB +--- !u!114 &2121984971 +MonoBehaviour: + m_ObjectHideFlags: 2 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 2121984965} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ea4da378c47144a86979765ac5e9690c, type: 3} + m_Name: + m_EditorClassIdentifier: + itemId: 3 + indentLevel: 0 + key: LabelA +--- !u!114 &2121984972 +MonoBehaviour: + m_ObjectHideFlags: 2 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 2121984965} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 050fb9e6e72f442b3b883da8a965bdeb, type: 3} + m_Name: + m_EditorClassIdentifier: + itemId: 2 + indentLevel: 0 + targetFlowchart: {fileID: 0} + targetBlock: {fileID: 2121984973} + startLabel: + stringRef: {fileID: 0} + stringVal: LabelB + startIndex: 0 + callMode: 0 +--- !u!114 &2121984973 +MonoBehaviour: + m_ObjectHideFlags: 2 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 2121984965} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3d3d73aef2cfc4f51abf34ac00241f60, type: 3} + m_Name: + m_EditorClassIdentifier: + nodeRect: + serializedVersion: 2 + x: 258 + y: 69 + width: 120 + height: 40 + tint: {r: 1, g: 1, b: 1, a: 1} + useCustomTint: 0 + itemId: 1 + blockName: CallTarget + description: + eventHandler: {fileID: 0} + commandList: + - {fileID: 2121984971} + - {fileID: 2121984969} + - {fileID: 2121984967} + - {fileID: 2121984970} + - {fileID: 2121984968} +--- !u!114 &2121984974 +MonoBehaviour: + m_ObjectHideFlags: 2 + m_PrefabParentObject: {fileID: 11462346, guid: 5e7fbc8d4eb714b279eeeef2262c1e1a, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 2121984965} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d2f6487d21a03404cb21b245f0242e79, type: 3} + m_Name: + m_EditorClassIdentifier: + parentBlock: {fileID: 2121984975} + waitForFrames: 1 +--- !u!114 &2121984975 +MonoBehaviour: + m_ObjectHideFlags: 2 + m_PrefabParentObject: {fileID: 11433304, guid: 5e7fbc8d4eb714b279eeeef2262c1e1a, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 2121984965} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3d3d73aef2cfc4f51abf34ac00241f60, type: 3} + m_Name: + m_EditorClassIdentifier: + nodeRect: + serializedVersion: 2 + x: 68 + y: 70 + width: 120 + height: 40 + tint: {r: 1, g: 1, b: 1, a: 1} + useCustomTint: 0 + itemId: 0 + blockName: Start + description: + eventHandler: {fileID: 2121984974} + commandList: + - {fileID: 2121984972} +--- !u!114 &2121984976 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 11430050, guid: 5e7fbc8d4eb714b279eeeef2262c1e1a, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 2121984965} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7a334fe2ffb574b3583ff3b18b4792d3, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 1 + scrollPos: {x: 1.7744522, y: -1.1711906} + variablesScrollPos: {x: 0, y: 0} + variablesExpanded: 1 + blockViewHeight: 400 + zoom: 1 + scrollViewRect: + serializedVersion: 2 + x: -350 + y: -350 + width: 1131 + height: 869 + selectedBlocks: + - {fileID: 2121984973} + selectedCommands: + - {fileID: 2121984971} + variables: [] + description: + stepPause: 0 + colorCommands: 1 + hideComponents: 1 + saveSelection: 1 + localizationId: + showLineNumbers: 0 + hideCommands: [] + luaEnvironment: {fileID: 0} + luaBindingName: flowchart From 71c2b4e357a8406cb3fcc3a01040dc3c8faa8890 Mon Sep 17 00:00:00 2001 From: Christopher Date: Tue, 15 Nov 2016 11:43:08 +0000 Subject: [PATCH 10/53] Added Game Loaded event handler and save key. --- Assets/Fungus/Scripts/Commands/SavePoint.cs | 19 +- Assets/Fungus/Scripts/Components/Flowchart.cs | 1 - .../Fungus/Scripts/Components/SaveManager.cs | 30 ++- .../Fungus/Scripts/Editor/SavePointEditor.cs | 44 ----- .../Scripts/EventHandlers/GameLoaded.cs | 32 ++++ .../GameLoaded.cs.meta} | 4 +- Assets/Fungus/Scripts/Utils/SavePointData.cs | 2 +- Assets/FungusExamples/SaveGame/SceneA.unity | 179 ++++++++++++++++-- 8 files changed, 225 insertions(+), 86 deletions(-) delete mode 100644 Assets/Fungus/Scripts/Editor/SavePointEditor.cs create mode 100644 Assets/Fungus/Scripts/EventHandlers/GameLoaded.cs rename Assets/Fungus/Scripts/{Editor/SavePointEditor.cs.meta => EventHandlers/GameLoaded.cs.meta} (76%) diff --git a/Assets/Fungus/Scripts/Commands/SavePoint.cs b/Assets/Fungus/Scripts/Commands/SavePoint.cs index bb9c67da..b1ce72e1 100644 --- a/Assets/Fungus/Scripts/Commands/SavePoint.cs +++ b/Assets/Fungus/Scripts/Commands/SavePoint.cs @@ -12,7 +12,7 @@ namespace Fungus "Creates a save point which can be saved to persistant storage and loaded again later.")] public class SavePoint : Command { - [SerializeField] protected Block resumeBlock; + [SerializeField] protected string saveKey; [SerializeField] protected bool saveNow; @@ -22,7 +22,7 @@ namespace Fungus { var saveManager = FungusManager.Instance.SaveManager; - saveManager.PopulateSaveBuffer(GetFlowchart(), resumeBlock.BlockName); + saveManager.PopulateSaveBuffer(GetFlowchart(), saveKey); if (saveNow) { @@ -34,12 +34,7 @@ namespace Fungus public override string GetSummary() { - if (resumeBlock == null) - { - return "Error: No resume block set"; - } - - return resumeBlock.BlockName; + return saveKey; } public override Color GetButtonColor() @@ -47,14 +42,6 @@ namespace Fungus return new Color32(235, 191, 217, 255); } - public override void GetConnectedBlocks(ref List connectedBlocks) - { - if (resumeBlock != null) - { - connectedBlocks.Add(resumeBlock); - } - } - #endregion } } \ No newline at end of file diff --git a/Assets/Fungus/Scripts/Components/Flowchart.cs b/Assets/Fungus/Scripts/Components/Flowchart.cs index 4ebdd2b7..a61f40f5 100644 --- a/Assets/Fungus/Scripts/Components/Flowchart.cs +++ b/Assets/Fungus/Scripts/Components/Flowchart.cs @@ -3,7 +3,6 @@ using UnityEngine; using UnityEngine.EventSystems; -using UnityEngine.Serialization; using System; using System.Text; using System.Linq; diff --git a/Assets/Fungus/Scripts/Components/SaveManager.cs b/Assets/Fungus/Scripts/Components/SaveManager.cs index 6f9da2e9..c4354849 100644 --- a/Assets/Fungus/Scripts/Components/SaveManager.cs +++ b/Assets/Fungus/Scripts/Components/SaveManager.cs @@ -55,14 +55,14 @@ namespace Fungus return true; } - protected virtual string CreateSaveData(Flowchart flowchart, string resumeBlockName) + protected virtual string CreateSaveData(Flowchart flowchart, string saveKey) { var saveData = new SavePointData(); // Store the scene, flowchart and block to execute on resume saveData.sceneName = SceneManager.GetActiveScene().name; saveData.flowchartName = flowchart.name; - saveData.resumeBlockName = resumeBlockName; + saveData.saveKey = saveKey; for (int i = 0; i < flowchart.Variables.Count; i++) { @@ -147,7 +147,27 @@ namespace Fungus flowchart.SetStringVariable(stringVar.key, stringVar.value); } - flowchart.ExecuteBlock(saveData.resumeBlockName); + // Fire any matching GameLoaded event handler with matching save key. + var eventHandlers = Object.FindObjectsOfType(); + for (int i = 0; i < eventHandlers.Length; i++) + { + var eventHandler = eventHandlers[i]; + eventHandler.OnGameLoaded(saveData.saveKey); + } + + // Execute any block with a Label matching the save key + var labels = Object.FindObjectsOfType