mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-21 08:02:39 +08:00
sprite event off & fix renderData hash bug (#10012)
* event off * fix renderData hash bug
This commit is contained in:
@@ -525,6 +525,12 @@ export class Sprite extends Renderable2D {
|
||||
}
|
||||
}
|
||||
|
||||
public onDisable () {
|
||||
if (this._spriteFrame && this._type === SpriteType.SLICED) {
|
||||
this._spriteFrame.off(SpriteFrame.EVENT_UV_UPDATED, this._updateUVs, this);
|
||||
}
|
||||
}
|
||||
|
||||
public onDestroy () {
|
||||
this.destroyRenderData();
|
||||
if (EDITOR) {
|
||||
|
||||
@@ -220,9 +220,7 @@ export class RenderData extends BaseRenderData {
|
||||
this.hashDirty = true;
|
||||
}
|
||||
if (this.hashDirty) {
|
||||
const hashString = ` ${this.layer} ${this.blendHash} ${this.textureHash}`;
|
||||
this.dataHash = murmurhash2_32_gc(hashString, 666);
|
||||
this.hashDirty = false;
|
||||
this.updateHash();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user