Spine.SkeletonData.FindSlotIndex C# (CSharp) Method

FindSlotIndex() public method

public FindSlotIndex ( String slotName ) : int
slotName String
return int
		public int FindSlotIndex (String slotName) {
			if (slotName == null) throw new ArgumentNullException("slotName", "slotName cannot be null.");
			ExposedList<SlotData> slots = this.slots;
			for (int i = 0, n = slots.Count; i < n; i++)
				if (slots.Items[i].name == slotName) return i;
			return -1;
		}

Usage Example

Esempio n. 1
0
    public static Spine.Attachment GetAttachment(string attachmentPath, Spine.SkeletonData skeletonData)
    {
        var hierarchy = SpineAttachment.GetHierarchy(attachmentPath);

        if (hierarchy.name == "")
        {
            return(null);
        }

        return(skeletonData.FindSkin(hierarchy.skin).GetAttachment(skeletonData.FindSlotIndex(hierarchy.slot), hierarchy.name));
    }
All Usage Examples Of Spine.SkeletonData::FindSlotIndex