コード例 #1
0
ファイル: GUIStyle.cs プロジェクト: Hengle/UtinyRipper-1
        public void Read(AssetStream stream)
        {
            StyleName = stream.ReadStringAligned();
            Normal.Read(stream);
            Hover.Read(stream);
            Active.Read(stream);
            Focused.Read(stream);
            OnNormal.Read(stream);
            OnHover.Read(stream);
            OnActive.Read(stream);
            OnFocused.Read(stream);
            Border.Read(stream);
            Margin.Read(stream);
            Padding.Read(stream);
            Overflow.Read(stream);
            Font.Read(stream);
            FontSize  = stream.ReadInt32();
            FontStyle = stream.ReadInt32();
            Alignment = stream.ReadInt32();
            WordWrap  = stream.ReadBoolean();
            RichText  = stream.ReadBoolean();
            stream.AlignStream(AlignType.Align4);

            TextClipping  = stream.ReadInt32();
            ImagePosition = stream.ReadInt32();
            ContentOffset.Read(stream);
            FixedWidth    = stream.ReadSingle();
            FixedHeight   = stream.ReadSingle();
            StretchWidth  = stream.ReadBoolean();
            StretchHeight = stream.ReadBoolean();
            stream.AlignStream(AlignType.Align4);
        }
コード例 #2
0
        public void Read(AssetReader reader)
        {
            StyleName = reader.ReadString();
            Normal.Read(reader);
            Hover.Read(reader);
            Active.Read(reader);
            Focused.Read(reader);
            OnNormal.Read(reader);
            OnHover.Read(reader);
            OnActive.Read(reader);
            OnFocused.Read(reader);
            Border.Read(reader);
            if (IsBuiltIn(reader.Version))
            {
                Margin.Read(reader);
                Padding.Read(reader);
            }
            else
            {
                Padding.Read(reader);
                Margin.Read(reader);
            }
            Overflow.Read(reader);
            Font.Read(reader);

            if (IsBuiltIn(reader.Version))
            {
                FontSize  = reader.ReadInt32();
                FontStyle = (FontStyle)reader.ReadInt32();
                Alignment = (TextAnchor)reader.ReadInt32();
                WordWrap  = reader.ReadBoolean();
                RichText  = reader.ReadBoolean();
                reader.AlignStream(AlignType.Align4);

                TextClipping  = (TextClipping)reader.ReadInt32();
                ImagePosition = (ImagePosition)reader.ReadInt32();
                ContentOffset.Read(reader);
                FixedWidth    = reader.ReadSingle();
                FixedHeight   = reader.ReadSingle();
                StretchWidth  = reader.ReadBoolean();
                StretchHeight = reader.ReadBoolean();
                reader.AlignStream(AlignType.Align4);
            }
            else
            {
                ImagePosition = (ImagePosition)reader.ReadInt32();
                Alignment     = (TextAnchor)reader.ReadInt32();
                WordWrap      = reader.ReadBoolean();
                reader.AlignStream(AlignType.Align4);

                TextClipping = (TextClipping)reader.ReadInt32();
                ContentOffset.Read(reader);
                ClipOffset.Read(reader);
                FixedWidth  = reader.ReadSingle();
                FixedHeight = reader.ReadSingle();
                if (IsReadFontSize(reader.Version))
                {
                    FontSize  = reader.ReadInt32();
                    FontStyle = (FontStyle)reader.ReadInt32();
                }
                StretchWidth = reader.ReadBoolean();
                reader.AlignStream(AlignType.Align4);
                StretchHeight = reader.ReadBoolean();
                reader.AlignStream(AlignType.Align4);
            }
        }
コード例 #3
0
        public void Read(AssetReader reader)
        {
            GUIStyleLayout layout = reader.Layout.Serialized.GUIStyle;

            Name = reader.ReadString();
            Normal.Read(reader);
            Hover.Read(reader);
            Active.Read(reader);
            Focused.Read(reader);
            OnNormal.Read(reader);
            OnHover.Read(reader);
            OnActive.Read(reader);
            OnFocused.Read(reader);
            Border.Read(reader);
            if (layout.IsBuiltinFormat)
            {
                Margin.Read(reader);
                Padding.Read(reader);
            }
            else
            {
                Padding.Read(reader);
                Margin.Read(reader);
            }

            Overflow.Read(reader);
            Font.Read(reader);
            if (layout.IsBuiltinFormat)
            {
                FontSize  = reader.ReadInt32();
                FontStyle = (FontStyle)reader.ReadInt32();
                Alignment = (TextAnchor)reader.ReadInt32();
                WordWrap  = reader.ReadBoolean();
                RichText  = reader.ReadBoolean();
                reader.AlignStream();

                TextClipping  = (TextClipping)reader.ReadInt32();
                ImagePosition = (ImagePosition)reader.ReadInt32();
                ContentOffset.Read(reader);
                FixedWidth    = reader.ReadSingle();
                FixedHeight   = reader.ReadSingle();
                StretchWidth  = reader.ReadBoolean();
                StretchHeight = reader.ReadBoolean();
                reader.AlignStream();
            }
            else
            {
                ImagePosition = (ImagePosition)reader.ReadInt32();
                Alignment     = (TextAnchor)reader.ReadInt32();
                WordWrap      = reader.ReadBoolean();
                reader.AlignStream();

                TextClipping = (TextClipping)reader.ReadInt32();
                ContentOffset.Read(reader);
                ClipOffset.Read(reader);
                FixedWidth  = reader.ReadSingle();
                FixedHeight = reader.ReadSingle();
                if (layout.HasFontSize)
                {
                    FontSize  = reader.ReadInt32();
                    FontStyle = (FontStyle)reader.ReadInt32();
                }
                StretchWidth = reader.ReadBoolean();
                reader.AlignStream();
                StretchHeight = reader.ReadBoolean();
                reader.AlignStream();
            }
        }