private void DrawTitle(Rect position, string title) { if (titleGuiStyle == null) { titleGuiStyle = new GUIStyle(GUI.skin.label); titleGuiStyle.alignment = TextAnchor.LowerCenter; titleGuiStyle.stretchWidth = true; titleGuiStyle.border = new RectOffset(); if (LostEditorUtil.IsProTheme()) { titleGuiStyle.normal.textColor = Color.white; } else { titleGuiStyle.normal.textColor = Color.black; } } if (string.IsNullOrEmpty(title) == false) { EditorGUILayout.LabelField(title, titleGuiStyle); } else { EditorGUILayout.LabelField(string.Empty, titleGuiStyle); } }
private Color GetCurrentRowColor() { if (this.gridDefinition.AlternateColors) { return(backgroundColors[this.currentRowIndex % backgroundColors.Count]); } else { return(LostEditorUtil.IsProTheme() ? new Color(0.298f, 0.298f, 0.298f) : new Color(0.867f, 0.867f, 0.867f)); } }
static Grid() { if (LostEditorUtil.IsProTheme()) { backgroundColors.Add(new Color(0.204f, 0.094f, 0.094f)); // dark red backgroundColors.Add(new Color(0.208f, 0.176f, 0.106f)); // dark yellow backgroundColors.Add(new Color(0.180f, 0.204f, 0.208f)); // dark blue } else { backgroundColors.Add(new Color(0.612f, 0.282f, 0.282f)); // red backgroundColors.Add(new Color(0.624f, 0.528f, 0.318f)); // yellow backgroundColors.Add(new Color(0.540f, 0.612f, 0.624f)); // blue } }
private void DrawTitle(Rect position, int foldoutId, string title) { if (titleGuiStyle == null) { titleGuiStyle = new GUIStyle(GUI.skin.label); titleGuiStyle.alignment = TextAnchor.LowerCenter; titleGuiStyle.stretchWidth = true; titleGuiStyle.border = new RectOffset(); if (LostEditorUtil.IsProTheme()) { titleGuiStyle.normal.textColor = Color.white; } else { titleGuiStyle.normal.textColor = Color.black; } } if (string.IsNullOrEmpty(title) == false) { EditorGUILayout.LabelField(title, titleGuiStyle); } else { EditorGUILayout.LabelField(string.Empty, titleGuiStyle); } // drawing the foldout Rect foldoutPosition = position; foldoutPosition.x += 15; foldoutPosition.y += 3; foldoutPosition.width = 15; foldoutPosition.height = 15; foldouts[foldoutId] = EditorGUI.Foldout(foldoutPosition, foldouts[foldoutId], GUIContent.none, false); }