Browse Source

Added tooltips to SequenceControllerEditor

master
chrisgregan 11 years ago
parent
commit
bfa0141874
  1. 4
      Assets/Fungus/Editor/FungusEditorWindow.cs
  2. 6
      Assets/Fungus/Editor/SequenceControllerEditor.cs
  3. 10
      Assets/Fungus/Editor/SequenceEditor.cs

4
Assets/Fungus/Editor/FungusEditorWindow.cs

@ -130,14 +130,14 @@ public class FungusEditorWindow : EditorWindow
GUILayout.BeginVertical();
GUILayout.FlexibleSpace();
GUILayout.BeginHorizontal();
GUILayout.Space(10);
GUILayout.Space(15);
if (GUILayout.Button(labelText))
{
Selection.activeGameObject = sequenceController.gameObject;
}
GUILayout.FlexibleSpace();
GUILayout.EndHorizontal();
GUILayout.Space(10);
GUILayout.Space(15);
GUILayout.EndVertical();
}

6
Assets/Fungus/Editor/SequenceControllerEditor.cs

@ -11,9 +11,11 @@ public class SequenceControllerEditor : Editor
{
SequenceController t = target as SequenceController;
t.stepTime = EditorGUILayout.FloatField("Step Time", t.stepTime);
GUIContent stepTimeLabel = new GUIContent("Step Time", "Minimum time to execute each step");
t.stepTime = EditorGUILayout.FloatField(stepTimeLabel, t.stepTime);
t.startSequence = SequenceEditor.SequenceField("Start Sequence", t, t.startSequence);
GUIContent startSequenceLabel = new GUIContent("Start Sequence", "Sequence to be executed when controller starts.");
t.startSequence = SequenceEditor.SequenceField(startSequenceLabel, t, t.startSequence);
if (t.startSequence == null)
{

10
Assets/Fungus/Editor/SequenceEditor.cs

@ -8,7 +8,7 @@ using Fungus;
public class SequenceEditor : Editor
{
static public Sequence SequenceField(string label, SequenceController sequenceController, Sequence sequence)
static public Sequence SequenceField(GUIContent label, SequenceController sequenceController, Sequence sequence)
{
if (sequenceController == null)
{
@ -18,14 +18,14 @@ public class SequenceEditor : Editor
Sequence result = sequence;
// Build dictionary of child sequences
List<string> sequenceNames = new List<string>();
List<GUIContent> sequenceNames = new List<GUIContent>();
int selectedIndex = 0;
sequenceNames.Add("None");
sequenceNames.Add(new GUIContent("None"));
Sequence[] sequences = sequenceController.GetComponentsInChildren<Sequence>();
for (int i = 0; i < sequences.Length; ++i)
{
sequenceNames.Add(sequences[i].name);
sequenceNames.Add(new GUIContent(sequences[i].name));
if (sequence == sequences[i])
{
@ -33,7 +33,7 @@ public class SequenceEditor : Editor
}
}
selectedIndex = EditorGUILayout.Popup("Start Sequence", selectedIndex, sequenceNames.ToArray());
selectedIndex = EditorGUILayout.Popup(label, selectedIndex, sequenceNames.ToArray());
if (selectedIndex == 0)
{
result = null; // Option 'None'

Loading…
Cancel
Save