You can use either regionAttachment.SetColor(..)
and meshAttachment.SetColor(..)
, or set individual RGBA component values via regionAttachment.r = red; regionAttachment.b = blue; regionAttachment.g = green;
(same applies to meshAttachment
).
You will need to cast any provided attachment (e.g. returned from Skin.GetAttachment()
) to either RegionAttachment or MeshAttachment before you can set a color:
RegionAttachment regionAttachment = attachment as RegionAttachment;
if (regionAttachment) {
regionAttachment.SetColor(color);
}
else {
MeshAttachment meshAttachment = attachment as MeshAttachment;
if (meshAttachment)
meshAttachment.SetColor(color);
}
This is necessary, because many Attachment classes like e.g. VertexAttachment or ClippingAttachment provide no color parameter.