Support spine version 4.2 (#18325)

This commit is contained in:
bofeng-song
2025-02-26 18:56:42 +08:00
committed by GitHub
parent cc31bcc64e
commit b2316fc02f
365 changed files with 33060 additions and 3451 deletions
+10 -3
View File
@@ -174,8 +174,7 @@ const cacheManager = require('./jsb-cache-manager');
this._target = target;
this._callback = callback;
// eslint-disable-next-line no-undef
const AnimationEventType = legacyCC.internal.SpineAnimationEventType;
const AnimationEventType = cc.internal.SpineAnimationEventType;
this.setStartListener(function (trackEntry) {
if (this._target && this._callback) {
@@ -405,6 +404,10 @@ const cacheManager = require('./jsb-cache-manager');
};
skeleton.setVertexEffectDelegate = function (effectDelegate) {
if (cc.internal.SPINE_VERSION === '4.2') {
cc.warn('setVertexEffectDelegate is deprecated since spine 4.2');
return;
}
if (this._nativeSkeleton && !this.isAnimationCached()) {
this._nativeSkeleton.setVertexEffectDelegate(effectDelegate);
}
@@ -696,7 +699,11 @@ const cacheManager = require('./jsb-cache-manager');
this._preCacheMode = this._cacheMode;
this.defaultSkin && this._nativeSkeleton.setSkin(this.defaultSkin);
this.animation = this.defaultAnimation;
if (this.defaultAnimation) {
this.animation = this.defaultAnimation;
} else if (this._animationName) {
this.animation = this._animationName;
}
} else if (this._nativeSkeleton) {
this._nativeSkeleton.stopSchedule();
this._nativeSkeleton._comp = null;