重构并增加HitTest

This commit is contained in:
ww-rm
2025-10-01 16:35:51 +08:00
parent 1d8e2efdff
commit 30dee9978c
170 changed files with 748 additions and 564 deletions

View File

@@ -0,0 +1,33 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Spine.Implementations.V34;
using Spine.Interfaces;
using Spine.Interfaces.Attachments;
using SpineRuntime34;
namespace Spine.Implementations.V34.Attachments
{
internal sealed class BoundingBoxAttachment34(BoundingBoxAttachment innerObject) :
Attachment34(innerObject),
IBoundingBoxAttachment
{
private readonly BoundingBoxAttachment _o = innerObject;
public override BoundingBoxAttachment InnerObject => _o;
public override int ComputeWorldVertices(ISlot slot, ref float[] worldVertices)
{
if (slot is Slot34 st)
{
var length = _o.WorldVerticesLength;
if (worldVertices.Length < length) worldVertices = new float[length];
_o.ComputeWorldVertices(st.InnerObject, worldVertices);
return length;
}
throw new ArgumentException($"Invalid slot type. Expected {nameof(Slot34)}, but received {slot.GetType().Name}", nameof(slot));
}
}
}