public static void Init(bool attemptDock) { bool firstInit = (m_window == null); m_window = AH_SettingsWindow.GetWindow <AH_SettingsWindow>(WINDOWNAME, true /*, typeof(AH_Window)*/); m_window.titleContent.image = AH_EditorData.Instance.Settings.Icon; AH_Window[] mainWindows = Resources.FindObjectsOfTypeAll <AH_Window>(); if (attemptDock && mainWindows.Length != 0 && firstInit) { HeurekaGames.Docker.Dock(mainWindows[0], m_window, Docker.DockPosition.Right); } }
private void doHeader() { AH_WindowStyler.DrawGlobalHeader(m_window, AH_WindowStyler.clr_Pink, "ASSET HUNTER PRO", true); EditorGUILayout.BeginHorizontal(); bool infoLoaded = (buildInfoManager != null && buildInfoManager.HasSelection); if (infoLoaded) { GUIContent RefreshGUIContent = new GUIContent(guiContentRefresh); Color origColor = GUI.color; if (buildInfoManager.ProjectDirty) { GUI.color = AH_WindowStyler.clr_lBlue; RefreshGUIContent.tooltip = String.Format("{0}{1}", RefreshGUIContent.tooltip, " (Project has changed which means that treeview is out of date)"); } if (doSelectionButton(RefreshGUIContent))// GUILayout.Button(content, GUILayout.MaxWidth(32), GUILayout.Height(18))) { RefreshBuildLog(); } GUI.color = origColor; } if (doSelectionButton(guiContentLoadBuildInfo)) { openBuildInfoSelector(); } EditorGUI.BeginDisabledGroup(!EditorBuildSettings.scenes.Any(val => val.enabled == true)); //Disable the generate btn if there are no enabled scenes in buildsettings if (doSelectionButton(guiContentGenerateBuildInfo)) { generateBuildInfo(); } EditorGUI.EndDisabledGroup(); if (doSelectionButton(guiContentSettings)) { AH_SettingsWindow.Init(true); } /*if (doSelectionButton(guiContentSceneUsage)) * AH_SceneReferenceWindow.Init();*/ //Only avaliable in 2018 #if UNITY_2018_1_OR_NEWER if (infoLoaded && doSelectionButton(guiContentBuildReport)) { AH_BuildReportWindow.Init(); } #endif #if AH_HAS_OLD_INSTALLED //Transfer settings to PRO GUIContent TransferSettingsContent = new GUIContent("Transfer Settings", "Transfer your settings from old Asset Hunter into PRO"); if (AH_VersionUpgrader.VersionUpgraderReady && GUILayout.Button(TransferSettingsContent, GUILayout.MaxHeight(18))) { AH_VersionUpgrader.RunUpgrade(); } #endif if (infoLoaded && m_TreeView.GetCombinedUnusedSize() > 0) { string sizeAsString = AH_Utils.GetSizeAsString(m_TreeView.GetCombinedUnusedSize()); GUIContent instancedGUIContent = new GUIContent(guiContentDeleteAll); instancedGUIContent.tooltip = string.Format(instancedGUIContent.tooltip, sizeAsString); if (AH_SettingsManager.Instance.HideButtonText) { instancedGUIContent.text = null; } GUIStyle btnStyle = "button"; GUIStyle newStyle = new GUIStyle(btnStyle); newStyle.normal.textColor = AH_WindowStyler.clr_Pink; m_TreeView.DrawDeleteAllButton(instancedGUIContent, newStyle, GUILayout.MaxHeight(AH_SettingsManager.Instance.HideButtonText ? btnMaxHeight * 2f : btnMaxHeight)); } GUILayout.FlexibleSpace(); GUILayout.Space(20); if (m_TreeView != null) { m_TreeView.AssetSelectionToolBarGUI(); } if (doSelectionButton(guiContentReadme)) { Heureka_PackageDataManagerEditor.SelectReadme(); if (AH_EditorData.Instance.Documentation != null) { AssetDatabase.OpenAsset(AH_EditorData.Instance.Documentation); } } EditorGUILayout.EndHorizontal(); }