本文整理汇总了C#中SkeletonData.FindSlotIndex方法的典型用法代码示例。如果您正苦于以下问题:C# SkeletonData.FindSlotIndex方法的具体用法?C# SkeletonData.FindSlotIndex怎么用?C# SkeletonData.FindSlotIndex使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SkeletonData
的用法示例。
在下文中一共展示了SkeletonData.FindSlotIndex方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ReadSkeletonSkins
private void ReadSkeletonSkins(SkeletonData skeletonData, JObject data, float scale)
{
foreach (JProperty skin in data["skins"])
{
var skeletonSkin = new Skin(skin.Name);
foreach (JProperty slot in skin.Value)
{
int slotIndex = skeletonData.FindSlotIndex(slot.Name);
foreach (JProperty attachment in slot.Value)
{
Attachment skeletonAttachment = ReadSkeletonAttachment(attachment.Name, attachment.Value, scale);
if (attachment != null)
{
skeletonSkin.AddAttachment(slotIndex, attachment.Name, skeletonAttachment);
}
}
}
skeletonData.AddSkin(skeletonSkin);
if (skeletonSkin.Name.Equals("default"))
{
skeletonData.DefaultSkin = skeletonSkin;
}
}
}
示例2: ReadAnimationSlots
private List<ITimeline> ReadAnimationSlots(SkeletonData skeletonData, JObject data)
{
var timelines = new List<ITimeline>();
JToken dataSlots = data["slots"];
if (dataSlots != null)
{
foreach (JProperty jsonSlot in dataSlots)
{
int slotIndex = skeletonData.FindSlotIndex(jsonSlot.Name);
foreach (JProperty jsonTimelineType in jsonSlot.Value)
{
var jsonTimelineList = (JArray) jsonTimelineType.Value;
ITimeline timeline;
switch (jsonTimelineType.Name)
{
case TIMELINE_COLOR:
timeline = ReadAnimationColorTimeline(jsonTimelineList, slotIndex);
break;
case TIMELINE_ATTACHMENT:
timeline = ReadAnimationAttachmentTimeline(jsonTimelineList, slotIndex);
break;
default:
throw new Exception("Invalid timeline type for a slot: " + jsonTimelineType.Name + " (" + jsonSlot.Name + ")");
}
timelines.Add(timeline);
}
}
}
return timelines;
}