Skip to content
JefferiesTube edited this page Mar 15, 2016 · 2 revisions

GetEditorStyle

public static GUIStyle GetEditorStyle(string style)

Returns a specific editor style. Works with Free and Pro skin

GetAssetPath

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

DrawIconHeader

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:

Imgur

GUIDrawRect

public static void GUIDrawRect(Rect position, Color color)

Draws a simple rectangle that is filled with a solid color

Clone this wiki locally