1

我正在尝试将现有的 .anim 文件导入现有的统一模型。我知道如何在 Unity 中做到这一点,并构建到一个 HTML 文件中,但我想知道是否有一种方法可以只使用 unityscript 或 javascript 来做到这一点?我的意思是使用javascript将.anim文件加载到统一网络播放器中的模型中,如果有任何解决方案,谢谢!

4

1 回答 1

1

Resource.Load允许您这样做。

var mdl : GameObject = Resources.Load("Animations/"+ animationFolder+"/" + aName);

    if (!mdl) {

        Debug.LogError("Missing animation asset: Animations/" + animationFolder+"/"+aName + " could not be found.");

    }  else {

        var aClip = mdl.animation.clip;
        charAnimation.AddClip(aClip, aName);
        Debug.Log(charAnimation[aName].name + " loaded from resource file " + animationFolder + "/" + aName + ". Length check: " + charAnimation[aName].length);    

    }
于 2013-07-31T07:14:01.430 回答