示例#1
0
        public static BioParticleLODLevel Parse(ExportEntry export)
        {
            BioParticleLODLevel bpll = new BioParticleLODLevel()
            {
                Export = export
            };

            var props = export.GetProperties();

            // We have to drill into the LODs to get what we want
            bpll.LODLevel            = props.GetProp <IntProperty>("Level")?.Value ?? 0;
            bpll.PeakActiveParticles = props.GetProp <IntProperty>("PeakActiveParticles")?.Value ?? 0;
            var modules = props.GetProp <ArrayProperty <ObjectProperty> >("Modules");

            if (modules != null)
            {
                bpll.Modules = modules.Select(x => ParseModule(x.ResolveToEntry(export.FileRef) as ExportEntry)).ToList();
            }


            return(bpll);
        }
示例#2
0
        public static BioParticleSpriteEmitter Parse(ExportEntry export)
        {
            BioParticleSpriteEmitter bpse = new BioParticleSpriteEmitter()
            {
                Export = export
            };

            var props = export.GetProperties();

            bpse.SpawnRate   = DistributionFloat.FromStruct(props.GetProp <StructProperty>("SpawnRate"));
            bpse.EmitterName = props.GetProp <NameProperty>("EmitterName")?.Value;
            var lods = props.GetProp <ArrayProperty <ObjectProperty> >("LODLevels").Select(x => BioParticleLODLevel.Parse(x.ResolveToEntry(export.FileRef) as ExportEntry));

            bpse.LODLevels = new ObservableCollectionExtended <BioParticleLODLevel>(lods);
            return(bpse);
        }