本文整理汇总了C#中Spine.Skeleton.SetDrawOrderToSetupPose方法的典型用法代码示例。如果您正苦于以下问题:C# Skeleton.SetDrawOrderToSetupPose方法的具体用法?C# Skeleton.SetDrawOrderToSetupPose怎么用?C# Skeleton.SetDrawOrderToSetupPose使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Spine.Skeleton
的用法示例。
在下文中一共展示了Skeleton.SetDrawOrderToSetupPose方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetToSetupPose
public static void SetToSetupPose (this Timeline timeline, Skeleton skeleton) {
if (timeline != null) {
// sorted according to assumed likelihood here
// Bone
if (timeline is RotateTimeline) {
var bone = skeleton.bones.Items[((RotateTimeline)timeline).boneIndex];
bone.rotation = bone.data.rotation;
} else if (timeline is TranslateTimeline) {
var bone = skeleton.bones.Items[((TranslateTimeline)timeline).boneIndex];
bone.x = bone.data.x;
bone.y = bone.data.y;
} else if (timeline is ScaleTimeline) {
var bone = skeleton.bones.Items[((ScaleTimeline)timeline).boneIndex];
bone.scaleX = bone.data.scaleX;
bone.scaleY = bone.data.scaleY;
// Attachment
} else if (timeline is DeformTimeline) {
var slot = skeleton.slots.Items[((DeformTimeline)timeline).slotIndex];
slot.attachmentVertices.Clear(false);
// Slot
} else if (timeline is AttachmentTimeline) {
skeleton.SetSlotAttachmentToSetupPose(((AttachmentTimeline)timeline).slotIndex);
} else if (timeline is ColorTimeline) {
skeleton.slots.Items[((ColorTimeline)timeline).slotIndex].SetColorToSetupPose();
// Constraint
} else if (timeline is IkConstraintTimeline) {
var ikTimeline = (IkConstraintTimeline)timeline;
var ik = skeleton.ikConstraints.Items[ikTimeline.ikConstraintIndex];
var data = ik.data;
ik.bendDirection = data.bendDirection;
ik.mix = data.mix;
// Skeleton
} else if (timeline is DrawOrderTimeline) {
skeleton.SetDrawOrderToSetupPose();
}
}
}
示例2: SetToSetupPose
// For each timeline type.
// Timelines know how to apply themselves based on skeleton data; They should know how to reset the skeleton back to skeleton data?
public static void SetToSetupPose (this Timeline timeline, Skeleton skeleton) {
if (timeline != null) {
// sorted according to assumed likelihood here
// Bone stuff
if (timeline is RotateTimeline) {
var bone = skeleton.bones.Items[((RotateTimeline)timeline).boneIndex];
bone.rotation = bone.data.rotation;
} else if (timeline is TranslateTimeline) {
var bone = skeleton.bones.Items[((TranslateTimeline)timeline).boneIndex];
bone.x = bone.data.x;
bone.y = bone.data.y;
} else if (timeline is ScaleTimeline) {
var bone = skeleton.bones.Items[((ScaleTimeline)timeline).boneIndex];
bone.scaleX = bone.data.scaleX;
bone.scaleY = bone.data.scaleY;
// Attachment stuff. How do you reset FFD?
} else if (timeline is FFDTimeline) {
var slot = skeleton.slots.Items[((FFDTimeline)timeline).slotIndex];
slot.attachmentVerticesCount = 0; // This causes (Weighted)MeshAttachment.ComputeWorldVertices to use its internal(stateless) vertex array.
//slot.attachmentTime = bone.skeleton.time; // Currently inconsequential. (Spine 3.1)
// Slot stuff. This is heavy to do every frame. Maybe not do it?
} else if (timeline is AttachmentTimeline) {
skeleton.SetSlotAttachmentToSetupPose(((AttachmentTimeline)timeline).slotIndex);
} else if (timeline is ColorTimeline) {
skeleton.slots.Items[((ColorTimeline)timeline).slotIndex].SetColorToSetupPose();
// Constraint Stuff
} else if (timeline is IkConstraintTimeline) {
var ikTimeline = (IkConstraintTimeline)timeline;
var ik = skeleton.ikConstraints.Items[ikTimeline.ikConstraintIndex];
var data = ik.data;
ik.bendDirection = data.bendDirection;
ik.mix = data.mix;
// Skeleton stuff. Skeleton.SetDrawOrderToSetupPose. This is heavy to do every frame. Maybe not do it?
} else if (timeline is DrawOrderTimeline) {
skeleton.SetDrawOrderToSetupPose();
}
}
}