示例#1
0
 // The decide function, called on Update() (State controller - current state - transition - decision).
 public override bool Decide(StateController controller)
 {
     // Reset sight status on loop before checking.
     controller.targetInSight = false;
     // Check sight.
     return(Decision.CheckTargetsInRadius(controller, controller.viewRadius, MyHandleTargets));
 }
示例#2
0
 // The decide function, called on Update() (State controller - current state - transition - decision).
 public override bool Decide(StateController controller)
 {
     // If target is not near: felt a shot and sight to target is clear, can focus.
     // If target is near, always check sense for target.
     return((sense != Sense.NEAR && controller.variables.feelAlert && !controller.BlockedSight()) ||
            Decision.CheckTargetsInRadius(controller, radius, MyHandleTargets));
 }
示例#3
0
    private Vector3 lastPos, currentPos;       // Last and current evidence positions.

    // The decide function, called on Update() (State controller - current state - transition - decision).
    public override bool Decide(StateController controller)
    {
        // Handle external alert received.
        if (controller.variables.hearAlert)
        {
            controller.variables.hearAlert = false;
            return(true);
        }
        // Check if something was heard by the NPC.
        else
        {
            return(Decision.CheckTargetsInRadius(controller, controller.perceptionRadius, MyHandleTargets));
        }
    }
示例#4
0
 public override bool Decide(StateController controller)
 {
     return((sence != Sence.NEAR && controller.variables.feelAlert && !controller.BlockedSight()) ||
            Decision.CheckTargetsInRadius(controller, radius, MyHanleTargets));
 }