diff --git a/Assets/Fungus/Portrait/Scripts/Stage.cs b/Assets/Fungus/Portrait/Scripts/Stage.cs index 7731aa4b..fffec97b 100644 --- a/Assets/Fungus/Portrait/Scripts/Stage.cs +++ b/Assets/Fungus/Portrait/Scripts/Stage.cs @@ -7,6 +7,8 @@ using System.Collections.Generic; namespace Fungus { + + [ExecuteInEditMode] public class Stage : MonoBehaviour { public Canvas portraitCanvas; @@ -23,7 +25,6 @@ namespace Fungus [HideInInspector] static public List activeStages = new List(); - [ExecuteInEditMode] protected virtual void OnEnable() { if (!activeStages.Contains(this)) @@ -31,11 +32,21 @@ namespace Fungus activeStages.Add(this); } } - [ExecuteInEditMode] + protected virtual void OnDisable() { activeStages.Remove(this); } + + protected virtual void Start() + { + if (Application.isPlaying && + portraitCanvas != null) + { + // Ensure the stage canvas is active + portraitCanvas.gameObject.SetActive(true); + } + } } }