public static bool ImageButton(Texture2D tex, params GUILayoutOption[] option) { var style = new GUIStyle(HEditorStyles.imageButton); //style.margin = new RectOffset( 0, 0, 0, 0 ); var r = EditorHelper.GetLayout(tex, style, option); return(HEditorGUI.ImageButton(r, EditorHelper.TempContent(tex), style)); }
public static bool IconButton(Texture2D image, string tooltip, int marginHeighOffset = 0, bool mouseUp = false) { var style = new GUIStyle(HEditorStyles.iconButton); style.margin = new RectOffset(0, 0, marginHeighOffset, 0); var r = EditorHelper.GetLayout(image, style); return(HEditorGUI.IconButton(r, EditorHelper.TempContent(image, tooltip), style, 0, mouseUp)); }
public static bool IconButton(Texture2D tex, int marginHeighOffset = 0) { var style = new GUIStyle(HEditorStyles.iconButton); style.margin = new RectOffset(0, 0, marginHeighOffset, 0); var r = EditorHelper.GetLayout(tex, style); return(HEditorGUI.IconButton(r, tex, style, 0)); }
public static bool ToggleLeft(string s, bool b, float heighOffset = 0) { using (new GUILayout.HorizontalScope()) { GUILayout.Space(15 * EditorGUI.indentLevel); var rt = EditorHelper.GetLayout("", EditorStyles.toggle, GUILayout.Width(16)); rt.y += heighOffset; bool b11 = GUI.Toggle(rt, b, ""); var r = EditorHelper.GetLayout(s, EditorStyles.label); r.x -= 5; r.y += heighOffset; GUI.Label(r, s, EditorStyles.label); return(b11); } }
public static bool ToggleLeft(string s, bool b, float heighOffset = 0) { GUILayout.BeginHorizontal(); GUILayout.Space(15 * EditorGUI.indentLevel); var rt = EditorHelper.GetLayout("", EditorStyles.toggle, GUILayout.Width(16), GUILayout.Height(EditorGUIUtility.singleLineHeight)); rt.y += heighOffset; bool b11 = GUI.Toggle(rt, b, ""); var r = EditorHelper.GetLayout(s, EditorStyles.label, GUILayout.Height(EditorGUIUtility.singleLineHeight)); r.x -= 2; r.y += heighOffset; //if( b11 ) HEditorGUI.DrawDebugRect( r ); GUI.Label(r, s, EditorStyles.label); GUILayout.EndHorizontal(); //HEditorGUI.DrawDebugRectAtLastRect(); //HEditorGUI.DrawDebugRect( r ); return(b11); }