1. sayfa (Toplam 1 sayfa)
Maltakreuz
In some my animations i need to change draw order by keyframes. So i need to reset draw order for another animations, on transition. How can i achieve that? I have found way to reset the whole skeleton here (http://esotericsoftware.com/spine-using-runtimes/#Animation-changes) by calling setToSetupPose, setBonesToSetupPose, or setSlotsToSetupPose. But it resets too much, i just need to reset draw order. Is there any better solution, but adding draw order keyframe in begin of all animations?
6.5 years ago
-
Maltakreuz - Mesajlar: 49
Pharan
Just open
And add the method that only resets draw order:
I'll run the idea by Nate when he gets back.
Skeleton.cs
And add the method that only resets draw order:
public void SetDrawOrderToSetupPose () {
ExposedList<Slot> slots = this.slots;
drawOrder.Clear();
for (int i = 0, n = slots.Count; i < n; i++)
drawOrder.Add(slots.Items[i]);
}
It's basically SetSlotsToSetupPose but without the slots resetting.ExposedList<Slot> slots = this.slots;
drawOrder.Clear();
for (int i = 0, n = slots.Count; i < n; i++)
drawOrder.Add(slots.Items[i]);
}
I'll run the idea by Nate when he gets back.
Spine-Unity Docs Repo, and check out the Unofficial Spine Users Tumblr.
6.5 years ago
-
Pharan - Mesajlar: 5366
Maltakreuz
[quote="Pharan"][/quote]Oh, that' great. Changing draw order for overlapping things is a really common task, i suppose it could be usefull not only for me. Thank you.
-- 21 Mar 2016, 13:13 --
udp: I find extension method is more safe on the place, because I update spine-libs pretty oft.
-- 21 Mar 2016, 13:13 --
udp: I find extension method is more safe on the place, because I update spine-libs pretty oft.
public static void SetDrawOrderToSetupPose(this Skeleton skeleton) {
ExposedList<Slot> slots = skeleton.slots;
skeleton.drawOrder.Clear();
for (int i = 0, n = slots.Count; i < n; i++) {
skeleton.drawOrder.Add(slots.Items[i]);
}
}
ExposedList<Slot> slots = skeleton.slots;
skeleton.drawOrder.Clear();
for (int i = 0, n = slots.Count; i < n; i++) {
skeleton.drawOrder.Add(slots.Items[i]);
}
}
6.5 years ago
-
Maltakreuz - Mesajlar: 49
Mark topic unread
• 1. sayfa (Toplam 1 sayfa)
Dön Unity
- Tüm zamanlar UTC