Browse Source

Display FungusScript name and description in script window

master
chrisgregan 10 years ago
parent
commit
dea7a40eaf
  1. 3
      Assets/Fungus/FungusScript/Editor/FungusScriptEditor.cs
  2. 9
      Assets/Fungus/FungusScript/Editor/FungusScriptWindow.cs
  3. 4
      Assets/Fungus/FungusScript/Scripts/FungusScript.cs
  4. 2
      ProjectSettings/EditorBuildSettings.asset

3
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);

9
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();
}

4
Assets/Fungus/FungusScript/Scripts/FungusScript.cs

@ -59,6 +59,10 @@ namespace Fungus
[HideInInspector]
public List<Variable> variables = new List<Variable>();
[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.
*/

2
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

Loading…
Cancel
Save