애니메이션 컨트롤러를 변경하는 방법이다.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
public class AnimTest : MonoBehaviour
{
[SerializeField]
private RuntimeAnimatorController animatorContoller; // Animator Controller
private Animator _anim;
void Start()
{
_anim = GetComponent<Animator>();
// 컨트롤러 변경
_anim.runtimeAnimatorController = animatorContoller;
// or Resources에서 불러오기
_anim.runtimeAnimatorController = Resources.Load<RuntimeAnimatorController>(animatorControllerPath);
}
}