mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-19 14:52:40 +08:00
fix both null condition (#260)
* fix both null condition * simplify check condition * simplify check condition
This commit is contained in:
@@ -850,14 +850,12 @@ export class Skeleton extends UIRenderer {
|
||||
warnID(16410);
|
||||
}
|
||||
const skeletonInfo = this._skeletonCache!.getSkeletonInfo(this._skeletonData!);
|
||||
if (this._skeletonInfo !== skeletonInfo) {
|
||||
if (this._skeletonInfo !== skeletonInfo || (!this._skeletonInfo && !skeletonInfo)) {
|
||||
this._destroySkeletonInfo(this._skeletonCache);
|
||||
if (!skeletonInfo && this._cacheMode === SpineAnimationCacheMode.PRIVATE_CACHE) {
|
||||
this._animCache = this._skeletonCache!.initAnimationCache(this.skeletonData!.uuid, this._skeletonData!, this._animationName);
|
||||
}
|
||||
this._skeletonInfo = this._skeletonCache!.createSkeletonInfo(this._skeletonData!);
|
||||
}
|
||||
if (this._skeletonInfo) {
|
||||
this._skeleton = this._skeletonInfo.skeleton!;
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user