Exemplo n.º 1
0
        public static void Copy()
        {
            var source = (Texture2D)AssetDatabase.LoadAssetAtPath(ConstellationEditor.GetEditorAssetPath() + "ConstellationScript.png", typeof(Texture2D));
            var target = (Texture2D)AssetDatabase.LoadAssetAtPath("Assets/Gizmos/ConstellationBehaviourScript Icon.png", typeof(Texture2D));

            if (source != null && target == null)
            {
                AssetDatabase.CreateFolder("Assets", "Gizmos");
                AssetDatabase.CopyAsset(ConstellationEditor.GetEditorAssetPath() + "ConstellationScript.png", "Assets/Gizmos/ConstellationBehaviourScript Icon.png");
            }
        }
Exemplo n.º 2
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);
        }
Exemplo n.º 3
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);
        }
Exemplo n.º 4
0
        public ConstellationEditorStyles GetConstellationEditorConfig()
        {
            if (ConstellationEditorStyles == null)
            {
                ConstellationEditorStyles = (ConstellationEditorStyles)AssetDatabase.LoadAssetAtPath(ConstellationEditor.GetEditorPath() + "ConstellationStyle.Asset", typeof(ConstellationEditorStyles));
            }

            return(ConstellationEditorStyles);
        }