UIRenderer.updateMaterial should not be marked as (#18320)

This commit is contained in:
James Chen
2025-02-12 10:46:05 +08:00
committed by GitHub
parent f5697c4c27
commit a02ff06c19
3 changed files with 8 additions and 5 deletions
+4 -1
View File
@@ -471,8 +471,11 @@ export class UIRenderer extends Renderer {
}
/**
* cocos-test-projects/assets/cases/rendertexture depends on this method, so it should not be marked as `@mangle` now.
* FIXME(cjh): `protected` is not equal to `@engineInternal + public`, because `protected` methods are also APIs exposed to developers,
* For example, developers could implement a class which extends `UIRenderer` and call this method.
* The mistake was merged in https://github.com/cocos/cocos-engine/pull/14572 , and it needs to be fixed in the future.
* @engineInternal
* @mangle
*/
public updateMaterial (): void {
if (this._customMaterial) {
+3 -3
View File
@@ -711,11 +711,11 @@ export class ArmatureDisplay extends UIRenderer {
/**
* @engineInternal
*/
public updateMaterial (): void {
let mat;
public override updateMaterial (): void {
let mat: Material;
if (this._customMaterial) mat = this._customMaterial;
else mat = this._updateBuiltinMaterial();
this.setSharedMaterial(mat as Material, 0);
this.setSharedMaterial(mat, 0);
this._cleanMaterialCache();
}
+1 -1
View File
@@ -1193,7 +1193,7 @@ export class Skeleton extends UIRenderer {
/**
* @engineInternal
*/
public updateMaterial (): void {
public override updateMaterial (): void {
let mat: Material;
if (this._customMaterial) mat = this._customMaterial;
else mat = this._updateBuiltinMaterial();