public GUIStyle GetTitleStyle(bool selected) { if (_styleTitle == null || _titleOrdinary == null || _titleSelected == null) { _styleTitle = new GUIStyle(EditorStyles.whiteBoldLabel); _styleTitle.alignment = TextAnchor.MiddleCenter; _titleOrdinary = PAEditorUtil.getColorTexture(PAEditorConst.TitleColor); _titleSelected = PAEditorUtil.getColorTexture(PAEditorConst.TitleColorSelected); } _styleTitle.normal.background = selected ? _titleSelected : _titleOrdinary; _styleTitle.normal.textColor = selected ? Color.yellow : Color.white; return(_styleTitle); }
static void InitializeStyles() { if (NameLabel == null) { NameLabel = new GUIStyle(EditorStyles.whiteBoldLabel); NameLabel.normal.background = PAEditorUtil.getColorTexture(LabelBackground); NameLabel.normal.textColor = Color.white; SmallLabel = new GUIStyle(EditorStyles.whiteLabel); SmallLabel.normal.background = PAEditorUtil.getColorTexture(LabelBackground); SmallLabel.normal.textColor = Color.white; HoverText = new GUIStyle(EditorStyles.whiteLabel); HoverText.alignment = TextAnchor.MiddleCenter; HoverText.normal.background = PAEditorUtil.getColorTexture(LabelBackground); HoverText.normal.textColor = Color.white; } }