Complete Cocos Creator port with level bundles, themes, and tooling.
Adds level prefabs, theme assets, audio, extensions, and deployment scripts for the Unity WebGL migration. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
23
assets/scripts/visual/TilePivots.ts
Normal file
23
assets/scripts/visual/TilePivots.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import { getThemeTilePivot } from './TileDisplayMeta';
|
||||
|
||||
/** 与 Unity Texture/*.png.meta 中 spritePivot 一致(无主题数据时的回退) */
|
||||
export interface TilePivot {
|
||||
x: number;
|
||||
y: number;
|
||||
}
|
||||
|
||||
const DEFAULT_PIVOTS: Record<string, TilePivot> = {
|
||||
Baseblock: { x: 0.5, y: 0.92 },
|
||||
JumpBlock: { x: 0.5, y: 0.77 },
|
||||
WallBlock: { x: 0.5, y: 0.67 },
|
||||
kuai11: { x: 0.5, y: 1.01 },
|
||||
Decor23: { x: 0.5, y: 0.92 },
|
||||
'素材切图-23': { x: 0.5, y: 0.92 },
|
||||
'素材切图2-23': { x: 0.5, y: 0.92 },
|
||||
'小游戏素材红色_03': { x: 0.5, y: 0.92 },
|
||||
};
|
||||
|
||||
export function getTilePivot(tileName: string, theme?: string): TilePivot {
|
||||
const fallback = DEFAULT_PIVOTS[tileName] ?? { x: 0.5, y: 0.92 };
|
||||
return getThemeTilePivot(theme, tileName, fallback);
|
||||
}
|
||||
Reference in New Issue
Block a user