using UnityEngine; using UnityEditor; namespace CustomEditorTools { /// /// A set of editor tools used to speed up custom editor creation /// static public class CET { /// /// Creates a 1X1 Images with the input color. Use to color editor backgrounds /// /// Color of background image static public Texture2D MakeEditorBackgroundColor (Color Color) { Texture2D t = new Texture2D(1, 1); t.SetPixel(0, 0, Color); t.Apply(); return t; } /// /// Loads a images as a Texture2D /// /// Path of image file e.g. Asset\Folder1\Folder2\file.png /// static public Texture2D LoadImageFromFile (string Path) { return (Texture2D)AssetDatabase.LoadAssetAtPath(Path, typeof(Texture2D)); } /// /// Draw a simple dividing line on an custom editor /// static public void HorizontalLine () { EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); } } }