mirror of
https://github.com/smallmain/cocos-enhance-kit.git
synced 2025-10-09 09:35:23 +00:00
[engine] 多纹理渲染、动态图集调整开关时主动刷新渲染状态
This commit is contained in:
@@ -435,10 +435,18 @@ sp.Skeleton = cc.Class({
|
||||
autoSwitchMaterial: {
|
||||
type: RenderComponent.EnableType,
|
||||
default: RenderComponent.EnableType.GLOBAL,
|
||||
notify(oldValue) {
|
||||
if (this.autoSwitchMaterial === oldValue) return;
|
||||
this.setVertsDirty();
|
||||
},
|
||||
},
|
||||
allowDynamicAtlas: {
|
||||
type: RenderComponent.EnableType,
|
||||
default: RenderComponent.EnableType.GLOBAL,
|
||||
notify(oldValue) {
|
||||
if (this.allowDynamicAtlas === oldValue) return;
|
||||
this.setVertsDirty();
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -458,6 +466,13 @@ sp.Skeleton = cc.Class({
|
||||
this._dataDirty = true;
|
||||
},
|
||||
|
||||
setVertsDirty() {
|
||||
this._dataDirty = true;
|
||||
this.invalidAnimationCache();
|
||||
this._materialCache = {};
|
||||
this._super();
|
||||
},
|
||||
|
||||
// override base class _getDefaultMaterial to modify default material
|
||||
_getDefaultMaterial () {
|
||||
return cc.Material.getBuiltinMaterial('2d-spine');
|
||||
@@ -1010,8 +1025,7 @@ sp.Skeleton = cc.Class({
|
||||
attachment.setRegion(region);
|
||||
attachment.updateOffset();
|
||||
}
|
||||
this._dataDirty = true;
|
||||
this.invalidAnimationCache();
|
||||
this.setVertsDirty();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
Reference in New Issue
Block a user