Class MineBotAnimation Extends VersionedMonoBehaviour

Public

Animation helper specifically made for the spider robot in the example scenes.

The spider robot (or mine-bot) which has been copied from the Unity Example Project can have this script attached to be able to pathfind around with animations working properly.

This script should be attached to a parent GameObject however since the original bot has Z+ as up. This component requires Z+ to be forward and Y+ to be up.
A movement script (e.g AIPath) must also be attached to the same GameObject to actually move the unit.

This script will forward the movement speed to the animator component (anim) using the following animator parameter:

  • NormalizedSpeed: Movement speed in world units, divided by MineBotAnimation.naturalSpeed and the character's scale. This will be 1 when the agent is moving at the natural speed, and 0 when it is standing still.

When the end of path is reached, if the endOfPathEffect is not null, it will be instantiated at the current position. However, a check will be done so that it won't spawn effects too close to the previous spawn-point.

Public Variables

anim

Animator component.

Public
endOfPathEffect

Effect which will be instantiated when end of path is reached.

Public
naturalSpeed

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

Public

Private/Protected Members

Awake ()
Protected
OnDisable ()
Private
OnEnable ()
Private
OnTargetReached ()

Called when the end of path has been reached.

Private
OnUpdate (components, count)
Private Static
OnUpdate ()
Private
OnUpgradeSerializedData (migrations, unityThread)

Handle serialization backwards compatibility.

Protected
Reset ()

Handle serialization backwards compatibility.

Protected
UpgradeSerializedData (isUnityThread)
Protected
ai
Private
isAtDestination
Private
lastTarget

Point for the last spawn of endOfPathEffect.

Protected
tr
Private