8 [CanEditMultipleObjects, CustomEditor(typeof(pb_GUIStyleApplier))]
11 SerializedProperty style;
12 SerializedProperty ignore;
14 [SerializeField]
bool show =
true;
18 style = serializedObject.FindProperty(
"style");
19 ignore = serializedObject.FindProperty(
"ignoreStyle");
24 serializedObject.Update();
26 EditorGUI.BeginChangeCheck();
29 EditorGUILayout.PropertyField(style);
31 EditorGUILayout.PropertyField(ignore);
33 if(!ignore.boolValue && style.objectReferenceValue !=
null)
35 show = EditorGUILayout.Foldout(show, style.objectReferenceValue.name);
40 Editor editor = Editor.CreateEditor(style.objectReferenceValue);
43 editor.OnInspectorGUI();
48 if(EditorGUI.EndChangeCheck() || GUILayout.Button(
"Apply"))
56 Canvas.ForceUpdateCanvases();
57 SceneView.RepaintAll();
60 serializedObject.ApplyModifiedProperties();
override void OnInspectorGUI()