Browse Source

Moved new visual scripting code to its own namespace

master
chrisgregan 10 years ago
parent
commit
d0c2e9c961
  1. 2
      Assets/Fungus/Editor/AddOptionCommandEditor.cs
  2. 2
      Assets/Fungus/Editor/CompareCommandEditor.cs
  3. 10
      Assets/Fungus/Editor/FungusCommandEditor.cs
  4. 8
      Assets/Fungus/Editor/FungusEditorWindow.cs
  5. 17
      Assets/Fungus/Editor/FungusScriptEditor.cs
  6. 2
      Assets/Fungus/Editor/SayCommandEditor.cs
  7. 9
      Assets/Fungus/Editor/SequenceEditor.cs
  8. 2
      Assets/Fungus/Editor/SetVariableCommandEditor.cs
  9. BIN
      Assets/Fungus/Tests/Sequence/SequenceTest.unity
  10. 1
      Assets/Fungus/Tests/Sequence/SequenceTestRoom.cs
  11. 2
      Assets/Fungus/VisualScripting/AddOptionCommand.cs
  12. 2
      Assets/Fungus/VisualScripting/CompareCommand.cs
  13. 2
      Assets/Fungus/VisualScripting/ExecuteCommand.cs
  14. 2
      Assets/Fungus/VisualScripting/FungusCommand.cs
  15. 12
      Assets/Fungus/VisualScripting/FungusScript.cs
  16. 2
      Assets/Fungus/VisualScripting/SayCommand.cs
  17. 2
      Assets/Fungus/VisualScripting/Sequence.cs
  18. 8
      Assets/Fungus/VisualScripting/SetVariableCommand.cs
  19. 2
      Assets/Fungus/VisualScripting/Variable.cs
  20. 2
      Assets/Fungus/VisualScripting/WaitCommand.cs

2
Assets/Fungus/Editor/AddOptionCommandEditor.cs

@ -4,7 +4,7 @@ using UnityEngine;
using System.Collections;
using System.Collections.Generic;
namespace Fungus
namespace Fungus.Script
{
[CustomEditor (typeof(AddOptionCommand))]

2
Assets/Fungus/Editor/CompareCommandEditor.cs

@ -3,7 +3,7 @@ using UnityEngine;
using System.Collections;
using System.Collections.Generic;
namespace Fungus
namespace Fungus.Script
{
[CustomEditor (typeof(CompareCommand))]

10
Assets/Fungus/Editor/FungusCommandEditor.cs

@ -2,12 +2,14 @@ using UnityEditor;
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using Fungus;
[CustomEditor (typeof(FungusCommand), true)]
public class FungusCommandEditor : Editor
namespace Fungus.Script
{
[CustomEditor (typeof(FungusCommand), true)]
public class FungusCommandEditor : Editor
{
public static FungusCommand selectedCommand;
public override void OnInspectorGUI()
@ -43,4 +45,6 @@ public class FungusCommandEditor : Editor
{
DrawDefaultInspector();
}
}
}

8
Assets/Fungus/Editor/FungusEditorWindow.cs

@ -3,10 +3,12 @@ using UnityEditor;
using System;
using System.Collections;
using System.Collections.Generic;
using Fungus;
public class FungusEditorWindow : EditorWindow
namespace Fungus.Script
{
public class FungusEditorWindow : EditorWindow
{
[System.NonSerialized]
public Vector2 scrollPos; // ScrollViews use a Vector2 to track the state of each scroll bar
@ -283,4 +285,6 @@ public class FungusEditorWindow : EditorWindow
{
return (command.IsExecuting() || (FungusCommandEditor.selectedCommand == command));
}
}
}

17
Assets/Fungus/Editor/FungusScriptEditor.cs

@ -6,9 +6,12 @@ using Fungus;
using Rotorz.ReorderableList;
using System.Linq;
[CustomPropertyDrawer (typeof(Variable))]
public class VariableDrawer : PropertyDrawer
namespace Fungus.Script
{
[CustomPropertyDrawer (typeof(Variable))]
public class VariableDrawer : PropertyDrawer
{
public override void OnGUI (Rect position, SerializedProperty property, GUIContent label)
{
SerializedProperty keyProp = property.FindPropertyRelative("key");
@ -37,11 +40,11 @@ public class VariableDrawer : PropertyDrawer
typeProp.enumValueIndex = selectedEnum;
}
}
}
}
[CustomEditor (typeof(FungusScript))]
public class FungusScriptEditor : Editor
{
[CustomEditor (typeof(FungusScript))]
public class FungusScriptEditor : Editor
{
SerializedProperty variablesProperty;
void OnEnable()
@ -95,4 +98,6 @@ public class FungusScriptEditor : Editor
serializedObject.ApplyModifiedProperties();
}
}
}

2
Assets/Fungus/Editor/SayCommandEditor.cs

@ -4,7 +4,7 @@ using UnityEngine;
using System.Collections;
using System.Collections.Generic;
namespace Fungus
namespace Fungus.Script
{
[CustomEditor (typeof(SayCommand))]

9
Assets/Fungus/Editor/SequenceEditor.cs

@ -2,12 +2,13 @@
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using Fungus;
[CustomEditor (typeof(Sequence))]
public class SequenceEditor : Editor
namespace Fungus.Script
{
[CustomEditor (typeof(Sequence))]
public class SequenceEditor : Editor
{
static public Sequence SequenceField(GUIContent label, FungusScript fungusScript, Sequence sequence)
{
if (fungusScript == null)
@ -71,4 +72,6 @@ public class SequenceEditor : Editor
return keys[newIndex];
}
}
}

2
Assets/Fungus/Editor/SetVariableCommandEditor.cs

@ -3,7 +3,7 @@ using UnityEngine;
using System.Collections;
using System.Collections.Generic;
namespace Fungus
namespace Fungus.Script
{
[CustomEditor (typeof(SetVariableCommand))]

BIN
Assets/Fungus/Tests/Sequence/SequenceTest.unity

Binary file not shown.

1
Assets/Fungus/Tests/Sequence/SequenceTestRoom.cs

@ -1,6 +1,7 @@
using UnityEngine;
using System.Collections;
using Fungus;
using Fungus.Script;
public class SequenceTestRoom : Room
{

2
Assets/Fungus/VisualScripting/AddOptionCommand.cs

@ -2,7 +2,7 @@
using System.Collections;
using System.Collections.Generic;
namespace Fungus
namespace Fungus.Script
{
public class AddOptionCommand : FungusCommand

2
Assets/Fungus/VisualScripting/CompareCommand.cs

@ -2,7 +2,7 @@ using UnityEngine;
using System.Collections;
using System.Collections.Generic;
namespace Fungus
namespace Fungus.Script
{
public enum CompareOperator

2
Assets/Fungus/VisualScripting/ExecuteCommand.cs

@ -3,7 +3,7 @@ using System;
using System.Collections;
using System.Collections.Generic;
namespace Fungus
namespace Fungus.Script
{
public class ExecuteCommand : FungusCommand

2
Assets/Fungus/VisualScripting/FungusCommand.cs

@ -5,7 +5,7 @@ using UnityEngine;
using System.Collections;
using System.Collections.Generic;
namespace Fungus
namespace Fungus.Script
{
[RequireComponent(typeof(Sequence))]
public class FungusCommand : MonoBehaviour

12
Assets/Fungus/VisualScripting/FungusScript.cs

@ -5,10 +5,12 @@ using UnityEngine;
using System;
using System.Collections;
using System.Collections.Generic;
using Fungus;
public class FungusScript : MonoBehaviour
namespace Fungus.Script
{
public class FungusScript : MonoBehaviour
{
public float stepTime;
public Sequence startSequence;
@ -35,9 +37,9 @@ public class FungusScript : MonoBehaviour
return;
}
#if UNITY_EDITOR
#if UNITY_EDITOR
Selection.activeGameObject = sequence.gameObject;
#endif
#endif
activeSequence = sequence;
sequence.ExecuteNextCommand();
@ -54,4 +56,6 @@ public class FungusScript : MonoBehaviour
}
return null;
}
}
}

2
Assets/Fungus/VisualScripting/SayCommand.cs

@ -3,7 +3,7 @@ using System;
using System.Collections;
using System.Collections.Generic;
namespace Fungus
namespace Fungus.Script
{
public class SayCommand : FungusCommand
{

2
Assets/Fungus/VisualScripting/Sequence.cs

@ -6,7 +6,7 @@ using System;
using System.Collections;
using System.Collections.Generic;
namespace Fungus
namespace Fungus.Script
{
public class Sequence : MonoBehaviour

8
Assets/Fungus/VisualScripting/SetVariableCommand.cs

@ -1,9 +1,11 @@
using UnityEngine;
using System.Collections;
using Fungus;
public class SetVariableCommand : FungusCommand
namespace Fungus.Script
{
public class SetVariableCommand : FungusCommand
{
public string variableKey;
public BooleanData booleanData;
@ -48,4 +50,6 @@ public class SetVariableCommand : FungusCommand
Continue();
}
}
}

2
Assets/Fungus/VisualScripting/Variable.cs

@ -2,7 +2,7 @@
using System;
using System.Collections;
namespace Fungus
namespace Fungus.Script
{
public enum VariableType

2
Assets/Fungus/VisualScripting/WaitCommand.cs

@ -2,7 +2,7 @@ using UnityEngine;
using System;
using System.Collections;
namespace Fungus
namespace Fungus.Script
{
public class WaitCommand : FungusCommand

Loading…
Cancel
Save