From ec268a50e0b6ea405c79943087f306b0c1ee1077 Mon Sep 17 00:00:00 2001 From: pharan Date: Thu, 24 Mar 2016 03:46:48 +0800 Subject: [PATCH] Minor SkeletonExtensions update. --- .../Assets/spine-unity/SkeletonExtensions.cs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/spine-unity/Assets/spine-unity/SkeletonExtensions.cs b/spine-unity/Assets/spine-unity/SkeletonExtensions.cs index 525edbff9..de4fbd08a 100644 --- a/spine-unity/Assets/spine-unity/SkeletonExtensions.cs +++ b/spine-unity/Assets/spine-unity/SkeletonExtensions.cs @@ -1,5 +1,3 @@ - - /***************************************************************************** * Spine Extensions by Mitch Thompson and John Dy * Full irrevocable rights and permissions granted to Esoteric Software @@ -7,7 +5,6 @@ using UnityEngine; using Spine; -using Spine.Unity; namespace Spine.Unity { public static class SkeletonExtensions { @@ -125,6 +122,16 @@ namespace Spine.Unity { if (animation == null) return; animation.Apply(skeleton, 0, time, loop, null); } + + /// Resets the DrawOrder to the Setup Pose's draw order + public static void SetDrawOrderToSetupPose (this Skeleton skeleton) { + var slotsItems = skeleton.slots.Items; + var drawOrder = skeleton.drawOrder; + + drawOrder.Clear(false); + for (int i = 0, n = skeleton.slots.Count; i < n; i++) + drawOrder.Add(slotsItems[i]); + } #endregion } }