public void SetBackgroundColor(Color darkColor, Color lightColor) { if (EditorGUIUtility.isProSkin) DoozyEditorUtility.SetBackgroundColor(darkColor); else DoozyEditorUtility.SetBackgroundColor(lightColor); }
public bool OnGUIEditorStateCheck(EditorWindow editorWindow, float windowWidth, float windowHeight) { if (DoozyEditorUtility.EditorIsCompiling(this, DoozyResources.InfoBarDisabled, windowWidth, windowHeight)) { return(true); } if (DoozyEditorUtility.EditorIsInPlayMode(this, DoozyResources.InfoBarDisabled, windowWidth, windowHeight)) { return(true); } return(false); }
public void OnGUIShowDisableButton(string symbol) { GUILayout.BeginHorizontal(); { GUILayout.FlexibleSpace(); if (GUILayout.Button("", WindowSkin.GetStyle("BtnWideDisable"))) { DoozyEditorUtility.RemoveScriptingDefineSymbol(symbol); } GUILayout.FlexibleSpace(); } GUILayout.EndHorizontal(); }
void DrawInfoCardInstalled(Texture texture, string version) { DoozyEditorUtility.DrawTexture(texture, 208, 32); GUILayout.Space(-16); EditorGUILayout.BeginHorizontal(); { GUILayout.Space(76); EditorGUILayout.LabelField(version, skin.GetStyle(DoozyStyle.StyleName.Version.ToString()), GUILayout.Width(104)); GUILayout.FlexibleSpace(); } EditorGUILayout.EndHorizontal(); GUILayout.Space(-4); }
/// <summary> /// Draws DISABLED or ENABLED textures for the target component depending on the isEnabled bool value. /// </summary> public void DrawInfoBar(bool isEnabled, bool showEnabledState = true) { SaveCurrentColorsAndResetColors(); if (isEnabled) { if (showEnabledState) { DoozyEditorUtility.DrawTexture(DoozyResources.InfoBarEnabled, WIDTH_1, 18f); } } else { DoozyEditorUtility.DrawTexture(DoozyResources.InfoBarDisabled, WIDTH_1, 18f); } LoadPreviousColors(); }
void DrawInfoCardNotInstalled(Texture texture, string url = "") { EditorGUILayout.BeginVertical(); { DoozyEditorUtility.DrawTexture(texture, 208, 32); if (!string.IsNullOrEmpty(url)) { EditorGUILayout.BeginHorizontal(); { GUILayout.FlexibleSpace(); if (GUILayout.Button("Download", skin.GetStyle(DoozyStyle.StyleName.BtnGreyDark.ToString()), GUILayout.Width(200))) { Application.OpenURL(url); //Application.OpenURL("http://unity3d.com/"); } GUILayout.FlexibleSpace(); } EditorGUILayout.EndHorizontal(); } } EditorGUILayout.EndVertical(); }
/// <summary> /// Adds a title and a remove component button. /// </summary> public void DrawTitleAndRemoveButton(string title, Object obj = null) { SaveCurrentColorsAndResetColors(); DoozyEditorUtility.DrawTexture(DoozyResources.HeaderBarSubtitle, WIDTH_1, 18f); GUILayout.Space(-18f); GUILayout.BeginHorizontal(GUILayout.Width(WIDTH_1)); { GUILayout.Space(44f); EditorGUILayout.LabelField(title, skin.GetStyle(DoozyStyle.StyleName.HeaderSubtitle.ToString()), GUILayout.Width(WIDTH_3 * 2 - 48)); if (GUILayout.Button("REMOVE COMPONENT", skin.GetStyle(DoozyStyle.StyleName.BtnRed.ToString()), GUILayout.Width(WIDTH_3))) { if (obj != null) { if (EditorUtility.DisplayDialog("REMOVE COMPONENT", "Are you sure you want to remove this component?\nThis action will delete the component and it cannot be undone.", "Yes", "Cancel")) { RemoveComponent(obj); } } } } GUILayout.EndHorizontal(); LoadPreviousColors(); }
public void SaveCurrentColorsAndResetColors() { SaveCurrentColors(); DoozyEditorUtility.ResetColors(); }
public void SetBackgroundTexture(Texture texture, float width, float height) { DoozyEditorUtility.DrawTexture(texture, width, height); }
void OnGUI() { EditorGUILayout.BeginHorizontal(GUILayout.Height(_height)); { GUILayout.FlexibleSpace(); DoozyEditorUtility.DrawGIF(DoozyResources.dUI_ElectricLogo, 30); GUILayout.FlexibleSpace(); } EditorGUILayout.EndHorizontal(); GUILayout.Space(-_height); //move the pointer up back to the top GUILayout.Space(180); //move the pointer down after the logo EditorGUILayout.BeginVertical(); { EditorGUILayout.BeginHorizontal(GUILayout.Width(_width)); { DoozyEditorUtility.HorizontalSpace(152); EditorGUILayout.BeginVertical(GUILayout.Width(208)); { #if dUI_MANAGER DrawInfoCardInstalled(DoozyResources.WindowAboutInfoUIManagerInstalled, DoozyConstants.VERSION_UIMANAGER); #else DrawInfoCardNotInstalled(DoozyResources.WindowAboutInfoUIManagerNotInstalled, DoozyConstants.LINK_UIMANAGER); #endif DoozyEditorUtility.VerticalSpace(VERTICAL_SPACE_BETWEEN_INFO_CARDS); #if dUI_BUTTON DrawInfoCardInstalled(DoozyResources.WindowAboutInfoUIButtonInstalled, DoozyConstants.VERSION_UIBUTTON); #else DrawInfoCardNotInstalled(DoozyResources.WindowAboutInfoUIButtonNotInstalled, DoozyConstants.LINK_UIBUTTON); #endif DoozyEditorUtility.VerticalSpace(VERTICAL_SPACE_BETWEEN_INFO_CARDS); #if dUI_ELEMENT DrawInfoCardInstalled(DoozyResources.WindowAboutInfoUIElementInstalled, DoozyConstants.VERSION_UIELEMENT); #else DrawInfoCardNotInstalled(DoozyResources.WindowAboutInfoUIElementNotInstalled, DoozyConstants.LINK_UIELEMENT); #endif DoozyEditorUtility.VerticalSpace(VERTICAL_SPACE_BETWEEN_INFO_CARDS); #if dUI_ORIENTATION_MANAGER DrawInfoCardInstalled(DoozyResources.WindowAboutInfoOrientationManagerInstalled, DoozyConstants.VERSION_ORIENTATION_MANAGER); #else DrawInfoCardNotInstalled(DoozyResources.WindowAboutInfoOrientationManagerNotInstalled, DoozyConstants.LINK_ORIENTATION_MANAGER); #endif DoozyEditorUtility.VerticalSpace(VERTICAL_SPACE_BETWEEN_INFO_CARDS); #if dUI_FONT_AWESOME DrawInfoCardInstalled(DoozyResources.WindowAboutInfoFontAwesomeInstalled, DoozyConstants.VERSION_FONT_AWESOME); #else DrawInfoCardNotInstalled(DoozyResources.WindowAboutInfoFontAwesomeNotInstalled, DoozyConstants.LINK_FONT_AWESOME); #endif } EditorGUILayout.EndVertical(); DoozyEditorUtility.HorizontalSpace(152); } EditorGUILayout.EndHorizontal(); GUILayout.FlexibleSpace(); EditorGUILayout.BeginHorizontal(GUILayout.Height(23));//space for copyright info { GUILayout.FlexibleSpace(); EditorGUILayout.LabelField(DoozyConstants.COPYRIGHT, skin.GetStyle(DoozyStyle.StyleName.Copyright.ToString()), GUILayout.Width(384)); GUILayout.FlexibleSpace(); } EditorGUILayout.EndHorizontal(); } EditorGUILayout.EndVertical(); }
/// <summary> /// Draws the component's header. /// </summary> public void DrawHeader(Texture texture, float width = HEADER_WIDTH, float height = HEADER_HEIGHT) { SaveCurrentColorsAndResetColors(); DoozyEditorUtility.DrawTexture(texture, width, height); LoadPreviousColors(); }