I am struggling to find a way to extract textures from an FBX model in Unity via script. Unity has a hidden method to extract materials here, but cannot find a method to extract textures even in their own github.
i even tried to use the same approach to load Texture2D-s from the asset file like so:
IEnumerable<Object> enumerable = from x in AssetDatabase.LoadAllAssetsAtPath(assetPath)
where x.GetType() == typeof(Texture2D)
select x;
but to no avail. Can anyone help? thank you!
You can achieve this using
ModelImporter
: