mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-21 09:46:02 +08:00
[unity] Remove primary Skin.RemoveAttachment extension.
This commit is contained in:
parent
495321e6af
commit
235391d81e
@ -824,17 +824,11 @@ namespace Spine.Unity.Modules.AttachmentTools {
|
|||||||
skin.AddAttachment(slotIndex, keyName, attachment);
|
skin.AddAttachment(slotIndex, keyName, attachment);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>Removes the attachment. Returns true if the element is successfully found and removed; otherwise, false.</summary>
|
public static void RemoveAttachment (this Skin skin, string slotName, string keyName, SkeletonData skeletonData) {
|
||||||
public static bool RemoveAttachment (this Skin skin, string slotName, string keyName, Skeleton skeleton) {
|
int slotIndex = skeletonData.FindSlotIndex(slotName);
|
||||||
int slotIndex = skeleton.FindSlotIndex(slotName);
|
if (skeletonData == null) throw new System.ArgumentNullException("skeletonData", "skeletonData cannot be null.");
|
||||||
if (skeleton == null) throw new System.ArgumentNullException("skeleton", "skeleton cannot be null.");
|
|
||||||
if (slotIndex == -1) throw new System.ArgumentException(string.Format("Slot '{0}' does not exist in skeleton.", slotName), "slotName");
|
if (slotIndex == -1) throw new System.ArgumentException(string.Format("Slot '{0}' does not exist in skeleton.", slotName), "slotName");
|
||||||
return skin.RemoveAttachment(slotIndex, keyName);
|
skin.RemoveAttachment(slotIndex, keyName);
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>Removes the attachment. Returns true if the element is successfully found and removed; otherwise, false.</summary>
|
|
||||||
public static bool RemoveAttachment (this Skin skin, int slotIndex, string keyName) {
|
|
||||||
return skin.Attachments.Remove(new Skin.AttachmentKeyTuple(slotIndex, keyName));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void Clear (this Skin skin) {
|
public static void Clear (this Skin skin) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user