diff --git a/Assets/Fungus/FungusScript/Editor/FungusScriptEditor.cs b/Assets/Fungus/FungusScript/Editor/FungusScriptEditor.cs index 50fe8f64..b9942ded 100644 --- a/Assets/Fungus/FungusScript/Editor/FungusScriptEditor.cs +++ b/Assets/Fungus/FungusScript/Editor/FungusScriptEditor.cs @@ -10,6 +10,7 @@ namespace Fungus [CustomEditor (typeof(FungusScript))] public class FungusScriptEditor : Editor { + protected SerializedProperty descriptionProp; protected SerializedProperty colorCommandsProp; protected SerializedProperty hideComponentsProp; protected SerializedProperty runSlowDurationProp; @@ -17,6 +18,7 @@ namespace Fungus protected virtual void OnEnable() { + descriptionProp = serializedObject.FindProperty("description"); colorCommandsProp = serializedObject.FindProperty("colorCommands"); hideComponentsProp = serializedObject.FindProperty("hideComponents"); runSlowDurationProp = serializedObject.FindProperty("runSlowDuration"); @@ -31,6 +33,7 @@ namespace Fungus fungusScript.UpdateHideFlags(); + EditorGUILayout.PropertyField(descriptionProp); EditorGUILayout.PropertyField(colorCommandsProp); EditorGUILayout.PropertyField(hideComponentsProp); EditorGUILayout.PropertyField(runSlowDurationProp); diff --git a/Assets/Fungus/FungusScript/Editor/FungusScriptWindow.cs b/Assets/Fungus/FungusScript/Editor/FungusScriptWindow.cs index 093e14d4..8171ae89 100755 --- a/Assets/Fungus/FungusScript/Editor/FungusScriptWindow.cs +++ b/Assets/Fungus/FungusScript/Editor/FungusScriptWindow.cs @@ -159,6 +159,15 @@ namespace Fungus GUILayout.FlexibleSpace(); + GUILayout.BeginVertical(); + GUILayout.FlexibleSpace(); + GUILayout.Label(fungusScript.name, EditorStyles.whiteBoldLabel); + if (fungusScript.description.Length > 0) + { + GUILayout.Label(fungusScript.description, EditorStyles.whiteLargeLabel); + } + GUILayout.EndVertical(); + GUILayout.EndHorizontal(); } diff --git a/Assets/Fungus/FungusScript/Scripts/FungusScript.cs b/Assets/Fungus/FungusScript/Scripts/FungusScript.cs index ea0190b8..5441aa41 100644 --- a/Assets/Fungus/FungusScript/Scripts/FungusScript.cs +++ b/Assets/Fungus/FungusScript/Scripts/FungusScript.cs @@ -59,6 +59,10 @@ namespace Fungus [HideInInspector] public List variables = new List(); + [TextArea(3, 5)] + [Tooltip("Description text displayed in the Fungus Script editor window")] + public string description; + /** * Minimum time for each command to execute when runSlowInEditor is enabled. */ diff --git a/ProjectSettings/EditorBuildSettings.asset b/ProjectSettings/EditorBuildSettings.asset index db3685af..c0b229ca 100644 --- a/ProjectSettings/EditorBuildSettings.asset +++ b/ProjectSettings/EditorBuildSettings.asset @@ -6,4 +6,4 @@ EditorBuildSettings: serializedVersion: 2 m_Scenes: - enabled: 1 - path: Assets/Examples/TheHunter/TheHunter.unity + path: Assets/FungusExamples/TheHunter/TheHunter.unity