Пример #1
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);
            }
        }
Пример #2
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);
            }
        }