// Activate a Mecanim animation private void Activate(Animator animator) { if (animationState == empty) return; if (resetNormalizedTime) { if (crossfadeTime > 0f) animator.CrossFadeInFixedTime(animationState, crossfadeTime, layer, 0f); else animator.Play(animationState, layer, 0f); } else { if (crossfadeTime > 0f) { animator.CrossFadeInFixedTime(animationState, crossfadeTime, layer); } else animator.Play(animationState, layer); } }