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.asset"; ConstellationEditorData t = (ConstellationEditorData)AssetDatabase.LoadAssetAtPath(path, typeof(ConstellationEditorData)); if (t == null) { return(Setup()); } EditorData = t; if (EditorData.LastOpenedConstellationPath == null) { EditorData.LastOpenedConstellationPath = new List <ConstellationScriptInfos>(); } return(EditorData); }