Example #1
0
 /// <summary>
 /// Displays the handle preferences. They will be displayed in the preference menu and the top of the inspector.
 /// </summary>
 new protected static void DisplayHandlePreferences()
 {
     EditorGUI.BeginChangeCheck();
     {
         s_OverrideBuiltinEditors.CurrentValue = EditorGUIX.DisplayOnOffToggle(
             "Override Builtin Joint Editors", s_OverrideBuiltinEditors.CurrentValue
             );
     }
     if (EditorGUI.EndChangeCheck())
     {
         UnityFeatureDefineSymbols.SetSymbolForAllBuildTargets(
             s_OverrideBuiltinEditorSymbol, g => s_OverrideBuiltinEditors.CurrentValue
             );
     }
     DisplaySceneGUIHandlePreferences();
 }
Example #2
0
        /// <summary>
        /// Initializes the <see cref="JointEditor"/> class.
        /// </summary>
        static JointEditor()
        {
            UnityFeatureDefineSymbols.SetSymbolForAllBuildTargets(
                s_OverrideBuiltinEditorSymbol, g => s_OverrideBuiltinEditors.CurrentValue
                );
#if USE_CANDLELIGHT_JOINT_EDITORS
            List <CustomEditor> attrs = new List <CustomEditor>(2);
            foreach (
                System.Type type in ReflectionX.AllTypes.Where(
                    t => t.Assembly != typeof(Editor).Assembly &&
                    t != typeof(JointEditor)
#if UNITY_5
                    && t != typeof(HingeJointEditor)
#endif
                    )
                )
            {
                type.GetCustomAttributes(attrs);
                foreach (CustomEditor attr in attrs)
                {
                    System.Type inspectedType = attr.GetFieldValue <System.Type>("m_InspectedType");
                    if (typeof(Joint).IsAssignableFrom(inspectedType))
                    {
                        Debug.LogError(
                            string.Format(
                                "{0} implements a custom editor for {1}, which interferes with that defined in {2}. " +
                                "To use that defined in {2}, remove the {3} attribute from {0}. " +
                                "Please also contact the plugin vendor to request that they include an option to " +
                                "disable their custom editor to avoid such conflicts.",
                                type, inspectedType, typeof(JointEditor), typeof(CustomEditor)
                                )
                            );
                    }
                }
            }
#endif
        }