private void OnEnable() { asw = this; this.initAllRules(); panelState = ImportPreferences.EPanel.Texture; }
public void onTopBar() { EditorGUILayout.BeginHorizontal(EditorStyles.toolbar); string[] enumNames = Enum.GetNames(typeof(ImportPreferences.EPanel)); ImportPreferences.EPanel[] enumValues = (ImportPreferences.EPanel[])Enum.GetValues(typeof(ImportPreferences.EPanel)); for (int i = 0; i < enumNames.Length - 1; i++) { if (GUILayout.Toggle(panelState == enumValues[i], enumNames[i], EditorStyles.toolbarButton, GUILayout.Width(100))) { panelState = enumValues[i]; curPanel = GetCurrentPanel(); } } GUILayout.Toolbar(0, new[] { "" }, EditorStyles.toolbar, GUILayout.ExpandWidth(true)); if (GUILayout.Toggle(panelState == ImportPreferences.EPanel.Setting, enumNames[enumNames.Length - 1], EditorStyles.toolbarButton, GUILayout.Width(100))) { panelState = enumValues[enumNames.Length - 1]; curPanel = GetCurrentPanel(); } if (lastPanelState != panelState) { lastPanelState = panelState; curPanel.OnInit(); } EditorGUILayout.EndHorizontal(); EditorGUILayout.Space(); }