|
@@ -10,47 +10,53 @@ import BufferManager from '../../engines/buffers/BufferManager';
|
|
|
import { PlatformManager } from '../../Platform/PlatformManager';
|
|
|
import { WeChatPlatform } from '../../Platform/WeChat/WeChatPlatform';
|
|
|
import { branchIdType } from '../../Platform/WeChat/branchIdType';
|
|
|
+import { LiangLiangSDK } from '../../libs/liangliangSDK';
|
|
|
const { ccclass, property } = _decorator;
|
|
|
|
|
|
@ccclass('PrepareScene')
|
|
|
export class PrepareScene extends Component {
|
|
|
|
|
|
- public static Inited:boolean=false;
|
|
|
-
|
|
|
+ public static Inited: boolean = false;
|
|
|
+
|
|
|
@property({
|
|
|
- type:Prefab
|
|
|
+ type: Prefab
|
|
|
})
|
|
|
- TextNoticeView:Prefab=null;
|
|
|
+ TextNoticeView: Prefab = null;
|
|
|
|
|
|
- start () {
|
|
|
+ start() {
|
|
|
console.log("进入Prepare场景");
|
|
|
- if(PrepareScene.Inited==false){
|
|
|
- PrepareScene.Inited=true;
|
|
|
- let canvas:Node=find("Canvas");
|
|
|
+ if (PrepareScene.Inited == false) {
|
|
|
+ PrepareScene.Inited = true;
|
|
|
+ let canvas: Node = find("Canvas");
|
|
|
//UI全局节点
|
|
|
- let uiRoot:Node=canvas.getChildByName("UIRoot");
|
|
|
- let layerRoot:Node=uiRoot.getChildByName("LayerRoot");
|
|
|
- let NoticeLayer:Node=uiRoot.getChildByName("NoticeLayer");
|
|
|
+ let uiRoot: Node = canvas.getChildByName("UIRoot");
|
|
|
+ let layerRoot: Node = uiRoot.getChildByName("LayerRoot");
|
|
|
+ let NoticeLayer: Node = uiRoot.getChildByName("NoticeLayer");
|
|
|
LayerManager.single.Init(layerRoot);
|
|
|
|
|
|
//提示
|
|
|
- let noticeMap:Map<string,Prefab>=new Map<string,Prefab>();
|
|
|
- noticeMap.set("Text",this.TextNoticeView);
|
|
|
- NoticeManager.Init(NoticeLayer,noticeMap);
|
|
|
+ let noticeMap: Map<string, Prefab> = new Map<string, Prefab>();
|
|
|
+ noticeMap.set("Text", this.TextNoticeView);
|
|
|
+ NoticeManager.Init(NoticeLayer, noticeMap);
|
|
|
|
|
|
UIConst.RegisterGUI();
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
GUIManager.single.Show(UIConst.PREPARE_UI);
|
|
|
|
|
|
+
|
|
|
let weChat = PlatformManager.impl as WeChatPlatform;
|
|
|
- if(weChat instanceof WeChatPlatform){
|
|
|
- weChat.branchAnalytics(branchIdType.EnterHall)
|
|
|
- }
|
|
|
+ if (weChat instanceof WeChatPlatform) {
|
|
|
+ weChat.branchAnalytics(branchIdType.EnterHall)
|
|
|
+ }
|
|
|
+
|
|
|
+ if(LiangLiangSDK.CanWuChu() == true){
|
|
|
+ GUIManager.single.Show(UIConst.ADVERTISING_UI)
|
|
|
+ }
|
|
|
|
|
|
}
|
|
|
-
|
|
|
- update (deltaTime: number) {
|
|
|
+
|
|
|
+ update(deltaTime: number) {
|
|
|
GameModel.single.CheckEarnings();
|
|
|
BufferManager.Tick(deltaTime);
|
|
|
}
|