public void StartEvent(Node behavior, bool interruptible = false, IHasBehaviorObject[] agents = null) { if (Enabled) { if (interruptible) { float priority = 1f; if (InEvent) { priority = g_BehaviorObject.CurrentEvent.Priority + 0.1f; } } agents = agents == null ? new IHasBehaviorObject[] { this } : agents; BehaviorEvent ev = new BehaviorEvent(doEvent => behavior, agents); ev.StartEvent(InEvent ? g_BehaviorObject.CurrentPriority + 1f : 1f); } }
public void StartEvent(Node behavior) { BehaviorEvent ev = new BehaviorEvent(doEvent => behavior, new IHasBehaviorObject[] { this }); ev.StartEvent(InEvent ? g_BehaviorObject.CurrentPriority + 1f : 1f); }
/// <summary> /// Void methods are self contained behaviors of an agent /// </summary> /// <param name="code"></param> public void Behavior_DoTimedGesture(GESTURE_CODE code) { BehaviorEvent be = new BehaviorEvent(doEvent => NPCBehavior_DoTimedGesture(code), new IHasBehaviorObject[] { this }); be.StartEvent(1f); }