protected override void LocalUpdate(AgentContext context) { NavmeshPoint pt; context.navCon.Query.GetRandomPoint(context.navCon.Filter, out pt); if (pt.polyRef == 0) state = TaskState.Failed; else { context.navCon.MoveTo(pt, RangeType.At, true); state = TaskState.Complete; } }
protected override void LocalUpdate(AgentContext context) { if (state == TaskState.Inactive) { mFailed = false; context.navCon.RequestGoalCheck(); // Just in case agent is already at goal. context.navCon.OnNavEvent += Controller_Monitor; state = TaskState.Active; return; } if (context.navCon.IsAtGoal) state = TaskState.Complete; else if (mFailed) state = TaskState.Failed; }
protected override void LocalUpdate(AgentContext context) { if (state == TaskState.Inactive) { mFailed = false; context.navCon.RequestGoalCheck(); // Just in case agent is already at goal. context.navCon.OnNavEvent += Controller_Monitor; state = TaskState.Active; return; } if (context.navCon.IsAtGoal) { state = TaskState.Complete; } else if (mFailed) { state = TaskState.Failed; } }
protected override bool LocalExit(AgentContext context) { if (state != TaskState.Active) context.navCon.OnNavEvent -= Controller_Monitor; return true; }
public bool EvaluateCondition(AgentContext context) { return(context.userControlled); }
protected override void LocalUpdate(AgentContext context) { context.navCon.SetUseCrowd(useCrowd); state = TaskState.Complete; }
protected override void LocalUpdate(AgentContext context) { state = context.userControlled ? TaskState.Complete : TaskState.Active; }