예제 #1
0
        public void Read(AssetStream stream)
        {
            if (IsMaxGradientFirst(stream.Version))
            {
                MaxGradient.Read(stream);
                MinGradient.Read(stream);
                if (IsColor32(stream.Version))
                {
                    MinColor32.Read(stream);
                    MaxColor32.Read(stream);
                }
                else
                {
                    MinColor.Read(stream);
                    MaxColor.Read(stream);
                }
            }

            MinMaxState = (MinMaxGradientState)stream.ReadUInt16();
            stream.AlignStream(AlignType.Align4);

            if (!IsMaxGradientFirst(stream.Version))
            {
                MinColor.Read(stream);
                MaxColor.Read(stream);
                MaxGradient.Read(stream);
                MinGradient.Read(stream);
            }
        }
예제 #2
0
        public void Read(AssetReader reader)
        {
            if (IsMaxGradientFirst(reader.Version))
            {
                MaxGradient.Read(reader);
                MinGradient.Read(reader);
                if (IsColor32(reader.Version))
                {
                    MinColor32 = reader.ReadAsset <ColorRGBA32>();
                    MaxColor32 = reader.ReadAsset <ColorRGBA32>();
                }
                else
                {
                    MinColor.Read(reader);
                    MaxColor.Read(reader);
                }
            }

            MinMaxState = (MinMaxGradientState)reader.ReadUInt16();
            reader.AlignStream();

            if (!IsMaxGradientFirst(reader.Version))
            {
                MinColor.Read(reader);
                MaxColor.Read(reader);
                MaxGradient.Read(reader);
                MinGradient.Read(reader);
            }
        }
예제 #3
0
        public void Read(AssetReader reader)
        {
            int maxGradientPlacement = GetMaxGradientPlacement(reader.Version);

            if (maxGradientPlacement == 1)
            {
                MaxGradient.Read(reader);
                MinGradient.Read(reader);
                if (IsColor32(reader.Version))
                {
                    MinColor32 = reader.ReadAsset <ColorRGBA32>();
                    MaxColor32 = reader.ReadAsset <ColorRGBA32>();
                }
                else
                {
                    MinColor.Read(reader);
                    MaxColor.Read(reader);
                }
            }

            // Int16 before 5.6.0p4
            MinMaxState = (MinMaxGradientState)reader.ReadUInt16();
            reader.AlignStream();

            if (maxGradientPlacement != 1)
            {
                if (maxGradientPlacement == 2)
                {
                    MaxGradient.Read(reader);
                    MinGradient.Read(reader);
                }
                MinColor.Read(reader);
                MaxColor.Read(reader);
                if (maxGradientPlacement == 3)
                {
                    MaxGradient.Read(reader);
                    MinGradient.Read(reader);
                }
            }
        }