MCPcopy Create free account
hub / github.com/esengine/esengine / onDestroy

Method onDestroy

packages/sprite/src/SpriteComponent.ts:478–487  ·  view source on GitHub ↗

* 组件销毁时调用 * Called when component is destroyed

()

Source from the content-addressed store, hash-verified

476 * Called when component is destroyed
477 */
478 onDestroy(): void {
479 // 释放资产引用 / Release asset reference
480 if (this._assetReference) {
481 this._assetReference.release();
482 this._assetReference = undefined;
483 }
484 // 清理材质覆盖 / Clear material overrides
485 this.materialOverrides = {};
486 this._instanceMaterial = null;
487 }
488}

Callers

nothing calls this directly

Calls 1

releaseMethod · 0.45

Tested by

no test coverage detected