用AssetDatabase.LoadAllAssetsAtPath()获取FBX文件里的所有资源

作者:追风剑情 发布于:2018-8-8 22:07 分类:Unity3d

FBX文件包含了很多资源, 如:Animator(动画)、SkinnedMeshRenderer(蒙皮网格)、MeshFilter(模型网格)、骨骼、......

示例

    [MenuItem("Assets/Check FBX")]
    static void CheckFBX()
    {
        string asset_path = "Assets/baobei01_skin.FBX";
        Debug.Log("FBX asset_path: " + asset_path);

        Object[] assets = AssetDatabase.LoadAllAssetsAtPath(asset_path);
        for (int i = 0; i < assets.Length; ++i) {
            Debug.Log("internal asset: " + assets[i].name);
        }
    }

Project中的FBX文件

222222.png

拖到Hierarchy中查看FBX文件结构

33333.png

输出信息

1111.png

标签: Unity3d

Powered by emlog  蜀ICP备18021003号-1   sitemap

川公网安备 51019002001593号