public SceneExportCollection(IAssetExporter assetExporter, string name, IEnumerable <Object> objects)
        {
            if (assetExporter == null)
            {
                throw new ArgumentNullException(nameof(assetExporter));
            }
            if (string.IsNullOrEmpty(name))
            {
                throw new ArgumentNullException(nameof(name));
            }

            AssetExporter = assetExporter;
            Name          = name;

            HashSet <string> exportIDs = new HashSet <string>();

            foreach (Object @object in objects.OrderBy(t => t, this))
            {
                AddObject(@object, exportIDs);
            }

            if (Config.IsGenerateGUIDByContent)
            {
                GUID = ObjectUtils.CalculateObjectsGUID(objects);
            }
            else
            {
                GUID = new UtinyGUID(new Guid());
            }
        }
Beispiel #2
0
 public OcclusionScene(UtinyGUID scene, int renderSize, int portalSize)
 {
     Scene          = scene;
     IndexRenderers = 0;
     SizeRenderers  = renderSize;
     IndexPortals   = 0;
     SizePortals    = portalSize;
 }
Beispiel #3
0
        public AssetInfo(ISerializedFile serializedFile, long pathID, ClassIDType classID)
        {
            if (serializedFile == null)
            {
                throw new ArgumentNullException(nameof(serializedFile));
            }
            File = serializedFile;

            PathID  = pathID;
            ClassID = classID;
            GUID    = new UtinyGUID(Guid.NewGuid());
        }
        public override ExportPointer CreateExportPointer(Object asset, bool isLocal)
        {
            string exportID = GetExportID(asset);

            if (isLocal && IsComponent(asset))
            {
                return(new ExportPointer(exportID));
            }
            else
            {
                UtinyGUID guid = IsComponent(asset) ? GUID : asset.GUID;
                return(new ExportPointer(exportID, guid, AssetType.Serialized));
            }
        }
Beispiel #5
0
        public Meta(IAssetImporter importer, UtinyGUID guid)
        {
            if (importer == null)
            {
                throw new ArgumentNullException(nameof(importer));
            }
            if (guid.IsZero)
            {
                throw new ArgumentNullException(nameof(guid));
            }

            m_importer = importer;
            m_guid     = guid;
        }
        public SceneExportCollection(IAssetExporter assetExporter, ISerializedFile file)
        {
            if (assetExporter == null)
            {
                throw new ArgumentNullException(nameof(assetExporter));
            }
            if (file == null)
            {
                throw new ArgumentNullException(nameof(file));
            }

            AssetExporter = assetExporter;
            Name          = file.Name;

            foreach (Object asset in file.FetchAssets())
            {
                if (OcclusionCullingSettings.IsCompatible(asset))
                {
                    AddComponent(file, asset);
                }
            }
            m_cexportIDs = m_cexportIDs.OrderBy(t => t.Key, this).ToDictionary(t => t.Key, t => t.Value);

            if (OcclusionCullingSettings.IsReadPVSData(file.Version))
            {
                if (Config.IsGenerateGUIDByContent)
                {
                    GUID = ObjectUtils.CalculateObjectsGUID(Objects);
                }
                else
                {
                    GUID = new UtinyGUID(Guid.NewGuid());
                }
            }
            else
            {
                OcclusionCullingSettings sceneSettings = Components.Where(t => t.ClassID == ClassIDType.OcclusionCullingSettings).Select(t => (OcclusionCullingSettings)t).FirstOrDefault();
                if (sceneSettings == null)
                {
                    GUID = new UtinyGUID(Guid.NewGuid());
                }
                else
                {
                    GUID = sceneSettings.SceneGUID;
                }
            }
        }
Beispiel #7
0
 public ExportPointer(string fileID, UtinyGUID guid, AssetType assetType) :
     this(fileID)
 {
     GUID      = guid;
     AssetType = assetType;
 }