public static GUIStyle Font(this GUIStyle current, string value, bool asCopy = true) { Font font = FileManager.GetAsset <Font>(value); if (font != null) { return(current.Font(font, asCopy)); } return(current); }
public static GUIStyle Background(this GUIStyle current, string value, bool asCopy = true) { if (value.IsEmpty()) { return(current.Background(new Texture2D(0, 0), asCopy)); } Texture2D texture = FileManager.GetAsset <Texture2D>(value); if (texture != null) { return(current.Background(texture, asCopy)); } return(current); }
public static Type GetSingleton <Type>(bool create = true) where Type : ScriptableObject { var name = typeof(Type).Name; return(FileManager.GetAsset <Type>(name + ".asset", false) ?? ScriptableObject.FindObjectOfType <Type>() ?? create?Utility.CreateSingleton("Assets/Settings/" + name).As <Type>() : null); }
public static GUIStyle Get(string skin, string name, bool copy = false) { var guiSkin = FileManager.GetAsset <GUISkin>(skin); return(Style.Get(guiSkin, name, copy)); }