카드 손패 생성기: UUID 형식 교정 및 중앙정렬 일반화

This commit is contained in:
2026-06-06 01:50:25 +09:00
parent 3b2e6afbcf
commit 2c390660fb

View File

@@ -13,11 +13,11 @@ const cards = [
{ name: '강타', cost: '2', desc: '피해 10', tint: ATTACK },
];
const CARD_BG_RUID = 'cd0560c4fc7f3b14994b90a502f00a21'; // 기존 버튼 스프라이트 재사용
const CARD_W = 180, CARD_H = 250;
const CARD_W = 180, CARD_H = 250, CARD_SPACING = 200;
// ---- guid helper (deterministic, hex-safe) ----
const guid = (n) =>
`cad0${n.toString(16).padStart(2, '0')}-0000-4000-8000-${n.toString(16).padStart(12, '0')}`;
`cad000${n.toString(16).padStart(2, '0')}-0000-4000-8000-${n.toString(16).padStart(12, '0')}`;
// ---- component builders ----
function transform({ parentW, parentH, anchor, pivot, size, pos }) {
@@ -175,7 +175,7 @@ cards.forEach((c, i) => {
componentNames: 'MOD.Core.UITransformComponent,MOD.Core.SpriteGUIRendererComponent',
displayOrder: i,
components: [
transform({ parentW: 1020, parentH: 280, anchor: { x: 0.5, y: 0.5 }, pivot: { x: 0.5, y: 0.5 }, size: { x: CARD_W, y: CARD_H }, pos: { x: (-2 + i) * 200, y: 0 } }),
transform({ parentW: 1020, parentH: 280, anchor: { x: 0.5, y: 0.5 }, pivot: { x: 0.5, y: 0.5 }, size: { x: CARD_W, y: CARD_H }, pos: { x: (i - (cards.length - 1) / 2) * CARD_SPACING, y: 0 } }),
sprite({ dataId: CARD_BG_RUID, color: c.tint, type: 0, raycast: true }),
],
}));