unity editor 读取FBX下的animtion clip文件

使用ModelImporter可以读取FBX下数据:

 1    ModelImporter modelImporter = (ModelImporter)AssetImporter.GetAtPath(modelAssetPath);
 2                                 if (modelImporter && modelImporter.clipAnimations.Length > 0)
 3                                 {
 4                                     //可能有animClip在fbx文件下面,表明是anim的规则判断
 5                                     regexString = string.Format(ctrInfo.animation_regex, assetFullNameRegex);
 6                                     fileType = "anim";
 7                                 }
 8                                 else
 9                                 {
10                                     regexString = string.Format(ctrInfo.model_regex, assetFullNameRegex);
11                                     fileType = "model";
12                                 }

 

posted @ 2022-10-21 17:18  sun_dust_shadow  阅读(73)  评论(0编辑  收藏  举报