Class AICooperative Extends VersionedMonoBehaviour, IAstarAI

Public

Movement script for cooperative pathfinding.

See

CooperativeContext

Todo

Add path pooling

Public Methods

FinalizeMovement (nextPosition, nextRotation)

Move the agent.

Public
MovementUpdate (nextPosition, nextRotation)
Public
SearchPath ()

Starts a path request to the destination.

Public

Public Variables

cooperativeContext

Handles time and space reservations for cooperative pathfinding.

Public
destination

Position in the world that this agent should move to.

Public
node
Public
onSearchPath

Called when the agent recalculates its path.

Public
pathPending
Public
pathSmoothing

How much to smooth the path.

Public
position

Position of the agent.

Public
reachedEndOfPath
Public
repathInterval

Time in seconds between new path requests.

Public
rotation

Rotation of the agent.

Public
rotationIn2D

If true, rotation will only be done along the Z axis so that the Y axis is the forward direction of the character.

Public
target
Public
velocity

Actual velocity that the agent is moving with.

Public

Private/Protected Members

agent
Private
AICooperative ()
Protected
Awake ()
Protected
canMove
Private
canSearch
Private
desiredVelocity
Private
hasPath
Private
isStopped
Private
lastRepath

Last time a path request was scheduled.

Private
maxSpeed
Private
Move (deltaPosition)

Move the agent.

Private
MovementUpdate (deltaTime, nextPosition, nextRotation)

Calculate how the character wants to move during this frame.

Private
OnDisable ()

Clear various fields when the component is disabled.

Private
OnEnable ()
Private
OnUpgradeSerializedData (version, unityThread)

Handle serialization backwards compatibility.

Protected
remainingDistance
Private
seeker

Handles path requests for this agent.

Private
SetPath (path)

Make the AI follow the specified path.

Private
Start ()
Private
steeringTarget
Private
Teleport (newPosition, clearPath)

Instantly move the agent to a new position.

Private
Update ()

Update is called once per frame.

Private
UpdatePosition ()
Private
Upgrade ()
Private