コード例 #1
0
        protected override YAMLMappingNode ExportYAMLRoot(IExportContainer container)
        {
            YAMLMappingNode node = base.ExportYAMLRoot(container);

            node.AddSerializedVersion(ToSerializedVersion(container.ExportVersion));
            node.Add(LengthInSecName, LengthInSec);
            node.Add(SimulationSpeedName, SimulationSpeed);
            node.Add(StopActionName, (int)StopAction);
            node.Add(LoopingName, Looping);
            node.Add(PrewarmName, Prewarm);
            node.Add(PlayOnAwakeName, PlayOnAwake);
            node.Add(UseUnscaledTimeName, UseUnscaledTime);
            node.Add(AutoRandomSeedName, GetAutoRandomSeed(container.Version));
            node.Add(UseRigidbodyForVelocityName, GetUseRigidbodyForVelocity(container.Version));
            node.Add(StartDelayName, GetStartDelay(container.Version).ExportYAML(container));
            node.Add(MoveWithTransformName, (int)MoveWithTransform);
            node.Add(MoveWithCustomTransformName, MoveWithCustomTransform.ExportYAML(container));
            node.Add(ScalingModeName, (int)GetScalingMode(container.Version));
            node.Add(RandomSeedName, RandomSeed);
            node.Add(InitialModuleName, InitialModule.ExportYAML(container));
            node.Add(ShapeModuleName, ShapeModule.ExportYAML(container));
            node.Add(EmissionModuleName, EmissionModule.ExportYAML(container));
            node.Add(SizeModuleName, SizeModule.ExportYAML(container));
            node.Add(RotationModuleName, RotationModule.ExportYAML(container));
            node.Add(ColorModuleName, ColorModule.ExportYAML(container));
            node.Add(UVModuleName, UVModule.ExportYAML(container));
            node.Add(VelocityModuleName, VelocityModule.ExportYAML(container));
            node.Add(InheritVelocityModuleName, GetInheritVelocityModule(container.Version).ExportYAML(container));
            node.Add(ForceModuleName, ForceModule.ExportYAML(container));
            node.Add(ExternalForcesModuleName, GetExternalForcesModule(container.Version).ExportYAML(container));
            node.Add(ClampVelocityModuleName, ClampVelocityModule.ExportYAML(container));
            node.Add(NoiseModuleName, GetNoiseModule(container.Version).ExportYAML(container));
            node.Add(SizeBySpeedModuleName, SizeBySpeedModule.ExportYAML(container));
            node.Add(RotationBySpeedModuleName, RotationBySpeedModule.ExportYAML(container));
            node.Add(ColorBySpeedModuleName, ColorBySpeedModule.ExportYAML(container));
            node.Add(CollisionModuleName, CollisionModule.ExportYAML(container));
            node.Add(TriggerModuleName, GetTriggerModule(container.Version).ExportYAML(container));
            node.Add(SubModuleName, SubModule.ExportYAML(container));
            node.Add(LightsModuleName, GetLightsModule(container.Version).ExportYAML(container));
            node.Add(TrailModuleName, GetTrailModule(container.Version).ExportYAML(container));
            node.Add(CustomDataModuleName, GetCustomDataModule(container.Version).ExportYAML(container));
            return(node);
        }
コード例 #2
0
        protected override YAMLMappingNode ExportYAMLRoot(IAssetsExporter exporter)
        {
#warning TODO: values acording to read version (current 2017.3.0f3)
            YAMLMappingNode node = base.ExportYAMLRoot(exporter);
            node.AddSerializedVersion(GetSerializedVersion(exporter.Version));
            node.Add("lengthInSec", LengthInSec);
            node.Add("simulationSpeed", SimulationSpeed);
            node.Add("stopAction", StopAction);
            node.Add("looping", Looping);
            node.Add("prewarm", Prewarm);
            node.Add("playOnAwake", PlayOnAwake);
            node.Add("useUnscaledTime", UseUnscaledTime);
            node.Add("autoRandomSeed", AutoRandomSeed);
            node.Add("useRigidbodyForVelocity", UseRigidbodyForVelocity);
            node.Add("startDelay", StartDelay.ExportYAML(exporter));
            node.Add("moveWithTransform", MoveWithTransform);
            node.Add("moveWithCustomTransform", MoveWithCustomTransform.ExportYAML(exporter));
            node.Add("scalingMode", ScalingMode);
            node.Add("randomSeed", RandomSeed);
            node.Add("InitialModule", InitialModule.ExportYAML(exporter));
            node.Add("ShapeModule", ShapeModule.ExportYAML(exporter));
            node.Add("EmissionModule", EmissionModule.ExportYAML(exporter));
            node.Add("SizeModule", SizeModule.ExportYAML(exporter));
            node.Add("RotationModule", RotationModule.ExportYAML(exporter));
            node.Add("ColorModule", ColorModule.ExportYAML(exporter));
            node.Add("UVModule", UVModule.ExportYAML(exporter));
            node.Add("VelocityModule", VelocityModule.ExportYAML(exporter));
            node.Add("InheritVelocityModule", InheritVelocityModule.ExportYAML(exporter));
            node.Add("ForceModule", ForceModule.ExportYAML(exporter));
            node.Add("ExternalForcesModule", ExternalForcesModule.ExportYAML(exporter));
            node.Add("ClampVelocityModule", ClampVelocityModule.ExportYAML(exporter));
            node.Add("NoiseModule", NoiseModule.ExportYAML(exporter));
            node.Add("SizeBySpeedModule", SizeBySpeedModule.ExportYAML(exporter));
            node.Add("RotationBySpeedModule", RotationBySpeedModule.ExportYAML(exporter));
            node.Add("ColorBySpeedModule", ColorBySpeedModule.ExportYAML(exporter));
            node.Add("CollisionModule", CollisionModule.ExportYAML(exporter));
            node.Add("TriggerModule", TriggerModule.ExportYAML(exporter));
            node.Add("SubModule", SubModule.ExportYAML(exporter));
            node.Add("LightsModule", LightsModule.ExportYAML(exporter));
            node.Add("TrailModule", TrailModule.ExportYAML(exporter));
            node.Add("CustomDataModule", CustomDataModule.ExportYAML(exporter));
            return(node);
        }
コード例 #3
0
        protected override YAMLMappingNode ExportYAMLRoot(IExportContainer container)
        {
            YAMLMappingNode node = base.ExportYAMLRoot(container);

            node.AddSerializedVersion(GetSerializedVersion(container.Version));
            node.Add("lengthInSec", LengthInSec);
            node.Add("simulationSpeed", SimulationSpeed);
            node.Add("stopAction", StopAction);
            node.Add("looping", Looping);
            node.Add("prewarm", Prewarm);
            node.Add("playOnAwake", PlayOnAwake);
            node.Add("useUnscaledTime", UseUnscaledTime);
            node.Add("autoRandomSeed", GetAutoRandomSeed(container.Version));
            node.Add("useRigidbodyForVelocity", GetUseRigidbodyForVelocity(container.Version));
            node.Add("startDelay", GetStartDelay(container.Version).ExportYAML(container));
            node.Add("moveWithTransform", (int)MoveWithTransform);
            node.Add("moveWithCustomTransform", MoveWithCustomTransform.ExportYAML(container));
            node.Add("scalingMode", (int)GetScalingMode(container.Version));
            node.Add("randomSeed", RandomSeed);
            node.Add("InitialModule", InitialModule.ExportYAML(container));
            node.Add("ShapeModule", ShapeModule.ExportYAML(container));
            node.Add("EmissionModule", EmissionModule.ExportYAML(container));
            node.Add("SizeModule", SizeModule.ExportYAML(container));
            node.Add("RotationModule", RotationModule.ExportYAML(container));
            node.Add("ColorModule", ColorModule.ExportYAML(container));
            node.Add("UVModule", UVModule.ExportYAML(container));
            node.Add("VelocityModule", VelocityModule.ExportYAML(container));
            node.Add("InheritVelocityModule", GetInheritVelocityModule(container.Version).ExportYAML(container));
            node.Add("ForceModule", ForceModule.ExportYAML(container));
            node.Add("ExternalForcesModule", GetExternalForcesModule(container.Version).ExportYAML(container));
            node.Add("ClampVelocityModule", ClampVelocityModule.ExportYAML(container));
            node.Add("NoiseModule", GetNoiseModule(container.Version).ExportYAML(container));
            node.Add("SizeBySpeedModule", SizeBySpeedModule.ExportYAML(container));
            node.Add("RotationBySpeedModule", RotationBySpeedModule.ExportYAML(container));
            node.Add("ColorBySpeedModule", ColorBySpeedModule.ExportYAML(container));
            node.Add("CollisionModule", CollisionModule.ExportYAML(container));
            node.Add("TriggerModule", GetTriggerModule(container.Version).ExportYAML(container));
            node.Add("SubModule", SubModule.ExportYAML(container));
            node.Add("LightsModule", GetLightsModule(container.Version).ExportYAML(container));
            node.Add("TrailModule", GetTrailModule(container.Version).ExportYAML(container));
            node.Add("CustomDataModule", GetCustomDataModule(container.Version).ExportYAML(container));
            return(node);
        }
コード例 #4
0
        public override void Read(AssetReader reader)
        {
            base.Read(reader);

            LengthInSec = reader.ReadSingle();
            if (IsStartDelayFirst(reader.Version))
            {
                if (HasStartDelaySingle(reader.Version))
                {
                    StartDelaySingle = reader.ReadSingle();
                }
                else
                {
                    StartDelay.Read(reader);
                }
            }

            SimulationSpeed = reader.ReadSingle();
            if (HasStopAction(reader.Version))
            {
                StopAction = (ParticleSystemStopAction)reader.ReadInt32();
            }

            if (IsRandomSeedFirst(reader.Version))
            {
                RandomSeed = unchecked ((int)reader.ReadUInt32());
            }

            if (HasCullingMode(reader.Version))
            {
                CullingMode    = (ParticleSystemCullingMode)reader.ReadInt32();
                RingBufferMode = (ParticleSystemRingBufferMode)reader.ReadInt32();
                RingBufferLoopRange.Read(reader);
            }

            Looping     = reader.ReadBoolean();
            Prewarm     = reader.ReadBoolean();
            PlayOnAwake = reader.ReadBoolean();
            if (HasUseUnscaledTime(reader.Version))
            {
                UseUnscaledTime = reader.ReadBoolean();
            }
            if (IsMoveWithTransformBool(reader.Version))
            {
                MoveWithTransform = reader.ReadBoolean() ? ParticleSystemSimulationSpace.Local : ParticleSystemSimulationSpace.World;
            }
            if (HasAutoRandomSeed(reader.Version))
            {
                AutoRandomSeed = reader.ReadBoolean();
            }
            if (HasUseRigidbodyForVelocity(reader.Version))
            {
                UseRigidbodyForVelocity = reader.ReadBoolean();
            }
            if (IsAlign(reader.Version))
            {
                reader.AlignStream();
            }

            if (!IsStartDelayFirst(reader.Version))
            {
                StartDelay.Read(reader);
                reader.AlignStream();
            }
            if (!IsMoveWithTransformBool(reader.Version))
            {
                MoveWithTransform = (ParticleSystemSimulationSpace)reader.ReadInt32();
                reader.AlignStream();
            }

            if (HasMoveWithCustomTransform(reader.Version))
            {
                MoveWithCustomTransform.Read(reader);
            }
            if (HasScalingMode(reader.Version))
            {
                ScalingMode = (ParticleSystemScalingMode)reader.ReadInt32();
            }
            if (!IsRandomSeedFirst(reader.Version))
            {
                RandomSeed = reader.ReadInt32();
            }

            InitialModule.Read(reader);
            ShapeModule.Read(reader);
            EmissionModule.Read(reader);
            SizeModule.Read(reader);
            RotationModule.Read(reader);
            ColorModule.Read(reader);
            UVModule.Read(reader);
            VelocityModule.Read(reader);
            if (HasInheritVelocityModule(reader.Version))
            {
                InheritVelocityModule.Read(reader);
            }
            ForceModule.Read(reader);
            if (HasExternalForcesModule(reader.Version))
            {
                ExternalForcesModule.Read(reader);
            }
            ClampVelocityModule.Read(reader);
            if (HasNoiseModule(reader.Version))
            {
                NoiseModule.Read(reader);
            }
            SizeBySpeedModule.Read(reader);
            RotationBySpeedModule.Read(reader);
            ColorBySpeedModule.Read(reader);
            CollisionModule.Read(reader);
            if (HasTriggerModule(reader.Version))
            {
                TriggerModule.Read(reader);
            }
            SubModule.Read(reader);
            if (HasLightsModule(reader.Version))
            {
                LightsModule.Read(reader);
                TrailModule.Read(reader);
            }
            if (HasCustomDataModule(reader.Version))
            {
                CustomDataModule.Read(reader);
            }
        }
コード例 #5
0
        public override void Read(AssetStream stream)
        {
            base.Read(stream);

            LengthInSec = stream.ReadSingle();
            if (IsStartDelayFirst(stream.Version))
            {
                if (IsReadStartDelaySingle(stream.Version))
                {
                    StartDelaySingle = stream.ReadSingle();
                }
                else
                {
                    StartDelay.Read(stream);
                }
            }

            SimulationSpeed = stream.ReadSingle();
            if (IsReadStopAction(stream.Version))
            {
                StopAction = stream.ReadInt32();
            }

            if (IsRandomSeedFirst(stream.Version))
            {
                RandomSeed = unchecked ((int)stream.ReadUInt32());
            }

            Looping     = stream.ReadBoolean();
            Prewarm     = stream.ReadBoolean();
            PlayOnAwake = stream.ReadBoolean();
            if (IsReadUseUnscaledTime(stream.Version))
            {
                UseUnscaledTime = stream.ReadBoolean();
            }
            if (IsMoveWithTransformBool(stream.Version))
            {
                MoveWithTransform = stream.ReadBoolean() ? 1 : 0;
            }
            if (IsReadAutoRandomSeed(stream.Version))
            {
                AutoRandomSeed = stream.ReadBoolean();
            }
            if (IsReadUseRigidbodyForVelocity(stream.Version))
            {
                UseRigidbodyForVelocity = stream.ReadBoolean();
            }
            if (IsAlign(stream.Version))
            {
                stream.AlignStream(AlignType.Align4);
            }

            if (!IsStartDelayFirst(stream.Version))
            {
                StartDelay.Read(stream);
                stream.AlignStream(AlignType.Align4);
            }
            if (!IsMoveWithTransformBool(stream.Version))
            {
                MoveWithTransform = stream.ReadInt32();
                stream.AlignStream(AlignType.Align4);
            }

            if (IsReadMoveWithCustomTransform(stream.Version))
            {
                MoveWithCustomTransform.Read(stream);
            }
            if (IsReadScalingMode(stream.Version))
            {
                ScalingMode = stream.ReadInt32();
            }
            if (!IsRandomSeedFirst(stream.Version))
            {
                RandomSeed = stream.ReadInt32();
            }

            InitialModule.Read(stream);
            ShapeModule.Read(stream);
            EmissionModule.Read(stream);
            SizeModule.Read(stream);
            RotationModule.Read(stream);
            ColorModule.Read(stream);
            UVModule.Read(stream);
            VelocityModule.Read(stream);
            if (IsReadInheritVelocityModule(stream.Version))
            {
                InheritVelocityModule.Read(stream);
            }
            ForceModule.Read(stream);
            if (IsReadExternalForcesModule(stream.Version))
            {
                ExternalForcesModule.Read(stream);
            }
            ClampVelocityModule.Read(stream);
            if (IsReadNoiseModule(stream.Version))
            {
                NoiseModule.Read(stream);
            }
            SizeBySpeedModule.Read(stream);
            RotationBySpeedModule.Read(stream);
            ColorBySpeedModule.Read(stream);
            CollisionModule.Read(stream);
            if (IsReadTriggerModule(stream.Version))
            {
                TriggerModule.Read(stream);
            }
            SubModule.Read(stream);
            if (IsReadLightsModule(stream.Version))
            {
                LightsModule.Read(stream);
                TrailModule.Read(stream);
            }
            if (IsReadCustomDataModule(stream.Version))
            {
                CustomDataModule.Read(stream);
            }
        }