DESKTOP-5RP3AKU\Jisol 0014eff5e0 update
2023-11-05 03:26:09 +08:00

40 lines
999 B
TypeScript

import { _decorator, Component, director, instantiate, Node, Prefab } from 'cc';
import { app } from './App';
import { JNGame } from '../../extensions/ngame/assets/ngame/JNGame';
import { JNSyncAction } from '../../extensions/ngame/assets/ngame/sync/JNSyncAction';
import { TableGRole } from '../resources/config/ts/TableGRole';
const { ccclass, property } = _decorator;
@ccclass('Main')
export class Main extends Component {
@property(Prefab)
UIPrefab: Prefab = null;
@property(Prefab)
WorldPrefab: Prefab = null;
async onLoad(){
// 创建UI
director.getScene().addChild(instantiate(this.UIPrefab));
//加载 APP
await JNGame.Init(app,[
{path:"proto/GDemo"}
]);
console.log("TableGRole",TableGRole.getAllConfig())
//发生帧同步开始
app.socket.Send(JNSyncAction.NSyncFrameStart);
// 创建世界
// director.getScene().addChild(instantiate(this.WorldPrefab));
}
}