mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-25 22:23:42 +08:00
[libgdx] Added SkeletonData#findSliderAnimations.
This commit is contained in:
parent
2059c866ca
commit
409bf9d639
@ -140,6 +140,17 @@ public class SkeletonData {
|
|||||||
return animations;
|
return animations;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Collects animations used by {@link SliderData slider constraints}.
|
||||||
|
* <p>
|
||||||
|
* Slider animations are designed to be applied by slider constraints rather than on their own. Applications that have a user
|
||||||
|
* choose an animation may want to exclude them. */
|
||||||
|
public Array<Animation> findSliderAnimations (Array<Animation> animations) {
|
||||||
|
ConstraintData[] constraints = this.constraints.items;
|
||||||
|
for (int i = 0, n = this.constraints.size; i < n; i++)
|
||||||
|
if (constraints[i] instanceof SliderData data && data.animation != null) animations.add(data.animation);
|
||||||
|
return animations;
|
||||||
|
}
|
||||||
|
|
||||||
/** Finds an animation by comparing each animation's name. It is more efficient to cache the results of this method than to
|
/** Finds an animation by comparing each animation's name. It is more efficient to cache the results of this method than to
|
||||||
* call it multiple times. */
|
* call it multiple times. */
|
||||||
public @Null Animation findAnimation (String animationName) {
|
public @Null Animation findAnimation (String animationName) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user