public void SetDefaultAnimation() { if (myAnimator != null) { if (DefaultAnimationActionPrefab != null) { CharAction defaultAnimationAction = Instantiate(DefaultAnimationActionPrefab, new Vector3(0f, 0f, 0f), Quaternion.identity) as CharAction; defaultAnimationAction.transform.SetParent(transform, false); defaultAnimationAction.MyAnimator = myAnimator; defaultAnimationAction.MakeAction(); } else { AnimationUtilities.SetTriggerIfExists("Idle", myAnimator); } } }
public override void MakeAction() { AnimationUtilities.SetTriggerIfExists("Idle", MyAnimator); Destroy(gameObject); }