47 lines
1.6 KiB
C#
47 lines
1.6 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using Spine.Implementations.V41;
|
|
using Spine.Interfaces;
|
|
using Spine.Interfaces.Attachments;
|
|
using SpineRuntime41;
|
|
|
|
namespace Spine.Implementations.V41.Attachments
|
|
{
|
|
internal sealed class MeshAttachment41(MeshAttachment innerObject) :
|
|
Attachment41(innerObject),
|
|
IMeshAttachment
|
|
{
|
|
private readonly MeshAttachment _o = innerObject;
|
|
|
|
public override MeshAttachment InnerObject => _o;
|
|
|
|
public override int ComputeWorldVertices(ISlot slot, ref float[] worldVertices)
|
|
{
|
|
if (slot is Slot41 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(Slot41)}, but received {slot.GetType().Name}", nameof(slot));
|
|
}
|
|
|
|
public float R { get => _o.R; set => _o.R = value; }
|
|
public float G { get => _o.G; set => _o.G = value; }
|
|
public float B { get => _o.B; set => _o.B = value; }
|
|
public float A { get => _o.A; set => _o.A = value; }
|
|
|
|
public SFML.Graphics.Texture RendererObject => (SFML.Graphics.Texture)((AtlasRegion)_o.Region).page.rendererObject;
|
|
|
|
public float[] UVs => _o.UVs;
|
|
|
|
public int[] Triangles => _o.Triangles;
|
|
|
|
public int HullLength => _o.HullLength;
|
|
}
|
|
}
|