-
Notifications
You must be signed in to change notification settings - Fork 33
Other
JefferiesTube edited this page Mar 15, 2016
·
2 revisions
public static GUIStyle GetEditorStyle(string style)
Returns a specific editor style. Works with Free and Pro skin
public static string GetAssetPath(string assetFileName)
Returns the path of a given asset. E.g. you can retrieve the path to an icon relative to a scripts location, preventing the usage of hardcoded paths
public static bool DrawIconHeader(string key, Texture icon, string caption, Color captionColor)
Draws an extended foldout that consists of an icon and a colored caption
_icon = AssetDatabase.LoadAssetAtPath(EditorHelper.GetAssetPath("MyScript.cs") + "Icons/MyIcon.png", typeof(Texture)) as Texture;
if (EditorHelper.DrawIconHeader("UniqueKeyForThisGroup", _icon, "Caption", Color.white))
{
// Do your UI Stuff here
}
A sample might look like this:
public static void GUIDrawRect(Rect position, Color color)
Draws a simple rectangle that is filled with a solid color