UnityEditor.ModelImporter.CalculateBestFittingPreviewGameObject C# (CSharp) Method

CalculateBestFittingPreviewGameObject() private method

private CalculateBestFittingPreviewGameObject ( ) : string
return string
        internal extern string CalculateBestFittingPreviewGameObject();
        /// <summary>

Usage Example

示例#1
0
        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);
            }
        }
All Usage Examples Of UnityEditor.ModelImporter::CalculateBestFittingPreviewGameObject