Exemple #1
0
 public void PlayList(BehaviorListHolder newBehaviorListHolder)
 {
     EndCurrentBehaviorList();
     _currentBehaviorList = newBehaviorListHolder;
     onBehaviorListStart.Invoke();
     newBehaviorListHolder.behaviorNodeSystem = this;
     _playingBehaviorNodesCoroutine           = StartCoroutine(PlayBehaviorNodesCoroutine());
 }
Exemple #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);
        }
Exemple #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();
 }
Exemple #4
0
        public override void OnInspectorGUI()
        {
            behaviorListHolder = (BehaviorListHolder)target;

            TryRegisterUndoCallback();

            DrawDefaultInspector();

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

            DrawNodesList();

            DrawUIForAddingNodes();

            if (GUI.changed)
            {
                serializedObject.ApplyModifiedProperties();
            }
        }
Exemple #5
0
 public override void createUIDescription(BehaviorListHolder behaviorList, SerializedObject serializedObject)
 {
     GUILayout.Label("<<Time to wait>>");
     timeToWait = EditorGUILayout.FloatField("Time to wait: ", timeToWait);
 }
Exemple #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)
 {
 }
Exemple #7
0
 public override void createUIDescription(BehaviorListHolder BehaviorList, SerializedObject serializedObject)
 {
     GUILayout.Label("<<Debug Log>>");
     text = EditorGUILayout.TextArea(text);
 }