AnimatorController即动画控制器创建的BUG
生活随笔
收集整理的這篇文章主要介紹了
AnimatorController即动画控制器创建的BUG
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
AnimatorController即動畫控制器創建的BUG
//---------------------------------------------------------------------------------------------------------------//!!!使用代碼創建animatorcontroller,雖然能創建成功,看起來也沒什么問題,可能是使用方式問題//但使用loadassetatpath重新加載時,狀態機為空,或關閉U3D再重新打開時發現狀態機確實沒有//查看了U3D文檔,說明如下,似乎是不支持.controller//You must ensure that the path uses a supported extension ('.mat' for materials, '.cubemap' for cubemaps, '.GUISkin' for skins, '.anim' for animations and '.asset' for arbitrary other assets.)//因此,采取另一種策略:先在UNITY編輯器中使用菜單功能創建一個空的AnimatorController,然后加載它并填充需要的東西//---------------------------------------------------------------------------------------------------------------//錯誤的創建方式://var aniCtrl = new AnimatorController();//aniCtrl.AddLayer("base layer");//aniCtrl.layers[0].stateMachine = new AnimatorStateMachine();//正確的創建方式:var aniCtrl = AssetDatabase.LoadAssetAtPath("Assets/res/Models/char/template.controller", typeof(AnimatorController)) as AnimatorController;?
posted on 2018-01-31 11:12 時空觀察者9號 閱讀(...) 評論(...) 編輯 收藏
總結
以上是生活随笔為你收集整理的AnimatorController即动画控制器创建的BUG的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 不可能的工作:在FBX模型导入脚本中生成
- 下一篇: 我的MAXSCRIPT笔记