import { _decorator, Component, Node, v2, Vec2 } from 'cc'; import { aa } from '../../scripts/aa'; import { UI_Notify } from '../ui/ui_notify/UI_Notify'; // import { UI_Notify } from '../ui_notify/UI_Notify'; export const GameConfing = { // 容器大小 capacity: 4, Hcapacity: 12, waterHight: 180, // 格子长宽 containerWith: 82 + 10, containerHightMin: 220, containerHightMax: 280 } export const SaveComponent = { getGameData: () => chsdk.get_gid() + "gameData", } export const Direction = Object.freeze({ UP: v2(0, 1), DOWN: v2(0, -1), LEFT: v2(-1, 0), RIGHT: v2(1, 0) }) export function Notify(msg: string): void { let ui = aa.uIMgr.getUI(UI_Notify) as UI_Notify; ui?.newNotify(msg); } /** * * @param time 单位秒 */ export function sleep(time: number): Promise { return new Promise((resolve)=>{ setTimeout(()=>{ resolve() },time*1000) }) }