Class AlchemyNavigationSystem
This class contains main logic of AlchemyNavigation
system.
Inheritance
Namespace: AlchemyBow.Navigation
Assembly: AlchemyBow.Navigation.dll
Syntax
public sealed class AlchemyNavigationSystem : MonoBehaviour
Remarks
This is strongly recommended to use AlchemyNavigation.Current
.
Properties
| Improve this Doc View SourceCurrent
Gets the current initialized instance of AlchemyNavigationSystem
or null
.
Declaration
public static AlchemyNavigationSystem Current { get; }
Property Value
Type | Description |
---|---|
AlchemyNavigationSystem | The current initialized instance of |
IsSurfaceActive
Determines whether there is the initialized instance of AlchemyNavigationSystem
and its surface is available.
Declaration
public static bool IsSurfaceActive { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
IsSystemInitialized
Determines whether there is the initialized instance of AlchemyNavigationSystem
.
Declaration
public static bool IsSystemInitialized { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Settings
Gets the settings used by the instance of AlchemyNavigationSystem
.
Declaration
public NavigationSettings Settings { get; }
Property Value
Type | Description |
---|---|
NavigationSettings | The settings used by the instance of |
Methods
| Improve this Doc View SourceContainsFace(Int32, IImmutableFace)
Determines whether the system contains the specified face.
Declaration
public bool ContainsFace(int layer, IImmutableFace face)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | layer | The index of the layer to check. |
IImmutableFace | face | The face to locate. |
Returns
Type | Description |
---|---|
System.Boolean |
|
Remarks
Use only when the surface is available.
CreatePathfindingRequest(Object, PathfindingRequest)
Schedules a PathfindingRequest
.
Declaration
public void CreatePathfindingRequest(object requestorKey, PathfindingRequest request)
Parameters
Type | Name | Description |
---|---|---|
System.Object | requestorKey | A unique identifier to distinguish requestors. |
PathfindingRequest | request | A request to schedule. |
Remarks
If there are multiple requests from one requestor during one calculation circle, only the last request is calculated.
Raycast(Ray, Int32, Int32, out SurfaceImmutableRaycastHit)
Casts a ray against faces in the system and returns information on what was hit.
Declaration
public bool Raycast(Ray ray, int layer, int areaMask, out SurfaceImmutableRaycastHit result)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.Ray | ray | The starting point and direction of the ray. |
System.Int32 | layer | The index of layer to check. |
System.Int32 | areaMask | An area mask that is used to selectively ignore faces when casting a ray. |
SurfaceImmutableRaycastHit | result | If |
Returns
Type | Description |
---|---|
System.Boolean |
|
Remarks
Use only when the surface is available.
RegisterFace(Vector3, Vector3, Vector3, Int32, Int32)
Registers a face in the system.
Declaration
public NavigationFaceWrapper RegisterFace(Vector3 a, Vector3 b, Vector3 c, int areaIndex, int layerIndex)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.Vector3 | a | Point a of the triangle. |
UnityEngine.Vector3 | b | Point b of the triangle. |
UnityEngine.Vector3 | c | Point c of the triangle. |
System.Int32 | areaIndex | Index of the area to which the triangle belongs. |
System.Int32 | layerIndex | Index of the layer to which the triangle belongs. |
Returns
Type | Description |
---|---|
NavigationFaceWrapper | The handle that can by used to unregister the face later. |
Remarks
Does not provide validation. The programmer's job is to ensure the correctness of the added elements.
The face is not added, immediately.
Exceptions
Type | Condition |
---|---|
System.Exception | Thrown when |
UnregisterFace(NavigationFaceWrapper)
Unregisters the face from the system.
Declaration
public void UnregisterFace(NavigationFaceWrapper handle)
Parameters
Type | Name | Description |
---|---|---|
NavigationFaceWrapper | handle | The unique face handle that was received during registration. |
Remarks
The face is not removed, immediately.
Events
| Improve this Doc View SourceOnPathfindingFinished
Raised whenever the AlchemyNavigationSystem
instance finishes pathfinding calculations.
Declaration
public static event NavigationAct OnPathfindingFinished
Event Type
Type | Description |
---|---|
NavigationAct |
OnSurfaceAvailable
Raised whenever the surface of the AlchemyNavigationSystem
instance becomes available.
Declaration
public static event NavigationAct OnSurfaceAvailable
Event Type
Type | Description |
---|---|
NavigationAct |
OnSurfaceUnavailable
Raised whenever the surface of the AlchemyNavigationSystem
instance becomes unavailable.
Declaration
public static event NavigationAct OnSurfaceUnavailable
Event Type
Type | Description |
---|---|
NavigationAct |
OnSystemDeinitialized
Raised whenever the AlchemyNavigationSystem
instance is deinitialized.
Declaration
public static event NavigationAct OnSystemDeinitialized
Event Type
Type | Description |
---|---|
NavigationAct |
OnSystemInitialized
Raised whenever the AlchemyNavigationSystem
instance is initialized.
Declaration
public static event NavigationAct OnSystemInitialized
Event Type
Type | Description |
---|---|
NavigationAct |