Ejemplo n.º 1
0
		public YAMLNode ExportYAML(IExportContainer container)
		{
			if (IsNull)
			{
				return ExportPointer.EmptyPointer.ExportYAML(container);
			}

			T asset = FindObject(container);
			if (asset == null)
			{
				ClassIDType classType = typeof(T).ToClassIDType();
				AssetType assetType = container.ToExportType(classType);
				ExportPointer pointer = new ExportPointer(classType, assetType);
				return pointer.ExportYAML(container);
			}

			ExportPointer exPointer = container.CreateExportPointer(asset);
			return exPointer.ExportYAML(container);
		}
Ejemplo n.º 2
0
        public YAMLNode ExportYAML(IExportContainer container)
        {
            if (IsNull)
            {
                return(MetaPtr.NullPtr.ExportYAML(container));
            }

            T asset = FindAsset(container);

            if (asset == null)
            {
                ClassIDType classType = typeof(T).ToClassIDType();
                AssetType   assetType = container.ToExportType(classType);
                MetaPtr     pointer   = new MetaPtr(classType, assetType);
                return(pointer.ExportYAML(container));
            }

            MetaPtr exPointer = container.CreateExportPointer(asset);

            return(exPointer.ExportYAML(container));
        }
Ejemplo n.º 3
0
        private YAMLNode GetExportOcclusionCullingData(IExportContainer container)
        {
            if (IsReadPVSData(container.Version))
            {
                if (m_PVSData.Length == 0)
                {
                    return(ExportPointer.EmptyPointer.ExportYAML(container));
                }
                else
                {
#warning HACK!!!
                    AssetInfo             dataAssetInfo = new AssetInfo(File, 0, ClassIDType.OcclusionCullingData);
                    OcclusionCullingData  ocData        = new OcclusionCullingData(dataAssetInfo, container, m_PVSData, SceneGUID, StaticRenderers, Portals);
                    SceneExportCollection scene         = (SceneExportCollection)container.CurrentCollection;
                    scene.OcclusionCullingData = ocData;

                    var exPointer = container.CreateExportPointer(ocData);
                    return(exPointer.ExportYAML(container));
                }
            }
            else
            {
#warning TODO: OcclusionCullingData has to find all corresponding OcclusionCullingSettings and fill IDs itself
                if (Classes.OcclusionCullingData.IsReadStaticRenderers(container.Flags))
                {
                    return(OcclusionCullingData.ExportYAML(container));
                }
                else
                {
                    OcclusionCullingData data = OcclusionCullingData.FindObject(container);
                    if (data != null)
                    {
                        data.SetIDs(container, SceneGUID, StaticRenderers, Portals);
                    }
                    return(OcclusionCullingData.ExportYAML(container));
                }
            }
        }