void Awake() { if (Instance == null) { Instance = this; } }
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(); }
public override void OnInspectorGUI() { EditorGUIUtility.labelWidth = EditorVariables.MediumLabelWidth; serializedObject.Update(); SelectedTab.intValue = GUILayout.Toolbar(SelectedTab.intValue, ToolbarTabs); GUILayout.Space(6); EditorGUILayout.LabelField(string.Empty, GUI.skin.horizontalSlider); GUILayout.Space(6); switch (SelectedTab.intValue) { case 0: DrawGeneralVariables(); break; case 1: UIEditor.OnInspectorGUI(); break; case 2: ButtonSettingsEditor.OnInspectorGUI(); break; case 3: OpenCreateInterface(); break; default: return; } GUILayout.Space(10); serializedObject.ApplyModifiedProperties(); //base.OnInspectorGUI(); }
private void OnEnable() { SetEditorVariables(); evaluator.CreateEditorVariables(); ButtonSettingsEditor.OnEnable(ButtonSettings); UIEditor.OnEnable(UI); }
public static void ExportResources(List <BuildGroup> groups) { UpdateResVersion(); #if !RECOURCE_CLIENT UIEditor.CreateUIAtlas(); UIEditor.CreateUIIcons(); #endif SetAssetBundleNames(false); foreach (BuildGroup group in groups) { Export(BuildHelper.GetBuildTarget(group.Platform)); } AutoBuildGameLogic.AutoBuild(); }
static void CreateWizard() { UIEditor window = (UIEditor)EditorWindow.GetWindow(typeof(UIEditor)); window.Show(); }
static void OpenUIEditor() { UIEditor myWindow = EditorWindow.GetWindow <UIEditor>(false, "UI Editor"); myWindow.minSize = new Vector2(700, 200); }