
- UID
- 350150
- 好友
- 0
- 蛮牛币
- 14
- 威望
- 0
- 注册时间
- 2020-7-13
- 在线时间
- 9 小时
- 最后登录
- 2021-4-5
|
5蛮牛币
如题,将Asset/Resources/xx.anim添加到模型(Humanoid)的Animator当中。而不是直接在面板上用鼠标拖动。下面是我写的代码,但是报错了,也不知道咋回事。新手,求各位大哥指点。using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
public class AddClip : MonoBehaviour
{
public anim;
private AnimationClip clipInstance;
// Start is called before the first update
private const string path = \"Assets/Resources/\";
void Start()
{
anim = GetComponent<Animation>();
//AnimationClip clip = Resources.Load<AnimationClip>(path);
AnimationClip clip = Resources.Load<AnimationClip>(path);
clipInstance = Instantiate(clip);
anim.AddClip(clipInstance \"RecordMotion_2021_03_14_15_52_16_Humanoid.anim\");
}
}
|
|