CalculatePreviewGameObject() private static method

private static CalculatePreviewGameObject ( UnityEngine selectedAnimator, Motion motion, ModelImporterAnimationType animationType ) : GameObject
selectedAnimator UnityEngine
motion UnityEngine.Motion
animationType ModelImporterAnimationType
return UnityEngine.GameObject
示例#1
0
        public void ResetPreviewInstance()
        {
            UnityEngine.Object.DestroyImmediate(this.m_PreviewInstance);
            GameObject go = AvatarPreview.CalculatePreviewGameObject(this.m_SourceScenePreviewAnimator, this.m_SourcePreviewMotion, this.animationClipType);

            this.SetupBounds(go);
        }
示例#2
0
 private void InitInstance(Animator scenePreviewObject, Motion motion)
 {
     this.m_SourcePreviewMotion        = motion;
     this.m_SourceScenePreviewAnimator = scenePreviewObject;
     if (this.m_PreviewInstance == null)
     {
         GameObject go = AvatarPreview.CalculatePreviewGameObject(scenePreviewObject, motion, this.animationClipType);
         this.SetupBounds(go);
     }
     if (this.timeControl == null)
     {
         this.timeControl = new TimeControl();
     }
     if (this.m_ReferenceInstance == null)
     {
         GameObject original = (GameObject)EditorGUIUtility.Load("Avatar/dial_flat.prefab");
         this.m_ReferenceInstance = UnityEngine.Object.Instantiate <GameObject>(original, Vector3.zero, Quaternion.identity);
         EditorUtility.InitInstantiatedPreviewRecursive(this.m_ReferenceInstance);
         this.previewUtility.AddSingleGO(this.m_ReferenceInstance);
     }
     if (this.m_DirectionInstance == null)
     {
         GameObject original2 = (GameObject)EditorGUIUtility.Load("Avatar/arrow.fbx");
         this.m_DirectionInstance = UnityEngine.Object.Instantiate <GameObject>(original2, Vector3.zero, Quaternion.identity);
         EditorUtility.InitInstantiatedPreviewRecursive(this.m_DirectionInstance);
         this.previewUtility.AddSingleGO(this.m_DirectionInstance);
     }
     if (this.m_PivotInstance == null)
     {
         GameObject original3 = (GameObject)EditorGUIUtility.Load("Avatar/root.fbx");
         this.m_PivotInstance = UnityEngine.Object.Instantiate <GameObject>(original3, Vector3.zero, Quaternion.identity);
         EditorUtility.InitInstantiatedPreviewRecursive(this.m_PivotInstance);
         this.previewUtility.AddSingleGO(this.m_PivotInstance);
     }
     if (this.m_RootInstance == null)
     {
         GameObject original4 = (GameObject)EditorGUIUtility.Load("Avatar/root.fbx");
         this.m_RootInstance = UnityEngine.Object.Instantiate <GameObject>(original4, Vector3.zero, Quaternion.identity);
         EditorUtility.InitInstantiatedPreviewRecursive(this.m_RootInstance);
         this.previewUtility.AddSingleGO(this.m_RootInstance);
     }
     this.m_IKOnFeet                = EditorPrefs.GetBool("AvatarpreviewShowIK", false);
     this.m_ShowReference           = EditorPrefs.GetBool("AvatarpreviewShowReference", true);
     this.is2D                      = EditorPrefs.GetBool("Avatarpreview2D", EditorSettings.defaultBehaviorMode == EditorBehaviorMode.Mode2D);
     this.timeControl.playbackSpeed = EditorPrefs.GetFloat("AvatarpreviewSpeed", 1f);
     this.SetPreviewCharacterEnabled(false, false);
     this.m_PivotPositionOffset = Vector3.zero;
 }
示例#3
0
 private void InitInstance(Animator scenePreviewObject, Motion motion)
 {
     this.m_SourcePreviewMotion        = motion;
     this.m_SourceScenePreviewAnimator = scenePreviewObject;
     if ((Object)this.m_PreviewInstance == (Object)null)
     {
         this.SetupBounds(AvatarPreview.CalculatePreviewGameObject(scenePreviewObject, motion, this.animationClipType));
     }
     if (this.timeControl == null)
     {
         this.timeControl = new TimeControl();
     }
     if ((Object)this.m_ReferenceInstance == (Object)null)
     {
         this.m_ReferenceInstance = (GameObject)Object.Instantiate(EditorGUIUtility.Load("Avatar/dial_flat.prefab"), Vector3.zero, Quaternion.identity);
         EditorUtility.InitInstantiatedPreviewRecursive(this.m_ReferenceInstance);
     }
     if ((Object)this.m_DirectionInstance == (Object)null)
     {
         this.m_DirectionInstance = (GameObject)Object.Instantiate(EditorGUIUtility.Load("Avatar/arrow.fbx"), Vector3.zero, Quaternion.identity);
         EditorUtility.InitInstantiatedPreviewRecursive(this.m_DirectionInstance);
     }
     if ((Object)this.m_PivotInstance == (Object)null)
     {
         this.m_PivotInstance = (GameObject)Object.Instantiate(EditorGUIUtility.Load("Avatar/root.fbx"), Vector3.zero, Quaternion.identity);
         EditorUtility.InitInstantiatedPreviewRecursive(this.m_PivotInstance);
     }
     if ((Object)this.m_RootInstance == (Object)null)
     {
         this.m_RootInstance = (GameObject)Object.Instantiate(EditorGUIUtility.Load("Avatar/root.fbx"), Vector3.zero, Quaternion.identity);
         EditorUtility.InitInstantiatedPreviewRecursive(this.m_RootInstance);
     }
     this.m_IKOnFeet                = EditorPrefs.GetBool("AvatarpreviewShowIK", false);
     this.m_ShowReference           = EditorPrefs.GetBool("AvatarpreviewShowReference", true);
     this.timeControl.playbackSpeed = EditorPrefs.GetFloat("AvatarpreviewSpeed", 1f);
     this.SetPreviewCharacterEnabled(false, false);
 }
示例#4
0
 public void ResetPreviewInstance()
 {
     Object.DestroyImmediate((Object)this.m_PreviewInstance);
     this.SetupBounds(AvatarPreview.CalculatePreviewGameObject(this.m_SourceScenePreviewAnimator, this.m_SourcePreviewMotion, this.animationClipType));
 }