[engine] 修复 v1.2.0 版本合并代码引入 spine cache 模式下的错误(#8)

This commit is contained in:
SmallMain 2024-09-04 17:11:00 +08:00
parent 2a97bc3a57
commit 7f956acda7
No known key found for this signature in database
2 changed files with 3 additions and 3 deletions

View File

@ -480,7 +480,7 @@ sp.Skeleton = cc.Class({
// override base class _updateMaterial to set define value and clear material cache // override base class _updateMaterial to set define value and clear material cache
_updateMaterial () { _updateMaterial () {
let useTint = this.useTint || (this.isAnimationCached() && !CC_NATIVERENDERER); let useTint = this.useTint;
let baseMaterial = this.getMaterial(0); let baseMaterial = this.getMaterial(0);
if (baseMaterial) { if (baseMaterial) {
const isMultiSupport = baseMaterial.material.isMultiSupport(); const isMultiSupport = baseMaterial.material.isMultiSupport();
@ -535,7 +535,7 @@ sp.Skeleton = cc.Class({
_updateUseTint () { _updateUseTint () {
let baseMaterial = this.getMaterial(0); let baseMaterial = this.getMaterial(0);
if (baseMaterial) { if (baseMaterial) {
let useTint = this.useTint || (this.isAnimationCached() && !CC_NATIVERENDERER); let useTint = this.useTint;
if (baseMaterial.material.isMultiSupport()) { if (baseMaterial.material.isMultiSupport()) {
this._defineMaterialTint(baseMaterial, useTint); this._defineMaterialTint(baseMaterial, useTint);
} else { } else {

View File

@ -925,7 +925,7 @@ export default class SpineAssembler extends Assembler {
if (!baseMaterial) return; if (!baseMaterial) return;
_useMulti = baseMaterial.material.isMultiSupport(); _useMulti = baseMaterial.material.isMultiSupport();
_useTint = comp.useTint || comp.isAnimationCached(); _useTint = comp.useTint;
_vertexFormat = _useTint ? (_useMulti ? VFTwoColorTexId : VFTwoColor) : (_useMulti ? VFOneColorTexId : (comp.isAnimationCached() ? VFTwoColor : VFOneColor)); _vertexFormat = _useTint ? (_useMulti ? VFTwoColorTexId : VFTwoColor) : (_useMulti ? VFOneColorTexId : (comp.isAnimationCached() ? VFTwoColor : VFOneColor));
// x y u v color1 color2 or x y u v color // x y u v color1 color2 or x y u v color
_perVertexSize = _useTint ? (_useMulti ? 7 : 6) : (_useMulti ? 6 : (comp.isAnimationCached() ? 6 : 5)); _perVertexSize = _useTint ? (_useMulti ? 7 : 6) : (_useMulti ? 6 : (comp.isAnimationCached() ? 6 : 5));