Adds level prefabs, theme assets, audio, extensions, and deployment scripts for the Unity WebGL migration. Co-authored-by: Cursor <cursoragent@cursor.com>
34 lines
1.3 KiB
TypeScript
34 lines
1.3 KiB
TypeScript
/** 等距网格常量(独立模块,避免 AppBootstrap ↔ GridCoords 循环依赖) */
|
||
export const CELL_PIXEL = 100;
|
||
|
||
/** Unity Player.prefab moveSpeed=1.2、Vehicle.prefab=1,按格子像素等比换算 */
|
||
export const UNITY_PLAYER_MOVE_SPEED = 1.2;
|
||
export const UNITY_VEHICLE_MOVE_SPEED = 1;
|
||
/** Unity PlayerController 跳上 JumpBlock 时 targetPosition.y += 0.15 */
|
||
export const UNITY_JUMP_ARC_OFFSET = 0.15;
|
||
|
||
/** 移动中拾取:步进进度达到该比例且进入道具格后才消失(0–1) */
|
||
export const PROP_COLLECT_MOVE_PROGRESS = 0.62;
|
||
|
||
/** 移动中拾取:角色与道具世界距离上限(相对 CELL_PIXEL) */
|
||
export const PROP_COLLECT_TOUCH_RADIUS = 0.42;
|
||
|
||
export function scaledJumpArcOffset(): number {
|
||
return UNITY_JUMP_ARC_OFFSET * CELL_PIXEL;
|
||
}
|
||
|
||
export function scaledMoveSpeed(unitySpeed: number): number {
|
||
return unitySpeed * CELL_PIXEL;
|
||
}
|
||
|
||
/** 与 Unity Web 模板 canvas 一致(Template/index.html 960×600) */
|
||
export const DESIGN_WIDTH = 960;
|
||
export const DESIGN_HEIGHT = 600;
|
||
|
||
/** Unity Main Camera orthographicSize=5 → 半高 500px(世界尺度,不随设计分辨率变) */
|
||
export const CAMERA_ORTHO_HALF = 500;
|
||
|
||
export function getHalfCellSize(): { halfW: number; halfH: number } {
|
||
return { halfW: CELL_PIXEL * 0.5, halfH: CELL_PIXEL * 0.25 };
|
||
}
|