private void InLos() { // This should only be called if the movement operator is the current one; // if that turns out not to be the case we can just add a check here. if (Visibility.InLineOfSight(Owner, _entity)) { _moveOperator.HaveArrived(); var mover = ActionOperators.Dequeue(); mover.Shutdown(Outcome.Success); } }
public override float GetScore(Blackboard context) { var owner = context.GetState <SelfState>().GetValue(); var target = context.GetState <TargetEntityState>().GetValue(); if (target == null) { return(0.0f); } return(Visibility.InLineOfSight(owner, target) ? 1.0f : 0.0f); }