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

            if (IsReadMode(reader.Version))
            {
                Mode = (ParticleSystemAnimationMode)reader.ReadInt32();
            }
            if (IsReadTimeMode(reader.Version))
            {
                TimeMode = (ParticleSystemAnimationTimeMode)reader.ReadInt32();
                FPS      = reader.ReadSingle();
            }
            FrameOverTime.Read(reader);
            if (IsReadStartFrame(reader.Version))
            {
                StartFrame.Read(reader);
            }
            if (IsReadSpeedRange(reader.Version))
            {
                SpeedRange.Read(reader);
            }
            TilesX        = reader.ReadInt32();
            TilesY        = reader.ReadInt32();
            AnimationType = (ParticleSystemAnimationType)reader.ReadInt32();
            RowIndex      = reader.ReadInt32();
            Cycles        = reader.ReadSingle();
            if (IsReadUvChannelMask(reader.Version))
            {
                UvChannelMask = reader.ReadInt32();
            }
            if (IsReadFlipU(reader.Version))
            {
                if (IsReadFlipUFirst(reader.Version))
                {
                    FlipU = reader.ReadSingle();
                    FlipV = reader.ReadSingle();
                }
            }
            RandomRow = reader.ReadBoolean();
            reader.AlignStream(AlignType.Align4);

            if (IsReadSprites(reader.Version))
            {
                m_sprites = reader.ReadArray <SpriteData>();
            }
            if (IsReadFlipU(reader.Version))
            {
                if (!IsReadFlipUFirst(reader.Version))
                {
                    FlipU = reader.ReadSingle();
                    FlipV = reader.ReadSingle();
                }
            }
        }
예제 #2
0
        public override void Read(AssetReader reader)
        {
            base.Read(reader);

            if (HasMode(reader.Version))
            {
                Mode = (ParticleSystemAnimationMode)reader.ReadInt32();
            }
            if (HasTimeMode(reader.Version))
            {
                TimeMode = (ParticleSystemAnimationTimeMode)reader.ReadInt32();
                FPS      = reader.ReadSingle();
            }
            FrameOverTime.Read(reader);
            if (HasStartFrame(reader.Version))
            {
                StartFrame.Read(reader);
            }
            if (HasSpeedRange(reader.Version))
            {
                SpeedRange.Read(reader);
            }
            TilesX        = reader.ReadInt32();
            TilesY        = reader.ReadInt32();
            AnimationType = (ParticleSystemAnimationType)reader.ReadInt32();
            RowIndex      = reader.ReadInt32();
            Cycles        = reader.ReadSingle();
            if (HasUvChannelMask(reader.Version))
            {
                UvChannelMask = reader.ReadInt32();
            }
            if (HasFlipU(reader.Version))
            {
                if (HasFlipUFirst(reader.Version))
                {
                    FlipU = reader.ReadSingle();
                    FlipV = reader.ReadSingle();
                }
            }
            if (HasRowMode(reader.Version))
            {
                RowMode = (ParticleSystemAnimationRowMode)reader.ReadInt32();
            }
            else
            {
                bool RandomRow = reader.ReadBoolean();
                RowMode = RandomRow ? ParticleSystemAnimationRowMode.Random : ParticleSystemAnimationRowMode.Custom;
                reader.AlignStream();
            }

            if (HasSprites(reader.Version))
            {
                Sprites = reader.ReadAssetArray <SpriteData>();
            }
            if (HasFlipU(reader.Version))
            {
                if (!HasFlipUFirst(reader.Version))
                {
                    FlipU = reader.ReadSingle();
                    FlipV = reader.ReadSingle();
                }
            }
        }