public void Play(string stateName) { LastPlay = stateName; if (anim != null && anim.runtimeAnimatorController != null) { // Debug.Log ("playing " + stateName); anim.Play(stateName); } else { // Debug.Log ("no animator on " + name); } //check to see if any children have animation transforms, and call closest animator on them as well. for (int i = 0; i < transform.childCount; i++) { Transform child = transform.GetChild(i); AnimationTransform at = child.GetComponent <AnimationTransform> (); if (at != null) { at.Play(stateName); } } }
public void DoCastAnimation(string name) { CastAnimationBegan(); animationTransform.Play(name); }
void MoveInNewDirection(string dir) { currentWalkingDirection = dir; animationTransform.Play(dir); sinceMovedInSameDirection = transform.position; }
public void DoAttackAnimation(string name) { AttackAnimationBegan(); animationTransform.Play(name); }