public static void OpenWindow(ProceduralUIComponent c) { thisWindow = UIEditorWindow.GetWindowWithRect <UIEditorWindow>(new Rect() { position = new Vector2(100, 100), size = new Vector2(1050, 700) }, true, "UI component", false); thisWindow.editing = c; EditorApplication.update -= Update50; EditorApplication.update += Update50; }
public override void OnInspectorGUI() { ProceduralUIComponent targ = (ProceduralUIComponent)target; Undo.RegisterCompleteObjectUndo(targ, "UI component changed"); GUILayout.Space(10); if (GUILayout.Button("Edit", EditorStyles.toolbarButton)) { UIEditorWindow.OpenWindow(targ); } GUILayout.Space(10); }