| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- 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<void> {
- return new Promise<void>((resolve)=>{
- setTimeout(()=>{
- resolve()
- },time*1000)
- })
- }
|