コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }