Exemplo n.º 1
0
        void SetupBounds(GameObject go)
        {
            m_IsValid = go != null && go != GetGenericAnimationFallback();

            if (go != null)
            {
                m_PreviewInstance = EditorUtility.InstantiateForAnimatorPreview(go);
                previewUtility.AddSingleGO(m_PreviewInstance);

                m_Previewables = m_PreviewInstance.GetComponentsInChildren <IAnimationPreviewable>();
                var bounds = GameObjectInspector.GetRenderableBounds(m_PreviewInstance);

                m_BoundingVolumeScale = Mathf.Max(bounds.size.x, Mathf.Max(bounds.size.y, bounds.size.z));


                if (Animator && Animator.isHuman)
                {
                    m_AvatarScale = m_ZoomFactor = Animator.humanScale;
                }
                else
                {
                    m_AvatarScale = m_ZoomFactor = m_BoundingVolumeScale / 2;
                }
            }
        }