From c0ca3405b511893e258d4e06d30df198cddc1ec9 Mon Sep 17 00:00:00 2001 From: Zhang mingzhen <32831993+Zhmz@users.noreply.github.com> Date: Tue, 26 Oct 2021 13:49:52 +0800 Subject: [PATCH] remove deprecated attributes: srcBlendFactor and dstBlendFactor#6461 (#9533) Co-authored-by: zhangmingzhen --- cocos/2d/framework/deprecated.ts | 20 +++++----- cocos/2d/framework/renderable-2d.ts | 58 ----------------------------- 2 files changed, 9 insertions(+), 69 deletions(-) diff --git a/cocos/2d/framework/deprecated.ts b/cocos/2d/framework/deprecated.ts index f4a82f837c..bb8b8bc4e8 100644 --- a/cocos/2d/framework/deprecated.ts +++ b/cocos/2d/framework/deprecated.ts @@ -47,6 +47,15 @@ removeProperty(UIComponent.prototype, 'UIComponent', [ }, ]); +removeProperty(Renderable2D.prototype, 'Renderable2D.prototype', [ + { + name: 'srcBlendFactor', + }, + { + name: 'dstBlendFactor', + }, +]); + replaceProperty(Canvas.prototype, 'Canvas.prototype', [ { name: 'camera', @@ -114,17 +123,6 @@ replaceProperty(Canvas.prototype, 'Canvas.prototype', [ }, ]); -markAsWarning(Renderable2D.prototype, 'Renderable2D.prototype', [ - { - name: 'srcBlendFactor', - suggest: 'Please use a custom material to specify blending options instead.', - }, - { - name: 'dstBlendFactor', - suggest: 'Please use a custom material to specify blending options instead.', - }, -]); - markAsWarning(UITransform.prototype, 'UITransform.prototype', [ { name: 'priority', diff --git a/cocos/2d/framework/renderable-2d.ts b/cocos/2d/framework/renderable-2d.ts index 942247949d..85af22f836 100644 --- a/cocos/2d/framework/renderable-2d.ts +++ b/cocos/2d/framework/renderable-2d.ts @@ -177,64 +177,6 @@ export class Renderable2D extends RenderableComponent { this._updateBlendFunc(); } - /** - * @en Specifies the source blend mode, it will clone a new material object. - * @zh 指定源的混合模式,这会克隆一个新的材质对象,注意这带来的性能和内存损耗。 - * @example - * ```ts - * sprite.srcBlendFactor = BlendFactor.ONE; - * ``` - * @deprecated - */ - get srcBlendFactor () { - if (!EDITOR && this._customMaterial) { - warnID(12001); - } - return this._srcBlendFactor; - } - - set srcBlendFactor (value: BlendFactor) { - if (this._customMaterial) { - warnID(12001); - return; - } - if (this._srcBlendFactor === value) { - return; - } - - this._srcBlendFactor = value; - this._updateBlendFunc(); - } - - /** - * @en Specifies the destination blend mode. - * @zh 指定目标的混合模式,这会克隆一个新的材质对象,注意这带来的性能和内存损耗。 - * @example - * ```ts - * sprite.dstBlendFactor = BlendFactor.ONE_MINUS_SRC_ALPHA; - * ``` - * @deprecated - */ - get dstBlendFactor () { - if (!EDITOR && this._customMaterial) { - warnID(12001); - } - return this._dstBlendFactor; - } - - set dstBlendFactor (value: BlendFactor) { - if (this._customMaterial) { - warnID(12001); - return; - } - if (this._dstBlendFactor === value) { - return; - } - - this._dstBlendFactor = value; - this._updateBlendFunc(); - } - /** * @en Main color for rendering, it normally multiplies with texture color. * @zh 渲染颜色,一般情况下会和贴图颜色相乘。