From e19fe7ec9d5599da746d567609ca2d2bed37704b Mon Sep 17 00:00:00 2001 From: ChiaNing Date: Thu, 4 Aug 2022 10:30:20 +0800 Subject: [PATCH] fix batch bind (#12312) * fix batch bind * fix * remove * Update cocos/core/root.jsb.ts * Update cocos/core/root.jsb.ts * Update cocos/core/root.jsb.ts Co-authored-by: ChiaNing Co-authored-by: Santy-Wang --- cocos/2d/renderer/deprecated.ts | 9 ++++++++- cocos/core/renderer/core/render-scene.ts | 6 ++++++ cocos/core/root.jsb.ts | 12 ++++++++++++ 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/cocos/2d/renderer/deprecated.ts b/cocos/2d/renderer/deprecated.ts index 0978708739..fb79fba44a 100644 --- a/cocos/2d/renderer/deprecated.ts +++ b/cocos/2d/renderer/deprecated.ts @@ -35,7 +35,14 @@ export { VertexFormat as UIVertexFormat }; export { Batcher2D as UI }; -export { DrawBatch2D as UIDrawBatch }; +export { UIDrawBatch }; + +/** + * @deprecated since v3.6.0, this is an engine private interface that will be removed in the future. + * @internal + */ +class UIDrawBatch extends DrawBatch2D { +} markAsWarning(MeshBuffer.prototype, 'MeshBuffer', [ diff --git a/cocos/core/renderer/core/render-scene.ts b/cocos/core/renderer/core/render-scene.ts index 7d576c2179..f640c3245c 100644 --- a/cocos/core/renderer/core/render-scene.ts +++ b/cocos/core/renderer/core/render-scene.ts @@ -409,6 +409,8 @@ export class RenderScene { * @en Add a draw batch of 2d objects, all draw batches attached to the render scene will be submitted for rendering. * @zh 增加一个 2D 渲染批次,渲染场景上挂载的所有 2D 渲染批次都会被提交渲染。 * @param batch The draw batch. + * @internal + * @deprecated since v3.6.0, this is an engine private interface that will be removed in the future. */ public addBatch (batch: DrawBatch2D) { this._batches.push(batch); @@ -418,6 +420,8 @@ export class RenderScene { * @en Remove a draw batch of 2d objects, draw batch removed will no longer be submitted for rendering. * @zh 删除一个 2D 渲染批次,移除的 2D 渲染批次将不再被提交渲染。 * @param batch The draw batch. + * @internal + * @deprecated since v3.6.0, this is an engine private interface that will be removed in the future. */ public removeBatch (batch: DrawBatch2D) { for (let i = 0; i < this._batches.length; ++i) { @@ -431,6 +435,8 @@ export class RenderScene { /** * @en Remove all 2d draw batches. * @zh 删除所有 2D 渲染批次。 + * @internal + * @deprecated since v3.6.0, this is an engine private interface that will be removed in the future. */ public removeBatches () { this._batches.length = 0; diff --git a/cocos/core/root.jsb.ts b/cocos/core/root.jsb.ts index 9e1b3c32d5..9c16d122ac 100644 --- a/cocos/core/root.jsb.ts +++ b/cocos/core/root.jsb.ts @@ -209,3 +209,15 @@ rootProto.setRenderPipeline = function (pipeline) { this._createBatcher2D(); return ppl; } + +rootProto.addBatch = function (batch) { + console.error('The Draw Batch class is implemented differently in the native platform and does not support this interface.'); +} + +rootProto.removeBatch = function (batch) { + console.error('The Draw Batch class is implemented differently in the native platform and does not support this interface.'); +} + +rootProto.removeBatches = function () { + console.error('The Draw Batch class is implemented differently in the native platform and does not support this interface.'); +} \ No newline at end of file