private void InitInstance(UnityEngine.Animator scenePreviewObject, Motion motion)
{
this.m_SourcePreviewMotion = motion;
this.m_SourceScenePreviewAnimator = scenePreviewObject;
if (this.m_PreviewInstance == null)
{
GameObject go = 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 = Object.Instantiate<GameObject>(original, Vector3.zero, Quaternion.identity);
EditorUtility.InitInstantiatedPreviewRecursive(this.m_ReferenceInstance);
}
if (this.m_DirectionInstance == null)
{
GameObject obj4 = (GameObject) EditorGUIUtility.Load("Avatar/arrow.fbx");
this.m_DirectionInstance = Object.Instantiate<GameObject>(obj4, Vector3.zero, Quaternion.identity);
EditorUtility.InitInstantiatedPreviewRecursive(this.m_DirectionInstance);
}
if (this.m_PivotInstance == null)
{
GameObject obj5 = (GameObject) EditorGUIUtility.Load("Avatar/root.fbx");
this.m_PivotInstance = Object.Instantiate<GameObject>(obj5, Vector3.zero, Quaternion.identity);
EditorUtility.InitInstantiatedPreviewRecursive(this.m_PivotInstance);
}
if (this.m_RootInstance == null)
{
GameObject obj6 = (GameObject) EditorGUIUtility.Load("Avatar/root.fbx");
this.m_RootInstance = Object.Instantiate<GameObject>(obj6, 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);
}