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

            Strength.Read(reader);
            StrengthY.Read(reader);
            StrengthZ.Read(reader);
            SeparateAxes = reader.ReadBoolean();
            reader.AlignStream(AlignType.Align4);

            Frequency = reader.ReadSingle();
            Damping   = reader.ReadBoolean();
            reader.AlignStream(AlignType.Align4);

            Octaves          = reader.ReadInt32();
            OctaveMultiplier = reader.ReadSingle();
            OctaveScale      = reader.ReadSingle();
            Quality          = (ParticleSystemNoiseQuality)reader.ReadInt32();
            ScrollSpeed.Read(reader);
            Remap.Read(reader);
            RemapY.Read(reader);
            RemapZ.Read(reader);
            RemapEnabled = reader.ReadBoolean();
            if (IsAlign(reader.Version))
            {
                reader.AlignStream(AlignType.Align4);
            }

            if (IsReadPositionAmount(reader.Version))
            {
                PositionAmount.Read(reader);
                RotationAmount.Read(reader);
                SizeAmount.Read(reader);
            }
        }
        public override void Read(AssetStream stream)
        {
            base.Read(stream);

            Strength.Read(stream);
            StrengthY.Read(stream);
            StrengthZ.Read(stream);
            SeparateAxes = stream.ReadBoolean();
            stream.AlignStream(AlignType.Align4);

            Frequency = stream.ReadSingle();
            Damping   = stream.ReadBoolean();
            stream.AlignStream(AlignType.Align4);

            Octaves          = stream.ReadInt32();
            OctaveMultiplier = stream.ReadSingle();
            OctaveScale      = stream.ReadSingle();
            Quality          = stream.ReadInt32();
            ScrollSpeed.Read(stream);
            Remap.Read(stream);
            RemapY.Read(stream);
            RemapZ.Read(stream);
            RemapEnabled = stream.ReadBoolean();
            if (IsAlign(stream.Version))
            {
                stream.AlignStream(AlignType.Align4);
            }

            if (IsReadPositionAmount(stream.Version))
            {
                PositionAmount.Read(stream);
                RotationAmount.Read(stream);
                SizeAmount.Read(stream);
            }
        }
        public override YAMLNode ExportYAML(IAssetsExporter exporter)
        {
            YAMLMappingNode node = (YAMLMappingNode)base.ExportYAML(exporter);

            node.Add("strength", Strength.ExportYAML(exporter));
            node.Add("strengthY", StrengthY.ExportYAML(exporter));
            node.Add("strengthZ", StrengthZ.ExportYAML(exporter));
            node.Add("separateAxes", SeparateAxes);
            node.Add("frequency", Frequency);
            node.Add("damping", Damping);
            node.Add("octaves", Octaves);
            node.Add("octaveMultiplier", OctaveMultiplier);
            node.Add("octaveScale", OctaveScale);
            node.Add("quality", Quality);
            node.Add("scrollSpeed", ScrollSpeed.ExportYAML(exporter));
            node.Add("remap", Remap.ExportYAML(exporter));
            node.Add("remapY", RemapY.ExportYAML(exporter));
            node.Add("remapZ", RemapZ.ExportYAML(exporter));
            node.Add("remapEnabled", RemapEnabled);
            node.Add("positionAmount", PositionAmount.ExportYAML(exporter));
            node.Add("rotationAmount", RotationAmount.ExportYAML(exporter));
            node.Add("sizeAmount", SizeAmount.ExportYAML(exporter));
            return(node);
        }