Browse Source

Fixed null reference errors

master
chrisgregan 11 years ago
parent
commit
e346683e20
  1. 20
      Assets/Fungus/Editor/FungusScript/FungusCommandEditor.cs
  2. 5
      Assets/Fungus/VisualScripting/Call.cs
  3. BIN
      Assets/Shuttle/ShuttleGame.unity

20
Assets/Fungus/Editor/FungusScript/FungusCommandEditor.cs

@ -25,6 +25,11 @@ namespace Fungus.Script
{ {
FungusCommand t = target as FungusCommand; FungusCommand t = target as FungusCommand;
if (t == null)
{
return;
}
GUILayout.BeginVertical(); GUILayout.BeginVertical();
GUILayout.BeginHorizontal(); GUILayout.BeginHorizontal();
@ -44,20 +49,8 @@ namespace Fungus.Script
GUILayout.EndHorizontal(); GUILayout.EndHorizontal();
if (!t.expanded) if (t.expanded)
{ {
GUILayout.EndVertical();
if (Event.current.type == EventType.Repaint &&
t.IsExecuting())
{
Rect rect = GUILayoutUtility.GetLastRect();
rect.x -= 10;
rect.width += 10;
GLDraw.DrawBox(rect, Color.green, 1.5f);
}
return;
}
GUILayout.BeginHorizontal(); GUILayout.BeginHorizontal();
GUILayout.FlexibleSpace(); GUILayout.FlexibleSpace();
@ -114,6 +107,7 @@ namespace Fungus.Script
EditorGUILayout.LabelField(new GUIContent("Error: " + t.errorMessage), style); EditorGUILayout.LabelField(new GUIContent("Error: " + t.errorMessage), style);
} }
} }
}
GUILayout.EndVertical(); GUILayout.EndVertical();

5
Assets/Fungus/VisualScripting/Call.cs

@ -190,6 +190,11 @@ namespace Fungus.Script
{ {
if (callCondition == CallCondition.CallAlways) if (callCondition == CallCondition.CallAlways)
{ {
if (targetSequence == null)
{
return "No target sequence selected";
}
return targetSequence.name; return targetSequence.name;
} }
else else

BIN
Assets/Shuttle/ShuttleGame.unity

Binary file not shown.
Loading…
Cancel
Save