Platformer Pro  2.3.2
A platform game kit for Unity.
PlatformerPro.MecanimAnimationBridge_3D Class Reference

An animator that sends sets state and previous state on a mecanim controller. Typically used for 3D models. More...

Inheritance diagram for PlatformerPro.MecanimAnimationBridge_3D:
PlatformerPro.MecanimAnimationBridge_3DExtraParams

Public Attributes

bool ensureStatePlaysForOneFrame = true
 Check animator to ensure state plays for at least one frame. More...
 
List< AnimatorControllerMappingmappings
 Maps from states to animator overrides. More...
 

Protected Member Functions

virtual void ActualUpdate ()
 Implements the update code so it can be reused. More...
 
virtual void Init ()
 Init this instance. More...
 
virtual void AnimationStateChanged (object sender, AnimationEventArgs args)
 Handles animation state changed. More...
 
virtual void HandleRespawned (object sender, CharacterEventArgs e)
 Handle character respawns by resetting animation state. More...
 

Protected Attributes

Dictionary< string, AnimatorOverrideController > animationStateOverrideLookup
 Lookup table of states to animator overrides. More...
 
RuntimeAnimatorController defaultController
 Store default controller. More...
 
IMob myCharacter
 Cached reference to the character. More...
 
Animator myAnimator
 Cached reference to the animator. More...
 
AnimationState state
 The state currently playing. More...
 
AnimationState queuedState
 The animation state that should play next. More...
 
bool hasPlayed
 Track if we have played an animation. If we play multiple animations faster than mecanim can handle it will sometimes not play the latest state. More...
 
ProjectileAimer aimer
 Cached reference to an aimer. More...
 

Static Protected Attributes

const float OneShotLength = 0.25f
 A work around for the very limited runtimeinformation available from Mecaim. If a clip is shorter than this it will play from the start when animators are changed instead of playing from the normalized time. More...
 
static string[] nonAimingStates = {AnimationState.DEATH.AsString (), AnimationState.GAME_OVER.AsString ()}
 States that never show aiming animations. You could extend this list in your own class. More...
 

Detailed Description

An animator that sends sets state and previous state on a mecanim controller. Typically used for 3D models.

Member Function Documentation

◆ ActualUpdate()

virtual void PlatformerPro.MecanimAnimationBridge_3D.ActualUpdate ( )
protectedvirtual

Implements the update code so it can be reused.

Reimplemented in PlatformerPro.MecanimAnimationBridge_3DExtraParams.

◆ AnimationStateChanged()

virtual void PlatformerPro.MecanimAnimationBridge_3D.AnimationStateChanged ( object  sender,
AnimationEventArgs  args 
)
protectedvirtual

Handles animation state changed.

Parameters
senderSender.
argsArguments.

◆ HandleRespawned()

virtual void PlatformerPro.MecanimAnimationBridge_3D.HandleRespawned ( object  sender,
CharacterEventArgs  e 
)
protectedvirtual

Handle character respawns by resetting animation state.

◆ Init()

virtual void PlatformerPro.MecanimAnimationBridge_3D.Init ( )
protectedvirtual

Init this instance.

Reimplemented in PlatformerPro.MecanimAnimationBridge_3DExtraParams.

Member Data Documentation

◆ aimer

ProjectileAimer PlatformerPro.MecanimAnimationBridge_3D.aimer
protected

Cached reference to an aimer.

◆ animationStateOverrideLookup

Dictionary<string, AnimatorOverrideController> PlatformerPro.MecanimAnimationBridge_3D.animationStateOverrideLookup
protected

Lookup table of states to animator overrides.

◆ defaultController

RuntimeAnimatorController PlatformerPro.MecanimAnimationBridge_3D.defaultController
protected

Store default controller.

◆ ensureStatePlaysForOneFrame

bool PlatformerPro.MecanimAnimationBridge_3D.ensureStatePlaysForOneFrame = true

Check animator to ensure state plays for at least one frame.

◆ hasPlayed

bool PlatformerPro.MecanimAnimationBridge_3D.hasPlayed
protected

Track if we have played an animation. If we play multiple animations faster than mecanim can handle it will sometimes not play the latest state.

◆ mappings

List<AnimatorControllerMapping> PlatformerPro.MecanimAnimationBridge_3D.mappings

Maps from states to animator overrides.

◆ myAnimator

Animator PlatformerPro.MecanimAnimationBridge_3D.myAnimator
protected

Cached reference to the animator.

◆ myCharacter

IMob PlatformerPro.MecanimAnimationBridge_3D.myCharacter
protected

Cached reference to the character.

◆ nonAimingStates

string [] PlatformerPro.MecanimAnimationBridge_3D.nonAimingStates = {AnimationState.DEATH.AsString (), AnimationState.GAME_OVER.AsString ()}
staticprotected

States that never show aiming animations. You could extend this list in your own class.

◆ OneShotLength

const float PlatformerPro.MecanimAnimationBridge_3D.OneShotLength = 0.25f
staticprotected

A work around for the very limited runtimeinformation available from Mecaim. If a clip is shorter than this it will play from the start when animators are changed instead of playing from the normalized time.

◆ queuedState

AnimationState PlatformerPro.MecanimAnimationBridge_3D.queuedState
protected

The animation state that should play next.

◆ state

AnimationState PlatformerPro.MecanimAnimationBridge_3D.state
protected

The state currently playing.


The documentation for this class was generated from the following file: