添加微信云开发环境
This commit is contained in:
@@ -7,20 +7,28 @@ import { UIConfigData } from './game/common/config/GameUIConfig';
|
||||
import { smc } from './game/common/SingletonModuleComp';
|
||||
import { Initialize } from './game/initialize/Initialize';
|
||||
import { EcsPositionSystem } from './game/common/ecs/position/EcsPositionSystem';
|
||||
import { WxCloudApi } from './game/wx_clound_client_api/WxCloudApi';
|
||||
// import { WxCloudApi } from './game/wx_clound_client_api/WxCloudApi';
|
||||
|
||||
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
// WxCloudApi.init("cloud1-6gknw0qk911036d8")
|
||||
@ccclass('Main')
|
||||
export class Main extends Root {
|
||||
|
||||
start() {
|
||||
if(this.isWxClient()){
|
||||
WxCloudApi.init("cloud1-6gknw0qk911036d8")
|
||||
}
|
||||
PhysicsSystem2D.instance.debugDrawFlags = EPhysics2DDrawFlags.Aabb |
|
||||
EPhysics2DDrawFlags.Pair
|
||||
// EPhysics2DDrawFlags.CenterOfMass |
|
||||
// EPhysics2DDrawFlags.Joint |
|
||||
// EPhysics2DDrawFlags.Shape;
|
||||
}
|
||||
private isWxClient(): boolean {
|
||||
// 检查是否存在微信API
|
||||
return typeof wx !== 'undefined' && typeof (wx as any).getSystemInfoSync === 'function';
|
||||
}
|
||||
protected async run() {
|
||||
smc.initialize = ecs.getEntity<Initialize>(Initialize);
|
||||
smc.vmAdd()
|
||||
|
||||
Reference in New Issue
Block a user