diff --git a/Assets/Fungus/Scripts/Components/SaveManager.cs b/Assets/Fungus/Scripts/Components/SaveManager.cs index c4354849..088ecbe9 100644 --- a/Assets/Fungus/Scripts/Components/SaveManager.cs +++ b/Assets/Fungus/Scripts/Components/SaveManager.cs @@ -147,12 +147,12 @@ namespace Fungus flowchart.SetStringVariable(stringVar.key, stringVar.value); } - // Fire any matching GameLoaded event handler with matching save key. - var eventHandlers = Object.FindObjectsOfType(); + // Fire any matching SavePointLoaded 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); + eventHandler.OnSavePointLoaded(saveData.saveKey); } // Execute any block with a Label matching the save key diff --git a/Assets/Fungus/Scripts/EventHandlers/FlowchartEnabled.cs b/Assets/Fungus/Scripts/EventHandlers/FlowchartEnabled.cs index 50c78d43..18c10305 100644 --- a/Assets/Fungus/Scripts/EventHandlers/FlowchartEnabled.cs +++ b/Assets/Fungus/Scripts/EventHandlers/FlowchartEnabled.cs @@ -8,7 +8,7 @@ namespace Fungus /// /// The block will execute when the Flowchart game object is enabled. /// - [EventHandlerInfo("", + [EventHandlerInfo("Scene", "Flowchart Enabled", "The block will execute when the Flowchart game object is enabled.")] [AddComponentMenu("")] diff --git a/Assets/Fungus/Scripts/EventHandlers/MessageReceived.cs b/Assets/Fungus/Scripts/EventHandlers/MessageReceived.cs index 79a36258..2ba62983 100644 --- a/Assets/Fungus/Scripts/EventHandlers/MessageReceived.cs +++ b/Assets/Fungus/Scripts/EventHandlers/MessageReceived.cs @@ -8,7 +8,7 @@ namespace Fungus /// /// The block will execute when the specified message is received from a Send Message command. /// - [EventHandlerInfo("", + [EventHandlerInfo("Scene", "Message Received", "The block will execute when the specified message is received from a Send Message command.")] [AddComponentMenu("")] diff --git a/Assets/Fungus/Scripts/EventHandlers/GameLoaded.cs b/Assets/Fungus/Scripts/EventHandlers/SavePointLoaded.cs similarity index 66% rename from Assets/Fungus/Scripts/EventHandlers/GameLoaded.cs rename to Assets/Fungus/Scripts/EventHandlers/SavePointLoaded.cs index 20c7d265..b17db2d3 100644 --- a/Assets/Fungus/Scripts/EventHandlers/GameLoaded.cs +++ b/Assets/Fungus/Scripts/EventHandlers/SavePointLoaded.cs @@ -6,20 +6,20 @@ using System.Collections.Generic; namespace Fungus { - [EventHandlerInfo("", - "Game Loaded", - "Execute this block when a saved game is loaded.")] - public class GameLoaded : EventHandler + [EventHandlerInfo("Scene", + "Save Point Loaded", + "Execute this block when a saved point is loaded.")] + public class SavePointLoaded : EventHandler { - [Tooltip("Block will execute if the Save Key of the loaded data matches an entry in the Save Keys list.")] + [Tooltip("Block will execute if the Save Key of the loaded save point matches an entry in the Save Keys list.")] [SerializeField] protected List saveKeys = new List(); #region Public methods /// - /// Called when a saved game is loaded. + /// Called when a save point is loaded. /// - public void OnGameLoaded(string saveKey) + public void OnSavePointLoaded(string saveKey) { if (saveKeys.Contains(saveKey)) { diff --git a/Assets/Fungus/Scripts/EventHandlers/GameLoaded.cs.meta b/Assets/Fungus/Scripts/EventHandlers/SavePointLoaded.cs.meta similarity index 100% rename from Assets/Fungus/Scripts/EventHandlers/GameLoaded.cs.meta rename to Assets/Fungus/Scripts/EventHandlers/SavePointLoaded.cs.meta diff --git a/Assets/FungusExamples/SaveGame/SceneA.unity b/Assets/FungusExamples/SaveGame/SceneA.unity index d762396f..61550ab3 100644 --- a/Assets/FungusExamples/SaveGame/SceneA.unity +++ b/Assets/FungusExamples/SaveGame/SceneA.unity @@ -214,8 +214,7 @@ MonoBehaviour: height: 909 selectedBlocks: - {fileID: 27697883} - selectedCommands: - - {fileID: 27697875} + selectedCommands: [] variables: - {fileID: 27697873} description: @@ -284,7 +283,7 @@ MonoBehaviour: stringVal: --- !u!114 &27697875 MonoBehaviour: - m_ObjectHideFlags: 0 + m_ObjectHideFlags: 2 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 27697867} @@ -399,7 +398,7 @@ MonoBehaviour: - {fileID: 27697878} --- !u!114 &27697881 MonoBehaviour: - m_ObjectHideFlags: 0 + m_ObjectHideFlags: 2 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 27697867} @@ -413,7 +412,7 @@ MonoBehaviour: key: save_1 --- !u!114 &27697882 MonoBehaviour: - m_ObjectHideFlags: 0 + m_ObjectHideFlags: 2 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 27697867} @@ -432,7 +431,7 @@ MonoBehaviour: ' --- !u!114 &27697883 MonoBehaviour: - m_ObjectHideFlags: 0 + m_ObjectHideFlags: 2 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 27697867}