remove deprecated attributes: srcBlendFactor and dstBlendFactor#6461 (#9533)

Co-authored-by: zhangmingzhen <mingzhen.zhang@cocos.com>
This commit is contained in:
Zhang mingzhen
2021-10-26 13:49:52 +08:00
committed by GitHub
parent d3bc40395c
commit c0ca3405b5
2 changed files with 9 additions and 69 deletions
+9 -11
View File
@@ -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',
-58
View File
@@ -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 渲染颜色,一般情况下会和贴图颜色相乘。