private static GetGenericAnimationFallback ( ) : |
||
return |
private static GameObject CalculatePreviewGameObject(Animator selectedAnimator, Motion motion, ModelImporterAnimationType animationType) { AnimationClip firstAnimationClipFromMotion = AvatarPreview.GetFirstAnimationClipFromMotion(motion); GameObject gameObject = AvatarPreviewSelection.GetPreview(animationType); if (AvatarPreview.IsValidPreviewGameObject(gameObject, ModelImporterAnimationType.None)) { return(gameObject); } if (selectedAnimator != null && AvatarPreview.IsValidPreviewGameObject(selectedAnimator.gameObject, animationType)) { return(selectedAnimator.gameObject); } gameObject = AvatarPreview.FindBestFittingRenderableGameObjectFromModelAsset(firstAnimationClipFromMotion, animationType); if (gameObject != null) { return(gameObject); } if (animationType == ModelImporterAnimationType.Human) { return(AvatarPreview.GetHumanoidFallback()); } if (animationType == ModelImporterAnimationType.Generic) { return(AvatarPreview.GetGenericAnimationFallback()); } return(null); }
private void SetupBounds(GameObject go) { this.m_IsValid = (go != null && go != AvatarPreview.GetGenericAnimationFallback()); if (go != null) { this.m_PreviewInstance = EditorUtility.InstantiateForAnimatorPreview(go); Bounds bounds = new Bounds(this.m_PreviewInstance.transform.position, Vector3.zero); GameObjectInspector.GetRenderableBoundsRecurse(ref bounds, this.m_PreviewInstance); this.m_BoundingVolumeScale = Mathf.Max(bounds.size.x, Mathf.Max(bounds.size.y, bounds.size.z)); if (this.Animator && this.Animator.isHuman) { this.m_AvatarScale = (this.m_ZoomFactor = this.Animator.humanScale); } else { this.m_AvatarScale = (this.m_ZoomFactor = this.m_BoundingVolumeScale / 2f); } } }