Exemplo n.º 1
0
        public override ExportPointer CreateExportPointer(Object asset, bool isLocal)
        {
            if (isLocal)
            {
                throw new NotSupportedException();
            }

            MonoScript script = m_scripts[asset];

            if (s_unityEngine.IsMatch(script.AssemblyName))
            {
                if (MonoScript.IsReadNamespace(script.File.Version))
                {
                    int fileID = Compute(script.Namespace, script.Name);
                    return(new ExportPointer(fileID, UnityEngineGUID, AssetExporter.ToExportType(asset)));
                }
                else
                {
                    ScriptInfo scriptInfo = script.GetScriptInfo();
                    if (scriptInfo != default)
                    {
                        int fileID = Compute(scriptInfo.Namespace, scriptInfo.Name);
                        return(new ExportPointer(fileID, UnityEngineGUID, AssetExporter.ToExportType(asset)));
                    }
                }
            }

            long       exportID   = GetExportID(asset);
            EngineGUID uniqueGUID = script.GUID;

            return(new ExportPointer(exportID, uniqueGUID, AssetExporter.ToExportType(asset)));
        }
Exemplo n.º 2
0
        public override bool Export(ProjectAssetContainer container, string dirPath)
        {
            string folderPath = Path.Combine(dirPath, OcclusionCullingSettings.SceneExportFolder);
            string fileName   = $"{Name}.unity";
            string filePath   = Path.Combine(folderPath, fileName);

            if (!Directory.Exists(folderPath))
            {
                Directory.CreateDirectory(folderPath);
            }

            AssetExporter.Export(container, Components, filePath);
            DefaultImporter sceneImporter = new DefaultImporter(false);
            Meta            meta          = new Meta(sceneImporter, GUID);

            ExportMeta(container, meta, filePath);

            string subFolderPath = Path.Combine(folderPath, Name);

            if (OcclusionCullingData != null)
            {
                ExportAsset(container, OcclusionCullingData, subFolderPath);
            }
            if (LightingDataAsset != null)
            {
                ExportAsset(container, OcclusionCullingData, subFolderPath);
            }
            if (m_navMeshData != null)
            {
                ExportAsset(container, m_navMeshData, subFolderPath);
            }

            return(true);
        }
        public override bool Export(ProjectAssetContainer container, string dirPath)
        {
            TryInitialize(container);

            string folderPath   = Path.Combine(dirPath, Object.AssetsKeyWord, OcclusionCullingSettings.SceneKeyWord);
            string sceneSubPath = GetSceneName(container);
            string fileName     = $"{sceneSubPath}.unity";
            string filePath     = Path.Combine(folderPath, fileName);

            folderPath = Path.GetDirectoryName(filePath);

            if (!DirectoryUtils.Exists(folderPath))
            {
                DirectoryUtils.CreateDirectory(folderPath);
            }

            AssetExporter.Export(container, Components, filePath);
            SceneImporter sceneImporter = new SceneImporter();
            Meta          meta          = new Meta(sceneImporter, GUID);

            ExportMeta(container, meta, filePath);

            string sceneName     = Path.GetFileName(sceneSubPath);
            string subFolderPath = Path.Combine(folderPath, sceneName);

            if (OcclusionCullingData != null)
            {
                ExportAsset(container, OcclusionCullingData, subFolderPath);
            }

            return(true);
        }
Exemplo n.º 4
0
        public override ExportPointer CreateExportPointer(Object asset, bool isLocal)
        {
            string exportID = GetExportID(asset);

            return(isLocal ?
                   new ExportPointer(exportID) :
                   new ExportPointer(exportID, Asset.GUID, AssetExporter.ToExportType(Asset.ClassID)));
        }
 protected override string ExportInner(ProjectAssetContainer container, string filePath)
 {
     if (m_convert)
     {
         string dirPath  = Path.GetDirectoryName(filePath);
         string fileName = Path.GetFileNameWithoutExtension(filePath);
         filePath = $"{Path.Combine(dirPath, fileName)}.png";
     }
     AssetExporter.Export(container, Asset, filePath);
     return(filePath);
 }
Exemplo n.º 6
0
        public ExportPointer CreateExportPointer(Object asset, bool isLocal)
        {
            if (isLocal)
            {
                throw new ArgumentException(nameof(isLocal));
            }

            long      exportId = GetExportID(asset);
            AssetType type     = AssetExporter.ToExportType(asset);

            return(new ExportPointer(exportId, EngineGUID.MissingReference, type));
        }
Exemplo n.º 7
0
        public ExportPointer CreateExportPointer(Object @object, bool isLocal)
        {
            if (isLocal)
            {
                throw new ArgumentException(nameof(isLocal));
            }

            string    exportId = GetExportID(@object);
            AssetType type     = AssetExporter.ToExportType(@object.ClassID);

            return(new ExportPointer(exportId, UtinyGUID.MissingReference, type));
        }
Exemplo n.º 8
0
        public override ExportPointer CreateExportPointer(Object asset, bool isLocal)
        {
            if (isLocal)
            {
                throw new NotSupportedException();
            }

            ulong      exportID   = GetExportID(asset);
            EngineGUID uniqueGUID = m_scripts[asset].GUID;

            return(new ExportPointer(exportID, uniqueGUID, AssetExporter.ToExportType(asset)));
        }
Exemplo n.º 9
0
        public override bool Export(ProjectAssetContainer container, string dirPath)
        {
            if (m_export.Count == 0)
            {
                return(false);
            }

            string scriptFolder = m_export[0].ExportName;
            string scriptPath   = Path.Combine(dirPath, scriptFolder);

            AssetExporter.Export(container, m_export, scriptPath, OnScriptExported);
            return(true);
        }
Exemplo n.º 10
0
        protected void ExportAsset(ProjectAssetContainer container, IAssetImporter importer, Object asset, string path, string name)
        {
            if (!Directory.Exists(path))
            {
                Directory.CreateDirectory(path);
            }

            string filePath = $"{Path.Combine(path, name)}.{asset.ExportExtension}";

            AssetExporter.Export(container, asset, filePath);
            Meta meta = new Meta(importer, asset.GUID);

            ExportMeta(container, meta, filePath);
        }
Exemplo n.º 11
0
 protected virtual string ExportInner(ProjectAssetContainer container, string filePath)
 {
     AssetExporter.Export(container, Asset, filePath);
     return(filePath);
 }
Exemplo n.º 12
0
 protected override string ExportInner(ProjectAssetContainer container, string filePath)
 {
     AssetExporter.Export(container, Objects, filePath);
     return(filePath);
 }