/// --------------------------------------------- /// Shared Add-On for Behavior Designer Pro /// Copyright (c) Opsive. All Rights Reserved. /// https://www.opsive.com /// --------------------------------------------- namespace Opsive.BehaviorDesigner.AddOns.Shared.Runtime.Pathfinding { using UnityEngine; /// /// Abstract class for any Movement Pack pathfinding implementation. /// public abstract class Pathfinder { /// /// The velocity of the agent. /// public abstract Vector3 Velocity { get; } /// /// The remaining distance of the agent. /// public abstract float RemainingDistance { get; } /// /// The destination of the agent. /// public abstract Vector3 Destination { get; } /// /// The speed of the agent. /// public abstract float Speed { get; set; } /// /// Initializes the pathfinder. /// /// The GameObject that the pathfinder belongs to. public abstract void Initialize(GameObject gameObject); /// /// The task has started. /// public virtual void OnStart() { } /// /// Set a new pathfinding destination. /// /// The destination to set. /// True if the destination is valid. public abstract bool SetDesination(Vector3 destination); /// /// Does the agent have a pathfinding path? /// /// True if the agent has a pathfinding path. public abstract bool HasPath(); /// /// Returns true if the position is a valid pathfinding position. /// /// The position to sample. The position will be updated to the valid sampled position. /// True if the position is a valid pathfinding position. public abstract bool SamplePosition(ref Vector3 position); /// /// Has the agent arrived at the destination? /// /// True if the agent has arrived at the destination. public abstract bool HasArrived(); /// /// The agent should stop moving. /// public abstract void Stop(); /// /// The task has ended. /// public virtual void OnEnd() { } /// /// Resets the values back to their default. /// public virtual void Reset() { } } }