Class BasicAgent
Describes an abstract unit to handle pathfinding requests and communice with AlchemyNavigationSystem
.
Inheritance
Namespace: AlchemyBow.Navigation
Assembly: AlchemyBow.Navigation.dll
Syntax
public abstract class BasicAgent : MonoBehaviour
Properties
| Improve this Doc View SourceAreaMask
Gets or sets the area mask of the agent.
Declaration
public int AreaMask { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | The area mask of the agent. |
Remarks
If set value is changed, OnAreaMaskChanged()
is called.
HasDestination
Determines whether the agent has destination.
Declaration
public bool HasDestination { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
HasPendingRequests
Determines whether the agent has pending requests.
Declaration
protected bool HasPendingRequests { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
IsPathWalking
Determines whether the agent is walking along the path.
Declaration
protected abstract bool IsPathWalking { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Layer
Gets or sets the target layer of the agent.
Declaration
public int Layer { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | The target layer of the agent. |
Remarks
If set value is changed, OnLayerChanged()
is called.
Radius
Defines how close the agent center can get to edges of the navigation mesh.
Declaration
public float Radius { get; }
Property Value
Type | Description |
---|---|
System.Single | The radius of the agent. |
Methods
| Improve this Doc View SourceCancelAllRequests()
Cancels all requested path calculations.
Declaration
public void CancelAllRequests()
OnAgentDisable()
Called when the agent becomes disabled or inactive.
Declaration
protected abstract void OnAgentDisable()
OnAgentEnable()
Called when the agent becomes enabled and active.
Declaration
protected abstract void OnAgentEnable()
OnAreaMaskChanged()
Called when the area mask property is changed.
Declaration
protected abstract void OnAreaMaskChanged()
OnConnectionWithSystemLost()
Called when the system is deinitialized.
Declaration
protected virtual void OnConnectionWithSystemLost()
Remarks
By default, sets the agent's game object inactive.
OnLayerChanged()
Called when the layer property is changed.
Declaration
protected abstract void OnLayerChanged()
OnPath(Vector3[], IImmutableFace[])
Called when one of the requested paths is calculated.
Declaration
protected abstract void OnPath(Vector3[] path, IImmutableFace[] facePath)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.Vector3[] | path | The calculated path consisting of waypoints. |
IImmutableFace[] | facePath | The calculated path consisting of faces. |
OnRequestsCanceled()
Called when requests are canceled.
Declaration
protected abstract void OnRequestsCanceled()
OnSurfaceAvailable(PathfindingRequest)
Called when the surface becomes available.
Declaration
protected abstract void OnSurfaceAvailable(PathfindingRequest delayedRequest)
Parameters
Type | Name | Description |
---|---|---|
PathfindingRequest | delayedRequest | A request that was delayed until surface becomes available. |
RequestPath(Vector3, Vector3, PathfindingRequest.PathType, IImmutableFace)
Schedules the path calculation.
Declaration
protected void RequestPath(Vector3 start, Vector3 destination, PathfindingRequest.PathType pathType, IImmutableFace startFace = null)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.Vector3 | start | The start point of a path. |
UnityEngine.Vector3 | destination | The end point of a path. |
PathfindingRequest.PathType | pathType | The target type of a path. |
IImmutableFace | startFace | (optional) The start face of the path. |