static public GameObject FindBestFittingRenderableGameObjectFromModelAsset(Object asset, ModelImporterAnimationType animationType)
{
if (asset == null)
{
return(null);
}
ModelImporter importer = AssetImporter.GetAtPath(AssetDatabase.GetAssetPath(asset)) as ModelImporter;
if (importer == null)
{
return(null);
}
string assetPath = importer.CalculateBestFittingPreviewGameObject();
GameObject tempGO = AssetDatabase.LoadMainAssetAtPath(assetPath) as GameObject;
// We should also check for isHumanClip matching the animationclip requiremenets...
if (IsValidPreviewGameObject(tempGO, ModelImporterAnimationType.None))
{
return(tempGO);
}
else
{
return(null);
}
}