mirror of
https://github.com/smallmain/cocos-enhance-kit.git
synced 2025-09-24 08:14:36 +00:00
[engine] 多纹理渲染、动态图集调整开关时主动刷新渲染状态
This commit is contained in:
@@ -586,15 +586,24 @@ let Label = 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();
|
||||
},
|
||||
},
|
||||
enableRetina: {
|
||||
type: RenderComponent.EnableType,
|
||||
default: RenderComponent.EnableType.GLOBAL,
|
||||
notify(oldValue) {
|
||||
if (this.enableRetina === oldValue) return;
|
||||
this.setVertsDirty();
|
||||
}
|
||||
},
|
||||
|
@@ -219,9 +219,21 @@ var MotionStreak = cc.Class({
|
||||
autoSwitchMaterial: {
|
||||
type: RenderComponent.EnableType,
|
||||
default: RenderComponent.EnableType.GLOBAL,
|
||||
notify(oldValue) {
|
||||
if (this.autoSwitchMaterial === oldValue) return;
|
||||
this.setVertsDirty();
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
setVertsDirty() {
|
||||
// 自动切换材质
|
||||
this._checkSwitchMaterial();
|
||||
|
||||
this._updateMaterial();
|
||||
this._super();
|
||||
},
|
||||
|
||||
__preload() {
|
||||
this._super();
|
||||
this._checkSwitchMaterial();
|
||||
|
@@ -391,10 +391,18 @@ var Sprite = 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();
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
|
Reference in New Issue
Block a user