动态更换animator的animatorcontroller

你可以这样

 Animator animator = this.gameObject.GetComponent<Animator>();
 animator.runtimeAnimatorController = Resources.Load("path_to_your_controller") as RuntimeAnimatorController;

也可以这样

public RuntimeAnimatorController anim2;
this.GetComponent().runtimeAnimatorController = anim2 as RuntimeAnimatorController;
原文地址:https://www.cnblogs.com/unityzc/p/8064961.html