cocos-engine
cocos-engine copied to clipboard
Optimize code size for tiled-layer.ts
Re: #
Changelog
Continuous Integration
This pull request:
- [ ] needs automatic test cases check.
Manual trigger with
@cocos-robot run test casesafterward. - [ ] does not change any runtime related code or build configuration
If any reviewer thinks the CI checks are needed, please uncheck this option, then close and reopen the issue.
Compatibility Check
This pull request:
- [ ] changes public API, and have ensured backward compatibility with deprecated features.
- [ ] affects platform compatibility, e.g. system version, browser version, platform sdk version, platform toolchain, language version, hardware compatibility etc.
- [ ] affects file structure of the build package or build configuration which requires user project upgrade.
- [ ] introduces breaking changes, please list all changes, affected features and the scope of violation.
Code Size Check Report
| Wechat (WASM) | Before | After | Diff |
|---|---|---|---|
| 2D Empty (legacy pipeline) | 1005779 bytes | 1005779 bytes | β 0 bytes |
| 2D All (legacy pipeline) | 2669492 bytes | 2668281 bytes | π -1211 bytes |
| 2D All (new pipeline) | 2757999 bytes | 2756788 bytes | π -1211 bytes |
| (2D + 3D) All | 10013883 bytes | 10012667 bytes | π -1216 bytes |
| Web (WASM + ASMJS) | Before | After | Diff |
|---|---|---|---|
| (2D + 3D) All | 16829448 bytes | 16828232 bytes | π -1216 bytes |
Interface Check Report
! WARNING this pull request has changed these public interfaces:
@@ -55099,11 +55099,11 @@
protected _diffX1?: number;
protected _diffY1?: number;
protected _useAutomaticVertexZ?: boolean;
protected _vertexZvalue?: number;
- protected _offset?: math.Vec2;
+ protected _offset: math.Vec2;
protected _tiledDataArray: __private._cocos_tiledmap_tiled_layer__TiledDataArray;
- protected _cameraNode?: Node;
+ protected _cameraNode: Node | null;
get tiledDataArray(): __private._cocos_tiledmap_tiled_layer__TiledDataArray;
get leftDownToCenterX(): number;
get leftDownToCenterY(): number;
constructor();
@@ -55433,9 +55433,8 @@
*/
_tiledDataArrayIdx: number;
protected _render(ui: __private._cocos_2d_renderer_i_batcher__IBatcher): void;
protected createRenderEntity(): __private._cocos_2d_renderer_render_entity__RenderEntity;
- prepareDrawData(): void;
}
/**
* @en Renders the TMX object group.
* @zh ζΈ²ζ tmx object groupγ