public static void ChangeUI(UIElement ui) { if (editor != null) { editor.OnDisable(); } Target = ui; if (Instance != null) { Instance.Repaint(); } var tc = typeof(UIEditor).Assembly.GetTypes(); var t = ui.GetType(); for (int i = 0; i < 32; i++) { editor = FindEditor(tc, t.Name); if (editor == null) { t = t.BaseType; if (t.Name == "UIElement") { break; } } } if (editor == null) { editor = new UIEditor(); } editor.Target = ui; editor.OnEnable(); }
private void OnEnable() { SetEditorVariables(); evaluator.CreateEditorVariables(); ButtonSettingsEditor.OnEnable(ButtonSettings); UIEditor.OnEnable(UI); }