public void PlayList(BehaviorListHolder newBehaviorListHolder) { EndCurrentBehaviorList(); _currentBehaviorList = newBehaviorListHolder; onBehaviorListStart.Invoke(); newBehaviorListHolder.behaviorNodeSystem = this; _playingBehaviorNodesCoroutine = StartCoroutine(PlayBehaviorNodesCoroutine()); }
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); }
private void EndCurrentBehaviorList() { if (_currentBehaviorList == null) { return; } if (_currentNode != null) { _currentNode.EndNodeExecution(); _currentNode.OnEnd(); } if (_playingBehaviorNodesCoroutine != null) { StopCoroutine(_playingBehaviorNodesCoroutine); } _currentBehaviorList = null; onBehaviorListEnd.Invoke(); }
public override void OnInspectorGUI() { behaviorListHolder = (BehaviorListHolder)target; TryRegisterUndoCallback(); DrawDefaultInspector(); if (behaviorListHolder.nodeListAsset == null) { DrawCreateNodeListAssetButton(); return; } DrawNodesList(); DrawUIForAddingNodes(); if (GUI.changed) { serializedObject.ApplyModifiedProperties(); } }
public override void createUIDescription(BehaviorListHolder behaviorList, SerializedObject serializedObject) { GUILayout.Label("<<Time to wait>>"); timeToWait = EditorGUILayout.FloatField("Time to wait: ", timeToWait); }
/*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) { }
public override void createUIDescription(BehaviorListHolder BehaviorList, SerializedObject serializedObject) { GUILayout.Label("<<Debug Log>>"); text = EditorGUILayout.TextArea(text); }