mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-21 08:02:39 +08:00
remove deprecated attributes: srcBlendFactor and dstBlendFactor#6461 (#9533)
Co-authored-by: zhangmingzhen <mingzhen.zhang@cocos.com>
This commit is contained in:
@@ -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',
|
||||
|
||||
@@ -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 渲染颜色,一般情况下会和贴图颜色相乘。
|
||||
|
||||
Reference in New Issue
Block a user