我是Unity的新手,它可能是一个基本信息 .

我想从另一个FBX模型动画中为FBX模型制作动画 . 例如,我们有A_FBX和B_FBX文件 . * A_FBX有模型,没有动画 . * B_FBX有模型和动画

我必须使用C#程序使用B_FBX动画为A_FBX模型设置动画 . 并且不应该有任何手动步骤 . 一切都只通过C#代码 .

尝试以下代码,但没有奏效 . 它有一些手动工作,我们将使用A_FBX和B_FBX映射每个游戏对象属性 .

Animation anim;
  //obj1 is GameObject and it will be mapped to A_FBX
  anim = obj1.AddComponent<Animation>();
//obj1 is GameObject and it will be mapped to A_FBX
  anim = obj2.GetComponent<Animation>();

  anim.Play();

提前致谢 .