2023-10-23 18:56:01 +08:00
|
|
|
import { _decorator, Component, director, instantiate, Node, Prefab } from 'cc';
|
|
|
|
import { app } from './App';
|
2023-11-09 04:22:04 +08:00
|
|
|
import { Env, JNGame } from '../../extensions/ngame/assets/ngame/JNGame';
|
2023-10-23 18:56:01 +08:00
|
|
|
import { JNSyncAction } from '../../extensions/ngame/assets/ngame/sync/JNSyncAction';
|
2023-11-17 18:29:39 +08:00
|
|
|
import { GOnHookPets } from '../../extensions/ngame/assets/ngame/message/proto';
|
2023-11-22 03:51:37 +08:00
|
|
|
import { EnvCurrent } from './Env';
|
2023-10-23 18:56:01 +08:00
|
|
|
const { ccclass, property } = _decorator;
|
|
|
|
|
2023-11-22 03:51:37 +08:00
|
|
|
window['GUser'] = "100000";
|
|
|
|
window['GPassworld'] = "123456";
|
|
|
|
|
2023-10-23 18:56:01 +08:00
|
|
|
@ccclass('Main')
|
|
|
|
export class Main extends Component {
|
|
|
|
|
|
|
|
@property(Prefab)
|
|
|
|
UIPrefab: Prefab = null;
|
|
|
|
|
|
|
|
@property(Prefab)
|
|
|
|
WorldPrefab: Prefab = null;
|
|
|
|
|
|
|
|
async onLoad(){
|
|
|
|
|
2023-11-22 03:51:37 +08:00
|
|
|
console.log("EnvCurrent",EnvCurrent)
|
|
|
|
|
2023-11-05 03:26:09 +08:00
|
|
|
// 创建UI
|
|
|
|
director.getScene().addChild(instantiate(this.UIPrefab));
|
|
|
|
|
2023-10-23 18:56:01 +08:00
|
|
|
//加载 APP
|
2023-11-13 02:37:29 +08:00
|
|
|
await JNGame.Init(app);
|
2023-10-23 18:56:01 +08:00
|
|
|
|
2023-11-22 03:51:37 +08:00
|
|
|
// //发生帧同步开始
|
|
|
|
// app.socket.Send(JNSyncAction.NSyncFrameStart);
|
2023-10-23 18:56:01 +08:00
|
|
|
|
2023-11-15 02:32:00 +08:00
|
|
|
// 创建世界
|
|
|
|
director.getScene().addChild(instantiate(this.WorldPrefab));
|
2023-10-23 18:56:01 +08:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|