mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-05 18:26:52 +08:00
[libgdx] Removed Slot#attachmentName.
Decided lazy attachment look up was premature optimization.
This commit is contained in:
parent
be01e0aae3
commit
bc629cec11
@ -39,10 +39,9 @@ public class Slot {
|
|||||||
final SlotData data;
|
final SlotData data;
|
||||||
final Bone bone;
|
final Bone bone;
|
||||||
final Color color;
|
final Color color;
|
||||||
private Attachment attachment;
|
Attachment attachment;
|
||||||
private float attachmentTime;
|
private float attachmentTime;
|
||||||
private FloatArray attachmentVertices = new FloatArray();
|
private FloatArray attachmentVertices = new FloatArray();
|
||||||
String attachmentName;
|
|
||||||
|
|
||||||
public Slot (SlotData data, Bone bone) {
|
public Slot (SlotData data, Bone bone) {
|
||||||
if (data == null) throw new IllegalArgumentException("data cannot be null.");
|
if (data == null) throw new IllegalArgumentException("data cannot be null.");
|
||||||
@ -82,10 +81,6 @@ public class Slot {
|
|||||||
|
|
||||||
/** @return May be null. */
|
/** @return May be null. */
|
||||||
public Attachment getAttachment () {
|
public Attachment getAttachment () {
|
||||||
if (attachmentName != null) {
|
|
||||||
attachment = bone.skeleton.getAttachment(data.index, attachmentName);
|
|
||||||
attachmentName = null;
|
|
||||||
}
|
|
||||||
return attachment;
|
return attachment;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user