diff --git a/Assets/Fungus/Dialog/Editor/DialogMenuItems.cs b/Assets/Fungus/Dialog/Editor/DialogMenuItems.cs index 99c2257e..03418203 100644 --- a/Assets/Fungus/Dialog/Editor/DialogMenuItems.cs +++ b/Assets/Fungus/Dialog/Editor/DialogMenuItems.cs @@ -53,10 +53,10 @@ namespace Fungus } } - [MenuItem("GameObject/Fungus/Portrait/PortraitStage")] - static void CreatePortraitStage() + [MenuItem("GameObject/Fungus/Portrait/Stage")] + static void CreateStage() { - FungusScriptMenuItems.SpawnPrefab("Assets/Fungus/Portrait/Prefabs/PortraitStage.prefab"); + FungusScriptMenuItems.SpawnPrefab("Assets/Fungus/Portrait/Prefabs/Stage.prefab"); } [MenuItem("GameObject/Fungus/Portrait/PortraitPosition")] diff --git a/Assets/Fungus/Dialog/Scripts/Dialog.cs b/Assets/Fungus/Dialog/Scripts/Dialog.cs index 4bc76a70..d8936661 100644 --- a/Assets/Fungus/Dialog/Scripts/Dialog.cs +++ b/Assets/Fungus/Dialog/Scripts/Dialog.cs @@ -1,4 +1,4 @@ -using UnityEngine; +using UnityEngine; using UnityEngine.UI; using UnityEngine.Events; using System; @@ -167,21 +167,21 @@ namespace Fungus speakingCharacter = character; // Dim portraits of non-speaking characters - foreach (PortraitStage ps in PortraitStage.activePortraitStages) + foreach (Stage s in Stage.activeStages) { - if (ps.dimPortraits) + if (s.dimPortraits) { - foreach (Character c in ps.charactersOnStage) + foreach (Character c in s.charactersOnStage) { if (prevSpeakingCharacter != speakingCharacter) { if (c != speakingCharacter) { - Portrait.Dim(c,ps); + Portrait.Dim(c,s); } else { - Portrait.Undim(c,ps); + Portrait.Undim(c,s); } } } diff --git a/Assets/Fungus/FungusScript/Editor/FungusScriptEditor.cs b/Assets/Fungus/FungusScript/Editor/FungusScriptEditor.cs index 2e0480b9..7f77c4c5 100644 --- a/Assets/Fungus/FungusScript/Editor/FungusScriptEditor.cs +++ b/Assets/Fungus/FungusScript/Editor/FungusScriptEditor.cs @@ -11,13 +11,13 @@ namespace Fungus [CustomEditor (typeof(FungusScript))] public class FungusScriptEditor : Editor { - protected SerializedProperty descriptionProp; - protected SerializedProperty defaultPortraitStageProp; protected class AddVariableInfo { public FungusScript fungusScript; public System.Type variableType; } + + protected SerializedProperty descriptionProp; protected SerializedProperty colorCommandsProp; protected SerializedProperty hideComponentsProp; protected SerializedProperty runSlowDurationProp; diff --git a/Assets/Fungus/Portrait/Editor/PortraitEditor.cs b/Assets/Fungus/Portrait/Editor/PortraitEditor.cs index 505e7503..b3093b2f 100644 --- a/Assets/Fungus/Portrait/Editor/PortraitEditor.cs +++ b/Assets/Fungus/Portrait/Editor/PortraitEditor.cs @@ -15,7 +15,7 @@ namespace Fungus [CustomEditor (typeof(Portrait))] public class PortraitEditor : CommandEditor { - protected SerializedProperty portraitStageProp; + protected SerializedProperty stageProp; protected SerializedProperty displayProp; protected SerializedProperty characterProp; protected SerializedProperty replacedCharacterProp; @@ -34,7 +34,7 @@ namespace Fungus protected virtual void OnEnable() { - portraitStageProp = serializedObject.FindProperty("portraitStage"); + stageProp = serializedObject.FindProperty("stage"); displayProp = serializedObject.FindProperty("display"); characterProp = serializedObject.FindProperty("character"); replacedCharacterProp = serializedObject.FindProperty("replacedCharacter"); @@ -58,16 +58,16 @@ namespace Fungus Portrait t = target as Portrait; - if (PortraitStage.activePortraitStages.Count > 1) + if (Stage.activeStages.Count > 1) { - CommandEditor.ObjectField(portraitStageProp, + CommandEditor.ObjectField(stageProp, new GUIContent("Portrait Stage", "Stage to display the character portraits on"), new GUIContent(""), - PortraitStage.activePortraitStages); + Stage.activeStages); } else { - t.portraitStage = null; + t.stage = null; } // Format Enum names string[] displayLabels = StringFormatter.FormatEnumNames(t.display,""); @@ -89,7 +89,7 @@ namespace Fungus Character.activeCharacters); bool showOptionalFields = true; - PortraitStage ps = t.portraitStage; + Stage s = t.stage; // Only show optional portrait fields once required fields have been filled... if (t.character != null) // Character is selected { @@ -99,14 +99,14 @@ namespace Fungus EditorGUILayout.HelpBox("This character has no portraits. Please add portraits to the character's prefab before using this command.", MessageType.Error); showOptionalFields = false; } - if (t.portraitStage == null) // If default portrait stage selected + if (t.stage == null) // If default portrait stage selected { - if (t.portraitStage == null) // If no default specified, try to get any portrait stage in the scene + if (t.stage == null) // If no default specified, try to get any portrait stage in the scene { - ps = GameObject.FindObjectOfType(); + s = GameObject.FindObjectOfType(); } } - if (ps == null) + if (s == null) { EditorGUILayout.HelpBox("No portrait stage has been set. Please create a new portrait stage using [Game Object > Fungus > Portrait > Portrait Stage].", MessageType.Error); showOptionalFields = false; @@ -176,7 +176,7 @@ namespace Fungus CommandEditor.ObjectField(fromPositionProp, new GUIContent("From Position", "Move the portrait to this position"), new GUIContent(""), - ps.positions); + s.positions); } } toPositionPrefix = "To "; @@ -193,7 +193,7 @@ namespace Fungus CommandEditor.ObjectField(toPositionProp, new GUIContent(toPositionPrefix+"Position", "Move the portrait to this position"), new GUIContent(""), - ps.positions); + s.positions); } else { diff --git a/Assets/Fungus/Portrait/Editor/StageEditor.cs b/Assets/Fungus/Portrait/Editor/StageEditor.cs index 858c2c5c..b126cda7 100644 --- a/Assets/Fungus/Portrait/Editor/StageEditor.cs +++ b/Assets/Fungus/Portrait/Editor/StageEditor.cs @@ -16,8 +16,8 @@ namespace Fungus public class StageEditor : CommandEditor { protected SerializedProperty displayProp; - protected SerializedProperty portraitStageProp; - protected SerializedProperty replacedPortraitStageProp; + protected SerializedProperty stageProp; + protected SerializedProperty replacedStageProp; protected SerializedProperty useDefaultSettingsProp; protected SerializedProperty fadeDurationProp; protected SerializedProperty waitUntilFinishedProp; @@ -25,8 +25,8 @@ namespace Fungus protected virtual void OnEnable() { displayProp = serializedObject.FindProperty("display"); - portraitStageProp = serializedObject.FindProperty("portraitStage"); - replacedPortraitStageProp = serializedObject.FindProperty("replacedPortraitStage"); + stageProp = serializedObject.FindProperty("stage"); + replacedStageProp = serializedObject.FindProperty("replacedStage"); useDefaultSettingsProp = serializedObject.FindProperty("useDefaultSettings"); fadeDurationProp = serializedObject.FindProperty("fadeDuration"); waitUntilFinishedProp = serializedObject.FindProperty("waitUntilFinished"); @@ -45,31 +45,31 @@ namespace Fungus string replaceLabel = "Portrait Stage"; if (t.display == StageDisplayType.Swap) { - CommandEditor.ObjectField(replacedPortraitStageProp, + CommandEditor.ObjectField(replacedStageProp, new GUIContent("Replace", "Character to swap with"), new GUIContent(""), - PortraitStage.activePortraitStages); + Stage.activeStages); replaceLabel = "With"; } - if (PortraitStage.activePortraitStages.Count > 1) + if (Stage.activeStages.Count > 1) { - CommandEditor.ObjectField(portraitStageProp, + CommandEditor.ObjectField(stageProp, new GUIContent(replaceLabel, "Stage to display the character portraits on"), new GUIContent(""), - PortraitStage.activePortraitStages); + Stage.activeStages); } bool showOptionalFields = true; - PortraitStage ps = t.portraitStage; + Stage s = t.stage; // Only show optional portrait fields once required fields have been filled... - if (t.portraitStage != null) // Character is selected + if (t.stage != null) // Character is selected { - if (t.portraitStage == null) // If no default specified, try to get any portrait stage in the scene + if (t.stage == null) // If no default specified, try to get any portrait stage in the scene { - ps = GameObject.FindObjectOfType(); + s = GameObject.FindObjectOfType(); } - if (ps == null) + if (s == null) { EditorGUILayout.HelpBox("No portrait stage has been set. Please create a new portrait stage using [Game Object > Fungus > Portrait > Portrait Stage].", MessageType.Error); showOptionalFields = false; diff --git a/Assets/Fungus/Portrait/Prefabs/PortraitStage.prefab b/Assets/Fungus/Portrait/Prefabs/Stage.prefab similarity index 99% rename from Assets/Fungus/Portrait/Prefabs/PortraitStage.prefab rename to Assets/Fungus/Portrait/Prefabs/Stage.prefab index 62c9cd13..6d8e59b5 100644 --- a/Assets/Fungus/Portrait/Prefabs/PortraitStage.prefab +++ b/Assets/Fungus/Portrait/Prefabs/Stage.prefab @@ -44,7 +44,7 @@ GameObject: - 4: {fileID: 410270} - 114: {fileID: 11410274} m_Layer: 0 - m_Name: PortraitStage + m_Name: Stage m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 diff --git a/Assets/Fungus/Portrait/Prefabs/PortraitStage.prefab.meta b/Assets/Fungus/Portrait/Prefabs/Stage.prefab.meta similarity index 100% rename from Assets/Fungus/Portrait/Prefabs/PortraitStage.prefab.meta rename to Assets/Fungus/Portrait/Prefabs/Stage.prefab.meta diff --git a/Assets/Fungus/Portrait/Scripts/Commands/ControlStage.cs b/Assets/Fungus/Portrait/Scripts/Commands/ControlStage.cs index 8446b8da..0fa88122 100644 --- a/Assets/Fungus/Portrait/Scripts/Commands/ControlStage.cs +++ b/Assets/Fungus/Portrait/Scripts/Commands/ControlStage.cs @@ -27,10 +27,10 @@ namespace Fungus public StageDisplayType display; [Tooltip("Stage to display characters on")] - public PortraitStage portraitStage; + public Stage stage; - [Tooltip("PortraitStage to swap with")] - public PortraitStage replacedPortraitStage; + [Tooltip("Stage to swap with")] + public Stage replacedStage; [Tooltip("Use Default Settings")] public bool useDefaultSettings = true; @@ -50,15 +50,15 @@ namespace Fungus return; } // Selected "use default Portrait Stage" - if (portraitStage == null) // Default portrait stage selected + if (stage == null) // Default portrait stage selected { - if (portraitStage == null) // If no default specified, try to get any portrait stage in the scene + if (stage == null) // If no default specified, try to get any portrait stage in the scene { - portraitStage = GameObject.FindObjectOfType(); + stage = GameObject.FindObjectOfType(); } } // If portrait stage does not exist, do nothing - if (portraitStage == null) + if (stage == null) { Continue(); return; @@ -66,12 +66,12 @@ namespace Fungus // Selected "use default Portrait Stage" if (display == StageDisplayType.Swap) // Default portrait stage selected { - if (replacedPortraitStage == null) // If no default specified, try to get any portrait stage in the scene + if (replacedStage == null) // If no default specified, try to get any portrait stage in the scene { - replacedPortraitStage = GameObject.FindObjectOfType(); + replacedStage = GameObject.FindObjectOfType(); } // If portrait stage does not exist, do nothing - if (replacedPortraitStage == null) + if (replacedStage == null) { Continue(); return; @@ -80,28 +80,28 @@ namespace Fungus // Use default settings if (useDefaultSettings) { - fadeDuration = portraitStage.fadeDuration; + fadeDuration = stage.fadeDuration; } switch(display) { case (StageDisplayType.Show): - Show(portraitStage); + Show(stage); break; case (StageDisplayType.Hide): - Hide(portraitStage); + Hide(stage); break; case (StageDisplayType.Swap): - Show(portraitStage); - Hide(replacedPortraitStage); + Show(stage); + Hide(replacedStage); break; case (StageDisplayType.MoveToFront): - MoveToFront(portraitStage); + MoveToFront(stage); break; case (StageDisplayType.UndimAllPortraits): - UndimAllPortraits(portraitStage); + UndimAllPortraits(stage); break; case (StageDisplayType.DimNonSpeakingPortraits): - DimNonSpeakingPortraits(portraitStage); + DimNonSpeakingPortraits(stage); break; } @@ -110,7 +110,8 @@ namespace Fungus Continue(); } } - protected void Show(PortraitStage portraitStage) + + protected void Show(Stage stage) { if (fadeDuration == 0) { @@ -119,14 +120,14 @@ namespace Fungus LeanTween.value(gameObject,0,1,fadeDuration).setOnUpdate( (float fadeAmount)=>{ - foreach ( Character c in portraitStage.charactersOnStage) + foreach ( Character c in stage.charactersOnStage) { c.state.portraitImage.material.SetFloat("_Alpha",fadeAmount); } } ).setOnComplete( ()=>{ - foreach ( Character c in portraitStage.charactersOnStage) + foreach ( Character c in stage.charactersOnStage) { c.state.portraitImage.material.SetFloat("_Alpha",1); } @@ -134,7 +135,8 @@ namespace Fungus } ); } - protected void Hide(PortraitStage portraitStage) + + protected void Hide(Stage stage) { if (fadeDuration == 0) { @@ -143,14 +145,14 @@ namespace Fungus LeanTween.value(gameObject,1,0,fadeDuration).setOnUpdate( (float fadeAmount)=>{ - foreach ( Character c in portraitStage.charactersOnStage) + foreach ( Character c in stage.charactersOnStage) { c.state.portraitImage.material.SetFloat("_Alpha",fadeAmount); } } ).setOnComplete( ()=>{ - foreach ( Character c in portraitStage.charactersOnStage) + foreach ( Character c in stage.charactersOnStage) { c.state.portraitImage.material.SetFloat("_Alpha",0); } @@ -158,32 +160,36 @@ namespace Fungus } ); } - protected void MoveToFront(PortraitStage portraitStage) + + protected void MoveToFront(Stage stage) { - foreach (PortraitStage ps in PortraitStage.activePortraitStages) + foreach (Stage s in Stage.activeStages) { - if (ps == portraitStage) + if (s == stage) { - ps.portraitCanvas.sortingOrder = 1; + s.portraitCanvas.sortingOrder = 1; } else { - ps.portraitCanvas.sortingOrder = 0; + s.portraitCanvas.sortingOrder = 0; } } } - protected void UndimAllPortraits(PortraitStage portraitStage) + + protected void UndimAllPortraits(Stage stage) { - portraitStage.dimPortraits = false; - foreach (Character character in portraitStage.charactersOnStage) + stage.dimPortraits = false; + foreach (Character character in stage.charactersOnStage) { - Portrait.Undim(character,portraitStage); + Portrait.Undim(character, stage); } } - protected void DimNonSpeakingPortraits(PortraitStage portraitStage) + + protected void DimNonSpeakingPortraits(Stage stage) { - portraitStage.dimPortraits = true; + stage.dimPortraits = true; } + protected void OnComplete() { if (waitUntilFinished) @@ -191,6 +197,7 @@ namespace Fungus Continue(); } } + public override string GetSummary() { string displaySummary = ""; @@ -202,12 +209,12 @@ namespace Fungus { return "Error: No display selected"; } - string portraitStageSummary = ""; - if (portraitStage != null) + string stageSummary = ""; + if (stage != null) { - portraitStageSummary = " \"" + portraitStage.name + "\""; + stageSummary = " \"" + stage.name + "\""; } - return displaySummary + portraitStageSummary; + return displaySummary + stageSummary; } public override Color GetButtonColor() diff --git a/Assets/Fungus/Portrait/Scripts/Commands/Portrait.cs b/Assets/Fungus/Portrait/Scripts/Commands/Portrait.cs index 4c3f50f9..4a6897d5 100644 --- a/Assets/Fungus/Portrait/Scripts/Commands/Portrait.cs +++ b/Assets/Fungus/Portrait/Scripts/Commands/Portrait.cs @@ -46,8 +46,8 @@ namespace Fungus "Controls a character portrait. ")] public class Portrait : Command { - [Tooltip("Display type")] - public PortraitStage portraitStage; + [Tooltip("Stage to display portrait on")] + public Stage stage; [Tooltip("Display type")] public DisplayType display; @@ -117,15 +117,15 @@ namespace Fungus return; } // Selected "use default Portrait Stage" - if (portraitStage == null) // Default portrait stage selected + if (stage == null) // Default portrait stage selected { - if (portraitStage == null) // If no default specified, try to get any portrait stage in the scene + if (stage == null) // If no default specified, try to get any portrait stage in the scene { - portraitStage = GameObject.FindObjectOfType(); + stage = GameObject.FindObjectOfType(); } } // If portrait stage does not exist, do nothing - if (portraitStage == null) + if (stage == null) { Continue(); return; @@ -133,7 +133,7 @@ namespace Fungus if (character.state.portraitImage == null) { - CreatePortraitObject(character,portraitStage); + CreatePortraitObject(character,stage); } // if no previous portrait, use default portrait if (character.state.portrait == null) @@ -148,7 +148,7 @@ namespace Fungus // if no previous position, use default position if (character.state.position == null) { - character.state.position = portraitStage.defaultPosition.rectTransform; + character.state.position = stage.defaultPosition.rectTransform; } // Selected "use previous position" if (toPosition == null) @@ -160,7 +160,7 @@ namespace Fungus // if no previous position, use default position if (replacedCharacter.state.position == null) { - replacedCharacter.state.position = portraitStage.defaultPosition.rectTransform; + replacedCharacter.state.position = stage.defaultPosition.rectTransform; } } // If swapping, use replaced character's position @@ -195,29 +195,29 @@ namespace Fungus // Use default settings if (useDefaultSettings) { - fadeDuration = portraitStage.fadeDuration; - moveSpeed = portraitStage.moveSpeed; - shiftOffset = portraitStage.shiftOffset; + fadeDuration = stage.fadeDuration; + moveSpeed = stage.moveSpeed; + shiftOffset = stage.shiftOffset; } switch(display) { case (DisplayType.Show): Show(character,fromPosition,toPosition); character.state.onScreen = true; - portraitStage.charactersOnStage.Add(character); + stage.charactersOnStage.Add(character); break; case (DisplayType.Hide): Hide(character,fromPosition,toPosition); character.state.onScreen = false; - portraitStage.charactersOnStage.Remove(character); + stage.charactersOnStage.Remove(character); break; case (DisplayType.Replace): Show(character,fromPosition,toPosition); Hide(replacedCharacter, replacedCharacter.state.position, replacedCharacter.state.position); character.state.onScreen = true; replacedCharacter.state.onScreen = false; - portraitStage.charactersOnStage.Add(character); - portraitStage.charactersOnStage.Remove(replacedCharacter); + stage.charactersOnStage.Add(character); + stage.charactersOnStage.Remove(replacedCharacter); break; case (DisplayType.MoveToFront): MoveToFront(character); @@ -241,10 +241,10 @@ namespace Fungus Continue(); } } - public static void CreatePortraitObject(Character character, PortraitStage portraitStage) + public static void CreatePortraitObject(Character character, Stage stage) { GameObject portraitObj = new GameObject(character.name, typeof(RectTransform), typeof(CanvasRenderer), typeof(Image)); - portraitObj.transform.SetParent(portraitStage.portraitCanvas.transform, true); + portraitObj.transform.SetParent(stage.portraitCanvas.transform, true); Image portraitImage = portraitObj.GetComponent(); portraitImage.preserveAspect = true; portraitImage.sprite = character.profileSprite; @@ -337,27 +337,27 @@ namespace Fungus protected void UpdateTweens(Character character, RectTransform fromPosition, RectTransform toPosition) { if (fadeDuration == 0) fadeDuration = float.Epsilon; - LeanTween.value(character.state.portraitObj,0,1,fadeDuration).setEase(portraitStage.fadeEaseType).setOnComplete(OnComplete).setOnUpdate( + LeanTween.value(character.state.portraitObj,0,1,fadeDuration).setEase(stage.fadeEaseType).setOnComplete(OnComplete).setOnUpdate( (float fadeAmount)=>{ character.state.portraitImage.material.SetFloat("_Fade", fadeAmount); } ); float moveDuration = (Vector3.Distance(fromPosition.anchoredPosition,toPosition.anchoredPosition)/moveSpeed); if (moveSpeed == 0) moveDuration = float.Epsilon; - LeanTween.value(character.state.portraitObj,fromPosition.anchoredPosition,toPosition.anchoredPosition,moveDuration).setEase(portraitStage.moveEaseType).setOnComplete(OnComplete).setOnUpdate( + LeanTween.value(character.state.portraitObj,fromPosition.anchoredPosition,toPosition.anchoredPosition,moveDuration).setEase(stage.moveEaseType).setOnComplete(OnComplete).setOnUpdate( (Vector3 updatePosition)=>{ character.state.portraitImage.rectTransform.anchoredPosition = updatePosition; } ); } - public static void Dim(Character character, PortraitStage portraitStage) + public static void Dim(Character character, Stage stage) { if (character.state.dimmed == false) { character.state.dimmed = true; - float fadeDuration = portraitStage.fadeDuration; + float fadeDuration = stage.fadeDuration; if (fadeDuration == 0) fadeDuration = float.Epsilon; - LeanTween.value(character.state.portraitObj,1f,0.5f,fadeDuration).setEase(portraitStage.fadeEaseType).setOnUpdate( + LeanTween.value(character.state.portraitObj,1f,0.5f,fadeDuration).setEase(stage.fadeEaseType).setOnUpdate( (float tintAmount)=>{ Color tint = new Color(tintAmount,tintAmount,tintAmount,1); character.state.portraitImage.material.SetColor("_Color", tint); @@ -365,14 +365,14 @@ namespace Fungus ); } } - public static void Undim(Character character, PortraitStage portraitStage) + public static void Undim(Character character, Stage stage) { if (character.state.dimmed == true) { character.state.dimmed = false; - float fadeDuration = portraitStage.fadeDuration; + float fadeDuration = stage.fadeDuration; if (fadeDuration == 0) fadeDuration = float.Epsilon; - LeanTween.value(character.state.portraitObj,0.5f,1f,fadeDuration).setEase(portraitStage.fadeEaseType).setOnUpdate( + LeanTween.value(character.state.portraitObj,0.5f,1f,fadeDuration).setEase(stage.fadeEaseType).setOnUpdate( (float tintAmount)=>{ Color tint = new Color(tintAmount,tintAmount,tintAmount,1); character.state.portraitImage.material.SetColor("_Color", tint); @@ -408,7 +408,7 @@ namespace Fungus string characterSummary = ""; string fromPositionSummary = ""; string toPositionSummary = ""; - string portraitStageSummary = ""; + string stageSummary = ""; string portraitSummary = ""; string facingSummary = ""; @@ -422,9 +422,9 @@ namespace Fungus } } characterSummary = character.name; - if (portraitStage != null) + if (stage != null) { - portraitStageSummary = " on \"" + portraitStage.name + "\""; + stageSummary = " on \"" + stage.name + "\""; } if (portrait != null) @@ -464,7 +464,7 @@ namespace Fungus } facingSummary = " facing \"" + facingSummary + "\""; } - return displaySummary + " \"" + characterSummary + portraitSummary + "\"" + portraitStageSummary + facingSummary + fromPositionSummary + toPositionSummary; + return displaySummary + " \"" + characterSummary + portraitSummary + "\"" + stageSummary + facingSummary + fromPositionSummary + toPositionSummary; } public override Color GetButtonColor() diff --git a/Assets/Fungus/Portrait/Scripts/PortraitStage.cs b/Assets/Fungus/Portrait/Scripts/Stage.cs similarity index 73% rename from Assets/Fungus/Portrait/Scripts/PortraitStage.cs rename to Assets/Fungus/Portrait/Scripts/Stage.cs index 9b398086..7731aa4b 100644 --- a/Assets/Fungus/Portrait/Scripts/PortraitStage.cs +++ b/Assets/Fungus/Portrait/Scripts/Stage.cs @@ -7,7 +7,7 @@ using System.Collections.Generic; namespace Fungus { - public class PortraitStage : MonoBehaviour + public class Stage : MonoBehaviour { public Canvas portraitCanvas; public bool dimPortraits; @@ -21,20 +21,20 @@ namespace Fungus public List charactersOnStage = new List(); [HideInInspector] - static public List activePortraitStages = new List(); + static public List activeStages = new List(); [ExecuteInEditMode] protected virtual void OnEnable() { - if (!activePortraitStages.Contains(this)) + if (!activeStages.Contains(this)) { - activePortraitStages.Add(this); + activeStages.Add(this); } } [ExecuteInEditMode] protected virtual void OnDisable() { - activePortraitStages.Remove(this); + activeStages.Remove(this); } } } diff --git a/Assets/Fungus/Portrait/Scripts/PortraitStage.cs.meta b/Assets/Fungus/Portrait/Scripts/Stage.cs.meta similarity index 100% rename from Assets/Fungus/Portrait/Scripts/PortraitStage.cs.meta rename to Assets/Fungus/Portrait/Scripts/Stage.cs.meta diff --git a/Assets/FungusExamples/Sherlock/TheExperiment.unity b/Assets/FungusExamples/Sherlock/TheExperiment.unity index 4b8d7ee4..6c478b11 100644 --- a/Assets/FungusExamples/Sherlock/TheExperiment.unity +++ b/Assets/FungusExamples/Sherlock/TheExperiment.unity @@ -2403,7 +2403,7 @@ GameObject: - 4: {fileID: 876464347} - 114: {fileID: 876464348} m_Layer: 0 - m_Name: PortraitStage + m_Name: Stage m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -3523,6 +3523,10 @@ Prefab: propertyPath: m_RootOrder value: 3 objectReference: {fileID: 0} + - target: {fileID: 11410280, guid: c6289d5f8fa843145a2355af9cb09719, type: 2} + propertyPath: m_Color.a + value: 0 + objectReference: {fileID: 0} m_RemovedComponents: [] m_ParentPrefab: {fileID: 100100000, guid: c6289d5f8fa843145a2355af9cb09719, type: 2} m_RootGameObject: {fileID: 876464346} @@ -4033,9 +4037,8 @@ MonoBehaviour: y: -1729.35046 width: 5969.4458 height: 2818.85034 - selectedSequence: {fileID: 1390555298} - selectedCommands: - - {fileID: 1390555345} + selectedSequence: {fileID: 0} + selectedCommands: [] variables: [] description: 'Example scene from Sherlock: The Game Is On' runSlowDuration: 0 @@ -4142,7 +4145,7 @@ MonoBehaviour: m_EditorClassIdentifier: errorMessage: indentLevel: 0 - portraitStage: {fileID: 0} + stage: {fileID: 0} display: 2 character: {fileID: 1880195408} replacedCharacter: {fileID: 0} @@ -5106,7 +5109,7 @@ MonoBehaviour: m_EditorClassIdentifier: errorMessage: indentLevel: 0 - portraitStage: {fileID: 0} + stage: {fileID: 0} display: 1 character: {fileID: 1880195408} replacedCharacter: {fileID: 0} @@ -5136,7 +5139,7 @@ MonoBehaviour: m_EditorClassIdentifier: errorMessage: indentLevel: 0 - portraitStage: {fileID: 0} + stage: {fileID: 0} display: 1 character: {fileID: 1880195408} replacedCharacter: {fileID: 0} @@ -5202,7 +5205,7 @@ MonoBehaviour: m_EditorClassIdentifier: errorMessage: indentLevel: 0 - portraitStage: {fileID: 0} + stage: {fileID: 0} display: 1 character: {fileID: 137130844} replacedCharacter: {fileID: 0} @@ -5232,7 +5235,7 @@ MonoBehaviour: m_EditorClassIdentifier: errorMessage: indentLevel: 0 - portraitStage: {fileID: 0} + stage: {fileID: 0} display: 1 character: {fileID: 137130844} replacedCharacter: {fileID: 0} @@ -5262,7 +5265,7 @@ MonoBehaviour: m_EditorClassIdentifier: errorMessage: indentLevel: 0 - portraitStage: {fileID: 0} + stage: {fileID: 0} display: 1 character: {fileID: 1880195408} replacedCharacter: {fileID: 0} @@ -5311,7 +5314,7 @@ MonoBehaviour: m_EditorClassIdentifier: errorMessage: indentLevel: 0 - portraitStage: {fileID: 0} + stage: {fileID: 0} display: 1 character: {fileID: 137130844} replacedCharacter: {fileID: 0} @@ -5341,7 +5344,7 @@ MonoBehaviour: m_EditorClassIdentifier: errorMessage: indentLevel: 0 - portraitStage: {fileID: 0} + stage: {fileID: 0} display: 1 character: {fileID: 137130844} replacedCharacter: {fileID: 0} @@ -5371,7 +5374,7 @@ MonoBehaviour: m_EditorClassIdentifier: errorMessage: indentLevel: 0 - portraitStage: {fileID: 0} + stage: {fileID: 0} display: 1 character: {fileID: 1880195408} replacedCharacter: {fileID: 0} @@ -5401,7 +5404,7 @@ MonoBehaviour: m_EditorClassIdentifier: errorMessage: indentLevel: 0 - portraitStage: {fileID: 0} + stage: {fileID: 0} display: 1 character: {fileID: 1880195408} replacedCharacter: {fileID: 0} @@ -5431,7 +5434,7 @@ MonoBehaviour: m_EditorClassIdentifier: errorMessage: indentLevel: 0 - portraitStage: {fileID: 0} + stage: {fileID: 0} display: 1 character: {fileID: 1880195408} replacedCharacter: {fileID: 0} @@ -5486,7 +5489,7 @@ MonoBehaviour: m_EditorClassIdentifier: errorMessage: indentLevel: 0 - portraitStage: {fileID: 0} + stage: {fileID: 0} display: 1 character: {fileID: 137130844} replacedCharacter: {fileID: 0} @@ -5516,7 +5519,7 @@ MonoBehaviour: m_EditorClassIdentifier: errorMessage: indentLevel: 0 - portraitStage: {fileID: 0} + stage: {fileID: 0} display: 1 character: {fileID: 137130844} replacedCharacter: {fileID: 0} @@ -5545,7 +5548,7 @@ MonoBehaviour: m_EditorClassIdentifier: errorMessage: indentLevel: 0 - portraitStage: {fileID: 0} + stage: {fileID: 0} display: 2 character: {fileID: 137130844} replacedCharacter: {fileID: 0} @@ -5574,7 +5577,7 @@ MonoBehaviour: m_EditorClassIdentifier: errorMessage: indentLevel: 0 - portraitStage: {fileID: 0} + stage: {fileID: 0} display: 1 character: {fileID: 137130844} replacedCharacter: {fileID: 0} @@ -5627,7 +5630,7 @@ MonoBehaviour: m_EditorClassIdentifier: errorMessage: indentLevel: 0 - portraitStage: {fileID: 0} + stage: {fileID: 0} display: 2 character: {fileID: 137130844} replacedCharacter: {fileID: 0} @@ -5702,7 +5705,7 @@ MonoBehaviour: m_EditorClassIdentifier: errorMessage: indentLevel: 0 - portraitStage: {fileID: 0} + stage: {fileID: 0} display: 2 character: {fileID: 1880195408} replacedCharacter: {fileID: 0} @@ -5731,7 +5734,7 @@ MonoBehaviour: m_EditorClassIdentifier: errorMessage: indentLevel: 0 - portraitStage: {fileID: 0} + stage: {fileID: 0} display: 1 character: {fileID: 1880195408} replacedCharacter: {fileID: 0} @@ -5846,8 +5849,8 @@ MonoBehaviour: errorMessage: indentLevel: 0 display: 2 - portraitStage: {fileID: 0} - replacedPortraitStage: {fileID: 0} + stage: {fileID: 0} + replacedStage: {fileID: 0} useDefaultSettings: 1 fadeDuration: 1 waitUntilFinished: 0 @@ -5890,7 +5893,7 @@ MonoBehaviour: m_EditorClassIdentifier: errorMessage: indentLevel: 0 - portraitStage: {fileID: 0} + stage: {fileID: 0} display: 1 character: {fileID: 137130844} replacedCharacter: {fileID: 0} @@ -5919,7 +5922,7 @@ MonoBehaviour: m_EditorClassIdentifier: errorMessage: indentLevel: 0 - portraitStage: {fileID: 0} + stage: {fileID: 0} display: 1 character: {fileID: 1880195408} replacedCharacter: {fileID: 0} @@ -5948,7 +5951,7 @@ MonoBehaviour: m_EditorClassIdentifier: errorMessage: indentLevel: 0 - portraitStage: {fileID: 0} + stage: {fileID: 0} display: 1 character: {fileID: 137130844} replacedCharacter: {fileID: 0} @@ -5977,7 +5980,7 @@ MonoBehaviour: m_EditorClassIdentifier: errorMessage: indentLevel: 0 - portraitStage: {fileID: 0} + stage: {fileID: 0} display: 1 character: {fileID: 1880195408} replacedCharacter: {fileID: 0} @@ -6006,7 +6009,7 @@ MonoBehaviour: m_EditorClassIdentifier: errorMessage: indentLevel: 0 - portraitStage: {fileID: 0} + stage: {fileID: 0} display: 1 character: {fileID: 137130844} replacedCharacter: {fileID: 0} @@ -6035,7 +6038,7 @@ MonoBehaviour: m_EditorClassIdentifier: errorMessage: indentLevel: 0 - portraitStage: {fileID: 0} + stage: {fileID: 0} display: 1 character: {fileID: 1880195408} replacedCharacter: {fileID: 0} @@ -6064,7 +6067,7 @@ MonoBehaviour: m_EditorClassIdentifier: errorMessage: indentLevel: 0 - portraitStage: {fileID: 0} + stage: {fileID: 0} display: 1 character: {fileID: 137130844} replacedCharacter: {fileID: 0} @@ -6093,7 +6096,7 @@ MonoBehaviour: m_EditorClassIdentifier: errorMessage: indentLevel: 0 - portraitStage: {fileID: 0} + stage: {fileID: 0} display: 1 character: {fileID: 1880195408} replacedCharacter: {fileID: 0} @@ -6122,7 +6125,7 @@ MonoBehaviour: m_EditorClassIdentifier: errorMessage: indentLevel: 0 - portraitStage: {fileID: 0} + stage: {fileID: 0} display: 1 character: {fileID: 137130844} replacedCharacter: {fileID: 0} @@ -6176,7 +6179,7 @@ MonoBehaviour: m_EditorClassIdentifier: errorMessage: indentLevel: 0 - portraitStage: {fileID: 0} + stage: {fileID: 0} display: 1 character: {fileID: 137130844} replacedCharacter: {fileID: 0} @@ -6205,7 +6208,7 @@ MonoBehaviour: m_EditorClassIdentifier: errorMessage: indentLevel: 0 - portraitStage: {fileID: 0} + stage: {fileID: 0} display: 1 character: {fileID: 1880195408} replacedCharacter: {fileID: 0} @@ -6234,7 +6237,7 @@ MonoBehaviour: m_EditorClassIdentifier: errorMessage: indentLevel: 0 - portraitStage: {fileID: 0} + stage: {fileID: 0} display: 1 character: {fileID: 137130844} replacedCharacter: {fileID: 0} @@ -6263,7 +6266,7 @@ MonoBehaviour: m_EditorClassIdentifier: errorMessage: indentLevel: 0 - portraitStage: {fileID: 0} + stage: {fileID: 0} display: 1 character: {fileID: 137130844} replacedCharacter: {fileID: 0}