mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-06 15:24:55 +08:00
[monogame] Adjusted monogame code to spine-csharp 4.3 changes.
This commit is contained in:
parent
37ae2ac476
commit
45eb76fed2
@ -95,7 +95,7 @@ namespace Spine {
|
||||
state.Apply(skeleton);
|
||||
|
||||
// Update the transformations of bones and other parts of the skeleton
|
||||
skeleton.UpdateWorldTransform(Skeleton.Physics.Update);
|
||||
skeleton.UpdateWorldTransform(Physics.Update);
|
||||
|
||||
// Clear the screen and setup the projection matrix of the skeleton renderer
|
||||
game.GraphicsDevice.Clear(Color.Black);
|
||||
@ -148,7 +148,7 @@ namespace Spine {
|
||||
skeleton.Update(deltaTime);
|
||||
state.Apply(skeleton);
|
||||
|
||||
skeleton.UpdateWorldTransform(Skeleton.Physics.Update);
|
||||
skeleton.UpdateWorldTransform(Physics.Update);
|
||||
|
||||
// Clear the screen and setup the projection matrix of the custom effect through the
|
||||
// "Projection" parameter.
|
||||
@ -193,7 +193,7 @@ namespace Spine {
|
||||
|
||||
// Set the "walk" animation on track one and let it loop forever
|
||||
state.SetAnimation(0, "walk", true);
|
||||
|
||||
|
||||
// Queue another animation after 2 seconds to let Spineboy jump
|
||||
state.AddAnimation(0, "jump", false, 2);
|
||||
|
||||
@ -206,7 +206,7 @@ namespace Spine {
|
||||
skeleton.Update(deltaTime);
|
||||
state.Apply(skeleton);
|
||||
|
||||
skeleton.UpdateWorldTransform(Skeleton.Physics.Update);
|
||||
skeleton.UpdateWorldTransform(Physics.Update);
|
||||
|
||||
game.GraphicsDevice.Clear(Color.Black);
|
||||
((BasicEffect)skeletonRenderer.Effect).Projection = Matrix.CreateOrthographicOffCenter(0, game.GraphicsDevice.Viewport.Width, game.GraphicsDevice.Viewport.Height, 0, 1, 0);
|
||||
@ -267,7 +267,7 @@ namespace Spine {
|
||||
skeleton.Update(deltaTime);
|
||||
state.Apply(skeleton);
|
||||
|
||||
skeleton.UpdateWorldTransform(Skeleton.Physics.Update);
|
||||
skeleton.UpdateWorldTransform(Physics.Update);
|
||||
|
||||
game.GraphicsDevice.Clear(Color.Black);
|
||||
((BasicEffect)skeletonRenderer.Effect).Projection = Matrix.CreateOrthographicOffCenter(0, game.GraphicsDevice.Viewport.Width, game.GraphicsDevice.Viewport.Height, 0, 1, 0);
|
||||
@ -323,7 +323,7 @@ namespace Spine {
|
||||
// lastPosition = currentPosition;
|
||||
|
||||
state.Apply(skeleton);
|
||||
skeleton.UpdateWorldTransform(Skeleton.Physics.Update);
|
||||
skeleton.UpdateWorldTransform(Physics.Update);
|
||||
|
||||
game.GraphicsDevice.Clear(Color.Black);
|
||||
((BasicEffect)skeletonRenderer.Effect).Projection = Matrix.CreateOrthographicOffCenter(0, game.GraphicsDevice.Viewport.Width, game.GraphicsDevice.Viewport.Height, 0, 1, 0);
|
||||
@ -380,7 +380,7 @@ namespace Spine {
|
||||
// lastPosition = currentPosition;
|
||||
|
||||
state.Apply(skeleton);
|
||||
skeleton.UpdateWorldTransform(Skeleton.Physics.Update);
|
||||
skeleton.UpdateWorldTransform(Physics.Update);
|
||||
|
||||
game.GraphicsDevice.Clear(Color.Black);
|
||||
((BasicEffect)skeletonRenderer.Effect).Projection = Matrix.CreateOrthographicOffCenter(0, game.GraphicsDevice.Viewport.Width, game.GraphicsDevice.Viewport.Height, 0, 1, 0);
|
||||
|
||||
@ -18,147 +18,74 @@
|
||||
<Folder Include="src\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="..\..\spine-csharp\src\Animation.cs">
|
||||
<Link>spine-csharp\Animation.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\AnimationState.cs">
|
||||
<Link>spine-csharp\AnimationState.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\AnimationStateData.cs">
|
||||
<Link>spine-csharp\AnimationStateData.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\Atlas.cs">
|
||||
<Link>spine-csharp\Atlas.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\BlendMode.cs">
|
||||
<Link>spine-csharp\BlendMode.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\Bone.cs">
|
||||
<Link>spine-csharp\Bone.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\BoneData.cs">
|
||||
<Link>spine-csharp\BoneData.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\ConstraintData.cs">
|
||||
<Link>spine-csharp\ConstraintData.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\Event.cs">
|
||||
<Link>spine-csharp\Event.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\EventData.cs">
|
||||
<Link>spine-csharp\EventData.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\ExposedList.cs">
|
||||
<Link>spine-csharp\ExposedList.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\IkConstraint.cs">
|
||||
<Link>spine-csharp\IkConstraint.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\IkConstraintData.cs">
|
||||
<Link>spine-csharp\IkConstraintData.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\PhysicsConstraint.cs">
|
||||
<Link>spine-csharp\PhysicsConstraint.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\PhysicsConstraintData.cs">
|
||||
<Link>spine-csharp\PhysicsConstraintData.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\IUpdatable.cs">
|
||||
<Link>spine-csharp\IUpdatable.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\Json.cs">
|
||||
<Link>spine-csharp\Json.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\MathUtils.cs">
|
||||
<Link>spine-csharp\MathUtils.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\PathConstraint.cs">
|
||||
<Link>spine-csharp\PathConstraint.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\PathConstraintData.cs">
|
||||
<Link>spine-csharp\PathConstraintData.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\Skeleton.cs">
|
||||
<Link>spine-csharp\Skeleton.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\SkeletonBinary.cs">
|
||||
<Link>spine-csharp\SkeletonBinary.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\SkeletonBounds.cs">
|
||||
<Link>spine-csharp\SkeletonBounds.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\SkeletonClipping.cs">
|
||||
<Link>spine-csharp\SkeletonClipping.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\SkeletonData.cs">
|
||||
<Link>spine-csharp\SkeletonData.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\SkeletonJson.cs">
|
||||
<Link>spine-csharp\SkeletonJson.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\SkeletonLoader.cs">
|
||||
<Link>spine-csharp\SkeletonLoader.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\Skin.cs">
|
||||
<Link>spine-csharp\Skin.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\Slot.cs">
|
||||
<Link>spine-csharp\Slot.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\SlotData.cs">
|
||||
<Link>spine-csharp\SlotData.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\TextureRegion.cs">
|
||||
<Link>spine-csharp\TextureRegion.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\TransformConstraint.cs">
|
||||
<Link>spine-csharp\TransformConstraint.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\TransformConstraintData.cs">
|
||||
<Link>spine-csharp\TransformConstraintData.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\Triangulator.cs">
|
||||
<Link>spine-csharp\Triangulator.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\Attachments\AtlasAttachmentLoader.cs">
|
||||
<Link>spine-csharp\Attachments\AtlasAttachmentLoader.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\Attachments\Attachment.cs">
|
||||
<Link>spine-csharp\Attachments\Attachment.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\Attachments\AttachmentLoader.cs">
|
||||
<Link>spine-csharp\Attachments\AttachmentLoader.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\Attachments\AttachmentType.cs">
|
||||
<Link>spine-csharp\Attachments\AttachmentType.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\Attachments\BoundingBoxAttachment.cs">
|
||||
<Link>spine-csharp\Attachments\BoundingBoxAttachment.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\Attachments\ClippingAttachment.cs">
|
||||
<Link>spine-csharp\Attachments\ClippingAttachment.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\Attachments\IHasTextureRegion.cs">
|
||||
<Link>spine-csharp\Attachments\IHasTextureRegion.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\Attachments\MeshAttachment.cs">
|
||||
<Link>spine-csharp\Attachments\MeshAttachment.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\Attachments\PathAttachment.cs">
|
||||
<Link>spine-csharp\Attachments\PathAttachment.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\Attachments\PointAttachment.cs">
|
||||
<Link>spine-csharp\Attachments\PointAttachment.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\Attachments\RegionAttachment.cs">
|
||||
<Link>spine-csharp\Attachments\RegionAttachment.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\Attachments\Sequence.cs">
|
||||
<Link>spine-csharp\Attachments\Sequence.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\Attachments\VertexAttachment.cs">
|
||||
<Link>spine-csharp\Attachments\VertexAttachment.cs</Link>
|
||||
</Compile>
|
||||
<!-- Core files -->
|
||||
<Compile Include="..\..\spine-csharp\src\Animation.cs"><Link>spine-csharp\Animation.cs</Link></Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\AnimationState.cs"><Link>spine-csharp\AnimationState.cs</Link></Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\AnimationStateData.cs"><Link>spine-csharp\AnimationStateData.cs</Link></Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\Atlas.cs"><Link>spine-csharp\Atlas.cs</Link></Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\BlendMode.cs"><Link>spine-csharp\BlendMode.cs</Link></Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\Bone.cs"><Link>spine-csharp\Bone.cs</Link></Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\BoneData.cs"><Link>spine-csharp\BoneData.cs</Link></Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\BoneLocal.cs"><Link>spine-csharp\BoneLocal.cs</Link></Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\BonePose.cs"><Link>spine-csharp\BonePose.cs</Link></Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\ColorMono.cs"><Link>spine-csharp\ColorMono.cs</Link></Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\ColorUnity.cs"><Link>spine-csharp\ColorUnity.cs</Link></Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\Constraint.cs"><Link>spine-csharp\Constraint.cs</Link></Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\ConstraintData.cs"><Link>spine-csharp\ConstraintData.cs</Link></Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\Event.cs"><Link>spine-csharp\Event.cs</Link></Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\EventData.cs"><Link>spine-csharp\EventData.cs</Link></Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\ExposedList.cs"><Link>spine-csharp\ExposedList.cs</Link></Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\IkConstraint.cs"><Link>spine-csharp\IkConstraint.cs</Link></Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\IkConstraintData.cs"><Link>spine-csharp\IkConstraintData.cs</Link></Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\IkConstraintPose.cs"><Link>spine-csharp\IkConstraintPose.cs</Link></Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\IPose.cs"><Link>spine-csharp\IPose.cs</Link></Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\IUpdate.cs"><Link>spine-csharp\IUpdate.cs</Link></Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\Json.cs"><Link>spine-csharp\Json.cs</Link></Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\MathUtils.cs"><Link>spine-csharp\MathUtils.cs</Link></Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\PathConstraint.cs"><Link>spine-csharp\PathConstraint.cs</Link></Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\PathConstraintData.cs"><Link>spine-csharp\PathConstraintData.cs</Link></Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\PathConstraintPose.cs"><Link>spine-csharp\PathConstraintPose.cs</Link></Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\Physics.cs"><Link>spine-csharp\Physics.cs</Link></Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\PhysicsConstraint.cs"><Link>spine-csharp\PhysicsConstraint.cs</Link></Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\PhysicsConstraintData.cs"><Link>spine-csharp\PhysicsConstraintData.cs</Link></Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\PhysicsConstraintPose.cs"><Link>spine-csharp\PhysicsConstraintPose.cs</Link></Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\Posed.cs"><Link>spine-csharp\Posed.cs</Link></Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\PosedActive.cs"><Link>spine-csharp\PosedActive.cs</Link></Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\PosedData.cs"><Link>spine-csharp\PosedData.cs</Link></Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\Skeleton.cs"><Link>spine-csharp\Skeleton.cs</Link></Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\SkeletonBinary.cs"><Link>spine-csharp\SkeletonBinary.cs</Link></Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\SkeletonBounds.cs"><Link>spine-csharp\SkeletonBounds.cs</Link></Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\SkeletonClipping.cs"><Link>spine-csharp\SkeletonClipping.cs</Link></Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\SkeletonData.cs"><Link>spine-csharp\SkeletonData.cs</Link></Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\SkeletonJson.cs"><Link>spine-csharp\SkeletonJson.cs</Link></Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\SkeletonLoader.cs"><Link>spine-csharp\SkeletonLoader.cs</Link></Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\Skin.cs"><Link>spine-csharp\Skin.cs</Link></Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\Slider.cs"><Link>spine-csharp\Slider.cs</Link></Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\SliderData.cs"><Link>spine-csharp\SliderData.cs</Link></Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\SliderPose.cs"><Link>spine-csharp\SliderPose.cs</Link></Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\Slot.cs"><Link>spine-csharp\Slot.cs</Link></Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\SlotData.cs"><Link>spine-csharp\SlotData.cs</Link></Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\SlotPose.cs"><Link>spine-csharp\SlotPose.cs</Link></Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\TextureRegion.cs"><Link>spine-csharp\TextureRegion.cs</Link></Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\TransformConstraint.cs"><Link>spine-csharp\TransformConstraint.cs</Link></Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\TransformConstraintData.cs"><Link>spine-csharp\TransformConstraintData.cs</Link></Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\TransformConstraintPose.cs"><Link>spine-csharp\TransformConstraintPose.cs</Link></Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\Triangulator.cs"><Link>spine-csharp\Triangulator.cs</Link></Compile>
|
||||
|
||||
<!-- Attachments folder -->
|
||||
<Compile Include="..\..\spine-csharp\src\Attachments\AtlasAttachmentLoader.cs"><Link>spine-csharp\Attachments\AtlasAttachmentLoader.cs</Link></Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\Attachments\Attachment.cs"><Link>spine-csharp\Attachments\Attachment.cs</Link></Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\Attachments\AttachmentLoader.cs"><Link>spine-csharp\Attachments\AttachmentLoader.cs</Link></Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\Attachments\AttachmentType.cs"><Link>spine-csharp\Attachments\AttachmentType.cs</Link></Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\Attachments\BoundingBoxAttachment.cs"><Link>spine-csharp\Attachments\BoundingBoxAttachment.cs</Link></Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\Attachments\ClippingAttachment.cs"><Link>spine-csharp\Attachments\ClippingAttachment.cs</Link></Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\Attachments\IHasTextureRegion.cs"><Link>spine-csharp\Attachments\IHasTextureRegion.cs</Link></Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\Attachments\MeshAttachment.cs"><Link>spine-csharp\Attachments\MeshAttachment.cs</Link></Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\Attachments\PathAttachment.cs"><Link>spine-csharp\Attachments\PathAttachment.cs</Link></Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\Attachments\PointAttachment.cs"><Link>spine-csharp\Attachments\PointAttachment.cs</Link></Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\Attachments\RegionAttachment.cs"><Link>spine-csharp\Attachments\RegionAttachment.cs</Link></Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\Attachments\Sequence.cs"><Link>spine-csharp\Attachments\Sequence.cs</Link></Compile>
|
||||
<Compile Include="..\..\spine-csharp\src\Attachments\VertexAttachment.cs"><Link>spine-csharp\Attachments\VertexAttachment.cs</Link></Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\..\spine-csharp\src\Animation.cs.meta">
|
||||
@ -203,9 +130,6 @@
|
||||
<None Include="..\..\spine-csharp\src\IkConstraintData.cs.meta">
|
||||
<Link>spine-csharp\IkConstraintData.cs.meta</Link>
|
||||
</None>
|
||||
<None Include="..\..\spine-csharp\src\IUpdatable.cs.meta">
|
||||
<Link>spine-csharp\IUpdatable.cs.meta</Link>
|
||||
</None>
|
||||
<None Include="..\..\spine-csharp\src\Json.cs.meta">
|
||||
<Link>spine-csharp\Json.cs.meta</Link>
|
||||
</None>
|
||||
|
||||
@ -107,9 +107,10 @@ namespace Spine {
|
||||
for (int i = 0, n = bones.Count; i < n; i++) {
|
||||
var bone = bones.Items[i];
|
||||
if (bone.Parent == null) continue;
|
||||
var x = bone.Data.Length * bone.A + bone.WorldX;
|
||||
var y = bone.Data.Length * bone.C + bone.WorldY;
|
||||
renderer.Line(bone.WorldX, bone.WorldY, x, y, z);
|
||||
BonePose bonePose = bone.AppliedPose;
|
||||
var x = bone.Data.Length * bonePose.A + bonePose.WorldX;
|
||||
var y = bone.Data.Length * bonePose.C + bonePose.WorldY;
|
||||
renderer.Line(bonePose.WorldX, bonePose.WorldY, x, y, z);
|
||||
}
|
||||
if (DrawSkeletonXY) renderer.X(skeletonX, skeletonY, 4, z);
|
||||
}
|
||||
@ -119,7 +120,7 @@ namespace Spine {
|
||||
var slots = skeleton.Slots;
|
||||
for (int i = 0, n = slots.Count; i < n; i++) {
|
||||
var slot = slots.Items[i];
|
||||
var attachment = slot.Attachment;
|
||||
var attachment = slot.AppliedPose.Attachment;
|
||||
if (attachment is RegionAttachment) {
|
||||
var regionAttachment = (RegionAttachment)attachment;
|
||||
var vertices = this.vertices;
|
||||
@ -136,11 +137,11 @@ namespace Spine {
|
||||
var slots = skeleton.Slots;
|
||||
for (int i = 0, n = slots.Count; i < n; i++) {
|
||||
var slot = slots.Items[i];
|
||||
var attachment = slot.Attachment;
|
||||
var attachment = slot.AppliedPose.Attachment;
|
||||
if (!(attachment is MeshAttachment)) continue;
|
||||
var mesh = (MeshAttachment)attachment;
|
||||
var world = vertices = vertices.Length < mesh.WorldVerticesLength ? new float[mesh.WorldVerticesLength] : vertices;
|
||||
mesh.ComputeWorldVertices(slot, 0, mesh.WorldVerticesLength, world, 0, 2);
|
||||
mesh.ComputeWorldVertices(skeleton, slot, 0, mesh.WorldVerticesLength, world, 0, 2);
|
||||
int[] triangles = mesh.Triangles;
|
||||
var hullLength = mesh.HullLength;
|
||||
if (DrawMeshTriangles) {
|
||||
@ -184,8 +185,9 @@ namespace Spine {
|
||||
if (DrawBones) {
|
||||
renderer.SetColor(boneOriginColor);
|
||||
for (int i = 0, n = bones.Count; i < n; i++) {
|
||||
var bone = bones.Items[i];
|
||||
renderer.Circle(bone.WorldX, bone.WorldY, 3, z);
|
||||
Bone bone = bones.Items[i];
|
||||
BonePose bonePose = bone.AppliedPose;
|
||||
renderer.Circle(bonePose.WorldX, bonePose.WorldY, 3, z);
|
||||
}
|
||||
}
|
||||
|
||||
@ -194,12 +196,12 @@ namespace Spine {
|
||||
renderer.SetColor(clipColor);
|
||||
for (int i = 0, n = slots.Count; i < n; i++) {
|
||||
var slot = slots.Items[i];
|
||||
var attachment = slot.Attachment;
|
||||
var attachment = slot.AppliedPose.Attachment;
|
||||
if (!(attachment is ClippingAttachment)) continue;
|
||||
var clip = (ClippingAttachment)attachment;
|
||||
var nn = clip.WorldVerticesLength;
|
||||
var world = vertices = vertices.Length < nn ? new float[nn] : vertices;
|
||||
clip.ComputeWorldVertices(slot, 0, nn, world, 0, 2);
|
||||
clip.ComputeWorldVertices(skeleton, slot, 0, nn, world, 0, 2);
|
||||
ExposedList<float> clippingPolygon = new ExposedList<float>();
|
||||
for (int ii = 0; ii < nn; ii += 2) {
|
||||
var x = world[ii];
|
||||
|
||||
@ -114,22 +114,24 @@ namespace Spine {
|
||||
public void Draw (Skeleton skeleton) {
|
||||
var drawOrder = skeleton.DrawOrder;
|
||||
var drawOrderItems = skeleton.DrawOrder.Items;
|
||||
float skeletonR = skeleton.R, skeletonG = skeleton.G, skeletonB = skeleton.B, skeletonA = skeleton.A;
|
||||
Color color = new Color();
|
||||
Color32F skeletonColor = skeleton.GetColor();
|
||||
|
||||
if (VertexEffect != null) VertexEffect.Begin(skeleton);
|
||||
|
||||
for (int i = 0, n = drawOrder.Count; i < n; i++) {
|
||||
Slot slot = drawOrderItems[i];
|
||||
SlotPose slotPose = slot.AppliedPose;
|
||||
if (!slot.Bone.Active) {
|
||||
clipper.ClipEnd(slot);
|
||||
continue;
|
||||
}
|
||||
|
||||
Attachment attachment = slot.Attachment;
|
||||
Attachment attachment = slotPose.Attachment;
|
||||
float attachmentZOffset = z + zSpacing * i;
|
||||
|
||||
float attachmentColorR, attachmentColorG, attachmentColorB, attachmentColorA;
|
||||
Color32F attachmentColor;
|
||||
Color32F slotColor = slotPose.GetColor();
|
||||
Color color;
|
||||
object textureObject = null;
|
||||
int verticesCount = 0;
|
||||
float[] vertices = this.vertices;
|
||||
@ -139,7 +141,7 @@ namespace Spine {
|
||||
|
||||
if (attachment is RegionAttachment) {
|
||||
RegionAttachment regionAttachment = (RegionAttachment)attachment;
|
||||
attachmentColorR = regionAttachment.R; attachmentColorG = regionAttachment.G; attachmentColorB = regionAttachment.B; attachmentColorA = regionAttachment.A;
|
||||
attachmentColor = regionAttachment.GetColor();
|
||||
regionAttachment.ComputeWorldVertices(slot, vertices, 0, 2);
|
||||
verticesCount = 4;
|
||||
indicesCount = 6;
|
||||
@ -149,11 +151,11 @@ namespace Spine {
|
||||
textureObject = region.page.rendererObject;
|
||||
} else if (attachment is MeshAttachment) {
|
||||
MeshAttachment mesh = (MeshAttachment)attachment;
|
||||
attachmentColorR = mesh.R; attachmentColorG = mesh.G; attachmentColorB = mesh.B; attachmentColorA = mesh.A;
|
||||
attachmentColor = mesh.GetColor();
|
||||
int vertexCount = mesh.WorldVerticesLength;
|
||||
if (vertices.Length < vertexCount) this.vertices = vertices = new float[vertexCount];
|
||||
verticesCount = vertexCount >> 1;
|
||||
mesh.ComputeWorldVertices(slot, vertices);
|
||||
mesh.ComputeWorldVertices(skeleton, slot, vertices);
|
||||
indicesCount = mesh.Triangles.Length;
|
||||
indices = mesh.Triangles;
|
||||
uvs = mesh.UVs;
|
||||
@ -161,7 +163,7 @@ namespace Spine {
|
||||
textureObject = region.page.rendererObject;
|
||||
} else if (attachment is ClippingAttachment) {
|
||||
ClippingAttachment clip = (ClippingAttachment)attachment;
|
||||
clipper.ClipStart(slot, clip);
|
||||
clipper.ClipStart(skeleton, slot, clip);
|
||||
continue;
|
||||
} else {
|
||||
clipper.ClipEnd(slot);
|
||||
@ -187,25 +189,25 @@ namespace Spine {
|
||||
}
|
||||
|
||||
// calculate color
|
||||
float a = skeletonA * slot.A * attachmentColorA;
|
||||
Color32F combinedColor = skeletonColor * slotColor * attachmentColor;
|
||||
float a = combinedColor.a;
|
||||
if (premultipliedAlpha) {
|
||||
color = new Color(
|
||||
skeletonR * slot.R * attachmentColorR * a,
|
||||
skeletonG * slot.G * attachmentColorG * a,
|
||||
skeletonB * slot.B * attachmentColorB * a, a);
|
||||
combinedColor.r * a,
|
||||
combinedColor.g * a,
|
||||
combinedColor.b * a, a);
|
||||
} else {
|
||||
color = new Color(
|
||||
skeletonR * slot.R * attachmentColorR,
|
||||
skeletonG * slot.G * attachmentColorG,
|
||||
skeletonB * slot.B * attachmentColorB, a);
|
||||
color = combinedColor;
|
||||
}
|
||||
|
||||
Color darkColor = new Color();
|
||||
if (slot.HasSecondColor) {
|
||||
Color32F? slotDarkColorOptional = slotPose.GetDarkColor();
|
||||
if (slotDarkColorOptional.HasValue) {
|
||||
Color32F slotDarkColor = slotDarkColorOptional.Value;
|
||||
if (premultipliedAlpha) {
|
||||
darkColor = new Color(slot.R2 * a, slot.G2 * a, slot.B2 * a);
|
||||
darkColor = new Color(slotDarkColor.r * a, slotDarkColor.g * a, slotDarkColor.b * a);
|
||||
} else {
|
||||
darkColor = new Color(slot.R2 * a, slot.G2 * a, slot.B2 * a);
|
||||
darkColor = new Color(slotDarkColor.r * a, slotDarkColor.g * a, slotDarkColor.b * a);
|
||||
}
|
||||
}
|
||||
darkColor.A = premultipliedAlpha ? (byte)255 : (byte)0;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user