UnityEditor.AvatarPreview.CalculatePreviewGameObject C# (CSharp) Méthode

CalculatePreviewGameObject() private static méthode

private static CalculatePreviewGameObject ( UnityEngine selectedAnimator, Motion motion, ModelImporterAnimationType animationType ) : GameObject
selectedAnimator UnityEngine
motion UnityEngine.Motion
animationType ModelImporterAnimationType
Résultat UnityEngine.GameObject
        private static GameObject CalculatePreviewGameObject(UnityEngine.Animator selectedAnimator, Motion motion, ModelImporterAnimationType animationType)
        {
            AnimationClip firstAnimationClipFromMotion = GetFirstAnimationClipFromMotion(motion);
            GameObject preview = AvatarPreviewSelection.GetPreview(animationType);
            if (IsValidPreviewGameObject(preview, ModelImporterAnimationType.None))
            {
                return preview;
            }
            if ((selectedAnimator != null) && IsValidPreviewGameObject(selectedAnimator.gameObject, animationType))
            {
                return selectedAnimator.gameObject;
            }
            preview = FindBestFittingRenderableGameObjectFromModelAsset(firstAnimationClipFromMotion, animationType);
            if (preview != null)
            {
                return preview;
            }
            if (animationType == ModelImporterAnimationType.Human)
            {
                return GetHumanoidFallback();
            }
            if (animationType == ModelImporterAnimationType.Generic)
            {
                return GetGenericAnimationFallback();
            }
            return null;
        }

Usage Example

        public void ResetPreviewInstance()
        {
            UnityEngine.Object.DestroyImmediate(this.m_PreviewInstance);
            GameObject go = AvatarPreview.CalculatePreviewGameObject(this.m_SourceScenePreviewAnimator, this.m_SourcePreviewMotion, this.animationClipType);

            this.SetupBounds(go);
        }
All Usage Examples Of UnityEditor.AvatarPreview::CalculatePreviewGameObject