public override void OnInspectorGUI()
        {
            bool flag  = base.targets.Length > 1;
            bool flag2 = false;

            base.serializedObject.UpdateIfDirtyOrScript();
            AnimatorOverrideController animatorOverrideController = this.target as AnimatorOverrideController;
            RuntimeAnimatorController  runtimeAnimatorController  = (!this.m_Controller.hasMultipleDifferentValues) ? animatorOverrideController.runtimeAnimatorController : null;

            EditorGUI.BeginChangeCheck();
            runtimeAnimatorController = (EditorGUILayout.ObjectField("Controller", runtimeAnimatorController, typeof(UnityEditor.Animations.AnimatorController), false, new GUILayoutOption[0]) as RuntimeAnimatorController);
            if (EditorGUI.EndChangeCheck())
            {
                for (int i = 0; i < base.targets.Length; i++)
                {
                    AnimatorOverrideController animatorOverrideController2 = base.targets[i] as AnimatorOverrideController;
                    animatorOverrideController2.runtimeAnimatorController = runtimeAnimatorController;
                }
                flag2 = true;
            }
            using (new EditorGUI.DisabledScope(this.m_Controller == null || (flag && this.m_Controller.hasMultipleDifferentValues) || runtimeAnimatorController == null))
            {
                EditorGUI.BeginChangeCheck();
                this.m_Clips         = animatorOverrideController.clips;
                this.m_ClipList.list = this.m_Clips;
                this.m_ClipList.DoLayoutList();
                if (EditorGUI.EndChangeCheck())
                {
                    for (int j = 0; j < base.targets.Length; j++)
                    {
                        AnimatorOverrideController animatorOverrideController3 = base.targets[j] as AnimatorOverrideController;
                        animatorOverrideController3.clips = this.m_Clips;
                    }
                    flag2 = true;
                }
            }
            if (flag2)
            {
                animatorOverrideController.PerformOverrideClipListCleanup();
            }
        }
        public override void OnInspectorGUI()
        {
            bool flag  = base.targets.Length > 1;
            bool flag2 = false;

            base.serializedObject.UpdateIfDirtyOrScript();
            AnimatorOverrideController target      = this.target as AnimatorOverrideController;
            RuntimeAnimatorController  controller2 = !this.m_Controller.hasMultipleDifferentValues ? target.runtimeAnimatorController : null;

            EditorGUI.BeginChangeCheck();
            controller2 = EditorGUILayout.ObjectField("Controller", controller2, typeof(UnityEditor.Animations.AnimatorController), false, new GUILayoutOption[0]) as RuntimeAnimatorController;
            if (EditorGUI.EndChangeCheck())
            {
                for (int i = 0; i < base.targets.Length; i++)
                {
                    AnimatorOverrideController controller3 = base.targets[i] as AnimatorOverrideController;
                    controller3.runtimeAnimatorController = controller2;
                }
                flag2 = true;
            }
            EditorGUI.BeginDisabledGroup(((this.m_Controller == null) || (flag && this.m_Controller.hasMultipleDifferentValues)) || (controller2 == null));
            EditorGUI.BeginChangeCheck();
            this.m_Clips         = target.clips;
            this.m_ClipList.list = this.m_Clips;
            this.m_ClipList.DoLayoutList();
            if (EditorGUI.EndChangeCheck())
            {
                for (int j = 0; j < base.targets.Length; j++)
                {
                    AnimatorOverrideController controller4 = base.targets[j] as AnimatorOverrideController;
                    controller4.clips = this.m_Clips;
                }
                flag2 = true;
            }
            EditorGUI.EndDisabledGroup();
            if (flag2)
            {
                target.PerformOverrideClipListCleanup();
            }
        }
        public override void OnInspectorGUI()
        {
            bool flag1 = this.targets.Length > 1;
            bool flag2 = false;

            this.serializedObject.UpdateIfDirtyOrScript();
            AnimatorOverrideController target = this.target as AnimatorOverrideController;
            RuntimeAnimatorController  animatorController1 = !this.m_Controller.hasMultipleDifferentValues ? target.runtimeAnimatorController : (RuntimeAnimatorController)null;

            EditorGUI.BeginChangeCheck();
            RuntimeAnimatorController animatorController2 = EditorGUILayout.ObjectField("Controller", (Object)animatorController1, typeof(UnityEditor.Animations.AnimatorController), false, new GUILayoutOption[0]) as RuntimeAnimatorController;

            if (EditorGUI.EndChangeCheck())
            {
                for (int index = 0; index < this.targets.Length; ++index)
                {
                    (this.targets[index] as AnimatorOverrideController).runtimeAnimatorController = animatorController2;
                }
                flag2 = true;
            }
            EditorGUI.BeginDisabledGroup(this.m_Controller == null || flag1 && this.m_Controller.hasMultipleDifferentValues || (Object)animatorController2 == (Object)null);
            EditorGUI.BeginChangeCheck();
            this.m_Clips         = target.clips;
            this.m_ClipList.list = (IList)this.m_Clips;
            this.m_ClipList.DoLayoutList();
            if (EditorGUI.EndChangeCheck())
            {
                for (int index = 0; index < this.targets.Length; ++index)
                {
                    (this.targets[index] as AnimatorOverrideController).clips = this.m_Clips;
                }
                flag2 = true;
            }
            EditorGUI.EndDisabledGroup();
            if (!flag2)
            {
                return;
            }
            target.PerformOverrideClipListCleanup();
        }
示例#4
0
        public override void OnInspectorGUI()
        {
            bool isEditingMultipleObjects = targets.Length > 1;
            bool changeCheck = false;

            serializedObject.UpdateIfRequiredOrScript();

            AnimatorOverrideController animatorOverrideController = target as AnimatorOverrideController;
            RuntimeAnimatorController  runtimeAnimatorController  = m_Controller.hasMultipleDifferentValues ? null : animatorOverrideController.runtimeAnimatorController;

            EditorGUI.BeginChangeCheck();
            runtimeAnimatorController = EditorGUILayout.ObjectField("Controller", runtimeAnimatorController, typeof(Animations.AnimatorController), false) as RuntimeAnimatorController;
            if (EditorGUI.EndChangeCheck())
            {
                for (int i = 0; i < targets.Length; i++)
                {
                    AnimatorOverrideController controller = targets[i] as AnimatorOverrideController;
                    controller.runtimeAnimatorController = runtimeAnimatorController;
                }

                changeCheck = true;
            }

            {
                GUI.SetNextControlName("OverridesSearch");

                if (Event.current.type == EventType.KeyDown && Event.current.keyCode == KeyCode.Escape && GUI.GetNameOfFocusedControl() == "OverridesSearch")
                {
                    m_Search = "";
                }

                EditorGUI.BeginChangeCheck();
                string newSearch = EditorGUILayout.ToolbarSearchField(m_Search);
                if (EditorGUI.EndChangeCheck())
                {
                    m_Search = newSearch;
                }
            }


            using (new EditorGUI.DisabledScope(m_Controller == null || (isEditingMultipleObjects && m_Controller.hasMultipleDifferentValues) || runtimeAnimatorController == null))
            {
                EditorGUI.BeginChangeCheck();
                animatorOverrideController.GetOverrides(m_Clips);

                if (m_Search.Length > 0)
                {
                    FilterOverrides();
                }
                else // If there is not filter simply sort all the list.
                {
                    m_Clips.Sort(new AnimationClipOverrideComparer());
                }

                m_ClipList.list = m_Clips;
                m_ClipList.DoLayoutList();
                if (EditorGUI.EndChangeCheck())
                {
                    for (int i = 0; i < targets.Length; i++)
                    {
                        AnimatorOverrideController controller = targets[i] as AnimatorOverrideController;
                        controller.ApplyOverrides(m_Clips);
                    }
                    changeCheck = true;
                }
            }

            if (changeCheck)
            {
                animatorOverrideController.PerformOverrideClipListCleanup();
            }
        }
示例#5
0
        public override void OnInspectorGUI()
        {
            bool flag  = base.targets.Length > 1;
            bool flag2 = false;

            base.serializedObject.UpdateIfRequiredOrScript();
            AnimatorOverrideController animatorOverrideController = base.target as AnimatorOverrideController;
            RuntimeAnimatorController  runtimeAnimatorController  = (!this.m_Controller.hasMultipleDifferentValues) ? animatorOverrideController.runtimeAnimatorController : null;

            EditorGUI.BeginChangeCheck();
            runtimeAnimatorController = (EditorGUILayout.ObjectField("Controller", runtimeAnimatorController, typeof(UnityEditor.Animations.AnimatorController), false, new GUILayoutOption[0]) as RuntimeAnimatorController);
            if (EditorGUI.EndChangeCheck())
            {
                for (int i = 0; i < base.targets.Length; i++)
                {
                    AnimatorOverrideController animatorOverrideController2 = base.targets[i] as AnimatorOverrideController;
                    animatorOverrideController2.runtimeAnimatorController = runtimeAnimatorController;
                }
                flag2 = true;
            }
            GUI.SetNextControlName("OverridesSearch");
            if (Event.current.type == EventType.KeyDown && Event.current.keyCode == KeyCode.Escape && GUI.GetNameOfFocusedControl() == "OverridesSearch")
            {
                this.m_Search = "";
            }
            EditorGUI.BeginChangeCheck();
            string search = EditorGUILayout.ToolbarSearchField(this.m_Search, new GUILayoutOption[0]);

            if (EditorGUI.EndChangeCheck())
            {
                this.m_Search = search;
            }
            using (new EditorGUI.DisabledScope(this.m_Controller == null || (flag && this.m_Controller.hasMultipleDifferentValues) || runtimeAnimatorController == null))
            {
                EditorGUI.BeginChangeCheck();
                animatorOverrideController.GetOverrides(this.m_Clips);
                if (this.m_Search.Length > 0)
                {
                    this.FilterOverrides();
                }
                else
                {
                    this.m_Clips.Sort(new AnimationClipOverrideComparer());
                }
                this.m_ClipList.list = this.m_Clips;
                this.m_ClipList.DoLayoutList();
                if (EditorGUI.EndChangeCheck())
                {
                    for (int j = 0; j < base.targets.Length; j++)
                    {
                        AnimatorOverrideController animatorOverrideController3 = base.targets[j] as AnimatorOverrideController;
                        animatorOverrideController3.ApplyOverrides(this.m_Clips);
                    }
                    flag2 = true;
                }
            }
            if (flag2)
            {
                animatorOverrideController.PerformOverrideClipListCleanup();
            }
        }