public Node NPCBehavior_DoTimedGestureAtPoint(Transform location, GESTURE_CODE gesture, Vector3 orientation) { return(new Sequence( NPCBehavior_GoTo(location, false), NPCBehavior_OrientTowards(orientation), NPCBehavior_DoGesture(gesture) )); }
private RunStatus Behavior_DoGesture(GESTURE_CODE gest, System.Object o = null, bool timed = false) { if (g_NPCController.Body.IsGesturePlaying(gest)) { return(RunStatus.Running); } else if (g_GestureRunning) { g_GestureRunning = false; return(RunStatus.Success); } else { try { g_NPCController.Body.DoGesture(gest, o, timed); g_GestureRunning = true; return(RunStatus.Running); } catch (System.Exception e) { g_NPCController.Debug("Could not initialize gesture with error: " + e.Message); return(RunStatus.Failure); } } }
public BEHAVIOR_STATUS Behavior_DoGesture(GESTURE_CODE Gesture, System.Object Value = null, bool Timed = false) { if (gNPCController.Body.IsTimedGesturePlaying(Gesture)) { return(BEHAVIOR_STATUS.RUNNING); } else if (g_GestureRunning) { g_GestureRunning = false; return(BEHAVIOR_STATUS.SUCCESS); } else { try { gNPCController.Body.DoGesture(Gesture, Value, Timed); g_GestureRunning = true; return(BEHAVIOR_STATUS.RUNNING); } catch (System.Exception e) { gNPCController.Debug("Could not initialize gesture with error: " + e.Message); return(BEHAVIOR_STATUS.FAILURE); } } }
/// <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); }
public Node NPCBehavior_DoGesture(GESTURE_CODE gesture, System.Object o = null, bool timed = false) { return(new LeafInvoke( () => Behavior_DoGesture(gesture, o, timed) )); }
public Node NPCBehavior_DoTimedGesture(GESTURE_CODE gesture, System.Object o = null) { return(NPCBehavior_DoGesture(gesture, o, true)); }