private void CreateStateMachine()
{
if ((this.m_AvatarPreview != null) && (this.m_AvatarPreview.Animator != null))
{
if (this.m_Controller == null)
{
this.m_Controller = new AnimatorController();
this.m_Controller.pushUndo = false;
this.m_Controller.AddLayer("preview");
this.m_StateMachine = this.m_Controller.layers[0].stateMachine;
this.m_StateMachine.pushUndo = false;
this.CreateParameters();
this.m_State = this.m_StateMachine.AddState("preview");
this.m_State.pushUndo = false;
this.m_State.motion = this.m_BlendTree;
this.m_State.iKOnFeet = this.m_AvatarPreview.IKOnFeet;
this.m_State.hideFlags = HideFlags.HideAndDontSave;
this.m_Controller.hideFlags = HideFlags.HideAndDontSave;
this.m_StateMachine.hideFlags = HideFlags.HideAndDontSave;
AnimatorController.SetAnimatorController(this.m_AvatarPreview.Animator, this.m_Controller);
this.m_Controller.OnAnimatorControllerDirty = (Action) Delegate.Combine(this.m_Controller.OnAnimatorControllerDirty, new Action(this, (IntPtr) this.ControllerDirty));
this.m_ControllerIsDirty = false;
}
if (AnimatorController.GetEffectiveAnimatorController(this.m_AvatarPreview.Animator) != this.m_Controller)
{
AnimatorController.SetAnimatorController(this.m_AvatarPreview.Animator, this.m_Controller);
}
}
}