diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/AnimationState.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/AnimationState.java index be1b96769..ce9e9035b 100644 --- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/AnimationState.java +++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/AnimationState.java @@ -1232,7 +1232,8 @@ public class AnimationState { start, interrupt, end, dispose, complete, event } - /** The interface to implement for receiving TrackEntry events. + /** The interface to implement for receiving TrackEntry events. It is always safe to call AnimationState methods when receiving + * events. *
* See TrackEntry {@link TrackEntry#setListener(AnimationStateListener)} and AnimationState
* {@link AnimationState#addListener(AnimationStateListener)}. */
@@ -1251,10 +1252,14 @@ public class AnimationState {
* References to the entry should not be kept after dispose is called, as it may be destroyed or reused. */
public void dispose (TrackEntry entry);
- /** Invoked every time this entry's animation completes a loop. */
+ /** Invoked every time this entry's animation completes a loop. Because this event is trigged in
+ * {@link AnimationState#apply(Skeleton)}, any animations set in response to the event won't be applied until the next time
+ * the AnimationState is applied. */
public void complete (TrackEntry entry);
- /** Invoked when this entry's animation triggers an event. */
+ /** Invoked when this entry's animation triggers an event. Because this event is trigged in
+ * {@link AnimationState#apply(Skeleton)}, any animations set in response to the event won't be applied until the next time
+ * the AnimationState is applied. */
public void event (TrackEntry entry, Event event);
}
diff --git a/spine-unity/Assets/Spine Examples/Scripts/MixAndMatch.cs b/spine-unity/Assets/Spine Examples/Scripts/MixAndMatch.cs
index eeebe0d4b..a905cb7da 100644
--- a/spine-unity/Assets/Spine Examples/Scripts/MixAndMatch.cs
+++ b/spine-unity/Assets/Spine Examples/Scripts/MixAndMatch.cs
@@ -111,11 +111,13 @@ namespace Spine.Unity.Examples {
// To prevent fallback from happening, make sure the key is not defined in the default skin.
// STEP 3: APPLY AND CLEAN UP.
- // Recommended: REPACK THE CUSTOM SKIN TO MINIMIZE DRAW CALLS
+ // Recommended, preferably at level-load-time: REPACK THE CUSTOM SKIN TO MINIMIZE DRAW CALLS
+ // IMPORTANT NOTE: the GetRepackedSkin() operation is expensive - if multiple characters
+ // need to call it every few seconds the overhead will outweigh the draw call benefits.
+ //
// Repacking requires that you set all source textures/sprites/atlases to be Read/Write enabled in the inspector.
// Combine all the attachment sources into one skin. Usually this means the default skin and the custom skin.
// call Skin.GetRepackedSkin to get a cloned skin with cloned attachments that all use one texture.
- // Under the hood, this relies on
if (repack) {
var repackedSkin = new Skin("repacked skin");
repackedSkin.AddAttachments(skeleton.Data.DefaultSkin); // Include the "default" skin. (everything outside of skin placeholders)
diff --git a/spine-unity/Assets/Spine/Runtime/spine-unity/Modules/AttachmentTools/AttachmentTools.cs b/spine-unity/Assets/Spine/Runtime/spine-unity/Modules/AttachmentTools/AttachmentTools.cs
index 766cec08b..918dda9e8 100644
--- a/spine-unity/Assets/Spine/Runtime/spine-unity/Modules/AttachmentTools/AttachmentTools.cs
+++ b/spine-unity/Assets/Spine/Runtime/spine-unity/Modules/AttachmentTools/AttachmentTools.cs
@@ -482,14 +482,14 @@ namespace Spine.Unity.Modules.AttachmentTools {
///