private void EnableDisableOnGUI() { using (new GUILayout.HorizontalScope()) { var icon = GhostCompilerServiceLoader.IsGhostCompilationEnabled() ? _greenIcon.image : _redIcon.image; if (GUILayout.Button(new GUIContent(icon), GUILayout.ExpandWidth(false), GUILayout.MaxHeight(38), GUILayout.ExpandHeight(false))) { if (GhostCompilerServiceLoader.IsGhostCompilationEnabled()) { GhostCompilerServiceLoader.DisableGhostCompilation(); } else { GhostCompilerServiceLoader.EnableGhostCompilation(); } } if (GhostCompilerServiceLoader.IsGhostCompilationEnabled()) { EditorGUILayout.HelpBox("Ghost Compilation is enabled", MessageType.Info, true); } else { EditorGUILayout.HelpBox("Ghost Compilation is disabled!", MessageType.Warning, true); } } }
private void OnGUI() { EnableDisableOnGUI(); if (!GhostCompilerServiceLoader.IsGhostCompilationEnabled()) { return; } Scan(GhostCompilerServiceLoader.service); ButtonsBarOnGUI(GhostCompilerServiceLoader.service); EditorGUILayout.Separator(); OptionsOnGUI(GhostCompilerServiceLoader.service); EditorGUILayout.Separator(); TemplateFoldersOnGUI(GhostCompilerServiceLoader.service); EditorGUILayout.Separator(); ComponentsDataOnGUI(GhostCompilerServiceLoader.service); }