Inheritance: UnityEngine.ScriptableObject
 protected void BuildEditorList(StateMachineBehaviour[] behaviours)
 {
     this.m_BehavioursEditor = new Editor[behaviours.Length];
     for (int i = 0; i < behaviours.Length; i++)
     {
         if ((behaviours[i] != null) && (behaviours[i] != null))
         {
             this.m_BehavioursEditor[i] = Editor.CreateEditor(behaviours[i]);
         }
         else
         {
             InvalidStateMachineBehaviour targetObject = ScriptableObject.CreateInstance <InvalidStateMachineBehaviour>();
             targetObject.monoScript = this.GetBehaviourMonoScript(i);
             if (targetObject.monoScript != null)
             {
                 targetObject.name = targetObject.monoScript.name;
             }
             targetObject.hideFlags      = HideFlags.HideAndDontSave;
             targetObject.controller     = this.m_ControllerContext;
             targetObject.state          = this.state;
             targetObject.stateMachine   = this.stateMachine;
             targetObject.layerIndex     = this.m_LayerIndexContext;
             targetObject.behaviourIndex = i;
             this.m_BehavioursEditor[i]  = Editor.CreateEditor(targetObject);
         }
     }
 }
        public override void OnInspectorGUI()
        {
            InvalidStateMachineBehaviour target = base.target as InvalidStateMachineBehaviour;

            using (new EditorGUI.DisabledScope(true))
            {
                EditorGUILayout.ObjectField("Script", target.monoScript, typeof(MonoScript), false, new GUILayoutOption[0]);
            }
            if ((target.monoScript != null) && !target.monoScript.GetScriptTypeWasJustCreatedFromComponentMenu())
            {
                EditorGUILayout.HelpBox(EditorGUIUtility.TextContent("The associated script can not be loaded.\nPlease fix any compile errors\nand assign a valid script.").text, MessageType.Warning, true);
            }
        }
        private static void Remove(MenuCommand command)
        {
            InvalidStateMachineBehaviour context    = command.context as InvalidStateMachineBehaviour;
            AnimatorController           controller = context.controller;
            AnimatorState        state        = context.state;
            AnimatorStateMachine stateMachine = context.stateMachine;

            if (state != null)
            {
                if (controller != null)
                {
                    controller.RemoveStateEffectiveBehaviour(state, context.layerIndex, context.behaviourIndex);
                }
                else
                {
                    state.RemoveBehaviour(context.behaviourIndex);
                }
            }
            else if (stateMachine != null)
            {
                stateMachine.RemoveBehaviour(context.behaviourIndex);
            }
            UnityEngine.Object.DestroyImmediate(context, true);
        }