From 6b5eff338d400454f8d2a23caa3067659c2faac8 Mon Sep 17 00:00:00 2001 From: Christopher Date: Tue, 24 Jan 2017 15:53:39 +0000 Subject: [PATCH] Fix for start point not being executed on startup. --- Assets/Fungus/Scripts/Components/SaveManager.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Assets/Fungus/Scripts/Components/SaveManager.cs b/Assets/Fungus/Scripts/Components/SaveManager.cs index 3c77e00a..17b91c61 100644 --- a/Assets/Fungus/Scripts/Components/SaveManager.cs +++ b/Assets/Fungus/Scripts/Components/SaveManager.cs @@ -147,6 +147,16 @@ namespace Fungus protected System.Action loadAction; + protected virtual void Start() + { + // The OnSceneLoaded callback above may not be called for the initial scene load in the game, + // so we call ExecuteStartBlock when the SaveManager starts up too. + if (loadAction == null) + { + loadAction = ExecuteStartBlock; + } + } + protected virtual void Update() { // Execute any previously scheduled load action