Beispiel #1
0
 public void PlayList(BehaviorListHolder newBehaviorListHolder)
 {
     EndCurrentBehaviorList();
     _currentBehaviorList = newBehaviorListHolder;
     onBehaviorListStart.Invoke();
     newBehaviorListHolder.behaviorNodeSystem = this;
     _playingBehaviorNodesCoroutine           = StartCoroutine(PlayBehaviorNodesCoroutine());
 }
Beispiel #2
0
        public override void createUIDescription(BehaviorListHolder behaviorList, SerializedObject serializedObject)
        {
            SetActiveNode node = this;

            GUILayout.Label("<<SetActiveNode>>");
            gameObj = (GameObject)EditorGUILayout.ObjectField("Object: ", gameObj, typeof(GameObject), true);
            active  = EditorGUILayout.Toggle("Active: ", active);
        }
Beispiel #3
0
 private void EndCurrentBehaviorList()
 {
     if (_currentBehaviorList == null)
     {
         return;
     }
     if (_currentNode != null)
     {
         _currentNode.EndNodeExecution();
         _currentNode.OnEnd();
     }
     if (_playingBehaviorNodesCoroutine != null)
     {
         StopCoroutine(_playingBehaviorNodesCoroutine);
     }
     _currentBehaviorList = null;
     onBehaviorListEnd.Invoke();
 }
Beispiel #4
0
        public override void OnInspectorGUI()
        {
            behaviorListHolder = (BehaviorListHolder)target;

            TryRegisterUndoCallback();

            DrawDefaultInspector();

            if (behaviorListHolder.nodeListAsset == null)
            {
                DrawCreateNodeListAssetButton();
                return;
            }

            DrawNodesList();

            DrawUIForAddingNodes();

            if (GUI.changed)
            {
                serializedObject.ApplyModifiedProperties();
            }
        }
Beispiel #5
0
 public override void createUIDescription(BehaviorListHolder behaviorList, SerializedObject serializedObject)
 {
     GUILayout.Label("<<Time to wait>>");
     timeToWait = EditorGUILayout.FloatField("Time to wait: ", timeToWait);
 }
Beispiel #6
0
 /*In this function, you define what will appear in the UI of the BehaviorList.
  * Just populate with GUILayout funcitons*/
 virtual public void createUIDescription(BehaviorListHolder behaviorList, SerializedObject serializedObject)
 {
 }
Beispiel #7
0
 public override void createUIDescription(BehaviorListHolder BehaviorList, SerializedObject serializedObject)
 {
     GUILayout.Label("<<Debug Log>>");
     text = EditorGUILayout.TextArea(text);
 }