同步主站 Cocos 当前工程:关卡资源、运行脚本与打包工具。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-12 14:40:34 +08:00
parent ae75fce80b
commit fac515a669
5609 changed files with 27744634 additions and 5653 deletions

View File

@@ -28,12 +28,17 @@ export function syncEmbeddedCamerasOrtho(): void {
const halfH = getEmbeddedOrthoHalf();
const scene = director.getScene();
if (!scene) return;
for (const camName of ['UICamera', 'BgCamera', 'Main Camera']) {
for (const camName of ['UICamera', 'BgCamera']) {
const cam = find(camName, scene)?.getComponent(Camera);
if (cam) cam.orthoHeight = halfH;
}
const preserve = !!(globalThis as { __tfrhPreserveMapView?: boolean }).__tfrhPreserveMapView;
const mainNode = find('Main Camera', scene);
if (mainNode) mainNode.setPosition(0, 0, mainNode.position.z);
const mainCam = mainNode?.getComponent(Camera);
if (!preserve) {
if (mainCam) mainCam.orthoHeight = halfH;
if (mainNode) mainNode.setPosition(0, 0, mainNode.position.z);
}
(globalThis as { __tfrhSyncHudOrtho?: () => void }).__tfrhSyncHudOrtho = syncEmbeddedCamerasOrtho;
}