【酷熊科技】工作积累 ----------- unity 动态设置 Animator组件的Controller

 

unity  动态加载 Animator 组件 的Controller

 

public Animator animator; // 直接拖拽,引用

 

string strPath = "FXV2/SoulAnimator/soul_had_animator_" + quality;  // 路径
RuntimeAnimatorController runAnim = (RuntimeAnimatorController) Resources.Load(strPath); // 加载,设置为RuntimeAnimatorController类型
animDiBan.runtimeAnimatorController = runAnim; // 赋值

 

posted @ 2017-05-19 17:31  silent-bobo  阅读(3892)  评论(0编辑  收藏  举报