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.

Animation is handled by this component. The Animation component refered to in anim should have animations named "awake" and "forward". The forward animation will have it's speed modified by the velocity and scaled by animationSpeed to adjust it to look good. The awake animation will only be sampled at the end frame and will not play.
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

Animation component.

Public
animationSpeed

Speed relative to velocity with which to play animations.

Public
endOfPathEffect

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

Public
sleepVelocity

Minimum velocity for moving.

Public

Private/Protected Members

ai
Private
Awake ()
Protected
isAtDestination
Private
lastTarget

Point for the last spawn of endOfPathEffect.

Protected
OnTargetReached ()

Called when the end of path has been reached.

Private
OnUpgradeSerializedData (version, unityThread)

Handle serialization backwards compatibility.

Protected
Reset ()

Handle serialization backwards compatibility.

Protected
Start ()
Private
tr
Private
Update ()
Protected