<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">(function () {
    "use strict";
    class EventMgr {
        constructor(router) {
            EventMgr.instance = this;
            EventMgr.instance._router = router;
        }
        static send(type, data) {
            EventMgr.instance._router.event(type, data);
        }
        static on(type, caller, listener, args) {
            EventMgr.instance._router.on(type, caller, listener, args);
        }
        static once(type, caller, listener, args) {
            EventMgr.instance._router.once(type, caller, listener, args);
        }
        static off(type, caller, listener, onceOnly) {
            EventMgr.instance._router.off(type, caller, listener, onceOnly);
        }
        static offAll(type) {
            EventMgr.instance._router.offAll(type);
        }
        static offAllCaller(caller) {
            EventMgr.instance._router.offAllCaller(caller);
        }
        static route(type, data) {
            if (data === void 0) return EventMgr.instance._router.event(type);
            return EventMgr.instance._router.event(type, data);
        }
        static onMsg(msgtype, caller, listener, args) {
            EventMgr.instance._router.on(msgtype.toString(), caller, listener, args);
        }
        static offMsg(msgtype, caller, listener) {
            EventMgr.instance._router.off(msgtype.toString(), caller, listener);
        }
        static offAllCallerMsg(caller) {
            EventMgr.instance._router.offAllCaller(caller);
        }
        static routeMsg(msgtype, msg) {
            EventMgr.instance._router.event(msgtype.toString(), msg);
        }
    }
    var GameEvent;
    (function (GameEvent) {
        GameEvent.View = {
            OPEN: "view:open",
            CLOSE: "view:close",
            SHUTDONWALL: "view:destroyall",
            CHECK: "view:check"
        };
        GameEvent.STAGE_RESIZE = "stageResize";
        GameEvent.ENTER_GAME = "entergame";
        GameEvent.NOTICE = "notice";
        GameEvent.UP_DATA_INFO = "UP_DATA_INFO";
        GameEvent.PROGRESS = "PROGRESS";
        GameEvent.PAUSE_GAME = "PAUSE_GAME";
        GameEvent.RESUME_GAME = "RESUME_GAME";
        GameEvent.GAME_OVER = "GAME_OVER";
        GameEvent.LOADING_PROGRESS = "LOADING_PROGRESS";
        GameEvent.LOAD_COMPLETE = "LOAD_COMPLETE";
        GameEvent.PLAY_STEP = "PLAY_STEP";
        GameEvent.STOP_GUIDE = "STOP_GUIDE";
        GameEvent.HOME_VISIBLE = "HOME_VISIBLE";
        GameEvent.REFRESH_CASE = "REFRESH_CASE";
        GameEvent.SELECT_CASE = "SELECT_CASE";
        GameEvent.SHOW_LOCALE = "SHOW_LOCALE";
        GameEvent.RE_GAME = "RE_GAME";
        GameEvent.FINISH_TASK = "FINISH_TASK";
        GameEvent.GET_AWARD = "GET_AWARD";
        GameEvent.SAVE_LOCAL_DATA = "SAVE_LOCAL_DATA";
        GameEvent.CHANGE_CURRENCY = "CHANGE_CURRENCY";
        GameEvent.CHANGE_RED = "CHANGE_RED";
        GameEvent.KEY_CODE = {
            UP: "KEY_CODE:UP",
            DOWN: "KEY_CODE:DOWN",
            LEFT: "KEY_CODE:LEFT",
            RIGHT: "KEY_CODE:RIGHT"
        };
        GameEvent.SOLVE = {
            CASE_COMPLETE: "CASE_COMPLETE",
            START_STEP: "START_STEP",
            FINISH_STEP: "FINISH_STEP"
        };
    })(GameEvent || (GameEvent = {}));
    class PlatformType { }
    PlatformType.PC = "PC";
    PlatformType.WX = "WX";
    class GlobalDef { }
    GlobalDef.platform = PlatformType.PC;
    class GameContext { }
    GameContext.use_log = false;
    GameContext.use_test = false;
    GameContext.MAX_ENERGY = 5;
    GameContext.MAX_CONFIG = 0;
    GameContext.gPlayer = null;
    GameContext.offsetXY = null;
    GameContext.TOP_PIXEL = 0;
    class MsgType { }
    MsgType.RANKING_NORMAL = "RANKING_NORMAL";
    MsgType.RANKING_T_NORMAL = "RANKING_T_NORMAL";
    MsgType.RANKING_T_HARD = "RANKING_T_HARD";
    MsgType.LOAD_LEVEL_JSON = "LOAD_LEVEL_JSON";
    MsgType.UN_DISPLAY = "undisplay";
    class AdBase {
        TransmitAdvertisingID(tempBannerId, tempVideoId, tempIniterId, tempNativeId, tempMatrixId, tempBoxId, tempGirdId) { }
        InitAdParams(callback) {
            callback();
        }
        SetBannerAdState(state, willRe = false) { }
        SetInterstitialAdState(state) { }
        SetBoxAdState(state) { }
        SetIconAdState(state) { }
        SetBlockAdState(state) { }
        PlayVideoAd(callName, successFunc, failFunc, errorFunc) {
            YYGGames.showReward(() =&gt; {
                EventMgr.send(GameEvent.FINISH_TASK, [2, 1]);
                successFunc &amp;&amp; successFunc();
            }, () =&gt; {
                failFunc &amp;&amp; failFunc();
            })
            // successFunc();
        }
        ShowNativeAd() { }
        GetNativeData() { }
        ReportNative() { }
        ToastShow(saying, times) { }
    }
    class ShareBase {
        InitShareParams() { }
        StartRecordVideo() { }
        StopRecordVideo(hide) { }
        ShareVideo(successFunc, failFunc) {
            successFunc();
        }
        StopAndShareVideo(successFunc, failFunc) {
            successFunc();
        }
        ShareGame(successFunc, failFunc) {
            successFunc();
        }
        SetJumpBtnState(state) { }
        SetMoreGameBtn(tAppId, imaPath, tleft, tTop, tWidth, tHeight) { }
        ToMiniProgram(toId, toAppid, pkgName, success, fail, complete) { }
        ShareAppMessage(title, useCanvas, imgPath) { }
    }
    class DeviceBase {
        ShakeDevice() { }
    }
    class ReportBase {
        OnReportAnalytics(key, rData, rData2, rData3, rData4) { }
    }
    class LoginBase {
        InitLoginParams() { }
        GetUserData(successFunc, failFunc) {
            successFunc();
        }
        GetUserTarget(global, useCloud) { }
    }
    class WxAdSDK extends AdBase {
        constructor() {
            super(...arguments);
            this.platform = "wx";
            this.bannerAdParam = "adunit-1cf9ea52f1673ab4";
            this.videoAdParam = "adunit-de49b486d654ca1e";
            this.interstitialAdParam = "";
            this.bannerAd = null;
            this.videoAd = null;
            this.interstitialAd = null;
            this.iconAd = null;
            this.callVideoName = "empty";
            this.videoState = true;
            this.videoDoneCallback = (() =&gt; { });
            this.videoYetCallback = (() =&gt; { });
        }
        static get instance() {
            if (!WxAdSDK.SELF) {
                WxAdSDK.SELF = new WxAdSDK();
            }
            return WxAdSDK.SELF;
        }
        InitAdParams(callback) {
            let _self = this;
            if (window[this.platform]) {
                let pt = window[this.platform];
                try {
                    _InitBannerAd(pt);
                } catch (e) {
                    console.log("init bannerAd error" + e);
                }
                try {
                    _InitVideoAd(pt);
                } catch (e) {
                    console.log("init videoAd error" + e);
                }
                if (callback != null) {
                    callback();
                }
            }
            function _InitBannerAd(pt) {
                let sysInfo = pt.getSystemInfoSync();
                let targetBannerAdWidth = 300;
                WxAdSDK.instance.bannerAd = pt.createBannerAd({
                    adUnitId: _self.bannerAdParam,
                    style: {
                        width: targetBannerAdWidth,
                        top: sysInfo.windowHeight - targetBannerAdWidth / 16 * 9,
                        left: (sysInfo.windowWidth - targetBannerAdWidth) / 2
                    }
                });
                WxAdSDK.instance.bannerAd.onLoad(function () {
                    console.log("banner å¹¿å‘Šæ‹‰å–æˆåŠŸ");
                });
                WxAdSDK.instance.bannerAd.onError(function (res) {
                    console.log("bannerå¹¿å‘Šæ‹‰å–é”™è¯¯", res.errMsg, res.errCode);
                });
            }
            function _InitVideoAd(pt) {
                WxAdSDK.instance.videoAd = pt.createRewardedVideoAd({
                    adUnitId: _self.videoAdParam
                });
                WxAdSDK.instance.videoAd.onLoad(() =&gt; {
                    _self.videoState = true;
                    console.log("è§†é¢‘å¹¿å‘Šæ‹‰å–æˆåŠŸ");
                });
                WxAdSDK.instance.videoAd.onError(function (res) {
                    _self.videoState = false;
                    console.log("è§†é¢‘å¹¿å‘Šæ‹‰å–é”™è¯¯", res.errMsg, res.errCode);
                });
            }
            function _InitInterstitialAd(pt) {
                WxAdSDK.instance.interstitialAd = pt.createInterstitialAd({
                    adUnitId: _self.interstitialAdParam
                });
                WxAdSDK.instance.interstitialAd.onLoad(() =&gt; {
                    console.log("æ’å± å¹¿å‘Šæ‹‰å–æˆåŠŸ");
                });
                WxAdSDK.instance.interstitialAd.onError(function (res) {
                    console.log("æ’å± å¹¿å‘Šæ‹‰å–é”™è¯¯", res.errMsg, res.errCode);
                });
            }
            function _InitIconAd(pt) {
                WxAdSDK.instance.iconAd = pt.createGameIcon({
                    adUnitId: "PBgAA2D04umtl5Mk"
                });
                WxAdSDK.instance.iconAd.onLoad(function () {
                    console.log("icon å¹¿å‘Šæ‹‰å–æˆåŠŸ");
                });
                WxAdSDK.instance.iconAd.onError(function (res) {
                    console.log("icon å¹¿å‘Šæ‹‰å–é”™è¯¯", res.errMsg, res.errCode);
                });
            }
        }
        SetBannerAdState(state) {
            if (window[this.platform]) {
                if (state === true) {
                    WxAdSDK.instance.bannerAd.show();
                } else {
                    WxAdSDK.instance.bannerAd.hide();
                }
            }
        }
        SetInterstitialAdState(state) {
            return;
            if (window[this.platform]) {
                if (state === true) {
                    WxAdSDK.instance.interstitialAd.show();
                    this.SetBannerAdState(false);
                } else {
                    WxAdSDK.instance.interstitialAd.hide();
                }
            }
        }
        SetIconAdState(state) {
            return;
            if (state) {
                WxAdSDK.instance.iconAd.load().then(() =&gt; {
                    WxAdSDK.instance.iconAd.show();
                }).catch(err =&gt; {
                    console.error(err);
                });
            } else {
                WxAdSDK.instance.iconAd.hide();
            }
        }
        PlayVideoAd(callName, watchVideoFinishCallback, watchVideoNotFinishCallback, getAdError) {
            // WxReport.instance.OnReportAnalytics(4, callName);
            // if (!this.videoState) {
            //     getAdError();
            //     watchVideoNotFinishCallback();
            //     this.ShowToast("å¹¿å‘Šå¼‚å¸¸ï¼Œè¯·é‡å¯æ¸¸æˆé‡è¯•");
            //     console.log("wx video error");
            //     return;
            // }
            // this.callVideoName = callName;
            // this.InitVideoAdCallback(watchVideoFinishCallback, watchVideoNotFinishCallback);
            // this.ShowVideoAd();
            YYGGames.showRewrad(() =&gt; {
                watchVideoFinishCallback &amp;&amp; watchVideoFinishCallback();
                watchVideoFinishCallback = null;
                watchVideoNotFinishCallback = null;
            }, () =&gt; {
                watchVideoNotFinishCallback &amp;&amp; watchVideoNotFinishCallback();
                watchVideoFinishCallback = null;
                watchVideoNotFinishCallback = null;
            })
        }
        InitVideoAdCallback(finshFunc, notFinishFunc) {
            this.videoDoneCallback = finshFunc;
            this.videoYetCallback = notFinishFunc;
            WxAdSDK.instance.videoAd.onClose(res =&gt; {
                this.VideoAdCallback(res);
            });
        }
        VideoAdCallback(res) {
            if (res.isEnded) {
                this.videoDoneCallback();
                WxReport.instance.OnReportAnalytics(5, this.callVideoName);
                console.log("è§†é¢‘å¹¿å‘Š çœ‹å®Œ");
            } else {
                this.videoYetCallback();
                console.log("è§†é¢‘å¹¿å‘Š æ²¡çœ‹å®Œ");
            }
            WxAdSDK.instance.videoAd.offClose();
        }
        ShowVideoAd() {
            WxAdSDK.instance.videoAd.show().then(() =&gt; {
                console.log("è§†é¢‘å¹¿å‘Šæ’­æ”¾æˆåŠŸ");
            }).catch(err =&gt; {
                console.log("è§†é¢‘å¹¿å‘Šæ’­æ”¾å¤±è´¥" + err);
            });
            WxAdSDK.instance.videoAd.onError(function (res) {
                console.log("bannerå¹¿å‘Šæ‹‰å–é”™è¯¯", res.errMsg, res.errCode);
            });
        }
        ShowToast(say) {
            if (window[this.platform]) {
                let pt = window[this.platform];
                pt.showToast({
                    title: say,
                    icon: "none",
                    duration: 1e3
                });
            }
        }
    }
    class WxShareSDK extends ShareBase {
        constructor() {
            super(...arguments);
            this.platform = "wx";
            this.shareTitle = "";
            this.shareUseCanvas = false;
            this.shareImgPath = null;
        }
        static get instance() {
            if (!WxShareSDK.SELF) {
                WxShareSDK.SELF = new WxShareSDK();
            }
            return WxShareSDK.SELF;
        }
        InitShareParams() {
            if (window[this.platform]) {
                let pt = window[this.platform];
                pt.showShareMenu({
                    success() {
                        console.log("æ˜¾ç¤ºå³ä¸Šè§’è½¬å‘æˆåŠŸ");
                    },
                    fail() {
                        console.log("æ˜¾ç¤ºå³ä¸Šè§’è½¬å‘å¤±è´¥");
                    }
                });
            }
        }
        ShareAppMessage() {
            let _self = this;
            if (window[this.platform]) {
                let pt = window[this.platform];
                pt.onShareAppMessage(() =&gt; {
                    if (_self.shareUseCanvas) {
                        console.log("share use canvas");
                        return {
                            title: _self.shareTitle,
                            imageUrl: canvas.toTempFilePathSync({
                                destWidth: 500,
                                destHeight: 400
                            })
                        };
                    } else {
                        if (_self.shareImgPath != null) {
                            console.log("share with imgPath");
                            return {
                                title: _self.shareTitle,
                                imageUrl: _self.shareImgPath
                            };
                        } else {
                            console.log("share without imgPath");
                            return {
                                title: _self.shareTitle
                            };
                        }
                    }
                });
            }
        }
    }
    class WxLogin extends LoginBase {
        constructor() {
            super(...arguments);
            this.platform = "wx";
            this.InfoBtn = null;
            this.appid = "";
            this.secret = "";
            this.code = null;
        }
        static get instance() {
            if (!WxLogin.SELF) {
                WxLogin.SELF = new WxLogin();
            }
            return WxLogin.SELF;
        }
        InitLoginParams() {
            if (window[this.platform]) {
                let pt = window[this.platform];
                this.LoginGame();
            }
        }
        LoginGame() {
            let _self = this;
            if (window[this.platform]) {
                let pt = window[this.platform];
                pt.login({
                    success(res) {
                        _self.code = res.code;
                        _self.GetUserTarget(false, false);
                    }
                });
            }
        }
        GetUserData(success, fail) {
            if (window[this.platform]) {
                let pt = window[this.platform];
                let res = this.CheckStatus();
                if (res != null) {
                    if (!res.authSetting["scope.userInfo"]) {
                        this.CreateAndShowInfoBtn();
                        WxLogin.instance.InfoBtn.onTap(res =&gt; {
                            if (res.userInfo) {
                                WxLogin.instance.InfoBtn.hide();
                                success(res);
                            }
                        });
                    } else {
                        return res.authSetting["scope.userInfo"];
                    }
                } else {
                    this.CreateAndShowInfoBtn();
                    WxLogin.instance.InfoBtn.onTap(res =&gt; {
                        if (res.userInfo) {
                            WxLogin.instance.InfoBtn.hide();
                            success(res);
                        }
                    });
                }
            }
        }
        GetUserTarget(global, useCloud) {
            // let _self = this;
            // console.log(`get user target: is global? ${global}, is use cloud? ${useCloud}`);
            // if (window[this.platform]) {
            //     let pt = window[this.platform];
            //     if (!global) {
            //         if (useCloud) {
            //             pt.cloud.callFunction({
            //                 name: "getId",
            //                 complete: res =&gt; {
            //                     console.log("wx cloud back " + "\n" + res);
            //                 }
            //             });
            //         } else {
            //             pt.request({
            //                 url: `https://api.weixin.qq.com/sns/jscode2session?appid=${_self.appid}&amp;secret=${_self.secret}&amp;js_code=${_self.code}&amp;grant_type=authorization_code`,
            //                 success: res =&gt; {
            //                     let data = res.data;
            //                     console.log(`openid = ${data.openid}`);
            //                     pt.aldSendOpenid(`${data.openid}`);
            //                 }
            //             });
            //         }
            //     }
            // }
        }
        CheckStatus() {
            if (window[this.platform]) {
                let pt = window[this.platform];
                pt.getSetting({
                    success(res) {
                        console.log(`get settings success, ${res}`);
                        return res;
                    },
                    fail(err) {
                        console.log(`get sys setting  fail, ${err}`);
                        return null;
                    }
                });
            } else {
                return null;
            }
        }
        CreateAndShowInfoBtn() {
            if (window[this.platform]) {
                let pt = window[this.platform];
                WxLogin.instance.InfoBtn = pt.createUserInfoButton({
                    type: "text",
                    text: "æˆ‘è¦æŽˆæƒ",
                    style: {
                        left: 10,
                        top: 76,
                        width: 200,
                        height: 40,
                        lineHeight: 40,
                        backgroundColor: "#ff0000",
                        color: "#ffffff",
                        textAlign: "center",
                        fontSize: 16,
                        borderRadius: 4
                    }
                });
                WxLogin.instance.InfoBtn.show();
            }
        }
    }
    class WxReport extends ReportBase {
        constructor() {
            super(...arguments);
            this.platform = "wx";
        }
        static get instance() {
            if (!WxReport.SELF) {
                WxReport.SELF = new WxReport();
            }
            return WxReport.SELF;
        }
        OnReportAnalytics(key, rData, rData2, rData3, rData4) {
            let _self = this;
            if (window[this.platform]) {
                let pt = window[this.platform];
                switch (key) {
                    case 0:
                        pt.aldSendEvent("æ¡ˆä»¶ç±»åž‹ï¼ˆç‚¹å‡»ï¼‰", {
                            name: `${rData}`
                        });
                        break;

                    case 1:
                        pt.aldSendEvent("æ¡ˆä»¶ç±»åž‹ï¼ˆå®Œæˆï¼‰", {
                            name: `${rData}`
                        });
                        break;

                    case 2:
                        pt.aldSendEvent("è­¦å±€ç­‰çº§", {
                            name: `${rData}`
                        });
                        break;

                    case 3:
                        pt.aldSendEvent("æ¯æ—¥ä»»åŠ¡", {
                            name: `${rData}`
                        });
                        break;

                    case 4:
                        pt.aldSendEvent("è§†é¢‘ç‚¹å‡»", {
                            name: `${rData}`
                        });
                        break;

                    case 5:
                        pt.aldSendEvent("è§†é¢‘çœ‹å®Œ", {
                            name: `${rData}`
                        });
                        break;

                    default:
                        break;
                }
            }
        }
    }
    var SdkChannel;
    (function (SdkChannel) {
        SdkChannel[SdkChannel["Qq"] = 0] = "Qq";
        SdkChannel[SdkChannel["Wx"] = 1] = "Wx";
        SdkChannel[SdkChannel["Pc"] = 2] = "Pc";
    })(SdkChannel || (SdkChannel = {}));
    class UseChannel { }
    UseChannel.useChannel = SdkChannel.Pc;
    class AdDealer extends AdBase {
        static get AdUser() {
            let usingClass = null;
            switch (UseChannel.useChannel) {
                case SdkChannel.Wx:
                    usingClass = WxAdSDK;
                    break;

                default:
                    usingClass = AdDealer;
                    break;
            }
            if (!usingClass._instance) {
                usingClass._instance = new usingClass();
            }
            return usingClass._instance;
        }
    }
    class ShareDealer extends ShareBase {
        static get ShareUser() {
            let usingClass = null;
            switch (UseChannel.useChannel) {
                case SdkChannel.Wx:
                    usingClass = WxShareSDK;
                    break;

                default:
                    usingClass = ShareDealer;
                    break;
            }
            if (!usingClass._instance) {
                usingClass._instance = new usingClass();
            }
            return usingClass._instance;
        }
    }
    class ReportDealer extends ReportBase {
        static get ReportUser() {
            let usingClass = null;
            switch (UseChannel.useChannel) {
                case SdkChannel.Wx:
                    usingClass = WxReport;
                    break;

                default:
                    usingClass = ReportDealer;
                    break;
            }
            if (!usingClass._instance) {
                usingClass._instance = new usingClass();
            }
            return usingClass._instance;
        }
    }
    const KIND_STEP1_PATH = ["kind/XunWen.json"];
    const KIND_STEP2_PATH = ["kind/XunWen.json"];
    const KIND_STEP3_PATH = ["kind/XunWen.json"];
    class CaseControl extends Laya.Script {
        constructor() {
            super();
            this.caseName = "é»‘æš—çš„çŠ¯ç½ªçŽ°åœº";
            this.configId = 1;
            this.kind = "0";
            this.scene = 0;
            this.witnessId = 0;
            this.suspectId = 0;
            this.weaponId = 0;
            this.evidence = "0";
            this.evidenceId = 0;
            this.step1Skin = "";
        }
        onStart() {
            this._caseModel = this.owner.dataSource;
            this.step1Skin = !this._caseModel.sceneId &amp;&amp; this.step1Skin ? this.step1Skin : this._caseModel.bgSkin;
            EventMgr.on(GameEvent.SOLVE.FINISH_STEP, this, this._finishStep);
            EventMgr.on(GameEvent.RE_GAME, this, () =&gt; {
                EventMgr.send(GameEvent.SOLVE.START_STEP, this._caseModel);
            });
            this._initCase();
        }
        onDisable() {
            EventMgr.offAllCaller(this);
        }
        _initCase() {
            EventMgr.send(GameEvent.SOLVE.START_STEP, this._caseModel);
        }
        _finishStep(step) {
            this._caseModel.curStep = step + 1;
            if (step != 4) {
                Laya.timer.once(1e3, this, () =&gt; {
                    EventMgr.send(GameEvent.SOLVE.START_STEP, this._caseModel);
                });
            } else {
                ShareDealer.ShareUser.StopRecordVideo(true);
                EventMgr.send(GameEvent.View.OPEN, ["ClearCaseView", this._caseModel]);
                if (this._caseModel.offerIndex !== undefined) {
                    GameContext.gPlayer.offerCtrl.finishCase(this._caseModel.offerIndex);
                }
                EventMgr.offAllCaller(this);
            }
        }
    }
    class StepBase extends Laya.Script {
        constructor() {
            super();
            this._isOnStart = false;
            let $this = this;
            let onEnable = this.onEnable;
            this.onEnable = function () {
                onEnable &amp;&amp; onEnable.apply(this);
                if (!$this._isOnStart) return;
                $this._onShow();
            };
        }
        onStart() {
            let offsetXY = GameContext.offsetXY;
            this.offsetX = offsetXY.x;
            this.offsetY = offsetXY.y;
            this.caseModel = this.owner.dataSource;
            let index = this.caseModel.curStep - 1;
            let imgBg = this.owner.getChildByName("imgBg");
            if (imgBg) {
                if (imgBg.skin === undefined) {
                    imgBg.skin = this.caseModel.stepModels[index].skinBg;
                }
            }
            this.onInit();
            this._isOnStart = true;
        }
        _onShow() {
            EventMgr.on(GameEvent.PAUSE_GAME, this, this.onPause);
            EventMgr.on(GameEvent.RESUME_GAME, this, this.onResume);
            this.onShow();
        }
        onDisable() {
            EventMgr.offAllCaller(this);
            this.onHide();
        }
        onDestroy() {
            this.onRelease();
        }
        onInit() { }
        onShow() { }
        onHide() { }
        onRelease() { }
        onTriggerBegin(other, self, contact) { }
        onPause() { }
        onResume() { }
    }
    var Const;
    (function (Const) {
        Const.Font = {
            SimHei: "SimHei"
        };
        Const.DEFAULT_FONT = Const.Font.SimHei;
        Const.FontSize = {
            S18: 18,
            S20: 20,
            S22: 22,
            S24: 24,
            S26: 26,
            S28: 28
        };
        Const.Color = {
            Purple: "#ce9aff",
            Green: "#69d35e",
            Red: "#de2525",
            Pink: "#f2509c",
            Golden: "#f6ca67",
            Blue: "#93a9ff",
            Yellow: "#edda8d",
            Orange: "#ffa563",
            White: "#ffffff",
            Gray: "#f9ffeb",
            Nude: "#ffe4c7",
            LightBlue: "#37b9fe",
            SkyBlue: "#7fe6ff",
            DarkGray: "#606060"
        };
        Const.PrefabNames = [];
        Const.PrefabPath = [];
        Const.fringeScreenModels = ["iPhone X", "iPhone x", "vivo X21A", "ASUS Zenfone 5", "Ulefone T2 Pro", "Leagoo S9", "HUAWEI P20", "DooGee V", "OPPO R15", "LG G7", "SAMSUNG S9", "COR-AL00", "vivo Y83A", "LLD-AL20", "vivo Z1", "PACM00", "PAAM00"];
    })(Const || (Const = {}));
    class ComTools {
        static getRandom(min, max) {
            min = Math.ceil(min);
            max = Math.floor(max);
            return Math.floor(Math.random() * (max - min + 1)) + min;
        }
        static now() {
            let layanow = Laya.Browser.now();
            if (this._nowTime &lt; layanow) this._nowTime = layanow;
            return this._nowTime;
        }
        static realtimeSinceStartup() {
            let d = this.now() - this._startTime;
            if (d &lt; this._guardTime) {
                return this._guardTime;
            }
            this._guardTime = d;
            return d;
        }
        static guuid() {
            let s4 = () =&gt; {
                return Math.floor((1 + Math.random()) * 65536).toString(16).substring(1);
            };
            return s4() + s4();
        }
        static caseToString(level) {
            let a = "case/Case";
            let b = "";
            if (level &lt; 10) {
                b = `00${level}`;
            } else if (level &lt; 100) {
                b = `0${level}`;
            } else if (level &lt; 1e3) {
                b = `${level}`;
            }
            return a + b;
        }
        static getStringToTimeInfo(sumSecond, unit = 0, isShowWord = true) {
            let str = "";
            let dayStr = isShowWord ? "d" : ":";
            let hourStr = isShowWord ? "h" : ":";
            let minuteStr = isShowWord ? "m" : ":";
            let secondStr = isShowWord ? "s" : "";
            if (sumSecond &gt;= 86400) {
                let st0 = unit &gt; 3 ? "" : Math.floor(sumSecond / 86400) + dayStr;
                let st1 = unit &gt; 2 ? "" : Math.floor(sumSecond % 86400 / 3600) + hourStr;
                let minute = Math.floor(sumSecond % 3600 / 60);
                let st2 = unit &gt; 1 ? "" : (minute &lt; 10 ? "0" + minute : minute) + minuteStr;
                let second = Math.floor(sumSecond % 60);
                let st3 = unit &gt; 0 ? "" : (second &lt; 10 ? "0" + second : second) + secondStr;
                str = st0 + st1 + st2 + st3;
                return str;
            } else if (sumSecond &gt;= 3600) {
                let st1 = unit &gt; 2 ? "" : Math.floor(sumSecond / 3600) + hourStr;
                let minute = Math.floor(sumSecond % 3600 / 60);
                let st2 = unit &gt; 1 ? "" : (minute &lt; 10 ? "0" + minute : minute) + minuteStr;
                let second = Math.floor(sumSecond % 60);
                let st3 = unit &gt; 0 ? "" : (second &lt; 10 ? "0" + second : second) + secondStr;
                str = st1 + st2 + st3;
                return str;
            } else if (sumSecond &gt;= 60) {
                let fen = Math.floor(sumSecond / 60);
                let miao = Math.floor(sumSecond % 60);
                let str1 = unit &gt; 1 ? "" : fen + minuteStr;
                let str2 = unit &gt; 0 ? "" : (miao &lt; 10 ? "0" + miao : miao) + secondStr;
                str = str1 + str2;
                return str;
            } else {
                let s = sumSecond.toFixed(0) + secondStr;
                return s;
            }
        }
        static numberToUnit(num) {
            let a = num;
            let b = 0;
            let c = "";
            if (num &gt;= 1e8) {
                a = Math.floor(num / 1e8);
                b = num % 1e8;
                c = " *100 million";
            } else if (num &gt;= 1e4) {
                a = Math.floor(num / 1e4);
                b = num % 1e4;
                c = "million";
            }
            if (b) {
                b = Math.floor(b / 1e3);
            }
            return a + (b ? "." + b : "") + c;
        }
        static simpleTrans(num) {
            num = Math.floor(num);
            let result = "";
            switch (num) {
                case 1:
                    result += "one";
                    break;

                case 2:
                    result += "two";
                    break;

                case 3:
                    result += "three";
                    break;

                case 4:
                    result += "Four";
                    break;

                case 5:
                    result += "five";
                    break;

                case 6:
                    result += "six";
                    break;

                case 7:
                    result += "seven";
                    break;

                case 8:
                    result += "eight";
                    break;

                case 9:
                    result += "nine";
                    break;
            }
            return result;
        }
        static getZeroTime() {
            let start = new Date();
            start.setHours(0);
            start.setMinutes(0);
            start.setSeconds(0);
            start.setMilliseconds(0);
            return start.getTime() / 1e3;
        }
        static showLater(btn, time) {
            btn.visible = false;
            Laya.timer.once(time, this, () =&gt; {
                btn.visible = true;
            });
        }
        static isFringeScreen() {
            if (Laya.Browser.onMiniGame) {
                let systemInfo = wx.getSystemInfoSync();
                if (systemInfo["model"] != null) {
                    let fringeScreenModels = Const.fringeScreenModels;
                    for (let i in fringeScreenModels) {
                        if (systemInfo.model.indexOf(fringeScreenModels[i]) &gt; -1) {
                            return true;
                        }
                    }
                }
            } else {
                let rate = Laya.Browser.height / Laya.Browser.width;
                return rate &gt; 2;
            }
            return false;
        }
        static getBrand() {
            var ua = navigator.userAgent.split("(")[1].split(")")[0];
            var brand = "";
            var phone = [/IPHONE/gi, /huawei/gi, /mi/gi, /vivo/gi, /OPPO/gi, /samsung/gi, /SONY/gi, /Nokia/gi, /HTC/gi, /ZTE/gi, /Lenovo/gi, /ZUK/gi];
            if (phone[0].test(ua)) {
                brand = "iPhone";
            } else if (phone[1].test(ua)) {
                brand = "HUAWEI";
            } else if (phone[2].test(ua)) {
                brand = "å°ç±³";
            } else if (phone[3].test(ua)) {
                brand = "vivo";
            } else if (phone[4].test(ua)) {
                brand = "OPPO";
            } else if (phone[5].test(ua)) {
                brand = "SAMSUNG";
            } else if (phone[6].test(ua)) {
                brand = "SONY";
            } else if (phone[7].test(ua)) {
                brand = "Nokia";
            } else if (phone[8].test(ua)) {
                brand = "HTC";
            } else if (phone[9].test(ua)) {
                brand = "ZTE";
            } else if (phone[10].test(ua) || phone[11].test(ua)) {
                brand = "Lenovo";
            } else {
                brand = "Android";
            }
            return brand;
        }
        static grayingRole(roleImg) {
            var grayscaleMat = [-1, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 1, 0];
            var grayscaleFilter = new Laya.ColorFilter(grayscaleMat);
            roleImg.filters = [grayscaleFilter];
        }
        static jumpTo(label, value, jumpToValue, handler, time, unit = "") {
            if (value == jumpToValue) {
                if (handler) {
                    handler.run();
                }
                return;
            }
            let oldValue = value;
            let target = jumpToValue;
            if (jumpToValue == oldValue) {
                if (handler) {
                    handler.run();
                }
                return;
            }
            let isAdd = jumpToValue &gt; oldValue;
            if (!time) {
                time = 1500;
            }
            let count = time / 50;
            let oneValue = isAdd ? Math.floor((jumpToValue - oldValue) / count) + 1 : Math.floor((jumpToValue - oldValue) / count);
            let ii = 1;
            let fuc = () =&gt; {
                value += oneValue;
                label.text = value + unit;
                ii++;
                if (isAdd &amp;&amp; value &gt;= target) {
                    value = target;
                    label.text = value + unit;
                    Laya.timer.clear(label, fuc);
                    handler &amp;&amp; handler.run();
                    return;
                }
                if (!isAdd &amp;&amp; value &lt;= target) {
                    value = target;
                    label.text = value + unit;
                    Laya.timer.clear(label, fuc);
                    handler &amp;&amp; handler.run();
                    return;
                }
            };
            Laya.timer.loop(50, label, fuc);
        }
        static accidentaTouch(state, btn, times, y0, y1, x0, x1, func0, func1) {
            btn.visible = true;
            if (state) {
                if (x0) btn.x = x0;
                btn.y = y0 + bottomSize();
                if (func0) func0(); else AdDealer.AdUser.SetBannerAdState(false);
                Laya.timer.once(times - 1e3, this, () =&gt; {
                    if (func1) func1(); else AdDealer.AdUser.SetBannerAdState(true);
                    Laya.timer.once(1e3, this, () =&gt; {
                        if (x1) btn.x = x1;
                        btn.y = y1 + bottomSize();
                    });
                });
            } else {
                if (x1) btn.x = x1;
                btn.y = y1 + bottomSize();
                if (func1) func1(); else AdDealer.AdUser.SetBannerAdState(true);
            }
            function bottomSize() {
                let _addTop = (Laya.Browser.height - Laya.Browser.width * 1.78) / 2;
                return _addTop;
            }
        }
        static flyGoldEff(x, y) {
            let sx = x;
            let sy = y;
            let count = 20;
            let endY = 25 + GameContext.TOP_PIXEL;
            let func = () =&gt; {
                let point1 = {
                    x: sx,
                    y: sy
                };
                let x2 = ComTools.getRandom(sx - 250, sx + 250);
                let y2 = ComTools.getRandom(sy + 200, sy);
                let point2 = {
                    x: x2,
                    y: y2
                };
                let point3 = {
                    x: 363,
                    y: endY
                };
                let points = [point1, point2, point3];
                let spr = Laya.Pool.getItemByClass("goldImg", Laya.Image);
                spr.skin = "develop/qian-da.png";
                spr.pos(sx, sy);
                spr.width = 48;
                spr.height = 48;
                Laya.stage.addChild(spr);
                let lastTime = Laya.timer.currTimer;
                let handler = new Laya.Handler(this, () =&gt; {
                    let t = (Laya.timer.currTimer - lastTime) / 1e3;
                    let pos = ComTools.MultiPointBezier(points, t);
                    spr.pos(pos.x, pos.y);
                });
                Laya.Tween.to(spr, {
                    update: handler
                }, 1e3, Laya.Ease.circIn, Laya.Handler.create(this, () =&gt; {
                    Laya.Pool.recover("goldImg", spr);
                    spr.removeSelf();
                }));
                count--;
                if (count &lt;= 0) {
                    Laya.timer.clear(this, func);
                }
            };
            Laya.timer.frameLoop(1, this, func);
        }
        static CreateBezierPoints(anchorpoints, pointsAmount) {
            var points = [];
            for (var i = 0; i &lt; pointsAmount; i++) {
                var point = this.MultiPointBezier(anchorpoints, i / pointsAmount);
                points.push(point);
            }
            return points;
        }
        static MultiPointBezier(points, t) {
            let len = points.length;
            let x = 0, y = 0;
            for (let i = 0; i &lt; len; i++) {
                let point = points[i];
                x += point.x * Math.pow(1 - t, len - 1 - i) * Math.pow(t, i) * this.erxiangshi(len - 1, i);
                y += point.y * Math.pow(1 - t, len - 1 - i) * Math.pow(t, i) * this.erxiangshi(len - 1, i);
            }
            return {
                x: x,
                y: y
            };
        }
        static erxiangshi(start, end) {
            let cs = 1, bcs = 1;
            while (end &gt; 0) {
                cs *= start;
                bcs *= end;
                start--;
                end--;
            }
            return cs / bcs;
        }
    }
    ComTools._startTime = Laya.Browser.now();
    ComTools._guardTime = 0;
    ComTools._nowTime = 0;
    const _hasOwnProperty = Object.prototype.hasOwnProperty;
    const has = function (obj, prop) {
        return _hasOwnProperty.call(obj, prop);
    };
    function defaultCompare(a, b) {
        if (a &lt; b) {
            return -1;
        } else if (a === b) {
            return 0;
        } else {
            return 1;
        }
    }
    function defaultEquals(a, b) {
        return a === b;
    }
    function defaultToString(item) {
        if (item === null) {
            return "COLLECTION_NULL";
        } else if (isUndefined(item)) {
            return "COLLECTION_UNDEFINED";
        } else if (isString(item)) {
            return "$s" + item;
        } else {
            return "$s" + item.toString();
        }
    }
    function makeString(item, join = ",") {
        if (item === null) {
            return "COLLECTION_NULL";
        } else if (isUndefined(item)) {
            return "COLLECTION_UNDEFINED";
        } else if (isString(item)) {
            return item.toString();
        } else {
            let toret = "{";
            let first = true;
            for (const prop in item) {
                if (has(item, prop)) {
                    if (first) {
                        first = false;
                    } else {
                        toret = toret + join;
                    }
                    toret = toret + prop + ":" + item[prop];
                }
            }
            return toret + "}";
        }
    }
    function isFunction(func) {
        return typeof func === "function";
    }
    function isUndefined(obj) {
        return typeof obj === "undefined";
    }
    function isString(obj) {
        return Object.prototype.toString.call(obj) === "[object String]";
    }
    function reverseCompareFunction(compareFunction) {
        if (!isFunction(compareFunction)) {
            return function (a, b) {
                if (a &lt; b) {
                    return 1;
                } else if (a === b) {
                    return 0;
                } else {
                    return -1;
                }
            };
        } else {
            return function (d, v) {
                return compareFunction(d, v) * -1;
            };
        }
    }
    function compareToEquals(compareFunction) {
        return function (a, b) {
            return compareFunction(a, b) === 0;
        };
    }
    class Dictionary {
        constructor(toStrFunction) {
            this.table = {};
            this.nElements = 0;
            this.toStr = toStrFunction || defaultToString;
        }
        getValue(key) {
            const pair = this.table["$" + this.toStr(key)];
            if (isUndefined(pair)) {
                return undefined;
            }
            return pair.value;
        }
        setValue(key, value) {
            if (isUndefined(key) || isUndefined(value)) {
                return undefined;
            }
            let ret;
            const k = "$" + this.toStr(key);
            const previousElement = this.table[k];
            if (isUndefined(previousElement)) {
                this.nElements++;
                ret = undefined;
            } else {
                ret = previousElement.value;
            }
            this.table[k] = {
                key: key,
                value: value
            };
            return ret;
        }
        remove(key) {
            const k = "$" + this.toStr(key);
            const previousElement = this.table[k];
            if (!isUndefined(previousElement)) {
                delete this.table[k];
                this.nElements--;
                return previousElement.value;
            }
            return undefined;
        }
        keys() {
            const array = [];
            for (const name in this.table) {
                if (has(this.table, name)) {
                    const pair = this.table[name];
                    array.push(pair.key);
                }
            }
            return array;
        }
        values() {
            const array = [];
            for (const name in this.table) {
                if (has(this.table, name)) {
                    const pair = this.table[name];
                    array.push(pair.value);
                }
            }
            return array;
        }
        forEach(callback) {
            for (const name in this.table) {
                if (has(this.table, name)) {
                    const pair = this.table[name];
                    const ret = callback(pair.key, pair.value);
                    if (ret === false) {
                        return;
                    }
                }
            }
        }
        containsKey(key) {
            return !isUndefined(this.getValue(key));
        }
        clear() {
            this.table = {};
            this.nElements = 0;
        }
        size() {
            return this.nElements;
        }
        isEmpty() {
            return this.nElements &lt;= 0;
        }
        toString() {
            let toret = "{";
            this.forEach((k, v) =&gt; {
                toret += `\n\t${k} : ${v}`;
            });
            return toret + "\n}";
        }
    }
    var Box = Laya.Box;
    class Step1Type2 extends StepBase {
        onInit() {
            let imgBg = this.owner.getChildByName("imgSceneBg");
            if (imgBg) {
                if (imgBg.skin !== undefined) {
                    for (let index = 0; index &lt; 3; index++) {
                        this.caseModel.stepModels[index].skinBg = imgBg.skin;
                    }
                }
            }
            this._imgProps = new Dictionary();
            let boxProps = this.owner.getChildByName("boxProps");
            this._boxProps = boxProps;
            this._boxs = [];
            let j = 0;
            for (let i = 0, len = boxProps.numChildren; i &lt; len; i++) {
                let box = boxProps.getChildAt(i);
                if (box instanceof Box) {
                    this._boxs[j] = box;
                    j++;
                }
            }
            let randIndexs = [];
            let len = this._boxs.length;
            while (randIndexs.length != 3) {
                let index = ComTools.getRandom(0, len - 1);
                randIndexs.indexOf(index) == -1 &amp;&amp; randIndexs.push(index);
            }
            randIndexs.sort();
            let tempSkins = [];
            let boxShow = this.owner.getChildByName("boxShow");
            for (let i = 0; i &lt; 3; i++) {
                let index = randIndexs[i];
                let btn = this._boxs[index].getChildAt(0);
                let img = boxShow.getChildAt(i).getChildAt(0);
                this._imgProps.setValue(index, img);
                let skin = btn.skin;
                img.skin = skin;
                tempSkins[i] = skin;
            }
            this.caseModel.tempData = tempSkins;
            for (let i = 0, len = this._boxs.length; i &lt; len; i++) {
                let box = this._boxs[i];
                box.on(Laya.Event.CLICK, this, this._onTouchProp, [i]);
            }
            this._ani = new Laya.Animation();
            this._ani.loadAnimation("animation/StartAni.ani");
            this._ani.gotoAndStop(30);
            this._ani.pos(-500, -500);
            this.owner.addChild(this._ani);
        }
        onShow() { }
        onHide() {
            this._ani.clear();
            this._imgProps.clear();
            let boxProps = this._boxs;
            for (let i = 0, len = boxProps.length; i &lt; len; i++) {
                let btn = this._boxs[i];
                btn.off(Laya.Event.CLICK, this, this._onTouchProp);
            }
            this.owner.destroy(true);
        }
        onRelease() { }
        _onTouchProp(index, e) {
            let prop = this._boxs[index];
            let img = this._imgProps.getValue(index);
            if (img) {
                let x = prop.x + prop.width / 2;
                let y = prop.y + prop.height / 2;
                this._ani.pos(x, y, true);
                this._ani.play(0, false);
                this._imgProps.remove(index);
                prop.visible = false;
                this._showProp(img);
            } else {
                let img = prop.getChildAt(0);
                Laya.Tween.to(img, {
                    scaleX: 1.1,
                    scaleY: 1.1
                }, 100, null, Laya.Handler.create(this, () =&gt; {
                    Laya.Tween.to(img, {
                        scaleX: 1,
                        scaleY: 1
                    }, 100);
                }));
            }
        }
        _showProp(img) {
            img.gray = false;
            Laya.Tween.to(img.parent, {
                scaleX: 1.1,
                scaleY: 1.2
            }, 100, null, Laya.Handler.create(this, () =&gt; {
                Laya.Tween.to(img.parent, {
                    scaleX: 1,
                    scaleY: 1
                }, 100, null, Laya.Handler.create(this, () =&gt; {
                    if (this._imgProps.size() == 0) {
                        Laya.timer.once(60, this, () =&gt; {
                            EventMgr.send(GameEvent.SOLVE.FINISH_STEP, [1]);
                        });
                    }
                }));
            }));
        }
    }
    class Step1Type1 extends StepBase {
        onInit() {
            this._imgDialog = this.owner.getChildByName("imgDialog");
            this._imgDialog.visible = false;
            let imgWeapon = this._imgDialog.getChildByName("imgWeapon");
            ComTools.grayingRole(imgWeapon);
            this._btnRole = this.owner.getChildByName("btnRole");
            this._btnRole.once(Laya.Event.CLICK, this, this._showDialog);
            let roleId = this.caseModel.stepModels[0].data;
            this._btnRole.skin = `role/npc${roleId}.png`;
            let weaponId = this.caseModel.weaponId;
            imgWeapon.skin = `weapon/weapon${weaponId}.png`;
            this._playMove();
            this._playStand();
        }
        onShow() { }
        onHide() {
            Laya.Tween.clearAll(this._btnRole);
            Laya.Tween.clearAll(this._imgDialog);
            this._btnRole.off(Laya.Event.CLICK, this, this._showDialog);
            EventMgr.offAllCaller(this);
            this.owner.destroy(true);
        }
        onRelease() { }
        _playMove() {
            this._btnRole.x = 0;
            Laya.Tween.to(this._btnRole, {
                x: 500
            }, 500);
        }
        _playStand() {
            this._btnRole.scaleY = 1;
            Laya.Tween.to(this._btnRole, {
                scaleY: 1.05
            }, 1e3, null, Laya.Handler.create(this, this.__playStand));
        }
        __playStand() {
            Laya.Tween.to(this._btnRole, {
                scaleY: 1
            }, 1e3, null, Laya.Handler.create(this, this._playStand));
        }
        _showDialog() {
            this._imgDialog.visible = true;
            this._imgDialog.scaleX = .1;
            this._imgDialog.scaleY = .1;
            Laya.Tween.to(this._imgDialog, {
                scaleX: 1,
                scaleY: 1
            }, 400, Laya.Ease.bounceOut);
            Laya.timer.once(1e3, this, () =&gt; {
                EventMgr.send(GameEvent.SOLVE.FINISH_STEP, [1]);
            });
        }
    }
    class Step2Type1 extends StepBase {
        constructor() {
            super(...arguments);
            this._curZOrder = 10;
        }
        onInit() {
            this._items = [];
            this._rectangles = [];
            let boxRandomRange = this.owner.getChildByName("boxRandomRange");
            this._boxRandomRange = boxRandomRange;
            for (let i = 0, len = boxRandomRange.numChildren; i &lt; len; i++) {
                let item = boxRandomRange.getChildAt(i);
                if (item.name == "imgItem") {
                    item.alpha = .3;
                    continue;
                }
                this._items.push(item);
                let index = this._rectangles.length;
                let x = item.x;
                let y = item.y;
                this._rectangles[index] = new Laya.Rectangle(x, y, item.width, item.height);
                item.name = `${index}`;
                item.x = ComTools.getRandom(10, 500);
                item.y = ComTools.getRandom(10, 500);
                item.on(Laya.Event.MOUSE_DOWN, this, this._onStartDrag, [item]);
                item.on(Laya.Event.MOUSE_UP, this, this._onCheck, [item]);
            }
            this._ani = new Laya.Animation();
            this._ani.loadAnimation("animation/CircleAni.ani");
        }
        onShow() { }
        onHide() {
            this._rectangles = [];
            this._items = [];
            for (let i = 0, len = this._boxRandomRange.numChildren; i &lt; len; i++) {
                let item = this._boxRandomRange.getChildAt(i);
                if (item.name == "imgItem") continue;
                item.off(Laya.Event.MOUSE_DOWN, this, this._onStartDrag);
                item.off(Laya.Event.MOUSE_UP, this, this._onCheck);
            }
            this._ani.removeSelf();
            this._ani = null;
            this.owner.destroy(true);
        }
        onRelease() { }
        _onStartDrag(item) {
            item.scaleX = 1.2;
            item.scaleY = 1.2;
            item.zOrder = this._curZOrder;
            this._curZOrder++;
            item.startDrag();
        }
        _onCheck(item) {
            item.stopDrag();
            item.scaleX = 1;
            item.scaleY = 1;
            let rectang = this._rectangles[Number(item.name)];
            if (rectang.intersects(item.getBounds())) {
                item.mouseEnabled = false;
                item.off(Laya.Event.MOUSE_DOWN, this, this._onStartDrag);
                item.off(Laya.Event.MOUSE_UP, this, this._onCheck);
                Laya.Tween.to(item, {
                    x: rectang.x,
                    y: rectang.y
                }, 100, null, Laya.Handler.create(this, () =&gt; {
                    this._ani.x = item.width / 2;
                    this._ani.y = item.height / 2;
                    item.addChild(this._ani);
                    this._ani.play(0, false);
                    let isFinish = true;
                    let items = this._items;
                    let rectangles = this._rectangles;
                    for (let i = 0, len = items.length; i &lt; len; i++) {
                        let item = items[i];
                        if (item.x != rectangles[i].x || item.y != rectangles[i].y) {
                            isFinish = false;
                            break;
                        }
                    }
                    isFinish &amp;&amp; EventMgr.send(GameEvent.SOLVE.FINISH_STEP, [2]);
                }));
            }
        }
    }
    class Step2Type2 extends StepBase {
        constructor() {
            super(...arguments);
            this._curPro = 0;
            this._isIntersect = false;
            this._isDown = false;
        }
        onInit() {
            this._boxScan = this.owner.getChildByName("boxScan");
            let imgBg = this.owner.getChildByName("imgBg");
            this._imgProDi = this._boxScan.getChildByName("imgProDi");
            this._imgPro = this._imgProDi.getChildByName("imgPro");
            this._textPro = this._imgProDi.getChildByName("textPro");
            this._imgProDi.visible = false;
            let panelScan = this._boxScan.getChildByName("panelScan");
            this._panelScan = panelScan;
            let num = ComTools.getRandom(1, 3);
            for (let i = 1; i &lt; 4; i++) {
                let wq = panelScan.getChildByName(`sprWQ${i}`);
                wq.visible = i == num;
                if (i == num) {
                    wq.skin = `weapon/weapon${this.caseModel.weaponId}.png`;
                    this._sprWQ = wq;
                    this._point = new Laya.Point(this._sprWQ.x, this._sprWQ.y);
                    this._sprWQ.parent.parent.localToGlobal(this._point);
                }
            }
            let tempData = this.caseModel.tempData;
            for (let i = 0; i &lt; 3; i++) {
                let img = imgBg.getChildAt(i);
                let skin = tempData[i];
                img.skin = skin;
            }
            Laya.timer.loop(33, this, this._loop);
        }
        onShow() { }
        onHide() {
            Laya.timer.clear(this, this._loop);
            this.owner.destroy(true);
        }
        onRelease() { }
        onMouseDown() {
            this._isDown = true;
        }
        onMouseUp(e) {
            this._isDown = false;
        }
        onMouseMove(e) {
            if (!this._isDown) return;
            let x = e.stageX - 120;
            let y = e.stageY - 290;
            this._boxScan.pos(x - this.offsetX, y - this.offsetY, true);
            let xx = this._point.x - x - this._panelScan.x;
            let yy = this._point.y - y - this._panelScan.y;
            this._sprWQ.pos(xx, yy, true);
            let isIntersect = xx &gt;= -40 &amp;&amp; xx &lt;= 167 &amp;&amp; yy &gt;= -40 &amp;&amp; yy &lt;= 93;
            this._isIntersect = isIntersect;
        }
        _loop() {
            if (this._isIntersect) {
                this._curPro++;
                this._imgPro.width = this._curPro * 2.58;
                this._textPro.text = `${this._curPro}%`;
                if (100 == this._curPro) {
                    Laya.timer.clear(this, this._loop);
                    EventMgr.send(GameEvent.SOLVE.FINISH_STEP, [2]);
                }
            } else {
                this._curPro = 0;
            }
            this._imgProDi.visible = this._isIntersect;
        }
    }
    class Step3Type1 extends StepBase {
        constructor() {
            super(...arguments);
            this._curPro = 0;
            this._isIntersect = false;
            this._isDown = false;
        }
        onInit() {
            this._boxScan = this.owner.getChildByName("boxScan");
            this._panelScan = this._boxScan.getChildByName("panelScan");
            this._imgProDi = this._boxScan.getChildByName("imgProDi");
            this._imgPro = this._imgProDi.getChildByName("imgPro");
            this._textPro = this._imgProDi.getChildByName("textPro");
            this._ani = new Laya.Animation();
            this._ani.loadAnimation("animation/ScanAni.ani");
            Laya.timer.loop(33, this, this._loop);
            this._setup();
        }
        onShow() { }
        onHide() {
            Laya.timer.clear(this, this._loop);
            this._ani.stop();
            this._ani.removeSelf();
            this._ani = null;
            this.owner.destroy(true);
        }
        onRelease() { }
        _setup() {
            let isDNA = this.caseModel.evidence == 0;
            let skin = isDNA ? "public/dna.png" : "public/finger.png";
            let num = ComTools.getRandom(1, 3);
            for (let i = 1; i &lt; 4; i++) {
                let sprZhiWen = this._panelScan.getChildByName(`sprZhiWen${i}`);
                sprZhiWen.visible = i == num;
                if (i == num) {
                    sprZhiWen.skin = skin;
                    this._ani.x = 50;
                    this._ani.y = 50;
                    sprZhiWen.addChild(this._ani);
                    this._ani.play(0, true);
                    this._sprZhiWen = sprZhiWen;
                    this._point = new Laya.Point(sprZhiWen.x, sprZhiWen.y);
                    sprZhiWen.parent.parent.localToGlobal(this._point);
                }
            }
        }
        onMouseDown() {
            this._isDown = true;
        }
        onMouseUp(e) {
            this._isDown = false;
        }
        onMouseMove(e) {
            if (!this._isDown) return;
            let x = e.stageX - 120;
            let y = e.stageY - 290;
            this._boxScan.pos(x - this.offsetX, y - this.offsetY, true);
            let xx = this._point.x - x - this._panelScan.x;
            let yy = this._point.y - y - this._panelScan.y;
            this._sprZhiWen.pos(xx, yy, true);
            let isIntersect = xx &gt;= -40 &amp;&amp; xx &lt;= 167 &amp;&amp; yy &gt;= -40 &amp;&amp; yy &lt;= 93;
            this._isIntersect = isIntersect;
        }
        _loop() {
            if (this._isIntersect) {
                this._curPro++;
                this._imgPro.width = this._curPro * 2.58;
                this._textPro.text = `${this._curPro}%`;
                if (100 == this._curPro) {
                    Laya.timer.clear(this, this._loop);
                    EventMgr.send(GameEvent.SOLVE.FINISH_STEP, [3]);
                }
            } else {
                this._curPro = 0;
            }
            this._imgProDi.visible = this._isIntersect;
        }
    }
    class Step3Type2 extends StepBase {
        constructor() {
            super(...arguments);
            this._isDown = false;
            this._isIntersect = false;
            this._curPro = 0;
            this._touchFrame = 10;
            this._curFrame = 0;
            this._isEnd = false;
        }
        onInit() {
            this._boxWipe = this.owner.getChildByName("boxWipe");
            this._imgWipe = this.owner.getChildByName("imgWipe");
            this._wipeAni = this.owner["wipeAni"];
            let imgItem = this.owner.getChildByName("imgItem");
            this._imgItem = imgItem;
            let isDNA = this.caseModel.evidence == 0;
            let skin = isDNA ? "public/dna.png" : "public/finger.png";
            let num = ComTools.getRandom(1, 3);
            for (let i = 1; i &lt; 4; i++) {
                let evidence = this.owner.getChildByName(`sprEvidence${i}`);
                evidence.visible = i == num;
                if (i == num) {
                    evidence.skin = skin;
                    this._sprEvidence = evidence;
                    evidence.alpha = 0;
                }
            }
            Laya.timer.frameLoop(1, this, this._loop);
            Laya.loader.load("animation/DustEff.part", Laya.Handler.create(this, this._onAssetsLoaded), null, Laya.Loader.JSON);
            this._ani = new Laya.Animation();
            this._ani.loadAnimation("animation/StartAni.ani");
            this._ani.x = 25;
            this._ani.y = 25;
        }
        onShow() { }
        onHide() {
            Laya.timer.clear(this, this._loop);
            Laya.Pool.clearBySign("dustPart");
            this.owner.destroy(true);
        }
        onRelease() { }
        onMouseDown() {
            if (this._isEnd) return;
            this._isDown = true;
            this._wipeAni.play(0, true);
        }
        onMouseUp(e) {
            this._isDown = false;
            this._wipeAni.gotoAndStop(0);
        }
        onMouseMove(e) {
            if (!this._isDown) return;
            let x = e.stageX - this.offsetX;
            let y = e.stageY - this.offsetY;
            this._imgWipe.pos(x + 139, y - 54, true);
            this._boxWipe.pos(x - 104, y - 243, true);
            let isIntersect = this._sprEvidence.getBounds().intersects(this._boxWipe.getBounds());
            this._isIntersect = isIntersect;
        }
        _loop() {
            if (this._isIntersect) {
                this._curPro++;
                this._sprEvidence.alpha = this._curPro / 100;
                if (100 == this._curPro) {
                    this._isEnd = true;
                    this._wipeAni.gotoAndStop(0);
                    this._ani.play(0, false);
                    this._sprEvidence.addChild(this._ani);
                    Laya.Tween.to(this._imgItem, {
                        scaleX: 1.1,
                        scaleY: 1.1
                    }, 150, null, Laya.Handler.create(this, () =&gt; {
                        Laya.Tween.to(this._imgItem, {
                            scaleX: 1,
                            scaleY: 1
                        }, 150);
                    }));
                    Laya.Tween.to(this._sprEvidence, {
                        scaleX: 1.2,
                        scaleY: 1.2
                    }, 150, null, Laya.Handler.create(this, () =&gt; {
                        Laya.Tween.to(this._sprEvidence, {
                            scaleX: 1,
                            scaleY: 1
                        }, 150);
                    }));
                    Laya.timer.clear(this, this._loop);
                    Laya.timer.once(1500, this, () =&gt; {
                        EventMgr.send(GameEvent.SOLVE.FINISH_STEP, [3]);
                    });
                }
                this._imgWipe.alpha = .6;
            } else {
                this._imgWipe.alpha = 1;
            }
            if (this._isDown) {
                this._curFrame++;
                if (this._curFrame &gt;= this._touchFrame) {
                    let dustPart = Laya.Pool.getItemByCreateFun("dustPart", this._createPart, this);
                    dustPart.autoPlay = false;
                    dustPart.emitter.start(.5);
                    dustPart.play();
                    dustPart.x = this._boxWipe.x + 65;
                    dustPart.y = this._boxWipe.y + 65;
                    this.owner.addChild(dustPart);
                    this._curFrame = 0;
                    Laya.timer.once(600, this, () =&gt; {
                        Laya.Pool.recover("dustPart", dustPart);
                    });
                }
            } else {
                this._curFrame = 20;
            }
        }
        _onAssetsLoaded(settings) {
            let _settings = Laya.loader.getRes("animation/DustEff.part");
            this._settings = _settings;
        }
        _createPart() {
            let dustPart = new Laya.Particle2D(this._settings);
            return dustPart;
        }
    }
    class Step4Type1 extends StepBase {
        constructor() {
            super(...arguments);
            this._imgArys = [];
            this._mLastMouseX = 0;
            this._skins = [];
            this._curIndexs = [0, 0, 0, 0, 0];
        }
        onInit() {
            this._init();
        }
        onShow() { }
        onHide() {
            this._imgArys = [];
            for (let i = 0; i &lt; 5; i++) {
                let img = this._boxContainer.getChildByName(`img${i}`);
                img.offAllCaller(img);
            }
            this.owner.destroy(true);
        }
        onRelease() { }
        _init() {
            let boxTouch = this.owner.getChildByName("boxTouch");
            boxTouch.once(Laya.Event.CLICK, this, () =&gt; {
                boxTouch.visible = false;
            });
            let sprDi = this.owner.getChildByName("sprDi");
            let boxContainer = sprDi.getChildByName("boxContainer");
            this._boxContainer = boxContainer;
            this._imgTemp = boxContainer.getChildByName("imgTemp");
            this._imgArys = [];
            for (let i = 0; i &lt; 5; i++) {
                let img = boxContainer.getChildByName(`img${i}`);
                img.on(Laya.Event.MOUSE_DOWN, this, this._onMouseDown, [i]);
                this._imgArys[i] = img;
            }
            let boxMini = this.owner.getChildByName("boxMini");
            let rand = ComTools.getRandom(0, 4);
            for (let i = 0; i &lt; 5; i++) {
                let img = boxMini.getChildByName(`img${i}`);
                if (i != rand) {
                    ComTools.grayingRole(img);
                }
            }
            this._initData();
            this._ani = this.owner["ani"];
        }
        _initData() {
            let rightId = this.caseModel.suspectId;
            this._rightId = rightId;
            for (let i = 0; i &lt; 5; i++) {
                this._skins[i] = [];
                let tempAry = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20];
                tempAry.splice(rightId - 1, 1);
                for (let j = 0; j &lt; 4; j++) {
                    let randIdx = ComTools.getRandom(0, tempAry.length - 1);
                    let randId = tempAry[randIdx];
                    this._skins[i][j] = `brokenRole/npc${randId}_${i + 1}.png`;
                    tempAry.splice(randIdx, 1);
                }
                let randIdx = ComTools.getRandom(0, 4);
                this._skins[i].splice(randIdx, 0, `brokenRole/npc${rightId}_${i + 1}.png`);
            }
            let boxMini = this.owner.getChildByName("boxMini");
            for (let i = 0; i &lt; 5; i++) {
                let img = boxMini.getChildByName(`img${i}`);
                img.skin = `brokenRole/npc${this._rightId}_${i + 1}.png`;
            }
            for (let i = 0; i &lt; 5; i++) {
                let img = this._imgArys[i];
                img.skin = this._skins[i][0];
            }
        }
        _onMouseDown(index, e) {
            if (this._curImg) return;
            let img = this._imgArys[index];
            this._curImg = img;
            this._mLastMouseX = img.parent.getMousePoint().x - img.x;
            this._onEvent(index, img);
        }
        _onMouseMove(index, e) {
            let img = this._curImg;
            if (!img) return;
            let imgTemp = this._imgTemp;
            img.x = img.parent.getMousePoint().x - this._mLastMouseX;
            if (img.x &lt; 300) {
                imgTemp.x = img.x + 600;
                let _index = this._curIndexs[index] + 1 &gt; 4 ? 0 : this._curIndexs[index] + 1;
                let imgPath = this._skins[index][_index];
                imgTemp.skin = imgPath;
            } else if (img.x &gt; 300) {
                imgTemp.x = img.x - 600;
                let _index = this._curIndexs[index] - 1 &lt; 0 ? 4 : this._curIndexs[index] - 1;
                let imgPath = this._skins[index][_index];
                imgTemp.skin = imgPath;
            }
            imgTemp.y = img.y;
        }
        _onMouseUp(index, e) {
            let img = this._curImg;
            if (!img) return;
            this._offEvent(img);
            this._backToCenter(img, index);
        }
        _onEvent(index, img) {
            img.on(Laya.Event.MOUSE_MOVE, this, this._onMouseMove, [index]);
            img.on(Laya.Event.MOUSE_OUT, this, this._onMouseUp, [index]);
            img.on(Laya.Event.MOUSE_UP, this, this._onMouseUp, [index]);
        }
        _offEvent(img) {
            img.off(Laya.Event.MOUSE_MOVE, this, this._onMouseMove);
            img.off(Laya.Event.MOUSE_OUT, this, this._onMouseUp);
            img.off(Laya.Event.MOUSE_UP, this, this._onMouseUp);
        }
        _backToCenter(img, index) {
            let imgTemp = this._imgTemp;
            let skin = imgTemp.skin;
            let ease = Laya.Ease.circOut;
            let time = 0;
            if (img.x &gt; 400) {
                time = 900 - img.x;
                Laya.Tween.to(img, {
                    x: 900
                }, time, ease, Laya.Handler.create(this, () =&gt; {
                    img.x = 300;
                    img.skin = skin;
                    let _index = this._curIndexs[index] - 1 &lt; 0 ? 4 : this._curIndexs[index] - 1;
                    this._curIndexs[index] = _index;
                }));
                Laya.Tween.to(imgTemp, {
                    x: 300
                }, time, ease, Laya.Handler.create(this, () =&gt; {
                    imgTemp.x = -300;
                }));
            } else if (img.x &lt; 200) {
                time = img.x + 300;
                Laya.Tween.to(img, {
                    x: -300
                }, time, ease, Laya.Handler.create(this, () =&gt; {
                    img.x = 300;
                    img.skin = skin;
                    let _index = this._curIndexs[index] + 1 &gt; 4 ? 0 : this._curIndexs[index] + 1;
                    this._curIndexs[index] = _index;
                }));
                Laya.Tween.to(imgTemp, {
                    x: 300
                }, time, ease, Laya.Handler.create(this, () =&gt; {
                    imgTemp.x = -300;
                }));
            } else {
                time = Math.abs(img.x - 300);
                Laya.Tween.to(img, {
                    x: 300
                }, time, ease);
                let x = img.x &gt; 300 ? -300 : 900;
                Laya.Tween.to(imgTemp, {
                    x: x
                }, time, ease, Laya.Handler.create(this, () =&gt; {
                    imgTemp.x = -300;
                }));
            }
            Laya.timer.once(time + 100, this, () =&gt; {
                let isSuc = true;
                let rightId = this._rightId;
                for (let i = 0; i &lt; 5; i++) {
                    let img = this._imgArys[i];
                    if (img.skin != `brokenRole/npc${rightId}_${i + 1}.png`) {
                        isSuc = false;
                        break;
                    }
                }
                if (isSuc) {
                    imgTemp.visible = false;
                    this._ani.play(0, false);
                    let ani = new Laya.Animation();
                    ani.loadAnimation("animation/StartAni.ani");
                    ani.scaleX = 2;
                    ani.scaleY = 2;
                    ani.timer.frameOnce(40, this, () =&gt; {
                        this._boxContainer.addChild(ani);
                        ani.play(0, false);
                        ani.pos(300, 300, true);
                    });
                    Laya.timer.once(1200, this, () =&gt; {
                        ani.clear();
                        EventMgr.send(GameEvent.SOLVE.FINISH_STEP, [4]);
                    });
                } else {
                    this._curImg = null;
                }
            });
        }
    }
    class Step4Type2 extends StepBase {
        constructor() {
            super(...arguments);
            this._colors = ["#aef424", "#7e03d7", "#f3c879", "#8df4f3", "#3da4ff"];
            this._heights = [112, 312, 458];
            this._boxColors = null;
            this._boxBtns = null;
            this._texts = null;
            this._boxReagent = null;
            this._btnRe = null;
            this._aniTest = null;
            this._aniBtns = null;
            this._tempCount = 0;
        }
        onInit() {
            this._init();
            this._onEvent();
            this._createLine();
        }
        onShow() { }
        onHide() {
            this._offEvent();
            Laya.timer.clearAll(this);
            for (let i = 0; i &lt; 3; i++) {
                let boxColor = this._boxColors[i];
                let spr = boxColor.getChildAt(0);
                let graphics = spr.graphics;
                graphics.clear();
            }
            this._boxColors = null;
            this._boxBtns = null;
            this._texts = null;
            this._aniBtns = null;
            this.owner.destroy(true);
        }
        onRelease() { }
        _offEvent() {
            for (let i = 0; i &lt; 3; i++) {
                this._boxBtns[i].off(Laya.Event.MOUSE_DOWN, this, this._onApePress);
            }
            this._btnRe.off(Laya.Event.CLICK, this, this._onRe);
            this._aniTest.off(Laya.Event.LABEL, this, this._aniEvent);
        }
        _init() {
            let idx = ComTools.getRandom(0, 4);
            this._colors.splice(idx, 1);
            idx = ComTools.getRandom(0, 3);
            this._colors.splice(idx, 1);
            let sprDi = this.owner.getChildByName("imgMini").getChildAt(0).getChildAt(0);
            for (let i = 0; i &lt; 3; i++) {
                let color = this._colors[i];
                let boxColor = sprDi.getChildByName(`boxColor${i + 1}`);
                boxColor.bgColor = color;
            }
        }
        _onEvent() {
            this._boxColors = [];
            this._boxBtns = [];
            this._texts = [];
            this._aniBtns = [];
            let imgRole = this.owner.getChildByName("boxRole").getChildAt(0);
            imgRole.skin = `role/npc${this.caseModel.suspectId}.png`;
            let boxReagent = this.owner.getChildByName("boxReagent");
            this._boxReagent = boxReagent;
            let sprDi = boxReagent.getChildByName("sprDi");
            let colors = this._colors;
            for (let i = 0; i &lt; 3; i++) {
                let boxColor = sprDi.getChildByName(`boxColor${i + 1}`);
                boxColor.bgColor = colors[i];
                this._boxColors[this._boxColors.length] = boxColor;
                let box = this.owner.getChildByName(`box${i + 1}`);
                box.bgColor = colors[i];
                this._boxBtns[this._boxBtns.length] = box;
                box.on(Laya.Event.MOUSE_DOWN, this, this._onApePress, [i]);
                let text = sprDi.getChildByName(`text${i + 1}`);
                this._texts[this._texts.length] = text;
            }
            let btnRe = this.owner.getChildByName("btnRe");
            this._btnRe = btnRe;
            btnRe.on(Laya.Event.CLICK, this, this._onRe);
            this._aniTest = this.owner["aniTest"];
            this._aniTest.on(Laya.Event.LABEL, this, this._aniEvent);
            let btn1 = this.owner["aniBtn1"];
            let btn2 = this.owner["aniBtn2"];
            let btn3 = this.owner["aniBtn3"];
            this._aniBtns = [btn1, btn2, btn3];
        }
        _onApePress(index) {
            Laya.stage.on(Laya.Event.MOUSE_UP, this, this._onApeRelease, [index]);
            Laya.stage.on(Laya.Event.MOUSE_OUT, this, this._onApeRelease, [index]);
            if (this._boxColors[2].height &gt;= 500) {
                return;
            }
            this._aniBtns[index].play(0, true);
            this._onHold(index);
            Laya.timer.frameLoop(1, this, this._onHold, [index]);
        }
        _onHold(index) {
            if (this._boxColors[2].height &gt;= 500) {
                return;
            }
            let boxColors = this._boxColors;
            let heights = this._heights;
            for (let i = 0; i &lt; 3; i++) {
                if (i &lt; index) continue;
                boxColors[i].height += 1;
                let height = boxColors[i].height;
                this._texts[i].color = height &gt;= heights[i] &amp;&amp; height &lt; heights[i] + 30 ? "#2de814" : "#ffffff";
            }
            this._tempCount++;
            if (this._tempCount % 5 == 0) {
                let waterDrop = Laya.Pool.getItemByClass("waterDrop", Laya.Sprite);
                waterDrop.x = 80;
                waterDrop.y = -200;
                this._boxReagent.addChild(waterDrop);
                waterDrop.graphics.drawCircle(35, 0, 10, this._colors[index]);
                Laya.Tween.to(waterDrop, {
                    y: this._boxColors[index].y
                }, 200, Laya.Ease.quartIn, Laya.Handler.create(this, () =&gt; {
                    waterDrop.removeSelf();
                    Laya.Pool.recover("waterDrop", waterDrop);
                }));
            }
        }
        _onApeRelease(index) {
            this._aniBtns[index].gotoAndStop(0);
            Laya.timer.clear(this, this._onHold);
            Laya.stage.off(Laya.Event.MOUSE_UP, this, this._onApeRelease);
            Laya.stage.off(Laya.Event.MOUSE_OUT, this, this._onApeRelease);
            let boxColors = this._boxColors;
            let heights = this._heights;
            let isSuc = true;
            for (let i = 0; i &lt; 3; i++) {
                let height = boxColors[i].height;
                if (height &lt; heights[i] || height &gt; heights[i] + 30) {
                    isSuc = false;
                    break;
                }
            }
            if (isSuc) {
                for (let i = 0; i &lt; 3; i++) {
                    this._boxBtns[i].off(Laya.Event.MOUSE_DOWN, this, this._onApePress);
                }
                this._btnRe.off(Laya.Event.CLICK, this, this._onRe);
                this._aniTest.play(0, false);
            }
        }
        _aniEvent(e) {
            switch (e) {
                case "endAni":
                    EventMgr.send(GameEvent.SOLVE.FINISH_STEP, [4]);
                    break;

                default:
                    break;
            }
        }
        _onRe() {
            this._tempCount = 0;
            Laya.Tween.to(this._boxReagent, {
                y: 1500
            }, 700, null, Laya.Handler.create(this, () =&gt; {
                for (let i = 0; i &lt; 3; i++) {
                    this._boxColors[i].height = 0;
                    this._texts[i].color = "#ffffff";
                }
                Laya.Tween.to(this._boxReagent, {
                    y: 568
                }, 700, null, Laya.Handler.create(this, () =&gt; { }));
            }));
        }
        _createLine() {
            for (let i = 0; i &lt; 3; i++) {
                let boxColor = this._boxColors[i];
                let color = this._colors[i];
                let spr = boxColor.getChildAt(0);
                let graphics = spr.graphics;
                let now = Laya.timer.currTimer;
                let loop = () =&gt; {
                    let delay = Laya.timer.currTimer - now;
                    graphics.clear();
                    let change = Math.sin(delay / 360) * 20;
                    graphics.drawCurves(0, 0, [-50, -change, 70, change, 175, 0], color, 20);
                };
                Laya.timer.loop(50, this, loop);
            }
        }
    }
    class Step4Type3 extends StepBase {
        constructor() {
            super(...arguments);
            this._imgArys = [];
            this._mLastMouseX = 0;
            this._skins = [];
            this._curIndexs = [0, 0, 0, 0, 0];
            this._folder = "";
        }
        onInit() {
            this._init();
        }
        onShow() { }
        onHide() {
            this._imgArys = [];
            for (let i = 0; i &lt; 5; i++) {
                let img = this._boxContainer.getChildByName(`img${i}`);
                img.offAllCaller(img);
                this._imgArys[i] = img;
            }
            this.owner.destroy(true);
        }
        onRelease() { }
        _init() {
            let boxTouch = this.owner.getChildByName("boxTouch");
            boxTouch.once(Laya.Event.CLICK, this, () =&gt; {
                boxTouch.visible = false;
            });
            let sprDi = this.owner.getChildByName("sprDi");
            let boxContainer = sprDi.getChildByName("boxContainer");
            this._boxContainer = boxContainer;
            this._imgTemp = boxContainer.getChildByName("imgTemp");
            this._imgArys = [];
            for (let i = 0; i &lt; 5; i++) {
                let img = boxContainer.getChildByName(`img${i}`);
                img.on(Laya.Event.MOUSE_DOWN, this, this._onMouseDown, [i]);
                this._imgArys[i] = img;
            }
            this._initData();
            this._ani = this.owner["ani"];
            let imgRole = sprDi.getChildByName("imgRole");
            imgRole.skin = `role/npc${this.caseModel.suspectId}.png`;
        }
        _initData() {
            let evidence = Number(this.caseModel.evidence);
            let rightId = this.caseModel.evidenceId;
            this._rightId = rightId;
            let isDNA = evidence == 0;
            this._isDNA = isDNA;
            let folder = this._isDNA ? "broken/dna" : "broken/Segment";
            this._folder = folder;
            for (let i = 0; i &lt; 5; i++) {
                this._skins[i] = [];
                let tempAry = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
                tempAry.splice(rightId - 1, 1);
                let idx = isDNA ? 5 - i : i + 1;
                for (let j = 0; j &lt; 4; j++) {
                    let randIdx = ComTools.getRandom(0, tempAry.length - 1);
                    let randId = tempAry[randIdx];
                    this._skins[i][j] = `${folder}${randId}_${idx}.png`;
                    tempAry.splice(randIdx, 1);
                }
                let randIdx = ComTools.getRandom(0, 4);
                this._skins[i].splice(randIdx, 0, `${folder}${rightId}_${idx}.png`);
            }
            let boxMini = this.owner.getChildByName("boxMini");
            for (let i = 0; i &lt; 5; i++) {
                let idx = isDNA ? 5 - i : i + 1;
                let img = boxMini.getChildByName(`img${i}`);
                img.skin = `${folder}${rightId}_${idx}.png`;
            }
            for (let i = 0; i &lt; 5; i++) {
                let img = this._imgArys[i];
                img.skin = this._skins[i][0];
            }
        }
        _onMouseDown(index, e) {
            if (this._curImg) return;
            let img = this._imgArys[index];
            this._curImg = img;
            this._mLastMouseX = img.parent.getMousePoint().x - img.x;
            this._onEvent(img, index);
        }
        _onMouseMove(index, e) {
            let img = this._curImg;
            if (!img) return;
            let imgTemp = this._imgTemp;
            img.x = img.parent.getMousePoint().x - this._mLastMouseX;
            if (img.x &lt; 175) {
                imgTemp.x = img.x + 250;
                let _index = this._curIndexs[index] + 1 &gt; 4 ? 0 : this._curIndexs[index] + 1;
                let imgPath = this._skins[index][_index];
                imgTemp.skin = imgPath;
            } else if (img.x &gt; 175) {
                imgTemp.x = img.x - 250;
                let _index = this._curIndexs[index] - 1 &lt; 0 ? 4 : this._curIndexs[index] - 1;
                let imgPath = this._skins[index][_index];
                imgTemp.skin = imgPath;
            }
            imgTemp.y = img.y;
        }
        _onMouseUp(index, e) {
            let img = this._curImg;
            if (!img) return;
            this._offEvent(img);
            this._backToCenter(img, index);
        }
        _onEvent(img, index) {
            img.on(Laya.Event.MOUSE_MOVE, this, this._onMouseMove, [index]);
            img.on(Laya.Event.MOUSE_OUT, this, this._onMouseUp, [index]);
            img.on(Laya.Event.MOUSE_UP, this, this._onMouseUp, [index]);
        }
        _offEvent(img) {
            img.off(Laya.Event.MOUSE_MOVE, this, this._onMouseMove);
            img.off(Laya.Event.MOUSE_OUT, this, this._onMouseUp);
            img.off(Laya.Event.MOUSE_UP, this, this._onMouseUp);
        }
        _backToCenter(img, index) {
            let imgTemp = this._imgTemp;
            let skin = imgTemp.skin;
            let ease = Laya.Ease.circOut;
            let time = 0;
            if (img.x &gt; 225) {
                time = (425 - img.x) * 2;
                Laya.Tween.to(img, {
                    x: 425
                }, time, ease, Laya.Handler.create(this, () =&gt; {
                    img.x = 175;
                    img.skin = skin;
                    let _index = this._curIndexs[index] - 1 &lt; 0 ? 4 : this._curIndexs[index] - 1;
                    this._curIndexs[index] = _index;
                }));
                Laya.Tween.to(imgTemp, {
                    x: 175
                }, time, ease, Laya.Handler.create(this, () =&gt; {
                    imgTemp.x = -175;
                }));
            } else if (img.x &lt; 125) {
                time = (img.x + 175) * 2;
                Laya.Tween.to(img, {
                    x: -175
                }, time, ease, Laya.Handler.create(this, () =&gt; {
                    img.x = 175;
                    img.skin = skin;
                    let _index = this._curIndexs[index] + 1 &gt; 4 ? 0 : this._curIndexs[index] + 1;
                    this._curIndexs[index] = _index;
                }));
                Laya.Tween.to(imgTemp, {
                    x: 175
                }, time, ease, Laya.Handler.create(this, () =&gt; {
                    imgTemp.x = -175;
                }));
            } else {
                time = Math.abs(img.x - 175) * 2;
                Laya.Tween.to(img, {
                    x: 175
                }, time, ease);
                let x = img.x &gt; 175 ? -175 : 425;
                Laya.Tween.to(imgTemp, {
                    x: x
                }, time, ease, Laya.Handler.create(this, () =&gt; {
                    imgTemp.x = -175;
                }));
            }
            Laya.timer.once(time + 100, this, () =&gt; {
                let isSuc = true;
                let rightId = this._rightId;
                for (let i = 0; i &lt; 5; i++) {
                    let img = this._imgArys[i];
                    let idx = this._isDNA ? 5 - i : i + 1;
                    if (img.skin != `${this._folder}${rightId}_${idx}.png`) {
                        isSuc = false;
                        break;
                    }
                }
                if (isSuc) {
                    imgTemp.visible = false;
                    this._ani.play(0, false);
                    let ani = new Laya.Animation();
                    ani.loadAnimation("animation/StartAni.ani");
                    ani.scaleX = 2;
                    ani.scaleY = 2;
                    ani.timer.frameOnce(40, this, () =&gt; {
                        this._boxContainer.parent.addChild(ani);
                        ani.play(0, false);
                        ani.pos(300, 300, true);
                    });
                    Laya.timer.once(1200, this, () =&gt; {
                        ani.clear();
                        EventMgr.send(GameEvent.SOLVE.FINISH_STEP, [4]);
                    });
                } else {
                    this._curImg = null;
                }
            });
        }
    }
    class Step4Type4 extends StepBase {
        constructor() {
            super(...arguments);
            this._roleIds = [];
            this._evidenceIds = [];
        }
        onInit() {
            this._init();
        }
        onShow() { }
        onHide() {
            for (let i = 0; i &lt; 4; i++) {
                let imgGrop = this.owner.getChildByName(`imgGrop${i}`);
                imgGrop.off(Laya.Event.CLICK, this, this._onSelect);
            }
            this.owner.destroy(true);
        }
        onRelease() { }
        _init() {
            let isDNA = this.caseModel.evidence == 0;
            let folder = isDNA ? "evidence/dna" : "evidence/fingerprint_";
            let W = isDNA ? 180 : 125;
            let H = isDNA ? 180 : 175;
            this._suspectId = this.caseModel.suspectId;
            this._evidenceId = this.caseModel.evidenceId;
            let roleAry = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20];
            roleAry.splice(this._suspectId - 1, 1);
            let evidenceAry = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
            evidenceAry.splice(this._evidenceId - 1, 1);
            for (let i = 0; i &lt; 3; i++) {
                let randRoleIdx = ComTools.getRandom(0, roleAry.length - 1);
                let randRoleId = roleAry[randRoleIdx];
                this._roleIds[i] = randRoleId;
                roleAry.splice(randRoleIdx, 1);
                let randEvidenceIdx = ComTools.getRandom(0, evidenceAry.length - 1);
                let randEvidenceId = evidenceAry[randEvidenceIdx];
                this._evidenceIds[i] = randEvidenceId;
                evidenceAry.splice(randEvidenceIdx, 1);
            }
            let randIndex = ComTools.getRandom(0, 3);
            this._roleIds.splice(randIndex, 0, this._suspectId);
            this._evidenceIds.splice(randIndex, 0, this._evidenceId);
            for (let i = 0; i &lt; 4; i++) {
                let roleId = this._roleIds[i];
                let evidenceId = this._evidenceIds[i];
                let imgGrop = this.owner.getChildByName(`imgGrop${i}`);
                let imgRandRole = imgGrop.getChildAt(1);
                imgRandRole.skin = `role/npc${roleId}.png`;
                let imgRandE = imgGrop.getChildAt(0);
                imgRandE.skin = `${folder}${evidenceId}.png`;
                imgRandE.width = W;
                imgRandE.height = H;
                imgGrop.on(Laya.Event.CLICK, this, this._onSelect, [evidenceId]);
            }
            let imgG = this.owner.getChildByName("imgGrop");
            let imgEvidence = imgG.getChildAt(0);
            imgEvidence.skin = `${folder}${this._evidenceId}.png`;
            imgEvidence.width = W;
            imgEvidence.height = H;
        }
        _onSelect(evidenceId) {
            if (evidenceId == this._evidenceId) {
                EventMgr.send(GameEvent.SOLVE.FINISH_STEP, [4]);
            } else {
                EventMgr.send(GameEvent.View.OPEN, "CaseFailedView");
            }
        }
    }
    class Case { }
    class Room { }
    class Level { }
    class Item { }
    class CaseModel {
        constructor() {
            this._seekSceneCount = 8;
            this._weaponCount = 12;
            this._evidenceCount = 10;
            this._roleCount = 20;
        }
        get curStep() {
            return this._curStep;
        }
        get caseId() {
            return this._caseId;
        }
        get caseType() {
            return this._caseType;
        }
        get bgSkin() {
            return this._bgSkin;
        }
        get sceneId() {
            return this._sceneId;
        }
        get award() {
            return this._award;
        }
        get weaponId() {
            return this._weaponId;
        }
        get evidenceId() {
            return this._evidenceId;
        }
        get evidence() {
            return this._evidence;
        }
        get suspectId() {
            return this._suspectId;
        }
        get tempData() {
            return this._tempData;
        }
        get stepModels() {
            return this._stepModels;
        }
        set curStep(step) {
            this._curStep = step;
        }
        set caseId(id) {
            this._caseId = id;
        }
        set caseType(id) {
            this._caseType = id;
        }
        set tempData(data) {
            this._tempData = data;
        }
        set award(award) {
            this._award = award;
        }
        get offerIndex() {
            return this._offerIndex;
        }
        set model(model) {
            this._curStep = 1;
            this._caseType = model.type;
            this._caseId = model.id;
            this._sceneId = model.sceneId;
            this._weaponId = model.weaponId;
            this._evidenceId = model.evidenceId;
            this._suspectId = model.suspectId;
            this._evidence = model.evidence;
            this._bgSkin = model.bgSkin;
            this._stepModels = model.stepModels;
            this._award = model.award;
        }
        get model() {
            return {
                id: this._caseId,
                sceneId: this._sceneId,
                type: this._caseType,
                award: this._award,
                suspectId: this.suspectId,
                weaponId: this._weaponId,
                evidenceId: this._evidenceId,
                stepModels: this._stepModels,
                evidence: this._evidence,
                bgSkin: this._bgSkin
            };
        }
        setInfo(id, type, award = 0, suspectId, offerIndex) {
            this._caseId = id;
            this._caseType = type;
            this._award = award;
            this._suspectId = suspectId;
            this._offerIndex = offerIndex;
            this._initData();
        }
        _initData() {
            this._curStep = 1;
            this._weaponId = this._getRandomWeaponId();
            this._evidence = ComTools.getRandom(0, 1);
            this._evidenceId = this._getRandomEvidenceId();
            this._suspectId = this._suspectId ? this._suspectId : ComTools.getRandom(1, this._roleCount);
            let steps = [1, 2, 3, 4];
            let stepModels = [];
            for (let i = 0; i &lt; 4; i++) {
                let step = steps[i];
                let stepModel = this._getStepModelByStep(step);
                stepModels.push(stepModel);
            }
            this._stepModels = stepModels;
            if (0 == this._award) {
                let type = this._caseType;
                let award = 0;
                switch (type) {
                    case 0:
                        award = ComTools.getRandom(50, 80);
                        break;

                    case 1:
                        award = ComTools.getRandom(100, 230);
                        break;

                    case 2:
                        award = ComTools.getRandom(240, 270);
                        break;

                    case 3:
                        award = 1500;
                        break;

                    default:
                        break;
                }
                this._award = award;
            }
        }
        _getStepModelByStep(step) {
            let stepModel = {
                kind: null,
                stepDes: "",
                viewPath: null,
                skinBg: null,
                data: null
            };
            switch (step) {
                case 1:
                    {
                        let kind = this._getKindByStep(step);
                        stepModel.kind = kind;
                        this._step1Kind = kind;
                        if (kind == 1) {
                            let rand = ComTools.getRandom(0, 1);
                            stepModel.stepDes = rand == 0 ? "Question the witness" : "Ask the assistant";
                            stepModel.viewPath = "case/step1/Step1Type1.json";
                            let skinBg = this._getRandomSkin();
                            this._bgSkin = skinBg;
                            stepModel.skinBg = skinBg;
                            let tempAry = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20];
                            tempAry.splice(this._suspectId - 1, 1);
                            let idx = ComTools.getRandom(1, tempAry.length - 1);
                            stepModel.data = tempAry[idx];
                        } else {
                            stepModel.stepDes = "Collect clues";
                            let id = this._getRandomScene();
                            this._sceneId = id;
                            stepModel.viewPath = this._add00("case/step1/seek/Scene", id);
                            let flag = [19, 2, 27, 24, 26, 8, 23, 12];
                            let skinBg = `big/bjt${flag[id - 1]}.jpg`;
                            this._bgSkin = skinBg;
                            stepModel.skinBg = skinBg;
                        }
                    }
                    break;

                case 2:
                    {
                        let kind = this._getKindByStep(step);
                        stepModel.kind = kind;
                        if (kind == 4) {
                            stepModel.stepDes = "Rearrange evidences";
                            stepModel.viewPath = this._add00("case/step2/puzzle/Weapon", this.weaponId);
                        } else if (kind == 6) {
                            stepModel.stepDes = "Scan weapon";
                            stepModel.viewPath = this._add00("case/step2/scan/Scene", this._sceneId);
                        }
                        stepModel.skinBg = this._bgSkin;
                    }
                    break;

                case 3:
                    {
                        let kind = this._getKindByStep(step);
                        stepModel.kind = kind;
                        if (kind == 8) {
                            let des = this._evidence == 0 ? "Scan DNA" : "Scan fingerprint";
                            stepModel.stepDes = des;
                            stepModel.viewPath = this._add00("case/step3/scan/Weapon", this.weaponId);
                        } else if (kind == 9) {
                            let des = this._evidence == 0 ? "Search for DNA" : "Search for fingerprint";
                            stepModel.stepDes = des;
                            stepModel.viewPath = this._add00("case/step3/seek/Weapon", this.weaponId);
                        }
                        stepModel.skinBg = this._bgSkin;
                    }
                    break;

                case 4:
                    {
                        let kind = this._getKindByStep(step);
                        stepModel.kind = kind;
                        if (kind == 10) {
                            stepModel.stepDes = "Search for the suspect";
                            stepModel.viewPath = `case/step4/Step4Type1.json`;
                            stepModel.skinBg = "big/bjt33.png";
                        } else if (kind == 11) {
                            let des = this._evidence == 0 ? "Looking for matching DNA" : "Match fingerprint";
                            stepModel.stepDes = des;
                            stepModel.viewPath = `case/step4/Step4Type3.json`;
                            stepModel.skinBg = "big/bjt33.png";
                        } else if (kind == 12) {
                            stepModel.stepDes = "Select the correct option";
                            stepModel.viewPath = `case/step4/Step4Type4.json`;
                            stepModel.skinBg = "big/bjt33.png";
                        } else if (kind == 13) {
                            stepModel.stepDes = "Detect DNA";
                            stepModel.viewPath = `case/step4/Step4Type2.json`;
                            stepModel.skinBg = "big/bjt33.png";
                        }
                    }
                    break;

                default:
                    break;
            }
            return stepModel;
        }
        _getKindByStep(step) {
            let index, kind, kinds;
            switch (step) {
                case 1:
                    kinds = [1, 3];
                    break;

                case 2:
                    kinds = [4, 6];
                    if (this._step1Kind == 1) {
                        kinds = [4];
                    } else if (this._step1Kind == 2) {
                        kinds = [6];
                    } else {
                        kinds = [6];
                    }
                    break;

                case 3:
                    kinds = [8, 9];
                    break;

                case 4:
                    kinds = [10, 11, 12, 13];
                    break;

                default:
                    break;
            }
            index = ComTools.getRandom(0, kinds.length - 1);
            kind = kinds[index];
            return kind;
        }
        _getRandomSkin() {
            let index = ComTools.getRandom(1, 32);
            return `big/bjt${index}.jpg`;
        }
        _getRandomWeaponId() {
            return ComTools.getRandom(1, this._weaponCount);
        }
        _getRandomEvidenceId() {
            return ComTools.getRandom(1, this._evidenceCount);
        }
        _getRandomScene() {
            return ComTools.getRandom(1, this._seekSceneCount);
        }
        _add00(path, level) {
            let a = path;
            let b = "";
            if (level &lt; 10) {
                b = `00${level}`;
            } else if (level &lt; 100) {
                b = `0${level}`;
            } else if (level &lt; 1e3) {
                b = `${level}`;
            }
            return a + b + ".json";
        }
    }
    class Logger {
        static log(message, ...optionalParams) {
            if (GameContext.use_log) console.log(message, optionalParams);
        }
        static error(message, ...optionalParams) {
            if (GameContext.use_log) console.error(message, optionalParams);
        }
    }
    class LogPanel {
        constructor() { }
        static initPanel() {
            if (!LogPanel._instacne) LogPanel._instacne = new LogPanel();
            LogPanel.maxCount = 20;
            this._instacne._baseBox = new Laya.Box();
            this._instacne._baseBox.y = 300;
            Laya.stage.addChild(this._instacne._baseBox);
            this._instacne._panel = new Laya.Panel();
            this._instacne._panel.width = Laya.stage.width;
            this._instacne._panel.height = Laya.stage.height - 300;
            this._instacne._panel.bgColor = "#ffffff";
            this._instacne._panel.vScrollBarSkin = "";
            this._instacne._panel.elasticEnabled = true;
            this._instacne._baseBox.addChild(this._instacne._panel);
            this._instacne._context = new Laya.Label();
            this._instacne._context.wordWrap = true;
            this._instacne._context.width = this._instacne._panel.width;
            this._instacne._context.fontSize = 22;
            this._instacne._context.color = "#ff0000";
            this._instacne._panel.addChild(this._instacne._context);
            this._instacne._toggle = new Laya.Label();
            this._instacne._toggle.fontSize = 26;
            this._instacne._toggle.y = -30;
            this._instacne._baseBox.addChild(this._instacne._toggle);
            this._instacne._toggle.on(Laya.Event.CLICK, this._instacne, this._instacne.onClick);
            this._instacne.disEnable();
        }
        static print(info) {
            this._instacne &amp;&amp; this._instacne.printLog(info);
        }
        onClick() {
            this._panel.visible = !this._panel.visible;
            this._toggle.text = this._panel.visible ? "éšè—æŠ¥é”™Log" : "æ˜¾ç¤ºæŠ¥é”™Log";
        }
        enable() {
            this._panel.visible = true;
            this._toggle.text = "éšè—æŠ¥é”™Log";
        }
        disEnable() {
            this._panel.visible = false;
            this._toggle.text = "æ˜¾ç¤ºæŠ¥é”™Log";
        }
        printLog(info) {
            if (!this._context || !info) return;
            if (!this.logStrs) this.logStrs = [];
            if (this.logStrs.length &gt;= LogPanel.maxCount) {
                this.logStrs.pop();
            }
            this.enable();
            this.logStrs.push(info);
            var str;
            for (let i = this.logStrs.length - 1; i &gt;= 0; i--) {
                str += this.logStrs[i] + "\n\n\n";
            }
            this._context.text = str;
            this._panel.scrollTo(0, 0);
            Laya.stage.setChildIndex(this._baseBox, Laya.stage.numChildren - 1);
        }
    }
    class RefMgr {
        constructor() {
            this._folder = "res/resource/";
            this._all = {};
            RefMgr.instance = this;
        }
        load(list, handler) {
            var filelist = [];
            list.forEach(v =&gt; {
                filelist.push({
                    url: this._folder + v + ".json",
                    type: "json"
                });
            });
            this.handler = handler;
            Laya.loader.load(filelist, Laya.Handler.create(this, this.onLoadComplete, [list]));
        }
        onLoadComplete(list) {
            list.forEach(name =&gt; {
                let array = Laya.loader.getRes(this._folder + name + ".json");
                Logger.log("*****start load " + name);
                let dict = {};
                for (const id in array) {
                    if (array.hasOwnProperty(id)) {
                        dict[id] = array[id];
                    }
                }
                this._all[name] = dict;
                Laya.loader.clearRes(this._folder + name + ".json");
                Logger.log("***** load " + name + " ok");
            });
            this.handler &amp;&amp; (this.handler.run(), this.handler = null);
        }
        getRef(type, id) {
            var name = type["name"];
            var tbl = this._all[name];
            if (!tbl) return null;
            return tbl[id];
        }
        getAllRef(type) {
            var name = type["name"];
            var tbl = this._all[name];
            return tbl;
        }
        static getRef(type, id) {
            if (!this.instance) return null;
            return this.instance.getRef(type, id);
        }
        static getAllRef(type) {
            if (!this.instance) return null;
            return this.instance.getAllRef(type);
        }
    }
    class CasePage extends Laya.Script {
        constructor() {
            super();
            this._refreshCount = 2;
            let cases = RefMgr.getAllRef(Case);
            let size = 0;
            for (let key in cases) {
                size++;
            }
            this._refSize = size;
            this._caseModel = new CaseModel();
        }
        onStart() {
            this.imgBg = this.owner.getChildByName("imgBg");
            this.imgPage = this.owner.getChildByName("imgPage");
            this.imgIcon = this.owner.getChildByName("imgIcon");
            this.imgType = this.owner.getChildByName("imgType");
            this.btnPass = this.owner.getChildByName("btnPass");
            this.btnTake = this.owner.getChildByName("btnTake");
            this.sprAd = this.owner.getChildByName("sprAd");
            this.textDes = this.owner.getChildByName("textDes");
            this.textAward = this.owner.getChildByName("textAward");
            this.textName = this.owner.getChildByName("textName");
            this.caseShow = this.owner["caseShow"];
            this.btnTake.on(Laya.Event.CLICK, this, this._toLocale);
            this.btnPass.on(Laya.Event.CLICK, this, this._onPass);
            EventMgr.on(GameEvent.REFRESH_CASE, this, this._refreshCase);
            let model = GameContext.gPlayer.caseModel;
            if (model) {
                this._refreshCount = 2;
                this._caseModel.model = model;
                this._upDataUI();
            } else {
                this._refreshCount = 0;
                this._refreshCase(false);
            }
        }
        onDisable() {
            this.btnTake.off(Laya.Event.CLICK, this, this._toLocale);
            this.btnPass.off(Laya.Event.CLICK, this, this._onPass);
        }
        clearRes() {
            this._lastSkin &amp;&amp; Laya.loader.clearTextureRes(`${this._lastSkin}`);
        }
        setInfo(model) {
            this._lastSkin = this._caseModel ? this._caseModel.bgSkin : null;
            this._caseModel = model;
            this._upDataUI();
        }
        _upDataUI() {
            let type = this._caseModel.caseType;
            let isSpecial = type &gt; 2;
            this.imgIcon.skin = isSpecial ? "main/Handcuffs.png" : "main/badge.png";
            let ref = RefMgr.getRef(Case, this._caseModel.caseId);
            this.textName.text = ref.name;
            this.imgBg.skin = this._caseModel.bgSkin;
            this.textAward.changeText(`${this._caseModel.award}`);
            let freeCount = GameContext.gPlayer.freeRefreshCounts;
            this.sprAd.visible = freeCount == 0;
            this.textDes.text = freeCount == 0 ? "VIP cases" : "Free refresh";
            switch (type) {
                case 0:
                    this.imgPage.skin = "big/frame2.png";
                    this.imgType.skin = "main/normol.png";
                    this.imgIcon.skin = "main/badge.png";
                    break;

                case 1:
                    this.imgPage.skin = "big/frame2.png";
                    this.imgType.skin = "main/medium.png";
                    this.imgIcon.skin = "main/badge.png";
                    break;

                case 2:
                    this.imgPage.skin = "big/frame.png";
                    this.imgType.skin = "main/High.png";
                    this.imgIcon.skin = "main/Handcuffs.png";
                    break;

                default:
                    break;
            }
            this.clearRes();
        }
        _toLocale() {
            YYGGames.showInterstitial(() =&gt; {
                GameContext.gPlayer.guideControl.nextStep();
                EventMgr.send(GameEvent.SELECT_CASE, this._caseModel);
                YYGGames.gameBanner.visible = false;
            })
        }
        _onPass() {
            GameContext.gPlayer.guideControl.nextStep();
            let freeCount = GameContext.gPlayer.freeRefreshCounts;
            if (freeCount &gt; 0) {
                --GameContext.gPlayer.freeRefreshCounts;
                this._refreshCase(false);
            } else {
                let $this = this;
                let success = () =&gt; {
                    $this._refreshCase(true);
                };
                let fail = () =&gt; { };
                AdDealer.AdUser.PlayVideoAd("çœ‹å¹¿å‘Šåˆ·æ–°æ¡ˆä»¶", success, fail, fail);
            }
        }
        _refreshCase(isAdBack) {
            let caseId = ComTools.getRandom(1, this._refSize);
            let type;
            if (this._refreshCount &gt; 1) {
                if (isAdBack) {
                    type = 2;
                } else {
                    let randNum = ComTools.getRandom(0, 1);
                    type = 0 == randNum ? 0 : 1;
                }
            } else if (0 == this._refreshCount) {
                type = 0;
            } else if (1 == this._refreshCount) {
                type = 1;
            }
            this._caseModel.setInfo(caseId, type);
            GameContext.gPlayer.caseModel = this._caseModel.model;
            EventMgr.send(GameEvent.SAVE_LOCAL_DATA);
            this._upDataUI();
            this._refreshCount++;
            this.caseShow.play(0, false);
        }
    }
    class Currency extends Laya.Script {
        constructor() {
            super();
        }
        onStart() {
            this._textGold = this.owner.getChildByName("textGold");
            EventMgr.on(GameEvent.CHANGE_CURRENCY, this, this._callLaterChange);
            this._callLaterChange();
            3;
        }
        onDisable() { }
        _callLaterChange() {
            Laya.timer.callLater(this, () =&gt; {
                let player = GameContext.gPlayer;
                let gold = player.gold;
                this._textGold.changeText(`${gold}`);
            });
        }
    }
    class ButtonRunTime extends Laya.Button {
        constructor() {
            super();
            this.scaleTime = 100;
        }
        scaleBig() {
            Laya.Tween.to(this, {
                scaleX: 1,
                scaleY: 1
            }, this.scaleTime);
        }
        scaleSmall() {
            Laya.Tween.to(this, {
                scaleX: .8,
                scaleY: .8
            }, this.scaleTime);
        }
        onEnable() {
            this.anchorX = this.anchorY = .5;
            this.x = this.width / 2 + this.x;
            this.y = this.height / 2 + this.y;
            this.on(Laya.Event.MOUSE_DOWN, this, this.scaleSmall);
            this.on(Laya.Event.MOUSE_UP, this, this.scaleBig);
            this.on(Laya.Event.MOUSE_OUT, this, this.scaleBig);
        }
        onDisable() {
            this.off(Laya.Event.MOUSE_DOWN, this, this.scaleSmall);
            this.off(Laya.Event.MOUSE_UP, this, this.scaleBig);
            this.off(Laya.Event.MOUSE_OUT, this, this.scaleBig);
        }
    }
    var REG = Laya.ClassUtils.regClass;
    var ui;
    (function (ui) {
        var com;
        (function (com) {
            class CasePageUI extends Laya.View {
                constructor() {
                    super();
                }
                createChildren() {
                    super.createChildren();
                    this.loadScene("com/CasePage");
                }
            }
            com.CasePageUI = CasePageUI;
            REG("ui.com.CasePageUI", CasePageUI);
            class OfferPageUI extends Laya.View {
                constructor() {
                    super();
                }
                createChildren() {
                    super.createChildren();
                    this.loadScene("com/OfferPage");
                }
            }
            com.OfferPageUI = OfferPageUI;
            REG("ui.com.OfferPageUI", OfferPageUI);
            class TipsUI extends Laya.View {
                constructor() {
                    super();
                }
                createChildren() {
                    super.createChildren();
                    this.loadScene("com/Tips");
                }
            }
            com.TipsUI = TipsUI;
            REG("ui.com.TipsUI", TipsUI);
        })(com = ui.com || (ui.com = {}));
    })(ui || (ui = {}));
    (function (ui) {
        class GameMainUI extends Laya.View {
            constructor() {
                super();
            }
            createChildren() {
                super.createChildren();
                this.loadScene("GameMain");
            }
        }
        ui.GameMainUI = GameMainUI;
        REG("ui.GameMainUI", GameMainUI);
    })(ui || (ui = {}));
    (function (ui) {
        var view;
        (function (view) {
            class AccTouchViewUI extends Laya.View {
                constructor() {
                    super();
                }
                createChildren() {
                    super.createChildren();
                    this.loadScene("view/AccTouchView");
                }
            }
            view.AccTouchViewUI = AccTouchViewUI;
            REG("ui.view.AccTouchViewUI", AccTouchViewUI);
            class BoxViewUI extends Laya.View {
                constructor() {
                    super();
                }
                createChildren() {
                    super.createChildren();
                    this.loadScene("view/BoxView");
                }
            }
            view.BoxViewUI = BoxViewUI;
            REG("ui.view.BoxViewUI", BoxViewUI);
            class CaseFailedViewUI extends Laya.View {
                constructor() {
                    super();
                }
                createChildren() {
                    super.createChildren();
                    this.loadScene("view/CaseFailedView");
                }
            }
            view.CaseFailedViewUI = CaseFailedViewUI;
            REG("ui.view.CaseFailedViewUI", CaseFailedViewUI);
            class ClearCaseViewUI extends Laya.View {
                constructor() {
                    super();
                }
                createChildren() {
                    super.createChildren();
                    this.loadScene("view/ClearCaseView");
                }
            }
            view.ClearCaseViewUI = ClearCaseViewUI;
            REG("ui.view.ClearCaseViewUI", ClearCaseViewUI);
            class DevelopViewUI extends Laya.View {
                constructor() {
                    super();
                }
                createChildren() {
                    super.createChildren();
                    this.loadScene("view/DevelopView");
                }
            }
            view.DevelopViewUI = DevelopViewUI;
            REG("ui.view.DevelopViewUI", DevelopViewUI);
            class GetEnergyViewUI extends Laya.View {
                constructor() {
                    super();
                }
                createChildren() {
                    super.createChildren();
                    this.loadScene("view/GetEnergyView");
                }
            }
            view.GetEnergyViewUI = GetEnergyViewUI;
            REG("ui.view.GetEnergyViewUI", GetEnergyViewUI);
            class GuideViewUI extends Laya.View {
                constructor() {
                    super();
                }
                createChildren() {
                    super.createChildren();
                    this.loadScene("view/GuideView");
                }
            }
            view.GuideViewUI = GuideViewUI;
            REG("ui.view.GuideViewUI", GuideViewUI);
            class LoadViewUI extends Laya.View {
                constructor() {
                    super();
                }
                createChildren() {
                    super.createChildren();
                    this.loadScene("view/LoadView");
                }
            }
            view.LoadViewUI = LoadViewUI;
            REG("ui.view.LoadViewUI", LoadViewUI);
            class LocaleViewUI extends Laya.View {
                constructor() {
                    super();
                }
                createChildren() {
                    super.createChildren();
                    this.loadScene("view/LocaleView");
                }
            }
            view.LocaleViewUI = LocaleViewUI;
            REG("ui.view.LocaleViewUI", LocaleViewUI);
            class NotMoneyViewUI extends Laya.View {
                constructor() {
                    super();
                }
                createChildren() {
                    super.createChildren();
                    this.loadScene("view/NotMoneyView");
                }
            }
            view.NotMoneyViewUI = NotMoneyViewUI;
            REG("ui.view.NotMoneyViewUI", NotMoneyViewUI);
            class OfferViewUI extends Laya.View {
                constructor() {
                    super();
                }
                createChildren() {
                    super.createChildren();
                    this.loadScene("view/OfferView");
                }
            }
            view.OfferViewUI = OfferViewUI;
            REG("ui.view.OfferViewUI", OfferViewUI);
            class OffLineViewUI extends Laya.View {
                constructor() {
                    super();
                }
                createChildren() {
                    super.createChildren();
                    this.loadScene("view/OffLineView");
                }
            }
            view.OffLineViewUI = OffLineViewUI;
            REG("ui.view.OffLineViewUI", OffLineViewUI);
            class ShareViewUI extends Laya.View {
                constructor() {
                    super();
                }
                createChildren() {
                    super.createChildren();
                    this.loadScene("view/ShareView");
                }
            }
            view.ShareViewUI = ShareViewUI;
            REG("ui.view.ShareViewUI", ShareViewUI);
            class ShopViewUI extends Laya.View {
                constructor() {
                    super();
                }
                createChildren() {
                    super.createChildren();
                    this.loadScene("view/ShopView");
                }
            }
            view.ShopViewUI = ShopViewUI;
            REG("ui.view.ShopViewUI", ShopViewUI);
            class TaskViewUI extends Laya.View {
                constructor() {
                    super();
                }
                createChildren() {
                    super.createChildren();
                    this.loadScene("view/TaskView");
                }
            }
            view.TaskViewUI = TaskViewUI;
            REG("ui.view.TaskViewUI", TaskViewUI);
        })(view = ui.view || (ui.view = {}));
    })(ui || (ui = {}));
    class Tips extends ui.com.TipsUI {
        constructor(msg) {
            super();
            this._msg = msg;
        }
        static show(msg) {
            for (let i of this._livingTips) {
                i.top -= 36;
            }
            let toast = new Tips(msg);
            Laya.stage.addChild(toast);
            Tips._livingTips.push(toast);
        }
        onEnable() {
            this.top = 150;
            this.mouseEnabled = false;
            this.enter();
        }
        enter() {
            this.labTips.text = this._msg;
            let width = this.labTips.width + 150;
            this.imgBg.width = width;
            this.x = Laya.stage.width / 2;
            this.width = width;
            Laya.Tween.to(this, {
                alpha: 1
            }, 800, Laya.Ease.quintOut, Laya.Handler.create(this, () =&gt; {
                Laya.Tween.to(this, {
                    alpha: 0
                }, 500, Laya.Ease.quintIn, Laya.Handler.create(this, () =&gt; {
                    if (this.parent) {
                        this.parent.removeChild(this);
                        for (let i = 0, len = Tips._livingTips.length; i &lt; len; i++) {
                            if (Tips._livingTips[i] == this) {
                                Tips._livingTips.splice(i, 1);
                                break;
                            }
                        }
                    }
                }), 1e3);
            }));
        }
    }
    Tips._livingTips = [];
    class ItemCell extends Laya.Script {
        onStart() {
            this._imgIcon = this.owner.getChildByName("imgIcon");
            this._textName = this.owner.getChildByName("textName");
            this._textOutPut = this.owner.getChildByName("textOutPut");
            this._textPrice = this.owner.getChildByName("textPrice");
            this._textUnlockDes = this.owner.getChildByName("textUnlockDes");
            this._sprLock = this.owner.getChildByName("sprLock");
            this._btnYgm = this.owner.getChildByName("btnYgm");
            this._btnBuy = this.owner.getChildByName("btnBuy");
            this._sprGold = this.owner.getChildByName("sprGold");
            this._lv = GameContext.gPlayer.level;
            this._btnBuy.on(Laya.Event.CLICK, this, () =&gt; {
                GameContext.gPlayer.guideControl.nextStep();
                let ref = RefMgr.getRef(Item, this._id);
                let price = ref.price;
                if (this._isUnlock) {
                    if (GameContext.gPlayer.isEnough(price)) {
                        this._btnYgm.visible = true;
                        this._btnBuy.visible = false;
                        GameContext.gPlayer.costGold(price);
                        GameContext.gPlayer.developCtrl.addItem(this._id);
                    } else {
                        if (GameContext.gPlayer.lookAdCount &gt; 0) {
                            EventMgr.send(GameEvent.View.OPEN, "NotMoneyView");
                            EventMgr.send(GameEvent.View.CLOSE, "ShopView");
                        } else {
                            Tips.show("Not enough money, get more money from wanted list");
                        }
                    }
                } else {
                    Tips.show(`Unlock at ${ref.unlockDes.toLowerCase()}`);
                }
            });
        }
        set dataSource(id) {
            this._id = id;
            let ref = RefMgr.getRef(Item, id);
            let skin = `develop/${ref.icon}.png`;
            this._imgIcon.skin = skin;
            this._textName.text = ref.name;
            this._textOutPut.text = `${(ref.outPut * 60).toFixed(1)}/s`;
            this._isUnlock = this._lv &gt;= ref.unlockLv;
            this._sprLock.visible = !this._isUnlock;
            this._btnYgm.visible = GameContext.gPlayer.developCtrl.isHaveItem(id);
            this._btnBuy.visible = !this._btnYgm.visible;
            this._btnBuy.gray = !this._isUnlock;
            this._textUnlockDes.visible = !this._isUnlock;
            if (!this._isUnlock) {
                this._textUnlockDes.changeText(`${ref.unlockDes} Unlock`);
            }
            if (this._btnYgm.visible) {
                this._sprGold.visible = false;
                this._textPrice.color = "#C1916D";
                this._textPrice.text = "Sold out";
            } else {
                let price = ref.price;
                this._textPrice.color = GameContext.gPlayer.isEnough(price) ? "#27AD55" : "#ff0000";
                this._sprGold.visible = true;
                this._textPrice.text = `${ref.price}`;
            }
        }
    }
    class PoliceCell extends Laya.Script {
        onStart() {
            this._imgIcon = this.owner.getChildByName("imgIcon");
            this._textName = this.owner.getChildByName("textName");
            this._textOutPut = this.owner.getChildByName("textOutPut");
            this._textPrice = this.owner.getChildByName("textPrice");
            this._textUnlockDes = this.owner.getChildByName("textUnlockDes");
            this._sprLock = this.owner.getChildByName("sprLock");
            this._btnYgm = this.owner.getChildByName("btnYgm");
            this._btnBuy = this.owner.getChildByName("btnBuy");
            this._btn_text = this._btnBuy.getChildByName("btn_text");
            this._sprGold = this.owner.getChildByName("sprGold");
            this._lv = GameContext.gPlayer.level;
            this._btnBuy.on(Laya.Event.CLICK, this, () =&gt; {
                let ref = RefMgr.getRef(Item, this._id);
                let price = ref.price;
                if (this._isUnlock) {
                    if (GameContext.gPlayer.isEnough(price)) {
                        GameContext.gPlayer.costGold(price);
                        GameContext.gPlayer.developCtrl.addPolice(this._id);
                        this.dataSource = this._id;
                    } else {
                        if (GameContext.gPlayer.lookAdCount &gt; 0) {
                            EventMgr.send(GameEvent.View.OPEN, "NotMoneyView");
                            EventMgr.send(GameEvent.View.CLOSE, "ShopView");
                        } else {
                            Tips.show("Not enough money, get more money from wanted list");
                        }
                    }
                } else {
                    Tips.show(`Unlock at ${ref.unlockDes.toLowerCase()}`);
                }
            });
        }
        set dataSource(id) {
            this._id = id;
            let ref = RefMgr.getRef(Item, id);
            let skin = `develop/${ref.icon}.png`;
            this._imgIcon.skin = skin;
            this._textName.text = ref.name;
            this._textOutPut.text = `${(ref.outPut * 60).toFixed(1)}/s`;
            this._isUnlock = this._lv &gt;= ref.unlockLv;
            this._sprLock.visible = !this._isUnlock;
            let count = GameContext.gPlayer.developCtrl.getPoliceCountById(id);
            this._btnYgm.visible = count &gt;= 3;
            this._btnBuy.visible = !this._btnYgm.visible;
            this._btnBuy.gray = !this._isUnlock;
            this._btn_text.text = `Hire\n${count}/3`;
            this._textUnlockDes.visible = !this._isUnlock;
            if (!this._isUnlock) {
                this._textUnlockDes.changeText(`${ref.unlockDes} Unlock`);
            }
            if (this._btnYgm.visible) {
                this._sprGold.visible = false;
                this._textPrice.color = "#C1916D";
                this._textPrice.text = "Stop hiring";
            } else {
                let price = ref.price;
                this._textPrice.color = GameContext.gPlayer.isEnough(price) ? "#27AD55" : "#ff0000";
                this._sprGold.visible = true;
                this._textPrice.text = `${ref.price}`;
            }
        }
    }
    class GameConfig {
        constructor() { }
        static init() {
            var reg = Laya.ClassUtils.regClass;
            reg("game/script/CaseControl.ts", CaseControl);
            reg("game/script/step1/Step1Type2.ts", Step1Type2);
            reg("game/script/step1/Step1Type1.ts", Step1Type1);
            reg("game/script/step2/Step2Type1.ts", Step2Type1);
            reg("game/script/step2/Step2Type2.ts", Step2Type2);
            reg("game/script/step3/Step3Type1.ts", Step3Type1);
            reg("game/script/step3/Step3Type2.ts", Step3Type2);
            reg("game/script/step4/Step4Type1.ts", Step4Type1);
            reg("game/script/step4/Step4Type2.ts", Step4Type2);
            reg("game/script/step4/Step4Type3.ts", Step4Type3);
            reg("game/script/step4/Step4Type4.ts", Step4Type4);
            reg("game/view/com/CasePage.ts", CasePage);
            reg("game/view/com/Currency.ts", Currency);
            reg("frame/com/ButtonRunTime.ts", ButtonRunTime);
            reg("game/view/com/ItemCell.ts", ItemCell);
            reg("game/view/com/PoliceCell.ts", PoliceCell);
        }
    }
    GameConfig.width = 640;
    GameConfig.height = 1136;
    GameConfig.scaleMode = "showall";
    GameConfig.screenMode = "none";
    GameConfig.alignV = "middle";
    GameConfig.alignH = "center";
    GameConfig.startScene = "GameMain.scene";
    GameConfig.sceneRoot = "";
    GameConfig.debug = false;
    GameConfig.stat = false;
    GameConfig.physicsDebug = false;
    GameConfig.exportSceneToJson = true;
    GameConfig.init();
    var EventDispatcher = Laya.EventDispatcher;
    class Router {
        constructor() {
            this._evtDispatcher = new EventDispatcher();
            this._msgDispatcher = new EventDispatcher();
        }
        event(type, data) {
            return this._evtDispatcher.event(type, data);
        }
        on(type, caller, listener, args) {
            this._evtDispatcher.on(type, caller, listener, args);
        }
        once(type, caller, listener, args) {
            this._evtDispatcher.once(type, caller, listener, args);
        }
        off(type, caller, listener, onceOnly) {
            this._evtDispatcher.off(type, caller, listener, onceOnly);
        }
        offAll(type) {
            this._evtDispatcher.offAll(type);
        }
        offAllCaller(caller) {
            this._evtDispatcher.offAllCaller(caller);
        }
        route(type, data) {
            if (data === void 0) return this.event(type);
            return this.event(type, data);
        }
        onMsg(msgtype, caller, listener, args) {
            this._msgDispatcher.on(msgtype.toString(), caller, listener, args);
        }
        offMsg(msgtype, caller, listener) {
            this._msgDispatcher.off(msgtype.toString(), caller, listener);
        }
        offAllCallerMsg(caller) {
            this._msgDispatcher.offAllCaller(caller);
        }
        routeMsg(msgtype, msg) {
            this._msgDispatcher.event(msgtype.toString(), msg);
        }
    }
    class config { }
    config.version = "100";
    config.appid = "1110727630";
    config.pkgName = "";
    config.appKey = "";
    config.env = "release";
    config.url = "";//https://gmone.huiruui.com
    config.switchUrl = "";//https://gmtwo.huiruui.com
    class ptgcspsdk {
        static sendLogin(channel, action, openid, isnew, from_appid, from_imgid, code, callBack) {
            if (!isnew) {
                isnew = 0;
            }
            let data = {
                channel: channel,
                action: action,
                openid: openid,
                from_appid: from_appid,
                from_imgid: from_imgid,
                my_appid: config.appid,
                code: code,
                isnew: isnew
            };
            NetWork.sendPost(data, callBack);
        }
        static sendAuthorize(channel, action, openid, isnew, from_appid, from_imgid, code, callBack) {
            if (!isnew) {
                isnew = 0;
            }
            let data = {
                channel: channel,
                action: action,
                openid: openid,
                from_appid: from_appid,
                from_imgid: from_imgid,
                my_appid: config.appid,
                code: code,
                isnew: isnew
            };
            NetWork.sendPost(data, callBack);
        }
        static startGame(channel, action, openid, callBack) {
            let data = {
                channel: channel,
                action: action,
                openid: openid,
                my_appid: config.appid
            };
            NetWork.sendPost(data, callBack);
        }
        static sendShare(channel, action, openid, type, callBack) {
            let data = {
                channel: channel,
                action: action,
                openid: openid,
                my_appid: config.appid,
                type: type
            };
            NetWork.sendPost(data, callBack);
        }
        static watchVideo(channel, action, openid, type, callBack) {
            let data = {
                channel: channel,
                action: action,
                openid: openid,
                my_appid: config.appid,
                type: type
            };
            NetWork.sendPost(data, callBack);
        }
        static sendJump(channel, action, openid, my_uuid, to_appid, callBack) {
            let data = {
                channel: channel,
                action: action,
                openid: openid,
                my_appid: config.appid,
                my_uuid: my_uuid,
                to_appid: to_appid
            };
            NetWork.sendPost(data, callBack);
        }
        static sendEvent(openid, eventid, callBack) {
            let data = {
                openid: openid,
                eventId: eventid,
                appid: config.appid
            };
            NetWork.sendPost(data, callBack, "/saveEvent");
        }
        static getJumpGameList(callBack) {
            NetWork.sendPost({
                appid: config.appid
            }, callBack, "/getJumpInfo");
        }
        static getGameSwitch(callBack) {
            NetWork.sendGet("/index/switch_new?appid=" + config.appid + "&amp;version=" + config.version, 2, callBack);
        }
        static getTouTiaoOpenid(code, anonymous_code, callBack) {
            NetWork.sendGet("/service/getTouTiaoOpenid?appid=" + config.appid + "&amp;code=" + code + "&amp;anonymous_code=" + anonymous_code, 1, callBack);
        }
        static getWxOpenid(code, anonymous_code, callBack) {
            NetWork.sendGet("/service/getWxOpenid?appid=" + config.appid + "&amp;code=" + code, 1, callBack);
        }
        static getQQOpenid(code, callBack) {
            NetWork.sendGet("/service/getQQOpenid?appid=" + config.appid + "&amp;js_code=" + code, 1, callBack);
        }
        static getOppoOpenid(token, callBack) {
            NetWork.sendGet("/service/getOppoOpenid?pkgName=" + config.pkgName + "&amp;token=" + token + "&amp;appid=" + config.appKey, 1, callBack);
        }
        static getVivoOpenid(token, callBack) {
            NetWork.sendGet("/service/getVivoOpenid?pkgName=" + config.pkgName + "&amp;token=" + token + "&amp;appid=" + config.appKey, 1, callBack);
        }
        static collection(action, openid, callBack) {
            var data = {
                action: action,
                openid: openid,
                my_appid: config.appid
            };
            NetWork.sendPost(data, callBack);
        }
        static probability(callBack) {
            var data = {
                appid: config.appid
            };
            NetWork.sendPost(data, callBack, "/probability");
        }
    }
    class NetWork {
        static sendPost(data, call_back = null, action = null) {
            // let xhr = new XMLHttpRequest();
            // let url = config.url;
            // if (action) {
            //     url = url + action;
            // }
            // xhr.open("POST", url);
            // xhr.onreadystatechange = function() {
            //     if (xhr.readyState == 4 &amp;&amp; (xhr.status &gt;= 200 &amp;&amp; xhr.status &lt;= 207)) {
            //         if (call_back) {
            //             if (config.env == "develop") {
            //                 console.log(url + "", JSON.parse(xhr.responseText));
            //             }
            //             call_back(JSON.parse(xhr.responseText));
            //         }
            //     }
            // };
            // let dataStr = JSON.stringify(data);
            // xhr.setRequestHeader("content-type", "application/x-www-form-urlencoded");
            // xhr.send("param=" + encodeURIComponent(dataStr));
        }
        static sendGet(action, type, call_back) {
            // var xhr = new XMLHttpRequest();
            // let url = config.switchUrl;
            // if (type == 1) {
            //     url = config.url;
            // }
            // xhr.open("GET", url + action);
            // xhr.onreadystatechange = function() {
            //     if (xhr.readyState == 4 &amp;&amp; (xhr.status &gt;= 200 &amp;&amp; xhr.status &lt;= 207)) {
            //         if (call_back) {
            //             if (config.env == "develop") {
            //                 console.log(config.switchUrl + action + "ï¼š", JSON.parse(xhr.responseText));
            //             }
            //             call_back(JSON.parse(xhr.responseText));
            //         }
            //     }
            // };
            // xhr.send();
        }
    }
    var ActionType;
    (function (ActionType) {
        ActionType[ActionType["Login"] = 1005] = "Login";
        ActionType[ActionType["Authority"] = 1006] = "Authority";
        ActionType[ActionType["Start"] = 1008] = "Start";
        ActionType[ActionType["Share"] = 1009] = "Share";
        ActionType[ActionType["Video"] = 1010] = "Video";
        ActionType[ActionType["VideoSuccess"] = 1011] = "VideoSuccess";
        ActionType[ActionType["Jump"] = 1007] = "Jump";
        ActionType[ActionType["JumpSuccess"] = 1017] = "JumpSuccess";
    })(ActionType || (ActionType = {}));
    var uuidType;
    (function (uuidType) {
        uuidType[uuidType["Left"] = 1001] = "Left";
        uuidType[uuidType["Right"] = 1002] = "Right";
        uuidType[uuidType["Settlement"] = 1003] = "Settlement";
        uuidType[uuidType["Common"] = 1004] = "Common";
        uuidType[uuidType["SettlementScroll"] = 1006] = "SettlementScroll";
        uuidType[uuidType["ReviveScroll"] = 1007] = "ReviveScroll";
        uuidType[uuidType["LobbyScroll"] = 1008] = "LobbyScroll";
    })(uuidType || (uuidType = {}));
    class PtSdk {
        constructor() {
            this.userType = 0;
            this.ptCfg = null;
            this.adRes = null;
            this.user_id = null;
        }
        static get instance() {
            if (!PtSdk.SELF) {
                PtSdk.SELF = new PtSdk();
            }
            return PtSdk.SELF;
        }
        InitPtSdk() {
            if (Laya.Browser.onQQMiniGame) this.GetId();
            this.GetCfg();
        }
        GetId() {
            let _self = this;
            qq.login({
                success: res =&gt; {
                    if (res.code) {
                        ptgcspsdk.getQQOpenid(res.code, res2 =&gt; {
                            _self.user_id = res2.openid;
                            PtSdk.instance.reportLogin();
                        });
                    }
                }
            });
        }
        GetCfg() {
            ptgcspsdk.getGameSwitch(res =&gt; {
                this.ptCfg = res.data;
                console.log(res.data);
            });
        }
        CheckVersion() {
            if (this.ptCfg == null) {
                return false;
            }
            if (this.ptCfg["version"] == 1) {
                return true;
            } else {
                return false;
            }
        }
        CheckRegionShow() {
            if (!this.CheckVersion()) {
                return false;
            }
            if (this.ptCfg == null) {
                return false;
            }
            if (this.ptCfg["local_switch"] == 2) {
                return true;
            } else {
                return false;
            }
        }
        CheckBoxSwitch() {
            return this.getCheck("screen_ad_switch", 1);
        }
        CheckStartVideo() {
            return this.getCheck("video_paly", 1);
        }
        CheckBlockAd() {
            return this.getCheck("blocks_show", 1);
        }
        CheckDefaultSetting() {
            return this.getCheck("default_check", 1);
        }
        CheckYieldShow() {
            return this.getCheck("delay_display", 1);
        }
        CheckBannerAcci() {
            return this.getCheck("delay_turn", 1);
        }
        CheckBoxAcci() {
            return this.getCheck("Icon_display", 1);
        }
        GetBannerRefreshTime() {
            return this.getParameter("Refresh_time1", 0);
        }
        GetBlockRefreshTime() {
            return this.getParameter("Refresh_time2", 0);
        }
        GetEggStart() {
            return this.getParameter("delay_egg_switch1", 0);
        }
        GetEggSucc() {
            return this.getParameter("delay_egg_switch3", 0);
        }
        GetEggFail() {
            return this.getParameter("delay_egg_switch2", 0);
        }
        GetEggBox() {
            return this.getParameter("delay_egg_switch4", 0);
        }
        getParameter(type, defaultData) {
            if (!this.CheckRegionShow()) {
                return defaultData;
            }
            if (this.ptCfg == null) {
                return defaultData;
            } else {
                return this.ptCfg[type];
            }
        }
        getCheck(type, trueNum) {
            if (!this.CheckRegionShow()) {
                return false;
            }
            if (this.ptCfg == null) {
                return false;
            }
            if (this.ptCfg[type] == trueNum) {
                return true;
            } else {
                return false;
            }
        }
        reportLogin() {
            if (this.user_id == null) {

                return;
            }
            ptgcspsdk.sendLogin(0, ActionType.Login, this.user_id, this.userType);
        }
        reportStart() {
            if (this.user_id == null) {

                return;
            }
            ptgcspsdk.startGame(0, ActionType.Start, this.user_id);
        }
        reportVideoClick(vType) {
            if (this.user_id == null) {

                return;
            }
            ptgcspsdk.watchVideo(0, ActionType.Video, this.user_id, vType);
        }
        reportVideoDone(vType) {
            if (this.user_id == null) {

                return;
            }
            ptgcspsdk.watchVideo(0, ActionType.VideoSuccess, this.user_id, vType);
        }
        reportJumpClick(toId, toAppid) {
            if (this.user_id == null) {

                return;
            }
            ptgcspsdk.sendJump(0, ActionType.Jump, this.user_id, toId, toAppid);
        }
        reportJumpDone(toId, toAppid) {
            if (this.user_id == null) {

                return;
            }
            ptgcspsdk.sendJump(0, ActionType.JumpSuccess, this.user_id, toId, toAppid);
        }
    }
    class PtStorage {
        static setUserCloudStorage(kvlist, callback) {
            if (Laya.Browser.onMiniGame) {
                wx.setUserCloudStorage({
                    KVDataList: kvlist,
                    success: function (e) {
                        Logger.log("-----success:" + JSON.stringify(e));
                    },
                    fail: function (e) {
                        Logger.log("-----fail:" + JSON.stringify(e));
                    },
                    complete: function (e) {
                        Logger.log("-----complete:" + JSON.stringify(e));
                    }
                });
            } else if (Laya.Browser.onPC) { }
        }
        static setLocalStorage(key, value) {
            Laya.LocalStorage.setItem(key, value);
        }
        static getLocalStorage(key) {
            let localStorage;
            let data = Laya.LocalStorage.getItem(key);
            if (data) {
                localStorage = JSON.parse(data);
                localStorage.exp = localStorage.exp || 0;
                localStorage.level = localStorage.level || 1;
                localStorage.roomLevel = localStorage.roomLevel || 0;
                localStorage.curEnergy = localStorage.curEnergy || GameContext.MAX_ENERGY;
                localStorage.startCountdown = localStorage.startCountdown || 0;
                localStorage.gold = localStorage.gold || 0;
                localStorage.diamond = localStorage.diamond || 0;
                localStorage.nextOutputTime = localStorage.nextOutputTime || 0;
                localStorage.taskData = localStorage.taskData || null;
                localStorage.newOfferData = localStorage.newOfferData || null;
                localStorage.developData = localStorage.developData || null;
                localStorage.guideId = localStorage.guideId || 0;
                localStorage.freeRefreshCounts = localStorage.freeRefreshCounts === undefined ? 1 : localStorage.freeRefreshCounts;
                localStorage.lastOfflineTime = localStorage.lastOfflineTime || 0;
                localStorage.loginTimestamp = localStorage.loginTimestamp || 0;
                localStorage.lookAdCount = localStorage.lookAdCount || 0;
                localStorage.caseModel = localStorage.caseModel || null;
            } else {
                localStorage = {
                    exp: 0,
                    level: 1,
                    roomLevel: 0,
                    curEnergy: GameContext.MAX_ENERGY,
                    startCountdown: 0,
                    gold: 0,
                    diamond: 0,
                    nextOutputTime: 0,
                    taskData: null,
                    newOfferData: null,
                    developData: null,
                    guideId: 0,
                    freeRefreshCounts: 1,
                    lastOfflineTime: 0,
                    loginTimestamp: 0,
                    lookAdCount: 3,
                    caseModel: null
                };
            }
            return localStorage;
        }
    }
    class TaskControl {
        constructor(taskData) {
            EventMgr.on(GameEvent.FINISH_TASK, this, this._finishTask);
            EventMgr.on(GameEvent.GET_AWARD, this, this._getAward);
            this._loginTimestamp = ComTools.getZeroTime();
            if (taskData) {
                if (taskData.timestamp == this._loginTimestamp) {
                    this._taskList = taskData.taskModels;
                    return;
                }
            }
            this._upDataTask();
        }
        get loginTimestamp() {
            return this._loginTimestamp;
        }
        get taskList() {
            return this._taskList;
        }
        _upDataTask() {
            this._taskList = [];
            this._taskList[0] = {
                taskType: 0,
                awardType: 0,
                awardCount: 1500,
                condition: 1e3,
                finishCount: 0,
                isAlready: false
            };
            this._taskList[1] = {
                taskType: 1,
                awardType: 0,
                awardCount: 5e3,
                condition: 5,
                finishCount: 0,
                isAlready: false
            };
            this._taskList[2] = {
                taskType: 2,
                awardType: 0,
                awardCount: 500,
                condition: 1,
                finishCount: 0,
                isAlready: false
            };
            this._taskList[3] = {
                taskType: 3,
                awardType: 2,
                awardCount: 1,
                condition: 3,
                finishCount: 0,
                isAlready: false
            };
        }
        _finishTask(taskType, finishCount) {
            let task = this._taskList[taskType];
            if (task.finishCount &gt;= task.condition) {
                if (taskType == 3) {
                    ReportDealer.ReportUser.OnReportAnalytics(3, 4);
                }
                return;
            }
            let totalCount = task.finishCount + finishCount;
            let isFinish = totalCount &gt;= task.condition;
            task.finishCount = isFinish ? task.condition : totalCount;
            if (taskType == 3) {
                if (!isFinish) {
                    ReportDealer.ReportUser.OnReportAnalytics(3, totalCount);
                }
            }
            if (isFinish &amp;&amp; taskType != 3) {
                this._finishTask(3, 1);
            }
            EventMgr.send(GameEvent.SAVE_LOCAL_DATA);
        }
        _getAward(taskType) {
            let task = this._taskList[taskType];
            if (task.isAlready) {
                Tips.show("Rewarded");
                return;
            }
            switch (taskType) {
                case 0:
                // GameContext.gPlayer.addGold(task.awardCount);
                // break;

                case 1:
                // GameContext.gPlayer.addGold(task.awardCount);
                // break;

                case 2:
                    GameContext.gPlayer.addGold(task.awardCount);
                    break;

                case 3:
                    if (!GameContext.gPlayer.useEnergy()) return;
                    let cases = RefMgr.getAllRef(Case);
                    let size = 0;
                    for (let key in cases) {
                        size++;
                    }
                    let caseId = ComTools.getRandom(1, size);
                    let caseModel = new CaseModel();
                    caseModel.setInfo(caseId, 3);
                    EventMgr.send(GameEvent.View.OPEN, ["LocaleView", caseModel]);
                    break;

                default:
                    break;
            }
        }
        get taskData() {
            let data = {
                timestamp: this._loginTimestamp,
                taskModels: this._taskList
            };
            return data;
        }
    }
    class OfferControl {
        constructor(taskData, lv) {
            this._names = ['Valley',
                'Roy',
                'Godwin',
                'Fenton',
                'Gift-Brave',
                'Beguiling',
                'Eliot',
                'Roderick',
                'Jimmy',
                'Morton',
                'Deborah',
                'Jane',
                'Joan',
                'Jasmine',
                'Wenda',
                'Hayley',
                'Hilda',
                'Katrina',
                'Hope',
                'Eileen',
                'Olin',
                'Elijah',
                'Egbert',
                'Joey',
                'Joseph',
                'Torrent',
                'Keaton',
                'Dion',
                'Darcy',
                'Half-Dane',
                'Lulu',
                'Luna',
                'Ula',
                'Nadine',
                'Beauty',
                'Glynnis',
                'Light',
                'Nursing',
                'Bound',
                'Kyla',
                'Ethanael',
                'Ferris',
                'Will',
                'Wylie',
                'Keegan',
                'Neville',
                'Joshua',
                'Quade',
                'Faithful',
                'Peacemaker',
                'Egbert',
                'Howard',
                'Zachary',
                'Leroy',
                'Exalted',
                'Thomas',
                'Lewis',
                'Meadow',
                'Lewis',
                'Tobias'];
            if (taskData) {
                this._offerList = taskData.offerModels;
            } else {
                this._initData(lv);
            }
            let unlockLv = [2, 5, 8, 11, 14, 15];
            for (let i = 0; i &lt; 20; i++) {
                let model = this._offerList[i];
                model.unlockLv = i &gt; 5 ? 20 : unlockLv[i];
            }
        }
        get offerList() {
            return this._offerList;
        }
        _initData(lv) {
            let ref = RefMgr.getRef(Level, lv);
            let unlockCount = ref.unlockCount;
            this._offerList = [];
            for (let i = 0; i &lt; 20; i++) {
                let model = {
                    index: i,
                    name: this._names[i],
                    roleIcon: `role/npc${i + 1}.png`,
                    adCount: 0,
                    unlockLv: 0,
                    isUnlock: unlockCount &gt; i,
                    award: 1200,
                    caseType: 5,
                    cdTime: 0,
                    isNew: true
                };
                this._offerList[i] = model;
            }
        }
        lookAd(index) {
            let model = this._offerList[index];
            model.adCount = Math.min(++model.adCount, 1);
            if (model.adCount == 1) {
                model.cdTime = 0;
            }
            EventMgr.send(GameEvent.SAVE_LOCAL_DATA);
        }
        finishCase(index) {
            let model = this._offerList[index];
            model.cdTime = Laya.timer.currTimer / 1e3 + 3600;
            let rand = ComTools.getRandom(1, 10);
            let type, award;
            if (rand &gt; 5) {
                type = 4;
                award = 800;
            } else if (rand &gt; 2) {
                type = 5;
                award = 1200;
            } else {
                type = 6;
                award = 2e3;
            }
            model.caseType = type;
            model.award = award;
            EventMgr.send(GameEvent.SAVE_LOCAL_DATA);
        }
        get taskData() {
            let data = {
                timestamp: Laya.timer.currTimer,
                offerModels: this._offerList
            };
            return data;
        }
        checkUnlock(lv) {
            let models = this._offerList;
            for (let i = 0, len = models.length; i &lt; len; i++) {
                let model = models[i];
                if (model.unlockLv == lv) {
                    model.isUnlock = true;
                    // if(model.unlockLv == lv)
                    model.isNew = true;
                }
            }
        }
    }
    class GuideControl {
        constructor() {
            this._initData();
        }
        _initData() {
            this._guideModel = [];
            this._guideModel[0] = {
                guideId: 1,
                checkType: 0,
                curStep: 0,
                guideSteps: []
            };
            let guidesteps = [];
            guidesteps[0] = {
                step: 1,
                des: "Welcome to Find Out The Criminal,~~~~ã€‚",
                rect: null,
                isTouchBg: true,
                isShowPoint: false,
                isShowMask: true,
                pos: 1,
                delay: 100
            };
            guidesteps[1] = {
                step: 1,
                des: "The more difficult the case is, the more rewards you will get",
                rect: [189, 590, 260, 45],
                isTouchBg: true,
                isShowPoint: false,
                isShowMask: true,
                pos: 1,
                delay: 100
            };
            guidesteps[2] = {
                step: 2,
                des: "Look at some other cases",
                rect: [120, 678, 200, 91],
                isTouchBg: false,
                isShowPoint: true,
                isShowMask: true,
                pos: 1,
                delay: 100
            };
            guidesteps[3] = {
                step: 3,
                des: "Not bad, click here",
                rect: [320, 678, 200, 91],
                isTouchBg: false,
                isShowPoint: true,
                isShowMask: true,
                pos: 1,
                delay: 100
            };
            this._guideModel[0].guideSteps = guidesteps;
            this._guideModel[1] = {
                guideId: 2,
                checkType: 0,
                curStep: 0,
                guideSteps: []
            };
            let guidesteps1 = [];
            guidesteps1[0] = {
                step: 1,
                des: "Let's see the famous case",
                rect: [415, 790, 127, 130],
                isTouchBg: false,
                isShowPoint: true,
                isShowMask: true,
                pos: 1,
                delay: 100
            };
            guidesteps1[1] = {
                step: 2,
                des: "Get a high reward after a wanted case",
                rect: [105, 520, 114, 70],
                isTouchBg: false,
                isShowPoint: true,
                isShowMask: true,
                pos: 0,
                delay: 100
            };
            this._guideModel[1].guideSteps = guidesteps1;
            this._guideModel[2] = {
                guideId: 3,
                checkType: 0,
                curStep: 0,
                guideSteps: []
            };
            let guidesteps2 = [];
            guidesteps2[0] = {
                step: 1,
                des: "Enter the police station",
                rect: [90, 790, 127, 130],
                isTouchBg: false,
                isShowPoint: true,
                isShowMask: true,
                pos: 1,
                delay: 100
            };
            guidesteps2[1] = {
                step: 2,
                des: "",
                rect: [540, 725, 80, 83],
                isTouchBg: false,
                isShowPoint: true,
                isShowMask: true,
                pos: 1,
                delay: 100
            };
            guidesteps2[2] = {
                step: 3,
                des: "",
                rect: [250, 260, 150, 90],
                isTouchBg: false,
                isShowPoint: true,
                isShowMask: true,
                pos: 1,
                delay: 100
            };
            guidesteps2[3] = {
                step: 4,
                des: "",
                rect: [433, 408, 81, 81],
                isTouchBg: false,
                isShowPoint: true,
                isShowMask: true,
                pos: 0,
                delay: 100
            };
            guidesteps2[4] = {
                step: 5,
                des: "",
                rect: [510, 181, 49, 49],
                isTouchBg: false,
                isShowPoint: true,
                isShowMask: true,
                pos: 1,
                delay: 100
            };
            guidesteps2[5] = {
                step: 6,
                des: "After the purchase, show it quickly, and it can bring you lasting earnings",
                rect: [540, 850, 80, 83],
                isTouchBg: false,
                isShowPoint: true,
                isShowMask: true,
                pos: 1,
                delay: 100
            };
            guidesteps2[6] = {
                step: 7,
                des: "",
                rect: [346, 458, 100, 98],
                isTouchBg: false,
                isShowPoint: true,
                isShowMask: true,
                pos: 0,
                delay: 100
            };
            guidesteps2[7] = {
                step: 8,
                des: "",
                rect: [475, 693, 144, 160],
                isTouchBg: false,
                isShowPoint: true,
                isShowMask: false,
                pos: 1,
                delay: 100
            };
            this._guideModel[2].guideSteps = guidesteps2;
            this._guideModel[3] = {
                guideId: 4,
                checkType: 1,
                curStep: 0,
                guideSteps: []
            };
            let guidesteps3 = [];
            guidesteps3[0] = {
                step: 1,
                des: "Please remember to collect your earnings",
                rect: [230, 120, 180, 180],
                isTouchBg: false,
                isShowPoint: true,
                isShowMask: true,
                pos: 1,
                delay: 100
            };
            this._guideModel[3].guideSteps = guidesteps3;
        }
        checkGuide(checkType) {
            if (this.isPlayGuide) return;
            let guideId = GameContext.gPlayer.guideId;
            if (GameContext.gPlayer.guideId &lt; this._guideModel.length) {
                this._curGuide = this._guideModel[guideId];
                if (checkType != this._curGuide.checkType) {
                    return;
                }
                this.isPlayGuide = true;
                EventMgr.send(GameEvent.View.OPEN, "GuideView");
                GameContext.gPlayer.guideId += 1;
            } else {
                this.isPlayGuide = false;
            }
        }
        nextStep() {
            if (this.isPlayGuide) {
                let idx = this._curGuide.curStep;
                if (idx &gt;= this._curGuide.guideSteps.length) {
                    this.isPlayGuide = false;
                    EventMgr.send(GameEvent.STOP_GUIDE);
                } else {
                    let step = this._curGuide.guideSteps[idx];
                    EventMgr.send(GameEvent.PLAY_STEP, step);
                    this._curGuide.curStep++;
                }
            }
        }
        stopGuide() {
            this.isPlayGuide = false;
            EventMgr.send(GameEvent.STOP_GUIDE);
        }
    }
    class DevelopControl {
        constructor(developData) {
            this._outPut = 0;
            if (developData) {
                this._polices = developData.polices;
                this._itemIds = [];
                this._itemDic = new Dictionary();
                let itemDic = developData.itemDic;
                for (let i = 0, len = itemDic.length; i &lt; len; i++) {
                    let item = itemDic[i];
                    let id = item.itemId;
                    this._itemDic.setValue(id, item);
                    this._itemIds[i] = id;
                }
            } else {
                this._initData();
            }
            this.checkOutPuts();
            this._checkRedDot();
        }
        get itemDic() {
            return this._itemDic;
        }
        get polices() {
            return this._polices;
        }
        get outPut() {
            return this._outPut;
        }
        get redDotInfo() {
            return this._isShowRedDots;
        }
        _initData() {
            this._itemDic = new Dictionary();
            this._itemDic.setValue(1, {
                itemId: 1,
                isSelected: true,
                isNew: false,
                count: 1,
                isDefault: true
            });
            this._itemDic.setValue(4, {
                itemId: 4,
                isSelected: true,
                isNew: false,
                count: 1,
                isDefault: true
            });
            this._itemDic.setValue(11, {
                itemId: 11,
                isSelected: true,
                isNew: false,
                count: 1,
                isDefault: true
            });
            this._itemDic.setValue(15, {
                itemId: 15,
                isSelected: true,
                isNew: false,
                count: 1,
                isDefault: true
            });
            this._itemIds = [1, 4, 11, 15];
            this._polices = [];
        }
        get developData() {
            let data = {
                timestamp: Laya.timer.currTimer,
                itemDic: this._itemDic.values(),
                polices: this._polices
            };
            return data;
        }
        addItem(id) {
            let item = this._itemDic.getValue(id);
            if (item) {
                item.count++;
            } else {
                this._itemDic.setValue(id, {
                    itemId: id,
                    isSelected: false,
                    isNew: true,
                    count: 1,
                    isDefault: false
                });
                this._itemIds.push(id);
            }
            this._checkRedDot();
            EventMgr.send(GameEvent.SAVE_LOCAL_DATA);
        }
        addPolice(id) {
            this._polices.push({
                itemId: id,
                isSelected: false,
                isNew: true,
                count: 1,
                isDefault: false
            });
            this._checkRedDot();
            EventMgr.send(GameEvent.SAVE_LOCAL_DATA);
        }
        isHaveItem(id) {
            return -1 != this._itemIds.indexOf(id);
        }
        getPoliceCountById(id) {
            let count = 0;
            for (let i = 0, len = this._polices.length; i &lt; len; i++) {
                let item = this._polices[i];
                if (id == item.itemId) {
                    count++;
                }
            }
            return count;
        }
        replaceById(id) {
            let ref = RefMgr.getRef(Item, id);
            if (id &lt; 19) {
                let groupType = ref.groupType;
                let curItem = this._itemDic.getValue(id);
                if (curItem.isSelected) {
                    if (curItem.isDefault) {
                        Tips.show("The default decoration cannot be removed");
                    } else {
                        this._itemDic.forEach((id, item) =&gt; {
                            let tempRef = RefMgr.getRef(Item, id);
                            if (groupType == tempRef.groupType &amp;&amp; tempRef.price == 0) {
                                item.isSelected = true;
                                return false;
                            }
                        });
                        curItem.isSelected = false;
                        this.checkOutPuts();
                    }
                } else {
                    this._itemDic.forEach((id, item) =&gt; {
                        let tempRef = RefMgr.getRef(Item, id);
                        if (groupType == tempRef.groupType) {
                            item.isSelected = false;
                        }
                    });
                    curItem.isSelected = true;
                    curItem.isNew = false;
                    this._checkRedDot();
                    this.checkOutPuts();
                }
            }
        }
        replacePolice(model) {
            if (model.isSelected) {
                model.isSelected = false;
                this.checkOutPuts();
                return true;
            } else {
                let count = 0;
                for (let i = 0, len = this._polices.length; i &lt; len; i++) {
                    let police = this._polices[i];
                    if (police.isSelected) {
                        count++;
                    }
                }
                if (count &gt;= 3) {
                    return false;
                }
                model.isSelected = true;
                model.isNew = false;
                this.checkOutPuts();
                this._checkRedDot();
                return true;
            }
        }
        checkOutPuts() {
            let outPut = 0;
            this._itemDic.forEach((id, item) =&gt; {
                if (item.isSelected) {
                    let ref = RefMgr.getRef(Item, id);
                    outPut += ref.outPut;
                }
            });
            for (let i = 0, len = this._polices.length; i &lt; len; i++) {
                let item = this._polices[i];
                if (item.isSelected) {
                    let ref = RefMgr.getRef(Item, item.itemId);
                    outPut += ref.outPut;
                }
            }
            this._outPut = outPut;
            EventMgr.send(GameEvent.SAVE_LOCAL_DATA);
            return outPut;
        }
        _checkRedDot() {
            this._isShowRedDots = [false, false, false];
            this._itemDic.forEach((id, item) =&gt; {
                if (item.isNew) {
                    if (id &lt; 4) {
                        this._isShowRedDots[0] = true;
                    } else {
                        this._isShowRedDots[1] = true;
                    }
                }
            });
            for (let i = 0, len = this._polices.length; i &lt; len; i++) {
                let item = this._polices[i];
                if (item.isNew) {
                    this._isShowRedDots[2] = true;
                    break;
                }
            }
            EventMgr.send(GameEvent.CHANGE_RED, [this._isShowRedDots]);
        }
    }
    class PlayerInfo {
        constructor() {
            this._energyKey = "Find-Out-The-Criminal-localData3";
            this._exp = 0;
            this._level = 0;
            this._roomLevel = 0;
            this._gold = 0;
            this._diamond = 0;
            this._recoveryTime = 3e5;
            this._curEnergy = 5;
            this._startCountdown = 0;
            this._loginTimestamp = 0;
            this._lookAdCount = 0;
            this._guideId = 0;
            this.freeRefreshCounts = 1;
            this._initData();
        }
        get curEnergy() {
            return this._curEnergy;
        }
        get loginTimestamp() {
            return this._loginTimestamp;
        }
        get lookAdCount() {
            return this._lookAdCount;
        }
        uselookAdCount() {
            if (this._lookAdCount &gt; 0) {
                --this._lookAdCount;
                Laya.timer.callLater(this, this._saveLocalData);
                return true;
            }
            return false;
        }
        get guideId() {
            return this._guideId;
        }
        set guideId(id) {
            if (id &lt; 0) return;
            this._guideId = id;
            Laya.timer.callLater(this, this._saveLocalData);
        }
        get taskCtrl() {
            return this._taskCtrl;
        }
        get offerCtrl() {
            return this._offerCtrl;
        }
        get guideControl() {
            return this._guideControl;
        }
        get developCtrl() {
            return this._developCtrl;
        }
        get caseModel() {
            return this._caseModel;
        }
        set caseModel(caseModel) {
            this._caseModel = caseModel;
        }
        _initData() {
            let localData = PtStorage.getLocalStorage(this._energyKey);
            this._exp = localData.exp;
            this._level = localData.level;
            this._roomLevel = localData.roomLevel;
            this._curEnergy = localData.curEnergy;
            this._startCountdown = localData.startCountdown;
            this._diamond = localData.diamond;
            this._gold = localData.gold;
            this._nextOutputTime = localData.nextOutputTime;
            this._guideId = localData.guideId;
            this.freeRefreshCounts = localData.freeRefreshCounts;
            this._lastOfflineTime = localData.lastOfflineTime;
            if (this._lastOfflineTime == 0) {
                this._lastOfflineTime = ComTools.now();
                Laya.timer.callLater(this, this._saveLocalData);
            }
            this._caseModel = localData.caseModel;
            this._loginTimestamp = localData.loginTimestamp;
            let loginTimestamp = ComTools.getZeroTime();
            if (loginTimestamp != this._loginTimestamp) {
                this._loginTimestamp = loginTimestamp;
                this._lookAdCount = 3;
                this._saveData();
            } else {
                this._lookAdCount = localData.lookAdCount;
            }
            this._taskCtrl = new TaskControl(localData.taskData);
            this._offerCtrl = new OfferControl(localData.newOfferData, this._level);
            this._developCtrl = new DevelopControl(localData.developData);
            this._guideControl = new GuideControl();
            EventMgr.on(GameEvent.SAVE_LOCAL_DATA, this, this._saveData);
        }
        get exp() {
            return this._exp;
        }
        addExp(exp) {
            if (exp &lt;= 0) return;
            if (this._level &gt;= 15) return;
            let curRef = RefMgr.getRef(Level, this._level);
            let nextRef = RefMgr.getRef(Level, this._level + 1);
            let needExp = nextRef.needExp;
            if (this._exp + exp &gt;= needExp) {
                this._exp = 0;
                this.levelUp();
                let addExp = this._exp + exp - needExp;
                this.addExp(addExp);
            } else {
                this._exp = this._exp + exp;
            }
            EventMgr.send(GameEvent.UP_DATA_INFO);
            Laya.timer.callLater(this, this._saveLocalData);
        }
        get level() {
            return this._level;
        }
        set level(level) {
            if (level &lt; 0) return;
            this._level = level;
            Laya.timer.callLater(this, this._saveLocalData);
        }
        levelUp() {
            let lv = this._level + 1;
            this._level = lv &gt; 15 ? 15 : lv;
            EventMgr.send(GameEvent.UP_DATA_INFO);
            Laya.timer.callLater(this, this._saveLocalData);
            this.offerCtrl.checkUnlock(lv);
        }
        get roomLevel() {
            return this._roomLevel;
        }
        set roomLevel(level) {
            if (level &lt; 0) return;
            this._roomLevel = level;
            Laya.timer.callLater(this, this._saveLocalData);
        }
        roomLevelUp() {
            let lv = this._roomLevel + 1;
            if (lv == 1) {
                this.changeNextOutputTime(Laya.timer.currTimer + 36e5);
            }
            this._roomLevel = lv &gt; 15 ? 15 : lv;
            Laya.timer.callLater(this, this._saveLocalData);
        }
        get gold() {
            return this._gold;
        }
        set gold(gold) {
            if (gold &lt; 0) return;
            this._gold = gold;
        }
        costGold(gold) {
            if (GameContext.use_test) return true;
            if (gold &gt; this._gold) return false;
            this._gold -= gold;
            EventMgr.send(GameEvent.CHANGE_CURRENCY);
            Laya.timer.callLater(this, this._saveLocalData);
            return true;
        }
        addGold(gold) {
            if (gold &lt; 0) return false;
            this._gold += gold;
            EventMgr.send(GameEvent.CHANGE_CURRENCY);
            Laya.timer.callLater(this, this._saveLocalData);
            EventMgr.send(GameEvent.FINISH_TASK, [0, gold]);
            return true;
        }
        isEnough(gold) {
            return gold &lt;= this._gold;
        }
        get diamond() {
            return this._diamond;
        }
        set diamond(diamond) {
            if (diamond &lt; 0) return;
            this._diamond = diamond;
        }
        costDiamond(diamond) {
            if (GameContext.use_test) return true;
            if (diamond &gt; this._diamond) return false;
            this._diamond -= diamond;
            EventMgr.send(GameEvent.CHANGE_CURRENCY);
            Laya.timer.callLater(this, this._saveLocalData);
            return true;
        }
        addDiamond(diamond) {
            if (diamond &lt; 0) return false;
            this._diamond += diamond;
            EventMgr.send(GameEvent.CHANGE_CURRENCY);
            Laya.timer.callLater(this, this._saveLocalData);
            return true;
        }
        get nextOutputTime() {
            return this._nextOutputTime;
        }
        changeNextOutputTime(time) {
            this._nextOutputTime = time;
            Laya.timer.callLater(this, this._saveLocalData);
        }
        useEnergy(gameBannerChange = false) {
            if (GameContext.use_test) return true;
            if (this._curEnergy &gt; 0) {
                this._curEnergy -= 1;
                this._startCountdown = this._startCountdown == 0 ? Date.now() : this._startCountdown;
                Laya.timer.callLater(this, this._saveLocalData);
                return true;
            }
            if (gameBannerChange) {
                YYGGames.gameBanner.visible = false;
                EventMgr.send(GameEvent.View.OPEN, ["GetEnergy", {
                    closeHandler: Laya.Handler.create(Laya.stage, () =&gt; {
                        YYGGames.gameBanner.visible = true;
                    })
                }]);
            } else {
                EventMgr.send(GameEvent.View.OPEN, "GetEnergy");
            }

            return false;
        }
        addEnergy() {
            this._curEnergy += 5;// Math.min(, 5);
            Laya.timer.callLater(this, this._saveLocalData);
            return true;
        }
        getShowTime(curTime) {
            let maxEnergy = GameContext.MAX_ENERGY;
            if (this._curEnergy &gt;= maxEnergy) {
                return 0;
            }
            curTime = curTime ? curTime : Date.now();
            let timed = curTime - this._startCountdown;
            let mul = Math.floor(timed / this._recoveryTime);
            if (mul &gt;= 1) {
                let tempEnergy = this._curEnergy + mul;
                if (tempEnergy &gt;= maxEnergy) {
                    this._curEnergy = maxEnergy;
                    this._startCountdown = 0;
                    return 0;
                } else {
                    this._startCountdown += this._recoveryTime * mul;
                    this._curEnergy = tempEnergy;
                    Laya.timer.callLater(this, this._saveLocalData);
                    return this._recoveryTime - curTime + this._startCountdown;
                }
            }
            return this._recoveryTime - timed;
        }
        get lastOfflineTime() {
            return this._lastOfflineTime;
        }
        changeLastOfflineTime(time) {
            this._lastOfflineTime = time;
            Laya.timer.callLater(this, this._saveLocalData);
        }
        _saveData() {
            Laya.timer.callLater(this, this._saveLocalData);
        }
        _saveLocalData() {
            if (GameContext.use_test) return;
            let localStorage = {
                exp: this._exp,
                level: this._level,
                roomLevel: this._roomLevel,
                curEnergy: this._curEnergy,
                startCountdown: this._startCountdown,
                gold: this._gold,
                diamond: this._diamond,
                nextOutputTime: this._nextOutputTime,
                taskData: this._taskCtrl.taskData,
                newOfferData: this._offerCtrl.taskData,
                developData: this._developCtrl.developData,
                guideId: this._guideId,
                freeRefreshCounts: this.freeRefreshCounts,
                lastOfflineTime: this._lastOfflineTime,
                loginTimestamp: this._loginTimestamp,
                lookAdCount: this._lookAdCount,
                caseModel: this._caseModel
            };
            PtStorage.setLocalStorage(this._energyKey, JSON.stringify(localStorage));
        }
    }
    class LoadControl {
        constructor(refMgr, levelMgr, prefabMgr) {
            this._step = 0;
            this._progress = 0;
            this._refMgr = null;
            this._levelMgr = null;
            this._prefabMgr = null;
            this.stepFunc = [{
                action: this._preLoadConfig,
                progress: this.loadProgress
            }, {
                action: this.preloadUIRes,
                progress: this.loadProgress
            }];
            this._handler = null;
            this._waitStart = 0;
            this._refMgr = refMgr;
            this._levelMgr = levelMgr;
            this._prefabMgr = prefabMgr;
        }
        onStart(handler) {
            this._handler = handler;
            this._initLoad();
        }
        _initLoad() {
            EventMgr.send(GameEvent.View.OPEN, "LoadView");
            this.loopNum = 0;
            EventMgr.send(GameEvent.LOADING_PROGRESS, {
                progress: this.loopNum
            });
            this._step = false;
            Laya.timer.frameLoop(10, this, this.loop0);
            YYGGames.init("Find-Out-The-Criminal", () =&gt; {
                YYGGames.audio.pause = Laya.LocalStorage.getJSON("Find-Out-The-Criminal-music") ?
                    JSON.parse(Laya.LocalStorage.getJSON("Find-Out-The-Criminal-music")) : false;
                Laya.SoundManager.playMusic("res/resource/bg.mp3");
                YYGGames.icon.skin = "logo.png";
                // YYGGames.icon.scale(0.3, 0.3);
                YYGGames.icon.top = 10;
                YYGGames.icon.right = 10;
                YYGGames.gameBanner.setBannerSize(150, 150);
                YYGGames.gameBanner.games.spaceX = 10;
                YYGGames.gameBanner.bottom = 0;
                YYGGames.gameBanner.visible = false;
                YYGGames.gameBox.visible = false;
                Laya.loader.load("res/arial.ttf", Laya.Handler.create(this, (e) =&gt; {
                    e.name = "Arial";
                    PtSdk.instance.InitPtSdk();
                    this._loadConfig();
                }))
            })
        }
        _loadConfig() {
            this._preLoadConfig();
            // this.nextStep();
            Laya.timer.frameLoop(10, this, this.loop);
        }
        _wxLoading() {
            // let that = this;
            // let subpackages = ["res", "big"];
            // let count = subpackages.length;
            // count--;
            // let progress = res.progress;
            // let totalBytesWritten = res.totalBytesWritten;
            // let totalBytesExpectedToWrite = res.totalBytesExpectedToWrite;
            // EventMgr.send(GameEvent.LOADING_PROGRESS, {
            //     progress: progress,
            //     totalBytesWritten: totalBytesWritten,
            //     totalBytesExpectedToWrite: totalBytesExpectedToWrite
            // });
        }
        loop0() {
            if (this._step) {
                this.loopNum += 0.1;
            } else {
                this.loopNum += 0.01;
            }
            if (this.loopNum &gt;= 0.95) {
                this.loopNum = 0.95;
                Laya.timer.clear(this, this.loop0);
            }
            EventMgr.send(GameEvent.LOADING_PROGRESS, {
                progress: this.loopNum
            });
            Adapter.percent(this.loopNum * 100);
        }

        loop() {
            // let ret = false;
            // let progress = this.stepProgress();
            // if (progress &gt;= 1) {
            //     // this._step++;
            //     if (!this.nextStep()) {
            //         progress = 100;
            //     }
            // }
            if (this._step &amp;&amp; this.loopNum == 0.95) {
                this._handler.run();
                Laya.timer.clear(this, this.loop);
                Laya.timer.clear(this, this.loop0);
                EventMgr.send(GameEvent.LOAD_COMPLETE);

            }
            // else {
            // progress = 100 * ((this._step + progress) / this.stepFunc.length);
            // }
            // if (this._progress != progress) {
            //     this._progress = progress;
            // }
            // Logger.log("é¢„åŠ&nbsp;è½½è¿›åº¦:" + progress);
        }
        nextStep() {
            // for (let i = this._step; i &lt; this.stepFunc.length; i++) {
            //     let func = this.stepFunc[i].action;
            //     if (!func.apply(this)) break;
            //     this._step++;
            // }
            // if (this._step &lt; this.stepFunc.length) return true;
            // return false;
        }
        _preLoadConfig() {
            Logger.log("å¼€å§‹åŠ&nbsp;è½½ç­–åˆ’é…ç½®è¡¨");
            var list = [];
            list.push("Case");
            list.push("Room");
            list.push("Level");
            list.push("Item");
            this._refMgr.load(list, Laya.Handler.create(this, this.preloadUIRes));
            // return false;
        }
        _preloadLevelConfig() {
            Logger.log("å¼€å§‹åŠ&nbsp;è½½å…³å¡é…ç½®");
            var list = [];
            let maxLevel = GameContext.MAX_CONFIG;
            for (let index = 1; index &lt;= maxLevel; index++) { }
            list.length &gt; 0 &amp;&amp; this._levelMgr.load(list, Laya.Handler.create(this, this._preloadPrefab));
            // return false;
        }
        _preloadPrefab() {
            Logger.log("å¼€å§‹åŠ&nbsp;è½½é¢„åˆ¶ä½“");
            Const.PrefabPath.length &gt; 0 &amp;&amp; this._prefabMgr.load(Const.PrefabPath, Laya.Handler.create(this, this._preloadPrefab));
            // return false;
        }
        _preLoadSound() {
            return false;
        }
        preloadUIRes() {
            let Loader = Laya.Loader;
            var assets = [];
            assets.push({
                url: "res/resource/bg.mp3",
                type: Loader.SOUND
            });
            assets.push({
                url: "big/zjmbjt.png",
                type: Loader.IMAGE
            });
            assets.push({
                url: "res/atlas/main.atlas",
                type: Loader.ATLAS
            });
            assets.push({
                url: "res/atlas/main.png",
                type: Loader.IMAGE
            });
            assets.push({
                url: "res/atlas/public.atlas",
                type: Loader.ATLAS
            });
            assets.push({
                url: "res/atlas/props.atlas",
                type: Loader.ATLAS
            });
            assets.push({
                url: "res/atlas/public.png",
                type: Loader.IMAGE
            });
            Laya.loader.load(assets, Laya.Handler.create(this, () =&gt; {
                // let assets0 = [];
                GameContext.gPlayer = new PlayerInfo();
                // // if (GameContext.gPlayer.guideId &lt; 3) {
                // //     assets0.push("res/atlas/develop.atlas");
                // //     assets0.push("view/DevelopView.json");
                // // }
                // // if (!assets0.length) {
                this._step = true;
                // } else {
                //     Laya.loader.load(assets0, Laya.Handler.create(this, () =&gt; {
                //         this._step = true;
                //     }))
                // }
            }));
            // return false;

        }
        preloadWait() {
            return false;
        }
        waitProgress() {
            let now = Laya.timer.currTimer;
            this._waitStart == 0 &amp;&amp; (this._waitStart = now);
            if (now - this._waitStart &lt; 1e3) {
                let delta = now - this._waitStart;
                return delta / 1e3;
            } else {
                return 1;
            }
        }
        stepProgress() {
            if (this._step &gt;= this.stepFunc.length) return 1;
            let func = this.stepFunc[this._step].progress;
            return func.apply(this);
        }
        loadProgress() {
            let ret = Laya.loader.getProgress();
            ret == 1 &amp;&amp; Laya.loader.resetProgress();
            return ret;
        }
    }
    class View extends Laya.UIComponent {
        constructor(cls) {
            super();
            this.group = 1;
            this.shutdownMode = 1;
            this._cls = cls;
        }
        createUI() {
            if (!this.view) this.view = new this._cls();
            return this.view;
        }
        onEnable() {
            let view = this.createUI();
            let $this = this;
            let onAwake = view.onAwake;
            view.onAwake = function () {
                onAwake &amp;&amp; onAwake.apply(view);
                $this.onInit();
                Logger.log($this.name + "onInit");
            };
            let onEnable = view.onEnable;
            view.onEnable = function () {
                onEnable &amp;&amp; onEnable.apply(view);
                $this.onShow($this.data);
                Logger.log($this.name + "onShow");
            };
            let onDisable = view.onDisable;
            view.onDisable = function () {
                $this.onHide();
                onDisable &amp;&amp; onDisable.apply(view);
                Logger.log($this.name + "onHide");
            };
            let onDestroy = view.onDestroy;
            view.onDestroy = function () {
                $this.onRelease();
                onDestroy &amp;&amp; onDestroy.apply(view);
                Logger.log($this.name + "onRelease");
            };
            this.addChild(view);
        }
        onInit() { }
        onShow(data) {
        }
        onHide() { }
        onRelease() { }
        onStageResize(w, h) { }
        hide() {
            // YYGGames.showInterstitial(() =&gt; {
            EventMgr.send(GameEvent.View.CLOSE, this.name);
            // })
        }
    }
    class GameMain extends View {
        constructor() {
            super(ui.GameMainUI);
            this._isTweening = false;
            this._isPageShow = true;
            this.group = 0;
        }
        onInit() { }
        onShow() {
            // Laya.SoundManager.playMusic(`res/resource/bg.mp3`, 0);
            this._upDataUI();
            this._onEvent();
            this._onHomgVisible(true);
            this._isPageShow = true;
            this.view.btn_music.skin = YYGGames.audio.pause ? "main/sound2.png" : "main/sound1.png";
            YYGGames.gameBanner.visible = true;
            Adapter &amp;&amp; Adapter.hideLoading();
            clickMask.inst.removeSelf();
        }
        onHide() {
            this._isPageShow = false;
            EventMgr.offAllCaller(this);
            this.view.btnEnergy.off(Laya.Event.CLICK, this, this._addEnergy);
            let boxBottom = this.view.boxBottom;
            for (let i = 0; i &lt; 3; i++) {
                let btn = boxBottom.getChildAt(i);
                btn.off(Laya.Event.CLICK, this, this._toView);
            }
            YYGGames.gameBanner.visible = false;
        }
        onRelease() { }
        _onEvent() {
            EventMgr.on(GameEvent.HOME_VISIBLE, this, this._onHomgVisible);
            EventMgr.on(GameEvent.SELECT_CASE, this, this._onSelectAnimation);
            EventMgr.on(GameEvent.UP_DATA_INFO, this, this._upDataUI);
            this.view.btnEnergy.on(Laya.Event.CLICK, this, this._addEnergy);
            this.view.btn_music.on(Laya.Event.CLICK, this, this.chengMusic);
            let boxBottom = this.view.boxBottom;
            for (let i = 0; i &lt; 3; i++) {
                let btn = boxBottom.getChildAt(i);
                btn.on(Laya.Event.CLICK, this, this._toView, [i]);
            }
            this._updataEnergy();
            Laya.timer.loop(1e3, this, this._updataEnergy);
        }
        chengMusic() {
            YYGGames.audio.pause = !YYGGames.audio.pause;
            this.view.btn_music.skin = YYGGames.audio.pause ? "main/sound2.png" : (Laya.SoundManager.playMusic("res/resource/bg.mp3"), "main/sound1.png");
            Laya.LocalStorage.setJSON("Find-Out-The-Criminal-music", YYGGames.audio.pause);
        }
        _onHomgVisible(isShow, isUpDataCase = false) {
            this.view.visible = isShow;
            if (!isShow) {
                AdDealer.AdUser.SetBannerAdState(false);
                return;
            } else {
                YYGGames.gameBanner.visible = true;
            }
            GameContext.gPlayer.guideControl.checkGuide(0);
            // let boxBottom = this.view.boxBottom;
            this._refreshHint();
            // for (let i = 0; i &lt; 3; i++) {
            //     let btn = boxBottom.getChildAt(i);
            //     btn.y = 192;
            //     Laya.timer.once(70 * i, this, () =&gt; {
            //         Laya.Tween.to(btn, {
            //             y: 46
            //         }, 700, Laya.Ease.quartOut);
            //     });
            // }
            // Laya.Resource.destroyUnusedResources();
            Laya.timer.once(2e3, this, () =&gt; {
                if (GameContext.gPlayer.guideControl.isPlayGuide) return;
                AdDealer.AdUser.SetBannerAdState(true);
                AdDealer.AdUser.SetBlockAdState(true);
                if (!PtSdk.instance.CheckRegionShow()) return;
                if (this._isPageShow) {
                    if (PtSdk.instance.CheckBoxSwitch()) {
                        AdDealer.AdUser.SetBoxAdState(true);
                    }
                }
            });
            AdDealer.AdUser.SetBlockAdState(false);
            isUpDataCase &amp;&amp; this._upDataCase();
        }
        _onSelectAnimation(caseModel) {
            let _self = this;
            if (this._isTweening) return;
            this._isTweening = true;
            if (!GameContext.gPlayer.useEnergy(true)) {
                this._isTweening = false;
                return;
            }
            Laya.timer.once(700, this, () =&gt; {
                EventMgr.send(GameEvent.View.OPEN, ["LocaleView", caseModel]);
                this._onHomgVisible(false);
                this._isTweening = false;
                if (PtSdk.instance.CheckStartVideo()) {
                    console.log("å¼€å±€å¼ºåˆ¶è§†é¢‘");
                    AdDealer.AdUser.PlayVideoAd("æŽ¥ä¸‹æ¡ˆä»¶å¼ºåˆ¶å¼¹å‡ºè§†é¢‘", () =&gt; {
                        eggPage();
                    }, () =&gt; {
                        eggPage();
                    }, () =&gt; {
                        eggPage();
                    });
                } else {
                    if (PtSdk.instance.GetBannerRefreshTime() &gt; 0) {
                        AdDealer.AdUser.SetBannerAdState(true, true);
                    } else {
                        AdDealer.AdUser.SetBannerAdState(false);
                    }
                }
                PtSdk.instance.reportStart();
            });
            function eggPage() {
                let _data = PtSdk.instance.GetEggStart();
                if (_data &gt; 0) {
                    EventMgr.send(GameEvent.View.OPEN, ["AccTouchView", [_data, false, true]]);
                } else {
                    AdDealer.AdUser.SetBannerAdState(true, true);
                }
            }
        }
        _upDataCase() {
            GameContext.gPlayer.freeRefreshCounts = 1;
            EventMgr.send(GameEvent.REFRESH_CASE, false);
        }
        _updataEnergy() {
            let maxEnergy = GameContext.MAX_ENERGY;
            let time = GameContext.gPlayer.getShowTime() / 1e3;
            this.view.labTime.visible = time != 0;
            this.view.labTime.text = ComTools.getStringToTimeInfo(time, 0, false);
            this.view.labEnergy.text = GameContext.gPlayer.curEnergy + "/" + maxEnergy;
        }
        _toView(tag) {
            if (this._isTweening) return;
            this._isTweening = true;
            // let boxBottom = this.view.boxBottom;
            // for (let i = 0; i &lt; 3; i++) {
            //     if (i == tag) continue;
            //     let btn = boxBottom.getChildAt(i);
            //     Laya.timer.once(70 * i, this, () =&gt; {
            //         Laya.Tween.to(btn, {
            //             y: 192
            //         }, 700, Laya.Ease.quartOut);
            //     });
            // }
            // Laya.timer.once(770, this, () =&gt; {
            YYGGames.showInterstitial(() =&gt; {
                YYGGames.gameBanner.visible = false;
                switch (tag) {
                    case 0:
                        GameContext.gPlayer.guideControl.nextStep();
                        EventMgr.send(GameEvent.View.OPEN, ["DevelopView", { hideFun: function () { YYGGames.gameBanner.visible = true; } }]);
                        break;

                    case 1:
                        EventMgr.send(GameEvent.View.OPEN, ["TaskView", { hideFun: function () { YYGGames.gameBanner.visible = true; } }]);
                        break;

                    case 2:
                        GameContext.gPlayer.guideControl.nextStep();
                        EventMgr.send(GameEvent.View.OPEN, ["OfferView", { hideFun: function () { YYGGames.gameBanner.visible = true; } }]);
                        break;

                    default:
                        break;
                }
                this._isTweening = false;
                this._onHomgVisible(false);
            })
            // });
        }
        _upDataUI() {
            let player = GameContext.gPlayer;
            let lv = player.level;
            let ref = RefMgr.getRef(Level, lv);
            this.view.textLv.text = ref.des;
            this.view.imgLv.skin = `main/police_${lv}.png`;
            this.view.textFullLv.visible = player.level == 15;
            if (player.level == 15) {
                this.view.imgPro.width = 258;
            } else {
                let nextRef = RefMgr.getRef(Level, lv + 1);
                this.view.imgPro.width = 258 * player.exp / nextRef.needExp;
            }
        }
        _addEnergy() {
            YYGGames.gameBanner.visible = false;
            EventMgr.send(GameEvent.View.OPEN, ["GetEnergy", {
                closeHandler: Laya.Handler.create(Laya.stage, () =&gt; {
                    YYGGames.gameBanner.visible = true;
                })
            }]);
        }
        _refreshHint() {
            {
                let redInfo = GameContext.gPlayer.developCtrl.redDotInfo;
                this.view.sprRoom.visible = redInfo[0] || redInfo[1] || redInfo[2];
            }
            {
                let isShow = false;
                let taskList = GameContext.gPlayer.taskCtrl.taskList;
                for (let i = 0, len = taskList.length; i &lt; len; i++) {
                    let task = taskList[i];
                    isShow = task.finishCount == task.condition &amp;&amp; !task.isAlready;
                    if (isShow) break;
                }
                this.view.sprTask.visible = isShow;
            }
        }
        _hidePanel() {
            this.view.visible = false;
            AdDealer.AdUser.SetBannerAdState(false);
        }
    }
    class LocaleView extends View {
        constructor() {
            super(ui.view.LocaleViewUI);
            this.group = 1;
        }
        onShow() {
            this._onEvent();
            this._createCase();
            this.view.boxTransition.visible = false;
            this._imgPros = [];
            for (let i = 0; i &lt; 4; i++) {
                let img = this.view.imgPro.getChildAt(i).getChildAt(0);
                img.visible = false;
                this._imgPros[i] = img;
            }
            ShareDealer.ShareUser.StartRecordVideo();
            clickMask.inst.removeSelf();
        }
        onHide() {
            this._caseView &amp;&amp; (this._caseView.removeChildren(), this._caseView.destroy(), this._caseView = null);
            this._offEvent();
            this.destroy(true);
        }
        onRelease() { }
        _onEvent() {
            this.view.btnClose.once(Laya.Event.CLICK, this, () =&gt; {
                YYGGames.showInterstitial(() =&gt; {
                    EventMgr.send(GameEvent.GAME_OVER);
                    EventMgr.send(GameEvent.View.OPEN, "ClearCaseView");
                })
            });
            this.view.btnSkip.on(Laya.Event.CLICK, this, this._skip);
            this.view.transitionAni.on(Laya.Event.LABEL, this, this._onEventAni);
            EventMgr.on(GameEvent.SOLVE.START_STEP, this, this._startStep);
            EventMgr.on(GameEvent.SOLVE.FINISH_STEP, this, this._finishStep);
            EventMgr.on(GameEvent.GAME_OVER, this, this._gameOver);
        }
        _offEvent() {
            this.view.btnClose.off(Laya.Event.CLICK, this, this.hide);
            this.view.btnSkip.off(Laya.Event.CLICK, this, this._skip);
            this.view.transitionAni.off(Laya.Event.LABEL, this, this._onEventAni);
            EventMgr.offAllCaller(this);
        }
        _startStep(caseModel) {
            if (!this._caseView) return;
            if (!caseModel) return;
            this._caseView.removeChildren();
            let step = caseModel.curStep;
            let stepModel = caseModel.stepModels[step - 1];
            this.view.textDes.text = stepModel.stepDes;
            Laya.Scene.load(stepModel.viewPath, Laya.Handler.create(this, view =&gt; {
                view.dataSource = caseModel;
                this._caseView &amp;&amp; this._caseView.addChild(view);
            }));
            let index = step - 1;
            for (let i = 0; i &lt; 4; i++) {
                let img = this._imgPros[i];
                img.visible = i &lt;= index;
                if (i == index) {
                    img.skin = "public/Search.png";
                } else if (i &lt; index) {
                    img.skin = "public/greenCircle.png";
                }
            }
        }
        _finishStep(step) {
            if (step != 4) {
                this._showTransitionAni(step);
            }
        }
        _gameOver() {
            this._caseView.removeChildren();
            this._caseView.destroy();
        }
        _createCase() {
            let caseModel = this.data;
            this._caseModel = caseModel;
            ReportDealer.ReportUser.OnReportAnalytics(0, this._caseModel.caseType);
            let casePath = `${ComTools.caseToString(caseModel.caseId)}.json`;
            Laya.Scene.load(casePath, Laya.Handler.create(this, view =&gt; {
                this._caseView = view;
                view.dataSource = caseModel;
                this.view.viewCase.addChild(view);
                this._caseComplete();
            }));
        }
        _caseComplete() {
            EventMgr.send(GameEvent.SOLVE.CASE_COMPLETE);
        }
        _showTransitionAni(step) {
            this.view.boxTransition.visible = true;
            this.view.transitionAni.play(0, false);
            this.view.sprXainSuo.visible = false;
            this.view.sprWuQI.visible = false;
            this.view.sprZj.visible = false;
            switch (step) {
                case 1:
                    this.view.xiansuoAni.play(0, true);
                    this.view.sprXainSuo.visible = true;
                    AdDealer.AdUser.SetBlockAdState(false);
                    break;

                case 2:
                    this.view.wuqiAni.play(0, false);
                    this.view.sprWuQI.visible = true;
                    break;

                case 3:
                    this.view.zhengjuAni.play(0, false);
                    this.view.sprZj.visible = true;
                    AdDealer.AdUser.SetBannerAdState(false);
                    break;

                default:
                    break;
            }
        }
        _onEventAni(e) {
            switch (e) {
                case "endAni":
                    this.view.boxTransition.visible = false;
                    this.view.xiansuoAni.gotoAndStop(0);
                    this.view.wuqiAni.gotoAndStop(0);
                    this.view.zhengjuAni.gotoAndStop(0);
                    this.view.sprXainSuo.visible = false;
                    this.view.sprWuQI.visible = false;
                    this.view.sprZj.visible = false;
                    break;

                default:
                    break;
            }
        }
        _skip() {
            function success() {
                EventMgr.send(GameEvent.SOLVE.FINISH_STEP, [4]);
            }
            function fail() { }
            AdDealer.AdUser.PlayVideoAd("è·³è¿‡æ¡ˆä»¶", success, fail, fail);
        }
    }
    class ClearCaseView extends View {
        constructor() {
            super(ui.view.ClearCaseViewUI);
            this._isFive = false;
            this._adsData = null;
            this._isPageShow = false;
            this.group = 1;
        }
        onInit() { }
        onShow() {
            this._isPageShow = true;
            this._caseModel = this.data;
            this._isSuc = this._caseModel ? true : false;
            this._caseModel ? this._initSuc() : this._initFailed();
            this.view.setMore.visible = false;
            Laya.timer.once(5200, this, () =&gt; {
                if (this._isSuc) {
                    // if (PtSdk.instance.CheckDefaultSetting()) {
                    this.view.setMore.on(Laya.Event.CLICK, this, this._onSetMore);
                    this._isFive = false;
                    this._onSetMore();
                    // ComTools.accidentaTouch(PtSdk.instance.CheckBannerAcci(), this.view.fakeAward, 2e3, 1025, 875);
                    // ComTools.accidentaTouch(false, this.view.btnAward, 2e3, 1025, 875, null, null, null, () =&gt; {
                    //     this.view.btnAward.visible = false;
                    // });
                    // } else {
                    //     ComTools.accidentaTouch(PtSdk.instance.CheckBannerAcci(), this.view.btnAward, 2e3, 1025, 875);
                    // }
                } else {
                    // ComTools.accidentaTouch(PtSdk.instance.CheckBannerAcci(), this.view.btnAward, 2e3, 1025, 875);
                }
                if (PtSdk.instance.CheckBoxSwitch()) {
                    AdDealer.AdUser.SetBoxAdState(true);
                }
                AdDealer.AdUser.SetBlockAdState(true);
            });
            clickMask.inst.removeSelf();
            YYGGames.gameBanner.visible = true;
        }
        onHide() {
            let isRefresh = this._isSuc &amp;&amp; this._caseModel.offerIndex === undefined;
            EventMgr.send(GameEvent.HOME_VISIBLE, [true, isRefresh]);
            this._caseModel = null;
            this._isPageShow = false;
            this.view.btnAward.off(Laya.Event.CLICK, this, this._getAward);
            this.view.btnFive.off(Laya.Event.CLICK, this, this._getAward);
            this.view.setMore.off(Laya.Event.CLICK, this, this._onSetMore);
            this.view.fakeAward.offAll();
            this.view.sucAni.stop();
            this.view.faildAni.stop();
            AdDealer.AdUser.SetBannerAdState(false);
            YYGGames.gameBanner.visible = false;
        }
        onRelease() { }
        _onComAni(isSuc) {
            if (isSuc) {
                this._onSetMore();
            } else {
                this.view.btnAward.visible = true;
            }
        }
        _initSuc() {
            if (PtSdk.instance.GetEggSucc() &gt; 0) {
                EventMgr.send(GameEvent.View.OPEN, ["AccTouchView", [PtSdk.instance.GetEggSucc(), false]]);
            }
            this.view.btnAward.once(Laya.Event.CLICK, this, this._getAward, [false]);
            this.view.btnFive.on(Laya.Event.CLICK, this, this._getAward, [true]);
            this.view.fakeAward.on(Laya.Event.CLICK, this, this._getAward, [true]);
            this.view.sucAni.on(Laya.Event.LABEL, this, this._onEventAni);
            this.view.sucAni.on(Laya.Event.COMPLETE, this, this._onComAni, [true]);
            this.view.imgRole.skin = `role/npc${this._caseModel.suspectId}.png`;
            this.view.sucAni.play(0, false);
            this.view.imgLv.skin = `main/police_${GameContext.gPlayer.level}.png`;
            let level = GameContext.gPlayer.level;
            let ref = RefMgr.getRef(Level, level);
            this.view.textLevel.text = `${ref.des}`;
            let award = this._caseModel.award;
            this._gold = award;
            this.view.textAward.text = `${award}`;
            this.view.textFive.text = `${award * 5}`;
            let curExp = GameContext.gPlayer.exp;
            let nextLv = Math.min(level + 1, 15);
            let nextRef = RefMgr.getRef(Level, nextLv);
            this.view.textNextLv.text = `${nextRef.des}`;
            this.view.imgPro.width = 258 * curExp / nextRef.needExp;
            this.view.textCount.text = `${curExp}/${nextRef.needExp}`;
            this.view.textDes += " " + this.view.textCount.text;
            let type = this._caseModel.caseType;
            if (0 == type || 1 == type || 2 == type) {
                EventMgr.send(GameEvent.FINISH_TASK, [1, 1]);
            }
            this._onEventAni("startExp");
            // this._onComAni(true)
        }
        _initFailed() {
            this.view.btnAward.once(Laya.Event.CLICK, this, this._getAward, [false]);
            this.view.faildAni.on(Laya.Event.COMPLETE, this, this._onComAni, [false]);
            this.view.faildAni.play(0, false);
        }
        _onEventAni(e) {
            switch (e) {
                case "startExp":
                    let curExp = GameContext.gPlayer.exp;
                    let level = GameContext.gPlayer.level;
                    if (level != 15) {
                        let nextRef = RefMgr.getRef(Level, level + 1);
                        let nextW = 258 * (curExp + 1) / nextRef.needExp;
                        Laya.Tween.to(this.view.imgPro, {
                            width: nextW
                        }, 300);
                        GameContext.gPlayer.addExp(1);
                        this.view.textCount.text = `${curExp + 1}/${nextRef.needExp}`;
                        this.view.textDes += " " + this.view.textCount.text;
                    } else {
                        this.view.imgPro.width = 258;
                        // this.view.textCount.text = "Max Level";
                        this.view.textDes = "Max Level";
                        // this.view.textDes.visible = false;
                    }
                    break;

                default:
                    break;
            }
        }
        _getAward(isAd) {
            let _self = this;
            if (!this._isSuc) {
                this._openBox(false);
                return;
            }
            function success() {
                GameContext.gPlayer.addGold(_self._gold * 5);
                _self._openBox(true);
            }
            function fail() { }
            if (isAd) {
                AdDealer.AdUser.PlayVideoAd("ä¾¦ç&nbsp;´æˆåŠŸ5å€å¥–åŠ±", success, fail, fail);
            } else {
                this.view.btnFive.mouseEnabled = false;
                GameContext.gPlayer.addGold(this._gold);
                ComTools.jumpTo(this.view.textAward, this._gold, 0);
                Laya.timer.once(2e3, this, () =&gt; {
                    this._openBox(true);
                });
            }

        }
        _onSetMore() {
            let _child = this.view.setMore.getChildByName("more");
            // this._isFive = !this._isFive;
            // if (this._isFive) {
            // _child.visible = true;
            // this.view.btnAward.visible = false;
            // this.view.fakeAward.visible = true;
            // } else {
            _child.visible = false;
            this.view.btnAward.visible = true;
            this.view.fakeAward.visible = false;
            // }
        }
        _openBox(isSuc) {
            EventMgr.send(GameEvent.View.OPEN, ["BoxView", isSuc]);
        }
    }
    class CaseFailedView extends View {
        constructor() {
            super(ui.view.CaseFailedViewUI);
            this.group = 2;
        }
        onShow() {
            AdDealer.AdUser.SetBannerAdState(true);
            if (PtSdk.instance.CheckBannerAcci) {
                ComTools.showLater(this.view.btnClose, 2e3);
            }
            function success() {
                EventMgr.send(GameEvent.RE_GAME);
                _self.hide();
            }
            function fail() {
                _self.hide();
                ShareDealer.ShareUser.StopRecordVideo(true);
                EventMgr.send(GameEvent.GAME_OVER);
                EventMgr.send(GameEvent.View.OPEN, "ClearCaseView");
            }
            this.view.btnClose.once(Laya.Event.CLICK, this, () =&gt; {
                fail();
            });
            this.view.btnRe.once(Laya.Event.CLICK, this, () =&gt; {
                AdDealer.AdUser.PlayVideoAd("ç&nbsp;´æ¡ˆå¤±è´¥çœ‹å¹¿å‘Š", success, fail, fail);
            });
            let _self = this;

            clickMask.inst.removeSelf();
        }
        onHide() {
            AdDealer.AdUser.SetBannerAdState(false);
        }
        onRelease() { }
    }
    class TaskView extends View {
        constructor() {
            super(ui.view.TaskViewUI);
            this._oneDayTime = 86400;
            this.group = 1;
        }
        onShow() {
            this.view.btnBack.once(Laya.Event.CLICK, this, () =&gt; {
                YYGGames.showInterstitial(() =&gt; {
                    this.hide();
                    EventMgr.send(GameEvent.HOME_VISIBLE, true);
                })
            });
            this._upDataUI();
            this._countDown();
            Laya.timer.loop(1e3, this, this._countDown);
            if (PtSdk.instance.CheckBoxSwitch()) {
                AdDealer.AdUser.SetBoxAdState(true);
            }
            AdDealer.AdUser.SetBlockAdState(true);
            AdDealer.AdUser.SetBannerAdState(true);
            clickMask.inst.removeSelf();
        }
        onHide() {
            for (let i = 0; i &lt; 3; i++) {
                let imgTask = this.view.boxView.getChildByName(`imgTask${i + 1}`);
                let btnGet = imgTask.getChildByName("btnGet");
                btnGet.offAll();
            }
            EventMgr.offAllCaller(this);
        }
        onRelease() { }
        _countDown() {
            let time = Laya.timer.currTimer / 1e3 - GameContext.gPlayer.taskCtrl.loginTimestamp;
            this.view.labTime.changeText(ComTools.getStringToTimeInfo(this._oneDayTime - time, 0, false));
        }
        _upDataUI() {
            let taskList = GameContext.gPlayer.taskCtrl.taskList;
            {
                for (let i = 0; i &lt; 3; i++) {
                    let task = taskList[i];
                    let imgTask = this.view.boxView.getChildByName(`imgTask${i + 1}`);
                    let imgPro = imgTask.getChildByName("imgPro");
                    let btnGet = imgTask.getChildByName("btnGet");
                    let imgPro1 = imgPro.getChildAt(0);
                    let labPro = imgPro.getChildAt(1);
                    imgPro1.width = task.finishCount / task.condition * 151;
                    labPro.changeText(`${task.finishCount}/${task.condition}`);
                    let isAlready = task.isAlready;
                    let isFinish = task.finishCount == task.condition;
                    imgPro.visible = !isFinish;
                    btnGet.visible = isFinish;
                    btnGet.gray = isAlready;
                    btnGet.label = isAlready ? "Claimed" : "Claim";
                    btnGet.once(Laya.Event.CLICK, this, () =&gt; {
                        if (!isAlready) {
                            EventMgr.send(GameEvent.GET_AWARD, i);
                            task.isAlready = true;
                            this._upDataUI();
                        } else {
                            Tips.show("Claimed");
                        }
                    });
                }
            }
            {
                let task = taskList[3];
                let isFinish = task.finishCount == task.condition;
                this.view.boxLock.visible = !isFinish;
                this.view.boxUnlock.visible = isFinish;
                if (!isFinish) {
                    let imgPro = this.view.boxLock.getChildByName("imgPro");
                    let textPro = this.view.boxLock.getChildByName("textPro");
                    textPro.changeText(`${task.finishCount}/${task.condition}`);
                    imgPro.width = task.finishCount / task.condition * 151;
                } else {
                    this.view.imgTask4.once(Laya.Event.CLICK, this, () =&gt; {
                        EventMgr.send(GameEvent.GET_AWARD, 3);
                        this.hide();
                    });
                }
            }
        }
    }
    class OfferPage extends ui.com.OfferPageUI {
        constructor(model) {
            super();
            this._model = model;
        }
        onEnable() {
            this.setInfo(this._model);
            this.btnGoOn.on(Laya.Event.CLICK, this, this._onClick);
            this.timer.loop(1e3, this, this._loop);
        }
        onDisable() {
            this.btnGoOn.off(Laya.Event.CLICK, this, this._onClick);
            this.timer.clear(this, this._loop);
        }
        _onEventAni(e) {
            switch (e) {
                case "endAni":
                    break;

                default:
                    break;
            }
        }
        setInfo(model) {
            this._model = model;
            this._upDataInfo();
            this.ani.play(0, false);
        }
        _upDataInfo() {
            let model = this._model;
            let type = model.caseType;
            switch (type) {
                case 4:
                    this.imgCase.skin = "main/jishouanjian.png";
                    break;

                case 5:
                    this.imgCase.skin = "main/teshuanjian.png";
                    break;

                case 6:
                    this.imgCase.skin = "main/guojianjian.png";
                    break;

                default:
                    break;
            }
            this.textAward.text = `${model.award}`;
            this.textName.changeText(model.name);
            this.imgRole.skin = model.roleIcon;
            this.imgLock1.visible = !model.isUnlock;
            this.imgCase.visible = model.isUnlock;
            let ref = RefMgr.getRef(Level, model.unlockLv);
            this.textLock.text = `${ref.des} \nUnlock`;
            if (model.cdTime == 0) {
                this.btnGoOn.text.changeText("Accept");
                this.sprAd.visible = false;
                this.textTime.visible = false;
                this.textTime1.visible = false;
                this.imgLock.visible = false;
            } else {
                this.btnGoOn.text.changeText("Free");
                this.sprAd.visible = true;
                this.textTime.visible = true;
                this.textTime1.visible = true;
                this.imgLock.visible = true;
                let time = model.cdTime - Laya.timer.currTimer / 1e3;
                this.textTime.text = `${ComTools.getStringToTimeInfo(time, 0, false)}`;
            }
        }
        _ad() {
            let _self = this;
            function success() {
                GameContext.gPlayer.offerCtrl.lookAd(_self._model.index);
                _self._upDataInfo();
                if (_self._model.cdTime == 0) {
                    _self._goCase();
                }
            }
            function fail() { }
            AdDealer.AdUser.PlayVideoAd("æ‚¬èµè§£é”æ¡ˆä»¶", success, fail, fail);

        }
        _onClick() {
            if (this._model.cdTime == 0) {
                YYGGames.showInterstitial(() =&gt; {
                    this._goCase();
                    GameContext.gPlayer.guideControl.nextStep();
                })
            } else {
                this._ad();
            }
        }
        _goCase() {
            let suspectId = this._model.index + 1;
            let cases = RefMgr.getAllRef(Case);
            let size = 0;
            for (let key in cases) {
                size++;
            }
            let caseId = ComTools.getRandom(1, size);
            let caseModel = new CaseModel();
            caseModel.setInfo(caseId, 3, this._model.award, suspectId, this._model.index);
            EventMgr.send(GameEvent.View.OPEN, ["LocaleView", caseModel]);
        }
        _loop() {
            let model = this._model;
            if (model.cdTime != 0) {
                let time = model.cdTime - Laya.timer.currTimer / 1e3;
                this.textTime.text = `${ComTools.getStringToTimeInfo(time, 0, false)}`;
            }
        }
    }
    class OfferView extends View {
        constructor() {
            super(ui.view.OfferViewUI);
            this._offerPages = null;
            this._curIndex = 0;
            this._totalCount = 6;
            this._totalPag = 0;
            this.group = 1;
        }
        onShow() {
            this.view.btnBack.on(Laya.Event.CLICK, this, () =&gt; {
                YYGGames.showInterstitial(() =&gt; {
                    EventMgr.send(GameEvent.HOME_VISIBLE, true);
                    this.hide();
                })
            });
            this._initUI();
            this.view.btnLeft.on(Laya.Event.CLICK, this, this._toLeft);
            this.view.btnRight.on(Laya.Event.CLICK, this, this._toRight);
            if (PtSdk.instance.CheckBoxSwitch()) {
                AdDealer.AdUser.SetBoxAdState(true);
            }
            AdDealer.AdUser.SetBannerAdState(true);
            clickMask.inst.removeSelf();
        }
        onHide() {
            EventMgr.offAllCaller(this);
            this.view.btnLeft.off(Laya.Event.CLICK, this, this._toLeft);
            this.view.btnRight.off(Laya.Event.CLICK, this, this._toRight);
        }
        onRelease() { }
        _initUI() {
            this._totalPag = Math.ceil(this._totalCount / 4);
            let offerModels = GameContext.gPlayer.offerCtrl.offerList;
            this._offerPages = [];
            let points = [[35, 112], [340, 112], [35, 445], [340, 445]];
            let i = 0;
            let loopFuc = () =&gt; {
                let model = offerModels[i];
                let page = new OfferPage(model);
                page.x = points[i][0];
                page.y = points[i][1];
                this.view.panelShow.addChild(page);
                this._offerPages[i] = page;
                if (i == 3) {
                    Laya.timer.clear(this, loopFuc);
                }
                i++;
            };
            Laya.timer.frameLoop(5, this, loopFuc);
            this.view.btnLeft.visible = false;
            let curIndex = this._curIndex;
            let boxPoint = this.view.boxPoint;
            for (let i = 0; i &lt; 5; i++) {
                let img = boxPoint.getChildAt(i);
                if (this._totalPag &gt; i) {
                    img.skin = i == curIndex ? "public/point2.png" : "public/point.png";
                } else {
                    img.visible = false;
                }
            }
            this.view.boxPoint.width = 50 * this._totalPag;
        }
        _toLeft() {
            this._curIndex = Math.max(--this._curIndex, 0);
            this.view.btnLeft.visible = this._curIndex != 0;
            this.view.btnRight.visible = true;
            this._preUpData();
        }
        _toRight() {
            this._curIndex = Math.min(++this._curIndex, this._totalPag - 1);
            this.view.btnRight.visible = this._curIndex != this._totalPag - 1;
            this.view.btnLeft.visible = true;
            this._preUpData();
        }
        _preUpData() {
            let i = 0;
            let loopFuc = () =&gt; {
                let page = this._offerPages[i];
                this.view.panelShow.addChild(page);
                page.visible = false;
                if (i == 3) {
                    Laya.timer.clear(this, loopFuc);
                    this._upDataUI();
                }
                i++;
            };
            Laya.timer.frameLoop(1, this, loopFuc);
        }
        _upDataUI() {
            let endCount = this._curIndex == this._totalPag - 1 ? 1 : 3;
            let offerModels = GameContext.gPlayer.offerCtrl.offerList;
            let curIndex = this._curIndex;
            let i = 0;
            let j = curIndex * 4;
            let loopFuc = () =&gt; {
                let model = offerModels[j];
                let page = this._offerPages[i];
                this.view.panelShow.addChild(page);
                page.visible = true;
                page.setInfo(model);
                if (i == endCount) {
                    Laya.timer.clear(this, loopFuc);
                }
                i++;
                j++;
            };
            Laya.timer.frameLoop(5, this, loopFuc);
            let boxPoint = this.view.boxPoint;
            for (let i = 0; i &lt; 5; i++) {
                let img = boxPoint.getChildAt(i);
                if (this._totalPag &gt; i) {
                    img.skin = i == curIndex ? "public/point2.png" : "public/point.png";
                } else {
                    img.visible = false;
                }
            }
            this.view.boxPoint.width = 50 * this._totalPag;
            this.view.boxPoint.visible = false
        }
    }
    class LoadView extends View {
        constructor() {
            super(ui.view.LoadViewUI);
            this.group = 1;
        }
        onShow() {
            EventMgr.on(GameEvent.LOADING_PROGRESS, this, this._loading);
            EventMgr.on(GameEvent.LOAD_COMPLETE, this, this._loadComplete);
            clickMask.inst.removeSelf();
        }
        onHide() {
            EventMgr.offAllCaller(this);
            this.view.logoAni.off(Laya.Event.LABEL, this, this._onEventAni);
        }
        onRelease() { }
        _loading(data) {
            let progress = Number(data.progress) &gt; 1 ? 1 : Number(data.progress);
            let totalBytesWritten = data.totalBytesWritten;
            let totalBytesExpecthis = data.totalBytesExpectedToWrite;
            this.view.panelPro.width = 66 + progress * 510;
            this.view.textPro.text = "Loading..." + parseInt(data.progress * 1000) / 10 + "%";
            // this.view.textPro.changeText(`èµ„æºåŠ&nbsp;è½½è¿›åº¦:${totalBytesWritten}bytes/${totalBytesExpecthis}bytes`);
        }
        _loadComplete() {
            this.hide();
        }
        _onEventAni(e) {
            switch (e) {
                case "logoEnd":
                    break;

                default:
                    break;
            }
        }
    }
    class GetEnergyView extends View {
        constructor() {
            super(ui.view.GetEnergyViewUI);
            this.group = 2;
        }
        onInit() { }
        onShow() {
            this.view.btnShare.on(Laya.Event.CLICK, this, this._share);
            this.view.btnGet.on(Laya.Event.CLICK, this, this._av);
            this.view.btnClose.once(Laya.Event.CLICK, this, this._close);
            // if (PtSdk.instance.CheckBannerAcci) {
            //     ComTools.showLater(this.view.btnClose, 2e3);
            // }
            this.view.btnClose.visible = true;
            clickMask.inst.removeSelf();
        }
        onHide() {
            this.view.btnShare.off(Laya.Event.CLICK, this, this._share);
            this.view.btnGet.off(Laya.Event.CLICK, this, this._av);
            this.view.btnClose.off(Laya.Event.CLICK, this, this._close);
            this.data.closeHandler &amp;&amp; this.data.closeHandler.run();
        }
        onRelease() { }
        _share() {
            let _self = this;
            ShareDealer.ShareUser.ShareGame(success, fail);
            function success() {
                GameContext.gPlayer.addEnergy();
                Tips.show("Energy +5");
                _self._close();
            }
            function fail() { }
        }
        _av() {
            let _self = this;
            function videoDone() {
                GameContext.gPlayer.addEnergy();
                Tips.show("Energy +5");
                _self._close();
            }
            function videoYet() { }
            AdDealer.AdUser.PlayVideoAd("çœ‹è§†é¢‘æ¢å¤ä½“åŠ›", videoDone, videoYet, videoYet);

        }
        _close() {
            this.view.closeAni.play(0, false);
            Laya.timer.frameOnce(25, this, () =&gt; {
                this.hide();
            });
        }
    }
    class ShareView extends View {
        constructor() {
            super(ui.view.ShareViewUI);
            this.group = 2;
        }
        onInit() { }
        onShow() {
            this.view.btnShare.on(Laya.Event.CLICK, this, this._share);
            this.view.btnClose.once(Laya.Event.CLICK, this, this._close);
            if (PtSdk.instance.CheckBannerAcci) {
                ComTools.showLater(this.view.btnClose, 2e3);
            }
            clickMask.inst.removeSelf();
        }
        onHide() {
            EventMgr.send(GameEvent.GAME_OVER);
            EventMgr.send(GameEvent.View.OPEN, ["ClearCaseView", this.data]);
            this.view.btnShare.off(Laya.Event.CLICK, this, this._share);
            this.view.btnClose.off(Laya.Event.CLICK, this, this._close);
        }
        onRelease() { }
        _share() {
            let _self = this;
            function success() {
                Tips.show("Diamon x5");
                GameContext.gPlayer.addDiamond(5);
                _self._close();
            }
            function fail() { }
            AdDealer.AdUser.PlayVideoAd("ç»“æŸçœ‹è§†é¢‘ç»™é’»çŸ³", success, fail, fail);

        }
        _close() {
            this.view.closeAni.play(0, false);
            Laya.timer.frameOnce(25, this, () =&gt; {
                this.hide();
            });
        }
    }
    var Sprite = Laya.Sprite;
    class GuideView extends View {
        constructor() {
            super(ui.view.GuideViewUI);
            this._canTouch = false;
            this._strArr = [];
            this._step = null;
            this._isStopTyper = false;
            this._isTypering = false;
            this.group = 4;
        }
        onShow() {
            EventMgr.on(GameEvent.PLAY_STEP, this, this._playStep);
            EventMgr.on(GameEvent.STOP_GUIDE, this, this.hide);
            this._init();
            GameContext.gPlayer.guideControl.nextStep();
            // clickMask.inst.removeSelf();
        }
        onHide() {
            this.view.boxTouch.off(Laya.Event.CLICK, this, this._onTouch);
            EventMgr.offAllCaller(this);
        }
        onRelease() { }
        _init() {
            this.cacheAs = "bitmap";
            this.view.boxTouch.on(Laya.Event.CLICK, this, this._onTouch);
            this.interactionArea = new Sprite();
            this.interactionArea.blendMode = "destination-out";
            this.view.boxMask.addChild(this.interactionArea);
            this.hitArea = new Laya.HitArea();
            this.hitArea.hit.drawRect(0, 0, Laya.stage.width, Laya.stage.height, "#000000");
            this.view.boxMask.hitArea = this.hitArea;
            this.view.boxMask.mouseEnabled = true;
        }
        _playStep(step) {
            this._step = step;
            this._touchCount = 0;
            if (!this._step.des || !this._step.des.length) {
                this.view.boxTouch.visible = false;
            } else {
                this.view.boxTouch.visible = true;
            }

            this.view.boxMask.visible = step.isShowMask;
            this.view.boxPoint.visible = false;
            this._isStopTyper = false;
            this._isTypering = false;
            this._strArr = [];
            step.des &amp;&amp; (this._strArr = step.des.split(""));
            this.view.textDes.text = "";
            this.view.imgDes.visible = this._strArr.length &gt; 0;
            if (this._strArr.length &gt; 0) {
                this.typerEffect(this._strArr);
            } else {
                this._showPoint();
            }
            this._canTouch = false;
            Laya.timer.once(step.delay, this, () =&gt; {
                this._canTouch = true;
            });
            let rect = step.rect;
            console.log(step)
            if (rect) {
                this.hitArea.unHit.clear();
                this.hitArea.unHit.drawRect(rect[0], rect[1], rect[2], rect[3], "#000000");
                this.interactionArea.graphics.clear();
                this.interactionArea.graphics.drawRect(rect[0], rect[1], rect[2], rect[3], "#000000");
                console.log(this.hitArea)
            }
            let pos = step.pos;
            // this.view.imgDes.y = 0 == pos ? 100 : 1 == pos ? 450 : 800;
        }
        _onTouch() {
            if (!this._canTouch) return;
            this._touchCount++;
            console.log(this._touchCount, this._step.isTouchBg, this._isTypering)
            if (1 == this._touchCount &amp;&amp; this._step.des.length &amp;&amp; this._isTypering) {
                this._isStopTyper = true;
                return;
            }
            if (this._step.isTouchBg) {
                if (this._isTypering == false) {
                    GameContext.gPlayer.guideControl.nextStep();
                }
            } else {
                this.view.boxTouch.visible = false;
            }
        }
        _onTouchMask() { }
        typerEffect(desAry) {
            if (desAry.length == 0) return;
            let func = () =&gt; {
                let des = desAry.shift();
                if (this._isStopTyper || !this._step.des.length || !des) {
                    this.view.textDes.text = this._step.des;
                    Laya.timer.clear(this, func);
                    this._showPoint();
                    if (!this._step.isTouchBg) {
                        this.view.boxTouch.visible = false;
                    }
                    this._isTypering = false;
                    return;
                }
                let tex = this.view.textDes.text;
                this.view.textDes.text = tex + des;
            };
            this._isTypering = true;
            Laya.timer.loop(150, this, func);
        }
        _showPoint() {
            if (this._step.isShowPoint) {
                this.view.boxPoint.visible = false;//true
                let rect = this._step.rect;
                if (rect[1] &lt;= 200) {
                    this.view.boxPoint.rotation = 180;
                    this.view.boxPoint.x = rect[2] / 2 + rect[0];
                    this.view.boxPoint.y = rect[1] + rect[3];
                    this.view.pointAni.play(0, true);
                } else {
                    this.view.boxPoint.rotation = 0;
                    this.view.boxPoint.x = rect[2] / 2 + rect[0];
                    this.view.boxPoint.y = rect[1];
                    this.view.pointAni.play(0, true);
                }
            }
        }
    }
    class BoxView extends View {
        constructor() {
            super(ui.view.BoxViewUI);
            this._keyCount = 3;
            this.group = 2;
        }
        onInit() { }
        onShow() {
            this._initData();
            this.view.listBox.renderHandler = new Laya.Handler(this, this._onRenderHandler);
            this.view.listBox.selectEnable = true;
            this.view.listBox.selectHandler = new Laya.Handler(this, this._onRenderSelect);
            this.view.listBox.array = this._boxModels;
            this.view.btnVideo.on(Laya.Event.CLICK, this, this._addKey);
            this.view.btnOff.on(Laya.Event.CLICK, this, this._onBtnOff);
            this.view.btnBack.on(Laya.Event.CLICK, this, this._onBtnOff);
            this.view.btnVideo.visible = false;
            this.view.btnOff.visible = false;
            this.view.btnBack.visible = false;
            clickMask.inst.removeSelf();
            YYGGames.gameBanner.visible = false;
        }
        onHide() {
            this.view.btnOff.off(Laya.Event.CLICK, this, this._onBtnOff);
            this.view.btnBack.off(Laya.Event.CLICK, this, this._onBtnOff);
            this.view.btnVideo.off(Laya.Event.CLICK, this, this._addKey);
        }
        onRelease() { }
        _initData() {
            let allIdxs = [0, 1, 2, 3, 4, 5, 6, 7, 8];
            let adIdxs = [];
            if (PtSdk.instance.CheckBoxAcci()) {
                adIdxs = adIdxs.concat(allIdxs.splice(ComTools.getRandom(0, allIdxs.length - 1), 1));
                adIdxs = adIdxs.concat(allIdxs.splice(ComTools.getRandom(0, allIdxs.length - 1), 1));
                adIdxs = adIdxs.concat(allIdxs.splice(ComTools.getRandom(0, allIdxs.length - 1), 1));
            }
            this._boxModels = [];
            for (let i = 0; i &lt; 9; i++) {
                let count = ComTools.getRandom(10, 50);
                this._boxModels[i] = {
                    index: i,
                    isOpen: false,
                    isAd: adIdxs.indexOf(i) != -1,
                    awardCount: count
                };
            }
        }
        _onRenderHandler(box, index) {
            let model = this._boxModels[index];
            let sprBox = box.getChildByName("sprBox");
            let sprAd = box.getChildByName("sprAd");
            let sprCash = box.getChildByName("sprCash");
            let textCount = box.getChildByName("textCount");
            sprBox.visible = !model.isOpen;
            sprAd.visible = model.isAd;
            sprCash.visible = model.isOpen;
            textCount.visible = model.isOpen;
            textCount.text = `x${model.awardCount}`;
        }
        _onRenderSelect(index) {
            let model = this._boxModels[index];
            if (!model.isOpen) {
                if (model.isAd) {
                    AdDealer.AdUser.PlayVideoAd("è¯¯è§¦å¼€å®ç®±", () =&gt; {
                        this._openBox(model);
                    }, () =&gt; { }, () =&gt; { });
                } else {
                    if (this._keyCount &gt; 0) {
                        this._keyCount--;
                        this._openBox(model);
                        if (0 == this._keyCount &amp;&amp; !this.view.btnBack.visible) {
                            this.view.btnVideo.visible = true;
                            // ComTools.showLater(this.view.btnOff, 2e3);
                            this.view.btnOff.visible = true;
                        }
                    } else {
                        Tips.show("Not enough keys");
                    }
                }
            }
        }
        _openBox(model) {
            model.isOpen = true;
            GameContext.gPlayer.addGold(model.awardCount);
            for (let i = 0; i &lt; 3; i++) {
                let imgKey = this.view.getChildByName(`imgKey${i}`);
                imgKey.gray = i &gt;= this._keyCount;
            }
            let isEnd = true;
            for (let i = 0; i &lt; 9; i++) {
                let boxModel = this._boxModels[i];
                if (!boxModel.isOpen) {
                    isEnd = false;
                    break;
                }
            }
            if (isEnd) {
                this.view.btnBack.visible = true;
                this.view.btnVideo.visible = false;
                this.view.btnOff.visible = false;
            }
        }
        _addKey() {
            let _self = this;
            function suc() {
                _self._keyCount = 3;
                for (let i = 0; i &lt; 3; i++) {
                    let imgKey = _self.view.getChildByName(`imgKey${i}`);
                    imgKey.gray = i &gt;= _self._keyCount;
                }
                _self.view.btnVideo.visible = false;
                _self.view.btnOff.visible = false;
            }
            AdDealer.AdUser.PlayVideoAd("å®ç®±èŽ·å¾—é’¥åŒ™", suc, null, null);
        }
        _onBtnOff() {
            YYGGames.showInterstitial(() =&gt; {
                this.hide();
                EventMgr.send(GameEvent.View.CLOSE, "ClearCaseView");
                clickMask.inst.removeSelf();
                YYGGames.gameBanner.visible = true;
            })
        }
    }
    class AccTouchView extends View {
        constructor() {
            super(ui.view.AccTouchViewUI);
            this.isBox = false;
            this.showBox = false;
            this.touchAmount = 0;
            this.barTimes = 10;
            this.showAcc = 6;
            this.aaa = 0;
            this.group = 2;
        }
        OnBtnAttack() {
            this.touchAmount++;
            this.view.eggBar.width += 421 / this.barTimes;
            if (this.view.eggBar.width &gt;= 421) {
                this.done();
            }
            if (this.touchAmount &lt; this.showAcc || this.touchAmount &gt; this.showAcc) return;
            if (this.showBox) {
                AdDealer.AdUser.SetBoxAdState(true);
            } else {
                AdDealer.AdUser.SetBannerAdState(true);
                Laya.timer.once(2e3, this, () =&gt; {
                    AdDealer.AdUser.SetBannerAdState(false);
                });
            }
            Laya.timer.once(1e3, this, this.done);
        }
        InitUI() {
            let _self = this;
            let _num = this.data[0];
            this.view.eggBar.width = 0;
            switch (_num) {
                case 1:
                    choseStyle(false);
                    break;

                case 2:
                    choseStyle(true);
                    break;

                case 3:
                    if (this.isBox) {
                        choseStyle(false);
                    } else {
                        choseStyle(true);
                    }
                    break;

                default:
                    console.error(`is UI init error! &lt;init style ${_num}&gt;`);
                    break;
            }
            AdDealer.AdUser.SetBannerAdState(false);
            function choseStyle(isBanner) {
                if (isBanner) {
                    _self.view.finger.visible = false;
                    _self.view.btnAttack.visible = true;
                    _self.view.btnAttack.on(Laya.Event.CLICK, this, () =&gt; {
                        _self.OnBtnAttack();
                    });
                    _self.showBox = false;
                } else {
                    _self.view.finger.visible = true;
                    _self.view.btnAttack.visible = false;
                    _self.view.imgEgg.on(Laya.Event.CLICK, this, () =&gt; {
                        _self.OnBtnAttack();
                    });
                    _self.showBox = true;
                }
            }
        }
        onQqBack() {
            let _self = this;
            qq.onShow(() =&gt; {
                if (_self.view.eggBar.width &gt;= 100) {
                    this.done();
                }
            });
        }
        done() {
            this.view.btnAttack.visible = false;
            this.view.barGround.visible = false;
            this.view.finger.visible = false;
            this.view.imgEgg.skin = "public/zuanshi.png";
            this.view.ani1.stop();
            this.view.imgEgg.rotation = 0;
            this.view.showText.text = "Diamon +5";
            GameContext.gPlayer.addDiamond(5);
            AdDealer.AdUser.SetBannerAdState(false);
            Laya.timer.once(2e3, this, () =&gt; {
                this.hide();
            });
        }
        autoBack() {
            Laya.timer.once(0, this, function fun1() {
                if (this.view.eggBar.width &lt;= 380) {
                    this.view.eggBar.width -= 5;
                    if (this.view.eggBar.width &lt; 0) {
                        this.view.eggBar.width = 0;
                    }
                    Laya.timer.once(100, this, fun1);
                }
            });
        }
        onInit() { }
        onShow() {
            this.InitUI();
            this.autoBack();
            clickMask.inst.removeSelf();
        }
        onHide() {
            try {
                this.view.btnAttack.offAll();
                this.view.imgEgg.offAll();
                if (this.data[2] &amp;&amp; this.data[2] == true) {
                    AdDealer.AdUser.SetBannerAdState(true, true);
                } else {
                    AdDealer.AdUser.SetBannerAdState(true);
                }
                let _closeView = this.data[1];
                if (_closeView) {
                    EventMgr.send(GameEvent.View.CLOSE, "ClearCaseView");
                } else {
                    this.hide();
                }
            } catch (e) {
                console.log("off acc listener error", e);
            }
        }
        onRelease() { }
    }
    class ShopView extends View {
        constructor() {
            super(ui.view.ShopViewUI);
            this._curIndex = 0;
            this.group = 2;
        }
        onInit() { }
        onShow() {
            this.view.btnClose.once(Laya.Event.CLICK, this, this._close);
            this._initUI();
            clickMask.inst.removeSelf();
        }
        onHide() {
            this.view.btnClose.off(Laya.Event.CLICK, this, this._close);
        }
        onRelease() { }
        _initUI() {
            let refItems = RefMgr.getAllRef(Item);
            let wallIds = [];
            let equipmentIds = [];
            let policeIds = [];
            let developCtrl = GameContext.gPlayer.developCtrl;
            for (let id in refItems) {
                let item = refItems[id];
                let itemId = Number(id);
                let type = item.type;
                if (1 == type) {
                    wallIds[item.tag] = itemId;
                } else if (2 == type) {
                    equipmentIds[item.tag] = itemId;
                } else if (3 == type) {
                    policeIds[item.tag] = itemId;
                }
            }
            for (let i = wallIds.length - 1; i &gt;= 0; i--) {
                let id = wallIds[i];
                developCtrl.isHaveItem(id) &amp;&amp; wallIds.push(wallIds.splice(i, 1)[0]);
            }
            for (let i = equipmentIds.length - 1; i &gt;= 0; i--) {
                let id = equipmentIds[i];
                developCtrl.isHaveItem(id) &amp;&amp; equipmentIds.push(equipmentIds.splice(i, 1)[0]);
            }
            for (let i = policeIds.length - 1; i &gt;= 0; i--) {
                let id = policeIds[i];
                developCtrl.isHaveItem(id) &amp;&amp; policeIds.push(policeIds.splice(i, 1)[0]);
            }
            this.view.listWall.renderHandler = new Laya.Handler(this, this._onWallRender, [wallIds]);
            this.view.listWall.vScrollBarSkin = "";
            this.view.listWall.array = wallIds;
            this.view.listEquipment.renderHandler = new Laya.Handler(this, this._onEquipmentRender, [equipmentIds]);
            this.view.listEquipment.vScrollBarSkin = "";
            this.view.listEquipment.array = equipmentIds;
            this.view.listPolice.renderHandler = new Laya.Handler(this, this._onPoliceRender, [policeIds]);
            this.view.listPolice.vScrollBarSkin = "";
            this.view.listPolice.array = policeIds;
            this.view.btnWall.on(Laya.Event.CLICK, this, this._toList, [0]);
            this.view.btnEquipment.on(Laya.Event.CLICK, this, this._toList, [1]);
            this.view.btnPolice.on(Laya.Event.CLICK, this, this._toList, [2]);
            this._toList(0);
        }
        _onWallRender(ids, cell, index) {
            let id = ids[index];
            let item = cell.getComponent(ItemCell);
            item.dataSource = id;
        }
        _onEquipmentRender(ids, cell, index) {
            let id = ids[index];
            let item = cell.getComponent(ItemCell);
            item.dataSource = id;
        }
        _onPoliceRender(ids, cell, index) {
            let id = ids[index];
            let item = cell.getComponent(PoliceCell);
            item.dataSource = id;
        }
        _close() {
            this.hide();
            GameContext.gPlayer.guideControl.nextStep();
        }
        _toList(index) {
            this.view.listWall.visible = 0 == index;
            this.view.listEquipment.visible = 1 == index;
            this.view.listPolice.visible = 2 == index;
            this.view.btnWall.skin = 0 == index ? "develop/qiang.diban-yeqian2.png" : "develop/qiang.diban-yeqian1.png";
            this.view.btnEquipment.skin = 1 == index ? "develop/shebei-yeqian2.png" : "develop/shebei-yeqian1.png";
            this.view.btnPolice.skin = 2 == index ? "develop/jingyuan-yeqian2.png" : "develop/jiingyuan-yeqian1.png";
            this.view.textName.text = 0 == index ? "Room" : 1 == index ? "Equipment" : "Police";
            if (1 == index) {
                GameContext.gPlayer.guideControl.nextStep();
            }
            this._curIndex = index;
        }
    }
    class DevelopView extends View {
        constructor() {
            super(ui.view.DevelopViewUI);
            this._isOpenDe = false;
            this.group = 1;
        }
        onShow() {
            this.view.btnBack.once(Laya.Event.CLICK, this, this.hide);
            this.view.btnShop.on(Laya.Event.CLICK, this, this._toShop);
            this.view.boxCloseDe.on(Laya.Event.CLICK, this, this._onDecorate);
            this.view.btnDecorate.on(Laya.Event.CLICK, this, this._onDecorate);
            this.view.btnOffLine.on(Laya.Event.CLICK, this, this._toOffLine);
            EventMgr.on(GameEvent.CHANGE_RED, this, this._updataRedDot);
            this._updataRedDot(GameContext.gPlayer.developCtrl.redDotInfo);
            let thiz = this;
            this.view.btnAd.on(Laya.Event.CLICK, this, () =&gt; {
                let count = GameContext.gPlayer.lookAdCount;
                if (count &gt; 0) {
                    AdDealer.AdUser.PlayVideoAd("è­¦å±€çœ‹å¹¿å‘Š(é‡‘å¸)", () =&gt; {
                        GameContext.gPlayer.uselookAdCount();
                        GameContext.gPlayer.addGold(1e3);
                        thiz.view.textLookAdCount.text = `${count - 1}/3`;
                    }, null, null);
                } else {
                    Tips.show("No remaining times today");
                }
            });
            this._initDecorate();
            this.view.textLookAdCount.text = `${GameContext.gPlayer.lookAdCount}/3`;
            clickMask.inst.removeSelf();
        }
        onHide() {
            this.view.btnBack.off(Laya.Event.CLICK, this, this.hide);
            this.view.btnShop.off(Laya.Event.CLICK, this, this._toShop);
            this.view.boxCloseDe.on(Laya.Event.CLICK, this, this._onDecorate);
            this.view.btnDecorate.off(Laya.Event.CLICK, this, this._onDecorate);
            this.view.btnOffLine.off(Laya.Event.CLICK, this, this._toOffLine);
            EventMgr.offAllCaller(this);
            YYGGames.showInterstitial(() =&gt; {
                EventMgr.send(GameEvent.HOME_VISIBLE, true);
            })
        }
        _toShop() {
            EventMgr.send(GameEvent.View.OPEN, "ShopView");
            if (GameContext.gPlayer.guideControl.isPlayGuide) {
                if (!GameContext.gPlayer.isEnough(300) || GameContext.gPlayer.developCtrl.isHaveItem(5)) {
                    GameContext.gPlayer.guideControl.stopGuide();
                    return;
                }
                GameContext.gPlayer.guideControl.nextStep();
            }
        }
        _toOffLine() {
            GameContext.gPlayer.guideControl.nextStep();
            if (GameContext.gPlayer.developCtrl.outPut != 0) {
                this._intervalTime = 0;
                EventMgr.send(GameEvent.View.OPEN, "OffLineView");
            } else {
                Tips.show("No earning");
            }
        }
        _onDecorate() {
            if (!this._isOpenDe) {
                this.view.boxCloseDe.visible = true;
                this.view.openAni.play(0, false);
                let itemDic = GameContext.gPlayer.developCtrl.itemDic;
                let wallIds = [];
                let equipmentIds = [];
                itemDic.forEach((id, model) =&gt; {
                    let ref = RefMgr.getRef(Item, id);
                    ref.type == 1 &amp;&amp; wallIds.push(id);
                    ref.type == 2 &amp;&amp; equipmentIds.push(id);
                });
                let sortTags = [];
                for (let i = 0, len = wallIds.length; i &lt; len; i++) {
                    let id = wallIds[i];
                    let model = itemDic.getValue(id);
                    let ref = RefMgr.getRef(Item, id);
                    let tag = model.isSelected ? 10 + ref.outPut : ref.outPut;
                    sortTags[i] = {
                        id: id,
                        tag: tag
                    };
                }
                sortTags.sort((a, b) =&gt; b.tag - a.tag);
                for (let i = 0, len = sortTags.length; i &lt; len; i++) {
                    wallIds[i] = sortTags[i].id;
                }
                this.view.listWall.array = wallIds;
                sortTags = [];
                for (let i = 0, len = equipmentIds.length; i &lt; len; i++) {
                    let id = equipmentIds[i];
                    let model = itemDic.getValue(id);
                    let ref = RefMgr.getRef(Item, id);
                    let tag = model.isSelected ? 10 + ref.outPut : ref.outPut;
                    sortTags[i] = {
                        id: id,
                        tag: tag
                    };
                }
                sortTags.sort((a, b) =&gt; b.tag - a.tag);
                for (let i = 0, len = sortTags.length; i &lt; len; i++) {
                    equipmentIds[i] = sortTags[i].id;
                }
                this.view.listEquipment.array = equipmentIds;
                let polices = GameContext.gPlayer.developCtrl.polices;
                polices.sort((a, b) =&gt; {
                    let atag = a.isSelected ? 10 + a.itemId : a.itemId;
                    let btag = b.isSelected ? 10 + b.itemId : b.itemId;
                    return btag - atag;
                });
                this.view.listPolice.array = polices;
                this._toList(0);
                GameContext.gPlayer.guideControl.nextStep();
            } else {
                this.view.boxCloseDe.visible = false;
                this.view.closeAni.play(0, false);
            }
            this._isOpenDe = !this._isOpenDe;
        }
        _initDecorate() {
            this._itemDic = GameContext.gPlayer.developCtrl.itemDic;
            this.view.listWall.renderHandler = new Laya.Handler(this, this._onWallRender);
            this.view.listWall.selectEnable = true;
            this.view.listWall.mouseHandler = new Laya.Handler(this, this._onWallSelect);
            this.view.listWall.vScrollBarSkin = "";
            this.view.listEquipment.renderHandler = new Laya.Handler(this, this._onEquipmentRender);
            this.view.listEquipment.selectEnable = true;
            this.view.listEquipment.mouseHandler = new Laya.Handler(this, this._onEquipmentSelect);
            this.view.listEquipment.vScrollBarSkin = "";
            this.view.listPolice.renderHandler = new Laya.Handler(this, this._onPoliceRender);
            this.view.listPolice.mouseEnabled = true;
            this.view.listPolice.mouseHandler = new Laya.Handler(this, this._onPoliceSelect);
            this.view.listPolice.vScrollBarSkin = "";
            this.view.btnWall.on(Laya.Event.CLICK, this, this._toList, [0]);
            this.view.btnEquipment.on(Laya.Event.CLICK, this, this._toList, [1]);
            this.view.btnPolice.on(Laya.Event.CLICK, this, this._toList, [2]);
            this._upDataDecorate(0);
            let player = GameContext.gPlayer;
            let lastOfflineTime = player.lastOfflineTime;
            let nowTime = ComTools.now();
            this._intervalTime = Math.floor((nowTime - lastOfflineTime) / 1e3);
            this._loopTime();
            this.timer.loop(1e3, this, this._loopTime);
            let lv = player.level;
            let ref = RefMgr.getRef(Level, lv);
            this.view.textLv.text = ref.des;
            this.view.imgLv.skin = `main/police_${lv}.png`;
            if (GameContext.gPlayer.developCtrl.outPut != 0) {
                GameContext.gPlayer.guideControl.checkGuide(1);
            }
        }
        _toList(index) {
            this.view.listWall.visible = 0 == index;
            this.view.listEquipment.visible = 1 == index;
            this.view.listPolice.visible = 2 == index;
            this.view.btnWall.x = 0 == index ? -91 : -61;
            this.view.btnEquipment.x = 1 == index ? -91 : -61;
            this.view.btnPolice.x = 2 == index ? -91 : -61;
            this.view.textName.text = 0 == index ? "Room" : 1 == index ? "Equipment" : "Police";
            if (1 == index) {
                GameContext.gPlayer.guideControl.nextStep();
            }
        }
        _onWallRender(cell, index) {
            let id = this.view.listWall.array[index];
            let model = this._itemDic.getValue(id);
            let ref = RefMgr.getRef(Item, id);
            let imgIcon = cell.getChildByName("imgIcon");
            let textName = cell.getChildByName("textName");
            let textOutPut = cell.getChildByName("textOutPut");
            let sprSelect = cell.getChildByName("sprSelect");
            let sprRed = cell.getChildByName("sprRed");
            sprRed.visible = model.isNew;
            let skin = `develop/${ref.icon}.png`;
            imgIcon.skin = skin;
            textName.text = ref.name;
            textOutPut.text = `${(ref.outPut * 60).toFixed(1)}/s`;
            sprSelect.visible = model.isSelected;
        }
        _onWallSelect(e, index) {
            if (Laya.Event.MOUSE_UP == e.type) {
                let id = this.view.listWall.array[index];
                GameContext.gPlayer.developCtrl.replaceById(id);
                this._upDataDecorate(1);
            }
        }
        _onEquipmentRender(cell, index) {
            let id = this.view.listEquipment.array[index];
            let model = GameContext.gPlayer.developCtrl.itemDic.getValue(id);
            let ref = RefMgr.getRef(Item, id);
            let imgIcon = cell.getChildByName("imgIcon");
            let textName = cell.getChildByName("textName");
            let textOutPut = cell.getChildByName("textOutPut");
            let sprSelect = cell.getChildByName("sprSelect");
            let sprRed = cell.getChildByName("sprRed");
            sprRed.visible = model.isNew;
            let skin = `develop/${ref.icon}.png`;
            imgIcon.skin = skin;
            textName.text = ref.name;
            textOutPut.text = `${(ref.outPut * 60).toFixed(1)}/s`;
            sprSelect.visible = model.isSelected;
        }
        _onEquipmentSelect(e, index) {
            if (Laya.Event.MOUSE_UP == e.type) {
                let id = this.view.listEquipment.array[index];
                GameContext.gPlayer.developCtrl.replaceById(id);
                this._upDataDecorate(1);
                GameContext.gPlayer.guideControl.nextStep();
            }
        }
        _onPoliceRender(cell, index) {
            let polices = GameContext.gPlayer.developCtrl.polices;
            let model = polices[index];
            let id = model.itemId;
            let ref = RefMgr.getRef(Item, id);
            let imgIcon = cell.getChildByName("imgIcon");
            let textName = cell.getChildByName("textName");
            let textOutPut = cell.getChildByName("textOutPut");
            let sprSelect = cell.getChildByName("sprSelect");
            let sprRed = cell.getChildByName("sprRed");
            sprRed.visible = model.isNew;
            let skin = `develop/${ref.icon}.png`;
            imgIcon.skin = skin;
            textName.text = ref.name;
            textOutPut.text = `${(ref.outPut * 60).toFixed(1)}/s`;
            sprSelect.visible = model.isSelected;
        }
        _onPoliceSelect(e, index) {
            if (Laya.Event.MOUSE_UP == e.type) {
                let polices = GameContext.gPlayer.developCtrl.polices;
                let model = polices[index];
                let isSuc = GameContext.gPlayer.developCtrl.replacePolice(model);
                if (isSuc) {
                    this._upDataDecorate(2);
                } else {
                    Tips.show("There is already full staffed,\n please recall the police and try again!");
                }
            }
        }
        _upDataDecorate(updataState) {
            if (0 == updataState || 1 == updataState) {
                this._itemDic.forEach((id, item) =&gt; {
                    if (item.isSelected) {
                        let ref = RefMgr.getRef(Item, id);
                        if (ref.groupType &lt; 6) {
                            let img = this.view.boxRoom.getChildByName(`img${ref.groupType}`);
                            img.skin = ref.image;
                        }
                    }
                });
                this.view.listWall.refresh();
                this.view.listEquipment.refresh();
            }
            if (0 == updataState || 2 == updataState) {
                for (let i = 1; i &lt; 4; i++) {
                    let spr = this.view.boxRoom.getChildByName(`spr${i}`);
                    if (spr.numChildren &gt; 0) {
                        let ani = spr.getChildAt(0);
                        ani.stop();
                        ani.removeSelf();
                        ani.destroy();
                    }
                }
                let sprIdx = 1;
                let polices = GameContext.gPlayer.developCtrl.polices;
                for (let i = 0, len = polices.length; i &lt; len; i++) {
                    let police = polices[i];
                    if (police.isSelected) {
                        let idx = police.itemId - 18;
                        let path = `animation/Police${idx}Ani.ani`;
                        let ani = new Laya.Animation();
                        ani.loadAnimation(path);
                        ani.play(0, true);
                        let spr = this.view.boxRoom.getChildByName(`spr${sprIdx}`);
                        if (spr) {
                            spr.addChild(ani);
                        }
                        sprIdx++;
                    }
                }
                this.view.listPolice.refresh();
            }
        }
        _loopTime() {
            this.view.textOutPut.text = `${(GameContext.gPlayer.developCtrl.outPut * 60).toFixed(1)}/s`;
            this._intervalTime++;
            if (GameContext.gPlayer.developCtrl.outPut == 0) {
                this.view.panelPro.height = 1;
                // let player = GameContext.gPlayer;
                // let lastOfflineTime = player.lastOfflineTime;
                // let nowTime = ComTools.now();
                // this._intervalTime = Math.floor((nowTime - lastOfflineTime) / 1e3);
                GameContext.gPlayer.changeLastOfflineTime(ComTools.now());
            } else {
                this.view.panelPro.height = 104 * this._intervalTime / 3600;
            }
        }
        _updataRedDot(redDotInfo) {
            this.view.wallRed.visible = redDotInfo[0];
            this.view.equipmentRed.visible = redDotInfo[1];
            this.view.policeRed.visible = redDotInfo[2];
            this.view.sprRed.visible = redDotInfo[0] || redDotInfo[1] || redDotInfo[2];
        }
    }
    class NotMoneyView extends View {
        constructor() {
            super(ui.view.NotMoneyViewUI);
            this.group = 2;
        }
        onShow() {
            this.view.btnAd.once(Laya.Event.CLICK, this, this._showAd);
            this.view.btnClose.once(Laya.Event.CLICK, this, this._close);
            this.view.btnClose.visible = true;
            // ComTools.showLater(this.view.btnClose, 2e3);
            this.view.textLookAdCount.text = `${GameContext.gPlayer.lookAdCount}/3`;
            clickMask.inst.removeSelf();
        }
        onHide() {
            this.view.btnClose.off(Laya.Event.CLICK, this, this._close);
        }
        onRelease() { }
        _close() {
            this.hide();
        }
        _showAd() {

            function success() {
                GameContext.gPlayer.uselookAdCount();
                GameContext.gPlayer.addGold(1e3);
            }
            function fail() { }
            AdDealer.AdUser.PlayVideoAd("è­¦å±€çœ‹å¹¿å‘Šå¥–åŠ±é‡‘å¸", () =&gt; {
                success();
            }, fail, fail);
            this._close();
        }
    }
    class OffLineView extends View {
        constructor() {
            super(ui.view.OffLineViewUI);
            this.group = 2;
        }
        onShow() {
            this.view.btnTwo.once(Laya.Event.CLICK, this, this._showAd);
            this.view.btnOne.once(Laya.Event.CLICK, this, this._one);
            // ComTools.showLater(this.view.btnOne, 2e3);
            this.view.btnOne.visible = true;
            let player = GameContext.gPlayer;
            let lastOfflineTime = player.lastOfflineTime;
            let nowTime = ComTools.now();
            let intervalTime = Math.floor((nowTime - lastOfflineTime) / 1e3);
            intervalTime = Math.min(intervalTime, 3600);
            let gold = intervalTime * player.developCtrl.outPut;
            this._gold = gold;
            this.view.textGold.text = "+" + Math.floor(gold);
            clickMask.inst.removeSelf();
        }
        onHide() {
            ComTools.flyGoldEff(307, 458);
            this.view.btnOne.off(Laya.Event.CLICK, this, this._one);
        }
        _one() {
            GameContext.gPlayer.addGold(Math.floor(this._gold));
            GameContext.gPlayer.changeLastOfflineTime(ComTools.now());
            this.hide();
        }
        _showAd() {
            let thiz = this;

            function success() {
                GameContext.gPlayer.addGold(Math.floor(thiz._gold * 2));
                GameContext.gPlayer.changeLastOfflineTime(ComTools.now());
            }
            function fail() { }
            AdDealer.AdUser.PlayVideoAd("çœ‹å¹¿å‘Šé¢†å–åŒå€ç¦»çº¿é‡‘å¸", () =&gt; {
                success();
            }, fail, fail);
            this.hide();
        }
    }
    class ViewCls { }
    ViewCls.GameMain = GameMain;
    ViewCls.LocaleView = LocaleView;
    ViewCls.ClearCaseView = ClearCaseView;
    ViewCls.CaseFailedView = CaseFailedView;
    ViewCls.TaskView = TaskView;
    ViewCls.OfferView = OfferView;
    ViewCls.LoadView = LoadView;
    ViewCls.GetEnergy = GetEnergyView;
    ViewCls.ShareView = ShareView;
    ViewCls.GuideView = GuideView;
    ViewCls.BoxView = BoxView;
    ViewCls.AccTouchView = AccTouchView;
    ViewCls.ShopView = ShopView;
    ViewCls.DevelopView = DevelopView;
    ViewCls.NotMoneyView = NotMoneyView;
    ViewCls.OffLineView = OffLineView;
    class ViewMgr {
        constructor(stage) {
            this._layArr = [0, 1, 2, 3, 4];
            this._dicLays = null;
            this._dicShowUI = null;
            this._dicShowUI = new Dictionary();
            this._dicLays = new Dictionary();
            for (let i = 0; i &lt; this._layArr.length; i++) {
                let lay = new Laya.Box();
                lay.mouseThrough = true;
                lay.width = GameConfig.width;
                lay.height = GameConfig.height;
                lay.centerX = 0;
                lay.centerY = 0;
                Laya.stage.addChild(lay);
                this._dicLays.setValue(this._layArr[i], lay);
            }
            GameContext.TOP_PIXEL = (Laya.stage.height - GameConfig.height) / 2;
            EventMgr.on(GameEvent.View.OPEN, this, this._openView);
            EventMgr.on(GameEvent.View.CLOSE, this, this._closeView);
        }
        getOffsetXY() {
            let lay = this._dicLays.getValue(0);
            return {
                x: lay.x,
                y: lay.y
            };
        }
        _onChangeSize() {
            // let w = GameConfig.width;
            // let h = GameConfig.height;
            // let rate = Laya.Browser.width / Laya.Browser.height;
            // let defaultRate = GameConfig.width / GameConfig.height;
            // if (rate &lt; defaultRate) Laya.stage.height = w / rate; else Laya.stage.height = h;
            // if (rate &gt;= defaultRate &amp;&amp; rate &lt; 1) Laya.stage.width = GameConfig.height / (Laya.Browser.height / Laya.Browser.width); else if (rate &gt;= 1) Laya.stage.width = Laya.Browser.width; else Laya.stage.width = Laya.stage.height * rate;
            // EventMgr.send(GameEvent.STAGE_RESIZE, [w, h]);
        }
        _openView(name, data, handle = null) {
            Laya.stage.addChild(clickMask.inst);
            if (!ViewCls[name]) {
                Logger.error("invalid view: " + name);
                clickMask.inst.removeSelf();
                return;
            }
            let viewClass = ViewCls[name];
            if (viewClass == null) {
                Logger.error("can't find view type: " + name);
                clickMask.inst.removeSelf();
                return;
            }
            let uiView = this._dicShowUI.getValue(name);
            if (!uiView) {
                uiView = new viewClass();
                uiView.name = name;
            }
            uiView.data = data;
            let lay = this._dicLays.getValue(uiView.group);
            if (!lay) return Logger.log("[" + name + "]æ‰¾ä¸åˆ°å±‚çº§[" + uiView.group + "]å®‰æ”¾");
            let group = uiView.group;
            lay.addChild(uiView);
            switch (group) {
                case 0:
                    break;

                case 1:
                    let numChildren = lay.numChildren;
                    for (let index = numChildren - 1; index &gt;= 0; index--) {
                        let winView = lay.getChildAt(index);
                        this._closeView(winView.name);
                    }
                    break;

                case 2:
                    break;

                case 3:
                    break;

                case 4:
                    break;

                default:
                    break;
            }
            this._dicShowUI.setValue(name, uiView);
            if (handle) {
                handle.run();
            }
        }
        _closeView(name, handle = null) {
            let view = this._dicShowUI.getValue(name);
            if (view) {
                this._dicShowUI.remove(name);
                view.removeSelf();
                view.shutdownMode == 1 &amp;&amp; view.destroy();
                if (handle) {
                    handle.run();
                }
            } else {
                Logger.log("UI[" + name + "]å¹¶æœªå±•ç¤º,ä¸éœ€è¦ç§»é™¤");
            }
        }
        setUI(key, value) { }
        getUIByName(name) {
            var ui = this._dicShowUI.getValue(name);
            if (!ui) {
                Logger.log("å–ä¸åˆ°[" + name + "]æ‰€å¯¹åº”çš„UI");
            }
            return ui;
        }
    }
    class LevelMgr {
        constructor() {
            this._folder = "levelConfig/";
            this._dicAll = null;
            LevelMgr.instance = this;
            this._dicAll = new Dictionary();
        }
        load(list, handler) {
            var filelist = [];
            list.forEach(v =&gt; {
                filelist.push({
                    url: this._folder + v + ".json",
                    type: "json"
                });
            });
            this.handler = handler;
            Laya.loader.load(filelist, Laya.Handler.create(this, this.onLoadComplete, [list]));
        }
        onLoadComplete(list) {
            list.forEach(name =&gt; {
                let array = Laya.loader.getRes(this._folder + name + ".json");
                if (!array) return;
                this._parserJson(name, array);
                Laya.loader.clearRes(this._folder + name + ".json");
            });
            this.handler &amp;&amp; (this.handler.run(), this.handler = null);
        }
        _parserJson(name, obj) {
            let levelModel = null;
            let children = obj["child"];
            if (children) {
                levelModel = this._analysisXML(children);
                this._dicAll.setValue(name, levelModel);
            } else {
                Logger.error(`è§£æžå¤±è´¥,å…³å¡:${name}`);
            }
            return levelModel;
        }
        _analysisXML(configs, prentRotation = 0) {
            let levelModel = {
                level: null,
                element: null
            };
            let elements = [];
            let len = configs.length;
            for (let i = 0; i &lt; len; i++) {
                let child = configs[i];
                let props = child["props"];
                let PreVar = props ? props["var"] : "";
                if (child.type == "Script" &amp;&amp; "game/script/LevelScript.ts" == props.runtime) {
                    levelModel = {
                        level: props["level"] || null,
                        element: null
                    };
                } else {
                    if (!PreVar || !this._isPrefab(PreVar)) {
                        Logger.error("PreVar is Error, PreVar = ", PreVar);
                        continue;
                    }
                    let x = props["x"] ? Number(props["x"]) : 0;
                    let y = props["y"] ? Number(props["y"]) : 0;
                    let rotation = props["rotation"] ? Number(props["rotation"]) + prentRotation : prentRotation;
                    let childs = child["child"];
                    let elment = null;
                    if (childs) {
                        let len = childs.length;
                        for (let j = 0; j &lt; len; j++) {
                            let oneChild = childs[j];
                            let props = oneChild.props;
                            if (oneChild.type == "Script" &amp;&amp; props.runtime == "game/script/ElementScript.ts") {
                                elment = {
                                    posX: props["posX"] ? props["posX"] : null
                                };
                                break;
                            }
                        }
                    }
                    elements.push(elment);
                }
            }
            levelModel.element = elements;
            return levelModel;
        }
        _isPrefab(prefabName) {
            return Const.PrefabNames.indexOf(prefabName) &gt;= 0;
        }
        _getLevelConfig(levelName) {
            var tbl = this._dicAll.getValue(levelName);
            return tbl;
        }
        static getLevelConfig(level) {
            if (!this.instance) return null;
            return this.instance._getLevelConfig(ComTools.caseToString(level));
        }
    }
    class PrefabMgr {
        constructor() {
            this._dicPrefab = null;
            this._folder = "prefab/";
            PrefabMgr.instance = this;
            this._dicPrefab = new Dictionary();
        }
        load(list, handler) {
            var filelist = [];
            list.forEach(v =&gt; {
                filelist.push({
                    url: this._folder + v + ".json",
                    type: "json"
                });
            });
            this.handler = handler;
            Laya.loader.load(filelist, Laya.Handler.create(this, this.onLoadComplete, [list]));
        }
        onLoadComplete(list) {
            list.forEach(name =&gt; {
                let array = Laya.loader.getRes(this._folder + name + ".json");
                Logger.log("*****start load " + name);
                let prefab = new Laya.Prefab();
                prefab.json = array;
                let _nameAry = name.split("/");
                let _name = "";
                _name = _nameAry.length == 1 ? _nameAry[0] : _nameAry[1];
                this._dicPrefab.setValue(_name, prefab);
                Laya.loader.clearRes(this._folder + name + ".json");
            });
            this.handler &amp;&amp; (this.handler.run(), this.handler = null);
        }
        static getPrefab(name) {
            if (!this.instance) return null;
            let pref = this.instance._dicPrefab.getValue(name);
            let pre = Laya.Pool.getItemByCreateFun(name, pref.create, pref);
            return pre;
        }
        static recoverPrefab(name, pre) {
            if (!this.instance) return null;
            Laya.Pool.recover(name, pre);
        }
    }
    var Game;
    (function (Game) {
        Game._game_ = null;
        Game.launch = function () {
            Game._game_ = new GameManager();
        };
        class GameManager {
            constructor() {
                this._router = new Router();
                this._stage = Laya.stage;
                this._eventMgr = new EventMgr(this._router);
                this._refMgr = new RefMgr();
                this._levelMgr = new LevelMgr();
                this._viewMgr = new ViewMgr(this._stage);
                let prefabMgr = new PrefabMgr();
                let load = new LoadControl(this._refMgr, this._levelMgr, prefabMgr);
                load.onStart(Laya.Handler.create(this, this._runGame));
            }
            get router() {
                return this._router;
            }
            get stage() {
                return this._stage;
            }
            get refMgr() {
                return this._refMgr;
            }
            get levelMgr() {
                return this._levelMgr;
            }
            get viewMgr() {
                return this._viewMgr;
            }
            get eventMgr() {
                return this._eventMgr;
            }
            _runGame() {
                Logger.log("preLoad ok!");
                this._router.event(GameEvent.View.OPEN, "GameMain");
                GameContext.offsetXY = this._viewMgr.getOffsetXY();
            }
        }
    })(Game || (Game = {}));
    class clickMask extends Laya.Box {
        static _inst = null;
        static get inst() {
            if (!clickMask._inst) {
                clickMask._inst = new clickMask();
            }
            return clickMask._inst;
        }
        constructor() {
            super();
            this.zOrder = 200001;
            this.size(Laya.stage.width, Laya.stage.height)
            this.sprBg = new Laya.Sprite();
            this.sprBg.size(Laya.stage.width, Laya.stage.height);
            this.sprBg.graphics.drawRect(0, 0, Laya.stage.width, Laya.stage.height, "#000000");
            this.sprBg.alpha = 0.5;
            this.addChild(this.sprBg);

            this.sprBgImg = new Laya.Image();
            this.sprBgImg.size(Laya.stage.width, Laya.stage.height);
            this.sprBgImg.skin = "loading/ladingBg.png";
            this.addChild(this.sprBgImg);

            this.warnText = new Laya.Label();
            this.warnText.text = "Loading...";
            this.warnText.color = "#ffffff";
            this.warnText.bgColor = "#000000";
            this.warnText.fontSize = 40;
            this.warnText.centerX = 0;
            this.warnText.centerY = -60;
            this.addChild(this.warnText);
            this.on(Laya.Event.CLICK, this, this.nullEvent);
        }
        nullEvent(e) {
            e.stopPropagation();
        }

    }
    class Main {
        constructor() {
            if (window["Laya3D"]) Laya3D.init(GameConfig.width, GameConfig.height);
            else Laya.init(GameConfig.width, GameConfig.height, Laya["WebGL"]);
            Laya.stage.scaleMode = GameConfig.scaleMode;
            Laya.stage.screenMode = GameConfig.screenMode;
            Laya.stage.alignV = GameConfig.alignV;
            Laya.stage.alignH = GameConfig.alignH;
            Laya.URL.exportSceneToJson = GameConfig.exportSceneToJson;
            Laya.ResourceVersion.enable("version.json", Laya.Handler.create(this, this.onVersionLoaded), Laya.ResourceVersion.FILENAME_VERSION);
        }
        onVersionLoaded() {
            Laya.AtlasInfoManager.enable("fileconfig.json", Laya.Handler.create(this, this.onConfigLoaded));
        }
        onConfigLoaded() {
            new clickMask();
            Game.launch();
        }
        catchError() {
            if (true) {
                let count = 0;
                let copy = function (target) {
                    target.select();
                    Laya.Browser.document.execCommand("Copy");
                };
                window.onerror = function (msg, uri, line, col, error) {
                    setTimeout(function () {
                        if (count == 0) {
                            let textarea = document.createElement("textarea");
                            textarea.id = "textarea";
                            textarea.value = "";
                            textarea.readOnly = true;
                            textarea.style.cssText = "color:red;font-size:20px;background:#404040D0;font-weight:bold;" + "width:100%;height:140px;position:fixed;margin:auto;left:0;right:0;bottom:0;";
                            let input = document.createElement("input");
                            input.type = "button";
                            input.value = "å¤åˆ¶é”™è¯¯";
                            input.style.cssText = "color:#000000;font-size:20px;background:#EEEEEEEE;" + "width:100px;height:40px;position:fixed;margin:auto;left:0;bottom:145px;";
                            input.onclick = function () {
                                copy(textarea);
                            };
                            document.body.appendChild(input);
                            document.body.appendChild(textarea);
                        }
                        let info = `/****************** é”™è¯¯ ${++count} ******************/\n${error.stack || error}\n\n`;
                        let device = "";
                        LogPanel.print(info);
                        if (Laya.Browser.onPC) {
                            device = "pc";
                            let textarea = document.getElementById("textarea");
                            textarea.value += info;
                            textarea.scrollTop = 0;
                        }
                    }, 0);
                    return false;
                };
            }
        }
    }
    new Main();
})();</pre></body></html>