extra assets + decoration
This commit is contained in:
@@ -0,0 +1,158 @@
|
||||
// Cristian Pop - https://boxophobic.com/
|
||||
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using Boxophobic.Constants;
|
||||
|
||||
namespace Boxophobic.StyledGUI
|
||||
{
|
||||
public partial class StyledGUI
|
||||
{
|
||||
public static void DrawInspectorBanner(Color color, string title)
|
||||
{
|
||||
GUILayout.Space(10);
|
||||
|
||||
var fullRect = GUILayoutUtility.GetRect(0, 0, 36, 0);
|
||||
var fillRect = new Rect(0, fullRect.position.y, fullRect.xMax + 3, 36);
|
||||
var lineRect = new Rect(0, fullRect.position.y, fullRect.xMax + 3, 1);
|
||||
|
||||
if (EditorGUIUtility.isProSkin)
|
||||
{
|
||||
color = new Color(color.r, color.g, color.b, 1f);
|
||||
}
|
||||
else
|
||||
{
|
||||
color = CONSTANT.ColorLightGray;
|
||||
}
|
||||
|
||||
EditorGUI.DrawRect(fillRect, color);
|
||||
EditorGUI.DrawRect(lineRect, CONSTANT.LineColor);
|
||||
|
||||
Color guiColor = CONSTANT.ColorDarkGray;
|
||||
|
||||
GUI.Label(fullRect, "<size=16><color=#" + ColorUtility.ToHtmlStringRGB(guiColor) + ">" + title + "</color></size>", CONSTANT.TitleStyle);
|
||||
|
||||
GUILayout.Space(10);
|
||||
}
|
||||
|
||||
public static void DrawInspectorBanner(string title)
|
||||
{
|
||||
GUILayout.Space(10);
|
||||
|
||||
var fullRect = GUILayoutUtility.GetRect(0, 0, 36, 0);
|
||||
var fillRect = new Rect(0, fullRect.position.y, fullRect.xMax + 3, 36);
|
||||
var lineRect = new Rect(0, fullRect.position.y, fullRect.xMax + 3, 1);
|
||||
|
||||
Color color;
|
||||
Color guiColor;
|
||||
|
||||
if (EditorGUIUtility.isProSkin)
|
||||
{
|
||||
color = CONSTANT.ColorDarkGray;
|
||||
guiColor = CONSTANT.ColorLightGray;
|
||||
}
|
||||
else
|
||||
{
|
||||
color = CONSTANT.ColorLightGray;
|
||||
guiColor = CONSTANT.ColorDarkGray;
|
||||
}
|
||||
|
||||
EditorGUI.DrawRect(fillRect, color);
|
||||
EditorGUI.DrawRect(lineRect, CONSTANT.LineColor);
|
||||
|
||||
GUI.Label(fullRect, "<size=16><color=#" + ColorUtility.ToHtmlStringRGB(guiColor) + ">" + title + "</color></size>", CONSTANT.TitleStyle);
|
||||
|
||||
GUILayout.Space(10);
|
||||
}
|
||||
|
||||
public static void DrawInspectorBanner(Color color, string title, string subtitle)
|
||||
{
|
||||
GUIStyle titleStyle = new GUIStyle("label")
|
||||
{
|
||||
richText = true,
|
||||
alignment = TextAnchor.MiddleCenter
|
||||
};
|
||||
|
||||
GUIStyle subTitleStyle = new GUIStyle("label")
|
||||
{
|
||||
richText = true,
|
||||
alignment = TextAnchor.MiddleRight
|
||||
};
|
||||
|
||||
GUILayout.Space(10);
|
||||
|
||||
var fullRect = GUILayoutUtility.GetRect(0, 0, 36, 0);
|
||||
var fillRect = new Rect(0, fullRect.position.y, fullRect.xMax + 3, 36);
|
||||
var subRect = new Rect(18, 16, fullRect.width - 2, fullRect.height);
|
||||
var lineRect = new Rect(0, fullRect.position.y, fullRect.xMax + 3, 1);
|
||||
|
||||
if (EditorGUIUtility.isProSkin)
|
||||
{
|
||||
color = new Color(color.r, color.g, color.b, 1f);
|
||||
}
|
||||
else
|
||||
{
|
||||
color = CONSTANT.ColorLightGray;
|
||||
}
|
||||
|
||||
EditorGUI.DrawRect(fillRect, color);
|
||||
EditorGUI.DrawRect(lineRect, CONSTANT.LineColor);
|
||||
|
||||
Color guiColor = CONSTANT.ColorDarkGray;
|
||||
|
||||
GUI.Label(fullRect, "<size=16><color=#" + ColorUtility.ToHtmlStringRGB(guiColor) + ">" + title + "</color></size>", titleStyle);
|
||||
GUI.enabled = false;
|
||||
GUI.Label(subRect, "<size=10>" + subtitle + "</size>", subTitleStyle);
|
||||
GUI.enabled = true;
|
||||
|
||||
GUILayout.Space(10);
|
||||
}
|
||||
|
||||
public static void DrawInspectorBanner(string title, string subtitle)
|
||||
{
|
||||
GUIStyle titleStyle = new GUIStyle("label")
|
||||
{
|
||||
richText = true,
|
||||
alignment = TextAnchor.MiddleCenter
|
||||
};
|
||||
|
||||
GUIStyle subTitleStyle = new GUIStyle("label")
|
||||
{
|
||||
richText = true,
|
||||
alignment = TextAnchor.MiddleRight
|
||||
};
|
||||
|
||||
GUILayout.Space(10);
|
||||
|
||||
var fullRect = GUILayoutUtility.GetRect(0, 0, 36, 0);
|
||||
var fillRect = new Rect(0, fullRect.position.y, fullRect.xMax + 3, 36);
|
||||
var subRect = new Rect(18, 16, fullRect.width - 2, fullRect.height);
|
||||
var lineRect = new Rect(0, fullRect.position.y, fullRect.xMax + 3, 1);
|
||||
|
||||
Color color;
|
||||
Color guiColor;
|
||||
|
||||
if (EditorGUIUtility.isProSkin)
|
||||
{
|
||||
color = CONSTANT.ColorDarkGray;
|
||||
guiColor = CONSTANT.ColorLightGray;
|
||||
}
|
||||
else
|
||||
{
|
||||
color = CONSTANT.ColorLightGray;
|
||||
guiColor = CONSTANT.ColorDarkGray;
|
||||
}
|
||||
|
||||
EditorGUI.DrawRect(fillRect, color);
|
||||
EditorGUI.DrawRect(lineRect, CONSTANT.LineColor);
|
||||
|
||||
GUI.Label(fullRect, "<size=16><color=#" + ColorUtility.ToHtmlStringRGB(guiColor) + ">" + title + "</color></size>", titleStyle);
|
||||
GUI.enabled = false;
|
||||
GUI.Label(subRect, "<size=10>" + subtitle + "</size>", subTitleStyle);
|
||||
GUI.enabled = true;
|
||||
|
||||
GUILayout.Space(10);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1525d4228f26951498e86e425363f3f0
|
||||
timeCreated: 1542661236
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,92 @@
|
||||
// Cristian Pop - https://boxophobic.com/
|
||||
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using Boxophobic.Constants;
|
||||
|
||||
namespace Boxophobic.StyledGUI
|
||||
{
|
||||
public partial class StyledGUI
|
||||
{
|
||||
public static void DrawInspectorCategory(string bannerText)
|
||||
{
|
||||
var fullRect = GUILayoutUtility.GetRect(0, 0, 18, 0);
|
||||
var fillRect = new Rect(0, fullRect.y, fullRect.xMax + 10, 18);
|
||||
var lineRect = new Rect(0, fullRect.y, fullRect.xMax + 10, 1);
|
||||
var titleRect = new Rect(fullRect.position.x - 1, fullRect.position.y, fullRect.width, 18);
|
||||
|
||||
EditorGUI.DrawRect(fillRect, CONSTANT.CategoryColor);
|
||||
EditorGUI.DrawRect(lineRect, CONSTANT.LineColor);
|
||||
|
||||
GUI.Label(titleRect, bannerText, CONSTANT.HeaderStyle);
|
||||
}
|
||||
|
||||
public static bool DrawInspectorCategory(string bannerText, bool enabled, bool colapsable, float top, float down)
|
||||
{
|
||||
GUI.color = new Color(1, 1, 1, 0.9f);
|
||||
|
||||
if (colapsable)
|
||||
{
|
||||
if (enabled)
|
||||
{
|
||||
GUILayout.Space(top);
|
||||
}
|
||||
else
|
||||
{
|
||||
GUILayout.Space(0);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
GUILayout.Space(top);
|
||||
}
|
||||
|
||||
var fullRect = GUILayoutUtility.GetRect(0, 0, 18, 0);
|
||||
var fillRect = new Rect(0, fullRect.y, fullRect.xMax + 10, 18);
|
||||
var lineRect = new Rect(0, fullRect.y - 1, fullRect.xMax + 10, 1);
|
||||
var titleRect = new Rect(fullRect.position.x - 1, fullRect.position.y, fullRect.width, 18);
|
||||
var arrowRect = new Rect(fullRect.position.x - 15, fullRect.position.y, fullRect.width, 18);
|
||||
|
||||
if (colapsable)
|
||||
{
|
||||
if (GUI.Button(arrowRect, "", GUIStyle.none))
|
||||
{
|
||||
enabled = !enabled;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
enabled = true;
|
||||
}
|
||||
|
||||
EditorGUI.DrawRect(fillRect, CONSTANT.CategoryColor);
|
||||
EditorGUI.DrawRect(lineRect, CONSTANT.LineColor);
|
||||
|
||||
GUI.Label(titleRect, bannerText, CONSTANT.HeaderStyle);
|
||||
|
||||
GUI.color = new Color(1, 1, 1, 0.39f);
|
||||
|
||||
if (colapsable)
|
||||
{
|
||||
if (enabled)
|
||||
{
|
||||
GUI.Label(arrowRect, "<size=10>▼</size>", CONSTANT.HeaderStyle);
|
||||
GUILayout.Space(down);
|
||||
}
|
||||
else
|
||||
{
|
||||
GUI.Label(arrowRect, "<size=10>►</size>", CONSTANT.HeaderStyle);
|
||||
GUILayout.Space(0);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
GUILayout.Space(down);
|
||||
}
|
||||
|
||||
GUI.color = Color.white;
|
||||
return enabled;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 87b94a9c1333f074e8c24cd5a2fe1d73
|
||||
timeCreated: 1542661236
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,149 @@
|
||||
// Cristian Pop - https://boxophobic.com/
|
||||
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using Boxophobic.Constants;
|
||||
|
||||
namespace Boxophobic.StyledGUI
|
||||
{
|
||||
public partial class StyledGUI
|
||||
{
|
||||
public static void DrawWindowBanner(Color color, string title)
|
||||
{
|
||||
GUILayout.Space(15);
|
||||
|
||||
var fullRect = GUILayoutUtility.GetRect(0, 0, 36, 0);
|
||||
var fillRect = new Rect(1, fullRect.position.y, fullRect.xMax - 2, 36);
|
||||
var lineRect = new Rect(1, fullRect.position.y, fullRect.xMax - 2, 1);
|
||||
|
||||
if (EditorGUIUtility.isProSkin)
|
||||
{
|
||||
color = new Color(color.r, color.g, color.b, 1f);
|
||||
}
|
||||
else
|
||||
{
|
||||
color = CONSTANT.ColorLightGray;
|
||||
}
|
||||
|
||||
EditorGUI.DrawRect(fillRect, color);
|
||||
EditorGUI.DrawRect(lineRect, CONSTANT.LineColor);
|
||||
|
||||
Color guiColor = CONSTANT.ColorDarkGray;
|
||||
|
||||
GUI.Label(fullRect, "<size=16><color=#" + ColorUtility.ToHtmlStringRGB(guiColor) + ">" + title + "</color></size>", CONSTANT.TitleStyle);
|
||||
|
||||
GUILayout.Space(15);
|
||||
}
|
||||
|
||||
public static void DrawWindowBanner(string title)
|
||||
{
|
||||
GUILayout.Space(15);
|
||||
|
||||
var fullRect = GUILayoutUtility.GetRect(0, 0, 36, 0);
|
||||
var fillRect = new Rect(2, fullRect.position.y, fullRect.xMax - 4, 36);
|
||||
|
||||
Color color;
|
||||
Color guiColor;
|
||||
|
||||
if (EditorGUIUtility.isProSkin)
|
||||
{
|
||||
color = CONSTANT.ColorDarkGray;
|
||||
guiColor = CONSTANT.ColorLightGray;
|
||||
}
|
||||
else
|
||||
{
|
||||
color = CONSTANT.ColorLightGray;
|
||||
guiColor = CONSTANT.ColorDarkGray;
|
||||
}
|
||||
|
||||
EditorGUI.DrawRect(fillRect, color);
|
||||
|
||||
GUI.Label(fullRect, "<size=16><color=#" + ColorUtility.ToHtmlStringRGB(guiColor) + ">" + title + "</color></size>", CONSTANT.TitleStyle);
|
||||
|
||||
GUILayout.Space(15);
|
||||
}
|
||||
|
||||
public static void DrawWindowBanner(Color color, string title, string subtitle)
|
||||
{
|
||||
GUIStyle titleStyle = new GUIStyle("label")
|
||||
{
|
||||
richText = true,
|
||||
alignment = TextAnchor.MiddleCenter
|
||||
};
|
||||
|
||||
GUIStyle subTitleStyle = new GUIStyle("label")
|
||||
{
|
||||
richText = true,
|
||||
alignment = TextAnchor.MiddleRight
|
||||
};
|
||||
|
||||
GUILayout.Space(15);
|
||||
|
||||
var fullRect = GUILayoutUtility.GetRect(0, 0, 36, 0);
|
||||
var fillRect = new Rect(1, fullRect.position.y, fullRect.xMax - 2, 36);
|
||||
var subRect = new Rect(18, 39, fullRect.width - 36, fullRect.height);
|
||||
var lineRect = new Rect(1, fullRect.position.y, fullRect.xMax - 2, 1);
|
||||
|
||||
if (EditorGUIUtility.isProSkin)
|
||||
{
|
||||
color = new Color(color.r, color.g, color.b, 1f);
|
||||
}
|
||||
else
|
||||
{
|
||||
color = CONSTANT.ColorLightGray;
|
||||
}
|
||||
|
||||
EditorGUI.DrawRect(fillRect, color);
|
||||
EditorGUI.DrawRect(lineRect, CONSTANT.LineColor);
|
||||
|
||||
Color guiColor = CONSTANT.ColorDarkGray;
|
||||
|
||||
GUI.Label(fullRect, "<size=16><color=#" + ColorUtility.ToHtmlStringRGB(guiColor) + ">" + title + "</color></size>", titleStyle);
|
||||
GUI.Label(subRect, "<b><size=11><color=#" + ColorUtility.ToHtmlStringRGB(guiColor) + ">" + subtitle + "</color></size></b>", subTitleStyle);
|
||||
|
||||
GUILayout.Space(15);
|
||||
}
|
||||
|
||||
public static void DrawWindowBanner(string title, string subtitle)
|
||||
{
|
||||
GUIStyle titleStyle = new GUIStyle("label")
|
||||
{
|
||||
richText = true,
|
||||
alignment = TextAnchor.MiddleCenter
|
||||
};
|
||||
|
||||
GUIStyle subTitleStyle = new GUIStyle("label")
|
||||
{
|
||||
richText = true,
|
||||
alignment = TextAnchor.MiddleRight
|
||||
};
|
||||
|
||||
GUILayout.Space(15);
|
||||
|
||||
var fullRect = GUILayoutUtility.GetRect(0, 0, 36, 0);
|
||||
var subRect = new Rect(18, 39, fullRect.width - 36, fullRect.height);
|
||||
var fillRect = new Rect(2, fullRect.position.y, fullRect.xMax - 4, 36);
|
||||
|
||||
Color color;
|
||||
Color guiColor;
|
||||
|
||||
if (EditorGUIUtility.isProSkin)
|
||||
{
|
||||
color = CONSTANT.ColorDarkGray;
|
||||
guiColor = CONSTANT.ColorLightGray;
|
||||
}
|
||||
else
|
||||
{
|
||||
color = CONSTANT.ColorLightGray;
|
||||
guiColor = CONSTANT.ColorDarkGray;
|
||||
}
|
||||
EditorGUI.DrawRect(fillRect, color);
|
||||
|
||||
GUI.Label(fullRect, "<size=16><color=#" + ColorUtility.ToHtmlStringRGB(guiColor) + ">" + title + "</color></size>", titleStyle);
|
||||
GUI.Label(subRect, "<b><size=11><color=#" + ColorUtility.ToHtmlStringRGB(guiColor) + ">" + subtitle + "</color></size></b>", subTitleStyle);
|
||||
|
||||
GUILayout.Space(15);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: dd0ddca94871d9a4586a143a83184806
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,89 @@
|
||||
// Cristian Pop - https://boxophobic.com/
|
||||
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using Boxophobic.Constants;
|
||||
|
||||
namespace Boxophobic.StyledGUI
|
||||
{
|
||||
public partial class StyledGUI
|
||||
{
|
||||
public static void DrawWindowCategory(string bannerText)
|
||||
{
|
||||
var fullRect = GUILayoutUtility.GetRect(0, 0, 18, 0);
|
||||
var fillRect = new Rect(0, fullRect.y, fullRect.xMax + 10, 18);
|
||||
var lineRect = new Rect(0, fullRect.y, fullRect.xMax + 10, 1);
|
||||
var titleRect = new Rect(fullRect.position.x + 4, fullRect.position.y, fullRect.width, 18);
|
||||
|
||||
EditorGUI.DrawRect(fillRect, CONSTANT.CategoryColor);
|
||||
EditorGUI.DrawRect(lineRect, CONSTANT.LineColor);
|
||||
|
||||
GUI.Label(titleRect, bannerText, CONSTANT.HeaderStyle);
|
||||
}
|
||||
|
||||
public static bool DrawWindowCategory(string bannerText, bool enabled, float top, float down, bool colapsable)
|
||||
{
|
||||
if (colapsable)
|
||||
{
|
||||
if (enabled)
|
||||
{
|
||||
GUILayout.Space(top);
|
||||
}
|
||||
else
|
||||
{
|
||||
GUILayout.Space(0);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
GUILayout.Space(top);
|
||||
}
|
||||
|
||||
var fullRect = GUILayoutUtility.GetRect(0, 0, 18, 0);
|
||||
var fillRect = new Rect(0, fullRect.y, fullRect.xMax + 10, 18);
|
||||
var lineRect = new Rect(0, fullRect.y, fullRect.xMax + 10, 1);
|
||||
var titleRect = new Rect(fullRect.position.x + 4, fullRect.position.y, fullRect.width, 18);
|
||||
|
||||
if (EditorGUIUtility.isProSkin)
|
||||
{
|
||||
GUI.color = CONSTANT.ColorDarkGray;
|
||||
}
|
||||
else
|
||||
{
|
||||
GUI.color = CONSTANT.ColorLightGray;
|
||||
}
|
||||
|
||||
if (colapsable)
|
||||
{
|
||||
if (GUI.Button(fullRect, "", GUIStyle.none))
|
||||
{
|
||||
enabled = !enabled;
|
||||
}
|
||||
}
|
||||
|
||||
EditorGUI.DrawRect(fillRect, CONSTANT.CategoryColor);
|
||||
EditorGUI.DrawRect(lineRect, CONSTANT.LineColor);
|
||||
|
||||
GUI.Label(titleRect, bannerText, CONSTANT.HeaderStyle);
|
||||
|
||||
if (colapsable)
|
||||
{
|
||||
if (enabled)
|
||||
{
|
||||
GUILayout.Space(down);
|
||||
}
|
||||
else
|
||||
{
|
||||
GUILayout.Space(0);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
GUILayout.Space(down);
|
||||
}
|
||||
|
||||
return enabled;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: aac99d6d81f90e54cabd822770c11875
|
||||
timeCreated: 1542661236
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user