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

            Rect.Read(reader);
            Offset.Read(reader);
            if (HasBorder(reader.Version))
            {
                Border.Read(reader);
            }
            PixelsToUnits = reader.ReadSingle();
            if (HasPivot(reader.Version))
            {
                Pivot.Read(reader);
            }
            Extrude = reader.ReadUInt32();
            if (HasPolygon(reader.Version))
            {
                IsPolygon = reader.ReadBoolean();
                reader.AlignStream();
            }
#if UNIVERSAL
            if (HasAtlasName(reader.Flags))
            {
                AtlasName  = reader.ReadString();
                PackingTag = reader.ReadString();
            }
#endif

            if (HasRendererData(reader.Version))
            {
                RenderDataKey = reader.ReadTupleTLong <GUID>();
                AtlasTags     = reader.ReadStringArray();
                SpriteAtlas.Read(reader);
            }
            RD.Read(reader);
#if UNIVERSAL
            if (HasAtlasRD(reader.Version, reader.Flags))
            {
                AtlasRD.Read(reader);
            }
#endif
            reader.AlignStream();

            if (HasPhysicsShape(reader.Version))
            {
                PhysicsShape = reader.ReadAssetArrayArray <Vector2f>();
            }

            if (HasBones(reader.Version))
            {
                Bones = reader.ReadAssetArray <SpriteBone>();
            }
#if UNIVERSAL
            if (HasSpriteID(reader.Version, reader.Flags))
            {
                SpriteID = reader.ReadString();
            }
#endif
        }
Exemple #2
0
        public override void Read(EndianStream stream)
        {
            base.Read(stream);

            AnchorMin.Read(stream);
            AnchorMax.Read(stream);
            AnchorPosition.Read(stream);
            SizeDelta.Read(stream);
            Pivot.Read(stream);
        }
Exemple #3
0
        public override void Read(AssetReader reader)
        {
            base.Read(reader);

            AnchorMin.Read(reader);
            AnchorMax.Read(reader);
            AnchorPosition.Read(reader);
            SizeDelta.Read(reader);
            Pivot.Read(reader);
        }
Exemple #4
0
 public void Read(AssetReader reader)
 {
     Border.Read(reader);
     Pivot.Read(reader);
     OldSize.Read(reader);
     NewSize.Read(reader);
     AdaptiveTilingThreshold = reader.ReadSingle();
     DrawMode       = reader.ReadInt32();
     AdaptiveTiling = reader.ReadBoolean();
     reader.AlignStream();
 }
 public void Read(AssetStream stream)
 {
     Border.Read(stream);
     Pivot.Read(stream);
     OldSize.Read(stream);
     NewSize.Read(stream);
     AdaptiveTilingThreshold = stream.ReadSingle();
     DrawMode       = stream.ReadInt32();
     AdaptiveTiling = stream.ReadBoolean();
     stream.AlignStream(AlignType.Align4);
 }
Exemple #6
0
        public override void Read(AssetReader reader)
        {
            base.Read(reader);

            Rect.Read(reader);
            Offset.Read(reader);
            if (IsReadBorder(reader.Version))
            {
                Border.Read(reader);
            }
            PixelsToUnits = reader.ReadSingle();
            if (IsReadPivot(reader.Version))
            {
                Pivot.Read(reader);
            }
            Extrude = reader.ReadUInt32();
            if (IsReadPolygon(reader.Version))
            {
                IsPolygon = reader.ReadBoolean();
                reader.AlignStream(AlignType.Align4);
            }

            if (IsReadRendererData(reader.Version))
            {
                RenderDataKey = reader.ReadTupleTLong <EngineGUID>();
                m_atlasTags   = reader.ReadStringArray();
                SpriteAtlas.Read(reader);
            }
            RD.Read(reader);
            reader.AlignStream(AlignType.Align4);

            if (IsReadPhysicsShape(reader.Version))
            {
                int count = reader.ReadInt32();
                m_physicsShape = new Vector2f[count][];
                for (int i = 0; i < count; i++)
                {
                    m_physicsShape[i] = reader.ReadArray <Vector2f>();
                }
            }

            if (IsReadBones(reader.Version))
            {
                m_bones = reader.ReadArray <SpriteBone>();
            }
        }
Exemple #7
0
        public void Read(AssetReader reader)
        {
            Name = reader.ReadString();
            Rect.Read(reader);
            Alignment = (SpriteAlignment)reader.ReadInt32();
            Pivot.Read(reader);
            if (HasBorder(reader.Version))
            {
                Border.Read(reader);
            }
            if (HasOutline(reader.Version))
            {
                Outline = reader.ReadAssetArrayArray <Vector2f>();
            }
            if (HasPhysicsShape(reader.Version))
            {
                PhysicsShape = reader.ReadAssetArrayArray <Vector2f>();
            }
            if (HasTessellationDetail(reader.Version))
            {
                TessellationDetail = reader.ReadSingle();
            }
            if (HasBones(reader.Version))
            {
                Bones    = reader.ReadAssetArray <SpriteBone>();
                SpriteID = reader.ReadString();
            }
            if (HasInternalID(reader.Version))
            {
                InternalID = reader.ReadInt64();
            }
            if (HasBones(reader.Version))
            {
                Vertices = reader.ReadAssetArray <Vector2f>();
                Indices  = reader.ReadInt32Array();
                Edges    = reader.ReadAssetArray <Int2Storage>();
                reader.AlignStream();

                Weights = reader.ReadAssetArray <BoneWeights4>();
                reader.AlignStream();
            }
        }
        public override void Read(AssetStream stream)
        {
            base.Read(stream);

            Rect.Read(stream);
            Offset.Read(stream);
            if (IsReadBorder(stream.Version))
            {
                Border.Read(stream);
            }
            PixelsToUnits = stream.ReadSingle();
            if (IsReadPivot(stream.Version))
            {
                Pivot.Read(stream);
            }
            Extrude = stream.ReadUInt32();
            if (IsReadPolygon(stream.Version))
            {
                IsPolygon = stream.ReadBoolean();
                stream.AlignStream(AlignType.Align4);
            }

            if (IsReadRendererData(stream.Version))
            {
                RenderDataKey = stream.ReadTupleTLong <UtinyGUID>();
                m_atlasTags   = stream.ReadStringArray();
                SpriteAtlas.Read(stream);
            }
            RD.Read(stream);
            stream.AlignStream(AlignType.Align4);

            if (IsReadPhysicsShape(stream.Version))
            {
                int count = stream.ReadInt32();
                m_physicsShape = new Vector2f[count][];
                for (int i = 0; i < count; i++)
                {
                    m_physicsShape[i] = stream.ReadArray <Vector2f>();
                }
            }
        }
Exemple #9
0
        public override void Read(AssetReader reader)
        {
            base.Read(reader);

            RenderMode = IsModeShort(reader.Version) ? (ParticleSystemRenderMode)reader.ReadUInt16() : (ParticleSystemRenderMode)reader.ReadInt32();
            if (IsSortModeFirst(reader.Version))
            {
                SortMode = (ParticleSystemSortMode)reader.ReadUInt16();
            }

            if (IsReadMinParticleSize(reader.Version))
            {
                MinParticleSize = reader.ReadSingle();
            }
            MaxParticleSize     = reader.ReadSingle();
            CameraVelocityScale = reader.ReadSingle();
            VelocityScale       = reader.ReadSingle();
            LengthScale         = reader.ReadSingle();
            SortingFudge        = reader.ReadSingle();

            if (IsReadNormalDirection(reader.Version))
            {
                NormalDirection = reader.ReadSingle();
            }
            if (IsReadShadowBias(reader.Version))
            {
                ShadowBias = reader.ReadSingle();
            }
            if (!IsSortModeFirst(reader.Version))
            {
                SortMode = (ParticleSystemSortMode)reader.ReadInt32();
            }

            if (IsReadRenderAlignment(reader.Version))
            {
                RenderAlignment = (ParticleSystemRenderSpace)reader.ReadInt32();
                Pivot.Read(reader);
            }
            else
            {
                RenderAlignment = RenderMode == ParticleSystemRenderMode.Mesh ? ParticleSystemRenderSpace.Local : ParticleSystemRenderSpace.View;
            }
            if (IsReadFlip(reader.Version))
            {
                Flip.Read(reader);
            }

            if (IsReadUseCustomVertexStreams(reader.Version))
            {
                UseCustomVertexStreams = reader.ReadBoolean();
                if (IsReadEnableGPUInstancing(reader.Version))
                {
                    EnableGPUInstancing = reader.ReadBoolean();
                }
                if (IsReadApplyActiveColorSpace(reader.Version))
                {
                    ApplyActiveColorSpace = reader.ReadBoolean();
                }
                if (IsReadAllowRoll(reader.Version))
                {
                    AllowRoll = reader.ReadBoolean();
                }
                reader.AlignStream(AlignType.Align4);
            }
            if (IsReadVertexStreamMask(reader.Version))
            {
                int         vertexStreamMask = reader.ReadInt32();
                List <byte> vertexStreams    = new List <byte>(8);
                for (byte i = 0; i < 8; i++)
                {
                    if ((vertexStreamMask & (1 << i)) != 0)
                    {
                        vertexStreams.Add(i);
                    }
                }
                m_vertexStreams = vertexStreams.ToArray();
            }
            if (IsReadVertexStreams(reader.Version))
            {
                m_vertexStreams = reader.ReadByteArray();
                reader.AlignStream(AlignType.Align4);
            }

            Mesh.Read(reader);
            if (IsReadMeshes(reader.Version))
            {
                Mesh1.Read(reader);
                Mesh2.Read(reader);
                Mesh3.Read(reader);
            }
            if (IsReadMaskInteraction(reader.Version))
            {
                MaskInteraction = (SpriteMaskInteraction)reader.ReadInt32();
            }
        }
		public override void Read(AssetStream stream)
		{
			base.Read(stream);

			if (IsModeShort(stream.Version))
			{
				RenderMode = stream.ReadUInt16();
			}
			else
			{
				RenderMode = stream.ReadInt32();
			}
			if (IsSortModeFirst(stream.Version))
			{
				SortMode = stream.ReadUInt16();
			}

			if (IsReadMinParticleSize(stream.Version))
			{
				MinParticleSize = stream.ReadSingle();
			}
			MaxParticleSize = stream.ReadSingle();
			CameraVelocityScale = stream.ReadSingle();
			VelocityScale = stream.ReadSingle();
			LengthScale = stream.ReadSingle();
			SortingFudge = stream.ReadSingle();

			if (IsReadNormalDirection(stream.Version))
			{
				NormalDirection = stream.ReadSingle();
			}
			if (!IsSortModeFirst(stream.Version))
			{
				SortMode = stream.ReadInt32();
			}

			if (IsReadRenderAlignment(stream.Version))
			{
				RenderAlignment = stream.ReadInt32();
				Pivot.Read(stream);
			}
			if (IsReadUseCustomVertexStreams(stream.Version))
			{
				UseCustomVertexStreams = stream.ReadBoolean();
				stream.AlignStream(AlignType.Align4);
			}
			if (IsReadVertexStreamMask(stream.Version))
			{
				VertexStreamMask = stream.ReadInt32();
			}
			if (IsReadVertexStreams(stream.Version))
			{
				m_vertexStreams = stream.ReadByteArray();
				stream.AlignStream(AlignType.Align4);
			}

			Mesh.Read(stream);
			if (IsReadMeshes(stream.Version))
			{
				Mesh1.Read(stream);
				Mesh2.Read(stream);
				Mesh3.Read(stream);
			}
			if (IsReadMaskInteraction(stream.Version))
			{
				MaskInteraction = stream.ReadInt32();
			}
		}