private GUIStyle InitNoteHoverStyle() { noteHoverStyle = new GUIStyle(NoteStyle); noteHoverStyle.normal.background = EditorGUIUtility.Load(ConstellationEditor.GetEditorAssetPath() + "note_on.png") as Texture2D; noteHoverStyle.border = new RectOffset(10, 10, 10, 10); noteHoverStyle.overflow = new RectOffset(7, 7, 5, 10); return(noteHoverStyle); }
private ConstellationEditorData Setup() { var path = ConstellationEditor.GetEditorPath() + "EditorData/EditorData.asset"; EditorData = ScriptableObject.CreateInstance <ConstellationEditorData> (); AssetDatabase.CreateAsset(EditorData, path); return(EditorData); }
public static void Copy() { var source = (Texture2D)AssetDatabase.LoadAssetAtPath(ConstellationEditor.GetEditorAssetPath() + "ConstellationScript.png", typeof(Texture2D)); var target = (Texture2D)AssetDatabase.LoadAssetAtPath("Assets/Gizmos/ConstellationScript Icon.png", typeof(Texture2D)); if (source != null && target == null) { AssetDatabase.CreateFolder("Assets", "Gizmos"); AssetDatabase.CopyAsset(ConstellationEditor.GetEditorAssetPath() + "ConstellationScript.png", "Assets/Gizmos/ConstellationScript Icon.png"); } }
private ConstellationEditorData Setup() { var path = ConstellationEditor.GetEditorPath() + "EditorData.asset"; var assemblyPath = ConstellationEditor.GetProjectPath() + "ConstellationAssembly.asset"; AssetDatabase.DeleteAsset(assemblyPath); AssetDatabase.DeleteAsset(path); AssetDatabase.Refresh(); EditorData = ScriptableObject.CreateInstance <ConstellationEditorData>(); AssetDatabase.CreateAsset(EditorData, path); EditorData.ScriptAssembly = ScriptableObject.CreateInstance <ConstellationScriptsAssembly>(); AssetDatabase.CreateAsset(EditorData.ScriptAssembly, assemblyPath); return(EditorData); }
public ConstellationEditorData OpenEditorData() { var path = ConstellationEditor.GetEditorPath() + "EditorData/EditorData.asset"; ConstellationEditorData t = (ConstellationEditorData)AssetDatabase.LoadAssetAtPath(path, typeof(ConstellationEditorData)); if (t == null) { return(Setup()); } EditorData = t; if (EditorData.LastOpenedConstellationPath == null) { EditorData.LastOpenedConstellationPath = new List <string> (); } return(EditorData); }
public ConstellationEditorStyles GetConstellationEditorConfig() { if (ConstellationEditorStyles == null) { ConstellationEditorStyles = (ConstellationEditorStyles)AssetDatabase.LoadAssetAtPath(ConstellationEditor.GetEditorPath() + "ConstellationStyle.Asset", typeof(ConstellationEditorStyles)); } return(ConstellationEditorStyles); }