Class MecanimBridge2D Extends VersionedMonoBehaviour

Public

Helper for adding animation to agents.

This script will forward the movement velocity to the animator component using the following animator parameters:

  • InputMagnitude: Movement speed, normalized by the agent's natural speed. 1 if the agent is moving at its natural speed, and 0 if it is standing still.

  • X: Horizontal movement speed, normalized by the agent's natural speed.

  • Y: Vertical movement speed, normalized by the agent's natural speed.

Public Variables

naturalSpeed

The natural movement speed is the speed that the animations are designed for.

Public
rotationMode

How the agent's rotation is handled.

Public
velocitySmoothing

How much to smooth the velocity of the agent.

Public

Public Enums

RotationMode
Public

Private/Protected Members

Awake ()
OnUpgradeSerializedData (migrations, unityThread)

Handle serialization backwards compatibility.

Reset ()

Handle serialization backwards compatibility.

Update ()
UpgradeSerializedData (isUnityThread)
ai

Cached reference to the movement script.

Private
anim

Cached Animator component.

Private
smoothedVelocity
Private