public override void OnInspectorGUI()
    {
        if (GUILayout.Button("Open Event Editor"))
        {
            MecanimEventEditor editor = EditorWindow.GetWindow <MecanimEventEditor>();
            editor.TargetController = serializedObject.FindProperty("lastEdit").objectReferenceValue;
        }

        if (previewedMotion != null && previewedMotion is BlendTree && avatarPreview != null)
        {
            EditorGUILayout.Separator();
            GUILayout.Label("BlendTree Parameter(s)", GUILayout.ExpandWidth(true));

            BlendTree bt = previewedMotion as BlendTree;

            for (int i = 0; i < bt.GetRecursiveBlendParamCount(); i++)
            {
                float min = bt.GetRecursiveBlendParamMin(i);
                float max = bt.GetRecursiveBlendParamMax(i);

                string paramName = bt.GetRecursiveBlendParam(i);
                float  value     = Mathf.Clamp(avatarPreview.Animator.GetFloat(paramName), min, max);
                value = EditorGUILayout.Slider(paramName, value, min, max);
                avatarPreview.Animator.SetFloat(paramName, value);
            }
        }
    }