Example #1
0
        public override void Read(AssetReader reader)
        {
            base.Read(reader);

            StartLifetime.Read(reader);
            StartSpeed.Read(reader);
            StartColor.Read(reader);
            StartSize.Read(reader);
            if (IsReadSizeAxes(reader.Version))
            {
                StartSizeY.Read(reader);
                StartSizeZ.Read(reader);
            }
            if (IsReadRotationAxes(reader.Version))
            {
                StartRotationX.Read(reader);
                StartRotationY.Read(reader);
            }
            StartRotation.Read(reader);

            if (IsReadRandomizeRotationDirection(reader.Version))
            {
                RandomizeRotationDirection = reader.ReadSingle();
            }
            if (IsReadGravityModifierSingle(reader.Version))
            {
                float gravityModifier = reader.ReadSingle();
                GravityModifier = new MinMaxCurve(gravityModifier);
            }
            if (IsReadInheritVelocity(reader.Version))
            {
                InheritVelocity = reader.ReadSingle();
            }
            MaxNumParticles = reader.ReadInt32();
            if (IsReadSize3D(reader.Version))
            {
                Size3D = reader.ReadBoolean();
            }
            if (IsReadRotation3D(reader.Version))
            {
                Rotation3D = reader.ReadBoolean();
                reader.AlignStream(AlignType.Align4);
            }

            if (!IsReadGravityModifierSingle(reader.Version))
            {
                GravityModifier.Read(reader);
            }
        }
        public override void Read(AssetStream stream)
        {
            base.Read(stream);

            StartLifetime.Read(stream);
            StartSpeed.Read(stream);
            StartColor.Read(stream);
            StartSize.Read(stream);
            if (IsReadSizeAxes(stream.Version))
            {
                StartSizeY.Read(stream);
                StartSizeZ.Read(stream);
            }
            if (IsReadRotationAxes(stream.Version))
            {
                StartRotationX.Read(stream);
                StartRotationY.Read(stream);
            }
            StartRotation.Read(stream);

            if (IsReadRandomizeRotationDirection(stream.Version))
            {
                RandomizeRotationDirection = stream.ReadSingle();
            }
            if (IsReadGravityModifierSingle(stream.Version))
            {
                GravityModifierSingle = stream.ReadSingle();
            }
            if (IsReadInheritVelocity(stream.Version))
            {
                InheritVelocity = stream.ReadSingle();
            }
            MaxNumParticles = stream.ReadInt32();
            if (IsReadSize3D(stream.Version))
            {
                Size3D = stream.ReadBoolean();
            }
            if (IsReadRotation3D(stream.Version))
            {
                Rotation3D = stream.ReadBoolean();
                stream.AlignStream(AlignType.Align4);
            }

            if (!IsReadGravityModifierSingle(stream.Version))
            {
                GravityModifier.Read(stream);
            }
        }