private void DrawLinkSettings(Rect rect, Event e) { if (GuiHelper.Button(rect, Styles.icon_style_linked, Styles.COLOR_ICON_ACTIVE_CYAN, MaterialLinker.IsLinked(ShaderEditor.active.currentProperty.materialProperty))) { ShaderEditor.input.Use(); List <Material> linked_materials = MaterialLinker.GetLinked(ShaderEditor.active.currentProperty.materialProperty); MaterialLinker.Popup(rect, linked_materials, ShaderEditor.active.currentProperty.materialProperty); } }
public static bool Button(GUIStyle style, int width, int height, Color c) { Color prevColor = GUI.backgroundColor; GUI.backgroundColor = c; bool b = GuiHelper.Button(style, width, height); GUI.backgroundColor = prevColor; return(b); }
public static bool Button(Rect r, string tooltip, GUIStyle style, Color c) { Color prevColor = GUI.backgroundColor; GUI.backgroundColor = c; bool b = GuiHelper.Button(r, tooltip, style); GUI.backgroundColor = prevColor; return(b); }
public static bool Button(Rect r, GUIStyle style, Color c, bool doColor) { Color prevColor = GUI.backgroundColor; if (doColor) { GUI.backgroundColor = c; } bool b = GuiHelper.Button(r, style); GUI.backgroundColor = prevColor; return(b); }
private void DrawDowdownSettings(Rect rect, Event e) { if (GuiHelper.Button(rect, Styles.icon_style_menu)) { ShaderEditor.input.Use(); Rect buttonRect = new Rect(rect); buttonRect.width = 150; buttonRect.x = Mathf.Min(Screen.width - buttonRect.width, buttonRect.x); buttonRect.height = 60; float maxY = GUIUtility.ScreenToGUIPoint(new Vector2(0, EditorWindow.focusedWindow.position.y + Screen.height)).y - 2.5f * buttonRect.height; buttonRect.y = Mathf.Min(buttonRect.y - buttonRect.height / 2, maxY); ShowHeaderContextMenu(buttonRect, ShaderEditor.active.currentProperty, ShaderEditor.active.materials[0]); } }
private void DrawHelpButton(Rect rect, PropertyOptions options, Event e) { ButtonData button = this.button != null ? this.button : options.button_help; if (button != null && button.condition_show.Test()) { if (GuiHelper.Button(rect, Styles.icon_style_help)) { ShaderEditor.input.Use(); if (button.action != null) { button.action.Perform(); } } } }