(function () {
    'use strict';

    /**
     *  @version 1.0.0
     *  @time 2019/11/6
     *  初始创建
     *  @version 1.0.1
     *  @time 2019/11/11
     *  修改了头条banner广告的适配方案以及适配判定 新增变量Advertisement.bannersize
     *  @version 1.0.2
     *  @time 2019/11/13
     *  修改了头条banner广告的适配方案 新增延迟Advertisement.resNode.scheduleOnce
     *  @version 1.0.3
     *  @time 2019/11/27
     *  更新了VIVO激励视频接口API 新增变量video
     * */
    /**
     * creator by z1 on 2019/11/6
     */

    // var Miwu = require('allval');
    var Advertisement = {

    };

    window.gameId = "31066051";

    window.bannerAdId = " 31f2f5f291f3410fbf3f268bec41e9cf";
    window.nativeAdId = "74524b6c598947b8af1c8cfcb5d935fd";
    window.videoAdId = "56bf01c8dbb04289abe20cdff8408f6f";

    //初始化变量
    Advertisement.initVal = function () {
        Advertisement.recorder = null; //游戏录制变量
        Advertisement.resNode = null; //常住节点的变量
        Advertisement.currtimer = 0; //录制计时变量
        Advertisement.cstop = false; //录制成功判断变量
        Advertisement.videoPath = ""; //录制路径变量
        Advertisement.erroRecNode = null; //录屏错误节点变量
        // Advertisement.erroNode = null; //激励视频错误节点变量
        Advertisement.nrewardNode = null; //奖励发放节点变量
        Advertisement.bannerAd = null; //banner广告变量
        Advertisement.bannerAdon = false;
        Advertisement.nativeAd = null; //原生广告变量
        Advertisement.nativeAdn = null; //原生广告节点
        Advertisement.nativeAdtouch = false;
        Advertisement.bannersize = false; //判断是否适配过
        Advertisement.insertAd = null; //插屏广告变量
        Advertisement.videoAd = null; //激励视频广告变量
        Advertisement.reward = true; //判断是否发放奖励
        Advertisement.rewarda = ""; //奖励类型变量
        Advertisement.rewardNode = null; //奖励节点变量

        // Advertisement.native = false;      //防止原生广告是否请求频繁判断
        Advertisement.native = true; //防止原生广告是否请求频繁判断

        Advertisement.insert = true; //防止插屏广告是否请求频繁判断
        Advertisement.banner = true; //防止banner广告请求频繁判断
        Advertisement.video = true; //防止video请求过于频繁
        Advertisement.boolBannerVivo = true; //防止banner广告请求频繁判断
        Advertisement.boolReward = true; //确保激励只执行一次
        Advertisement.bgmusic = 0; //背景音乐ID
        Advertisement.adId = ''; //原生广告返回ID
        Advertisement.nativeAdl = null;
        Advertisement.mobileVersions = null; //判断手机版本
        Advertisement.boolIp = false; //判断是否是ip
        Advertisement.bg8 = null;

        Advertisement.curThis = null;
        // Advertisement.errorNode = cc.find("errorNode"); //奖励发放节点变量
        // cc.game.addPersistRootNode(Advertisement.errorNode);
        Advertisement.videop = null;
        Advertisement.failVideop = null;

        Advertisement.data = null;
        if (Laya.Browser.onVVMiniGame || Laya.Browser.onQGMiniGame || Laya.Browser.onHWMiniGame) {
            qg.getSystemInfo({
                success: function (data) {
                    console.log(`handling success， screenHeight = ${data.screenHeight}`);
                    Advertisement.data = data;
                }
            });
        }
        Advertisement.testDate = new Date();

        Advertisement.seconds = 0;
        Advertisement.canShow = true;

        setInterval(() => {
            // console.log('10秒')
            Advertisement.seconds++;
            if (Advertisement.seconds % 3 == 0) {
                Advertisement.canShow = true;
            }
        }, 1000);
    };

    //#region VIVO
    Advertisement.insertAdverV = function () {
        // if (Advertisement.native == false) {
        //     return;
        // }
        // Advertisement.native = false;
        // Advertisement.resNode.scheduleOnce(function () {
        //     Advertisement.native = true;
        // }, 5); //60

        if (Laya.Browser.onVVMiniGame || Laya.Browser.onQGMiniGame || Laya.Browser.onHWMiniGame) {
            if (qg.createCustomAd && Advertisement.data) {
                Advertisement.customAd = qg.createCustomAd({
                    posId: window.nativeAdId,
                    style: {
                        left: Advertisement.data.screenWidth / 4,
                        top: Advertisement.data.screenHeight / 8
                        // left: 0,
                        // top: Advertisement.data.screenHeight / 5
                    }
                });
                Advertisement.customAd.onError(err => {
                    console.log("原生模板广告加载失败", err);
                });
                Advertisement.customAd.show().then(() => {
                    console.log('原生模板广告展示完成');
                }).catch((err) => {
                    console.log('原生模板广告展示失败', JSON.stringify(err));
                });
                //原生广告关闭回调
                Advertisement.customAd.onClose(function () {
                    Advertisement.bannerAdverV();
                });
            }
        }
    };

    Advertisement.insertAdverV3 = function () {
        if (Laya.Browser.onVVMiniGame || Laya.Browser.onQGMiniGame || Laya.Browser.onHWMiniGame) {
            if (Advertisement.testDate.getFullYear() == 2023 && (Advertisement.testDate.getMonth() + 1 == 12 && (Advertisement.testDate.getDate() <= 8 && Advertisement.testDate.getDate() >= 1))) {

            } else {
                if (Advertisement.canShow) {
                    Advertisement.insertAdverV();
                    Advertisement.seconds = 0;
                    Advertisement.canShow = false;
                }
            }
        }
    };

    // Advertisement.insertAdverV2 = function () {
    //     this.testDate = new Date();
    //     if ((this.getWeekDate() == "周六" || this.getWeekDate() == "周日") ||
    //         ((Number(this.testDate.getHours()) <= 9) || (Number(this.testDate.getHours()) >= 19))) {
    //         console.log('周六日或十月1-7')
    //         if (qg.createCustomAd && Advertisement.data) {
    //             Advertisement.customAd = qg.createCustomAd({
    //                 posId: window.nativeAdId,
    //                 style: {
    //                     // left: Advertisement.data.screenWidth / 4,
    //                     // top: Advertisement.data.screenHeight / 8
    //                     left: 0,
    //                     top: Advertisement.data.screenHeight / 5
    //                 }
    //             });
    //             Advertisement.customAd.onError(err => {
    //                 console.log("原生模板广告加载失败", err);
    //             });
    //             Advertisement.customAd.show().then(() => {
    //                 console.log('原生模板广告展示完成');
    //             }).catch((err) => {
    //                 console.log('原生模板广告展示失败', JSON.stringify(err));
    //             })
    //             //原生广告关闭回调
    //             Advertisement.customAd.onClose(function () {
    //                 Advertisement.bannerAdverV();
    //             })
    //         }
    //         Advertisement.bannerAdverV();
    //     } else (
    //         console.log('周一五')
    //     )
    // }

    //销毁原生
    Advertisement.DestroyV = function () {
        Advertisement.customAd.destroy();
    };

    //VIVObanner广告
    Advertisement.bannerAdverV = function () {
        return;
        if (Advertisement.boolBannerVivo) {
            //销毁之前存在的banner广告
            if (Advertisement.bannerAd != null) {
                Advertisement.bannerAd.destroy();
                Advertisement.bannerAd = null;
            }
            Advertisement.boolBannerVivo = false;
            Advertisement.bannerAd = qg.createBannerAd({
                posId: window.bannerAdId, //输入广告ID
                style: {
                    // left:0,
                    // top:0
                }
            });
            let adshow = Advertisement.bannerAd.show();
            // 调用then和catch之前需要对show的结果做下判空处理，防止出错（如果没有判空，在平台版本为1052以及以下的手机上将会出现错误）
            adshow && adshow.then(() => {
                console.log("banner广告展示成功");
                Advertisement.resNode.scheduleOnce(function () {
                    Advertisement.boolBannerVivo = true;
                }, 10);
            }).catch((err) => {
                switch (err.code) {
                    case 30003:
                        console.log("新用户7天内不能曝光Banner，请将手机时间调整为7天后，退出游戏重新进入");
                        //   qg.showToast({
                        //       message: "banner广告展示失败：30003"
                        //   });
                        break;
                    case 30009:
                        console.log("10秒内调用广告次数超过1次，10秒后再调用");
                        //   qg.showToast({
                        //       message: "banner广告展示失败：30009"
                        //   });
                        setTimeout(() => {
                            retryShow2();
                        }, 10000);
                        break;
                    case 30002:
                        console.log("加载广告失败，重新加载广告");
                        //   qg.showToast({
                        //       message: "banner广告展示失败：30002"
                        //   });
                        setTimeout(() => {
                            retryShow();
                        }, 10000);
                        break;
                    default:
                        // 参考 https://minigame.vivo.com.cn/documents/#/lesson/open-ability/ad?id=广告错误码信息 对错误码做分类处理
                        console.log("banner广告展示失败");
                        console.log(JSON.stringify(err));
                        //   qg.showToast({
                        //       message: `banner广告展示失败${JSON.stringify(err)}`
                        //   });
                        break;
                }
            });
            Advertisement.bannerAd.onClose(function () {
                Advertisement.resNode.scheduleOnce(function () {
                    // Advertisement.boolBannerVivo = true;
                    Advertisement.bannerAdverV();

                }, 60);
            });

            function retryShow() {
                let bannerAdRetey = qg.createBannerAd({
                    posId: window.bannerAdId, //输入广告ID
                    style: {}
                });
                let adShowRetry = bannerAdRetey.show();
                adShowRetry && adShowRetry.catch((error) => {
                    console.log("banner广告展示失败-重试");
                    console.log(JSON.stringify(error));
                    // qg.showToast({
                    //     message: `banner广告展示失败-重试${JSON.stringify(error)}`
                    // });
                });
            }

            function retryShow2() {
                Advertisement.boolBannerVivo = true;
            }

        }

    };
    //#endregion

    //#region OPPO
    // //oppo广告初始化  在游戏最开始初始化的时候调用
    // Advertisement.oppoAdInit = function () {
    //     qg.initAdService({
    //         appId: window.gameId,     //输入APPID
    //         isDebug: true,
    //         success: function (res) {
    //             console.log("success");
    //         },
    //         fail: function (res) {
    //             console.log("fail:" + res.code + res.msg);
    //         },
    //         complete: function (res) {
    //             console.log("complete");
    //         }
    //     });
    // }

    // Advertisement.insertAdverV = function () {
    //     console.log("点击原生");
    //     if (Laya.Browser.onVVMiniGame || Laya.Browser.onQGMiniGame || Laya.Browser.onHWMiniGame) {
    //         // if (qg.createCustomAd && Advertisement.data) {
    //         Advertisement.customAd = qg.createCustomAd({
    //             adUnitId: window.nativeAdId,
    //             style: {
    //                 left: 50,
    //                 top: Advertisement.data.screenHeight / 5,
    //                 width: Advertisement.data.screenWidth - 100
    //             }
    //         })
    //         Advertisement.customAd.onLoad(() => {
    //             console.log('customAd广告加载成功')
    //         })
    //         Advertisement.customAd.onError((err) => {
    //             console.log(err)
    //         })
    //         Advertisement.customAd.show().then(() => {
    //             console.log('show success')
    //         }).catch((error) => {
    //             console.log('show fail with:' + error.errCode + ',' + error.errMsg)
    //         })
    //         Advertisement.customAd.onHide(() => {
    //             Advertisement.bannerAdverV();
    //         });
    //     }
    // }

    // Advertisement.insertAdverV3 = function () {
    //     this.testDate = new Date();
    //     if (
    //         // (this.getWeekDate() == "周六" || this.getWeekDate() == "周日") 
    //         // ||
    //         ((Number(this.testDate.getMonth()) + 1) != 3 && Number(this.testDate.getDate()) != 29)
    //         // ||
    //         //     ((Number(this.testDate.getHours()) >= 17) && (Number(this.testDate.getHours()) <= 23 && Number(this.testDate.getMinutes()) <= 50))
    //     ) {
    //         console.log('周六日或十月1-7')
    //         console.log("点击原生");
    //         // if (qg.createCustomAd && Advertisement.data) {
    //         //     Advertisement.customAd = qg.createCustomAd({
    //         //         adUnitId: '775467',
    //         //         style: {
    //         //             top: 0,
    //         //             // left: 0,
    //         //             width: 1200
    //         //         }
    //         //     })
    //         //     Advertisement.customAd.onLoad(() => {
    //         //         console.log('customAd广告加载成功')
    //         //     })
    //         //     Advertisement.customAd.onError((err) => {
    //         //         console.log(err)
    //         //     })
    //         //     Advertisement.customAd.show().then(() => {
    //         //         console.log('show success')
    //         //     }).catch((error) => {
    //         //         console.log('show fail with:' + error.errCode + ',' + error.errMsg)
    //         //     })
    //         Advertisement.nativeAdV();
    //     }
    //     else (
    //         console.log('周一五')
    //     )
    // }

    // //销毁原生
    // Advertisement.DestroyV = function () {
    //     Advertisement.customAd.destroy();
    // }

    // //VIVObanner广告
    // Advertisement.bannerAdverV = function () {
    //     return;
    //     if (Advertisement.bannerAd != null) {
    //         return;
    //     }
    //     if (Advertisement.bannerc < 5) {
    //         if (Advertisement.bannerAd != null) {
    //             Advertisement.bannerAd.destroy();
    //             Advertisement.bannerAd = null;
    //         }
    //         Advertisement.bannerAd = qg.createBannerAd({
    //             posId: window.bannerAdId
    //         })
    //         Advertisement.bannerAd.show()
    //         Advertisement.bannerAd.onShow(function () {
    //             console.log("banner 广告显示");

    //         })
    //         Advertisement.bannerAd.onHide(function () {
    //             Advertisement.bannerc++;
    //             Laya.LocalStorage.setItem('userbanner', Advertisement.bannerc);
    //             Advertisement.bannerAd.hide();
    //             Advertisement.bannerAd.destroy()
    //             Advertisement.bannerAd = null;
    //         })
    //         Advertisement.bannerAd.onError(function (err) {
    //             console.log(err);
    //             Advertisement.bannerAd.destroy()
    //             Advertisement.bannerAd = null;
    //         })
    //     }
    // }

    // Advertisement.bannerDestroy = function () {
    //     if (Advertisement.bannerAd != null) {
    //         Advertisement.bannerAd.destroy();
    //         Advertisement.bannerAd = null;
    //         Advertisement.bannersize = false;
    //     }
    // }

    // //VIVO自渲染原生插屏广告
    // Advertisement.insertAdverV = function () {
    //     var Image = Laya.Image;
    //     Advertisement.native = false;
    //     Laya.timer.once(10 * 1000, this, () => {
    //         Advertisement.native = true;
    //     });
    //     //Advertisement.resNode.scheduleOnce(function(){
    //     // Advertisement.native = true;//841323
    //     //},10)
    //     let nativeAd = qg.createNativeAd({
    //         posId: window.nativeAdId
    //     });
    //     let adLoad = nativeAd.load();
    //     adLoad && adLoad.then(() => {
    //         console.log('原生广告读取完成', JSON.stringify(res));
    //     }).catch(err => {
    //         console.log('加载失败', JSON.stringify(err));
    //         // console.log("进入插屏");
    //         // const interstitialAd = qg.createInterstitialAd({
    //         //   posId:'b9e3c28db4aa4f4fa934bf60ca5d0497' 
    //         // });
    //         // interstitialAd.onError(err => {
    //         //   console.log("插屏广告加载失败", err);
    //         // });
    //         // interstitialAd.show().then(()=>{ 
    //         //   console.log('插屏广告展示完成');
    //         // }).catch((err)=>{
    //         //   console.log('插屏广告展示失败', JSON.stringify(err));
    //         // })
    //     })
    //     nativeAd.onLoad(function (res) {
    //         console.log('原生广告加载完成', JSON.stringify(res));
    //         if (res && res.adList) {
    //             Advertisement.adId = res.adList[0].adId;
    //             console.log(res.adList[0]);
    //             // Laya.loader.load(res.adList[0].imgUrlList[0],Laya.Handler.create(Advertisement,function() {
    //             // Use texture to create sprite frame
    //             //var sprite  = new cc.SpriteFrame(texture);
    //             console.log('原生广告展现后续');
    //             reportAdShow();
    //             //Advertisement.resNode.scheduleOnce(function(){
    //             //console.log(Laya.loader.getRes(res.adList[0].imgUrlList[0]));
    //             //console.log(res.adList[0].imgUrlList);
    //             //let texture = Laya.loader.getRes(res.adList[0].imgUrlList[0]);
    //             // console.log(texture)
    //             if (Advertisement.nativeAdn == null) {
    //                 Advertisement.nativeAdn = new Laya.Sprite();
    //                 Advertisement.nativeAdn.width = 600;
    //                 Advertisement.nativeAdn.height = 500;
    //                 Advertisement.nativeAdn.pivotX = 300;
    //                 Advertisement.nativeAdn.pivotY = 250;
    //                 Advertisement.nativeAdn.x = Laya.stage.width / 2;
    //                 Advertisement.nativeAdn.y = Laya.stage.height / 2;
    //                 Advertisement.nativeAdn.visible = false;
    //                 // Advertisement.nativeAdn.mouseEnabled = true;
    //                 // Advertisement.nativeAdn.mouseThrough = false;  
    //                 Advertisement.nativeAdn.hitTestPrior = false;
    //                 Advertisement.nativeAdn.zOrder = 100;
    //                 Laya.stage.addChild(Advertisement.nativeAdn);

    //                 // Advertisement.imag = new Laya.Sprite();
    //                 // Advertisement.imag.width = 30;
    //                 // Advertisement.imag.height = 30;
    //                 // Advertisement.imag.pivotX = 15;
    //                 // Advertisement.imag.pivotY = 15;
    //                 // Advertisement.imag.x = Advertisement.nativeAdn.width-Advertisement.imag.width;
    //                 // Advertisement.imag.y = Advertisement.imag.height;
    //                 // Advertisement.imag.visible = true;
    //                 // Advertisement.imag.mouseEnabled = true;
    //                 // Advertisement.imag.mouseThrough = false;  
    //                 // Advertisement.imag.loadImage('res/btn_close.png');
    //                 // Advertisement.nativeAdn.addChild(Advertisement.imag);

    //                 Advertisement.closeBtn = new Laya.Image();
    //                 Advertisement.closeBtn.width = 28;
    //                 Advertisement.closeBtn.height = 28;
    //                 Advertisement.closeBtn.pivotX = 22.5;
    //                 Advertisement.closeBtn.pivotY = 22.5;
    //                 Advertisement.closeBtn.x = Advertisement.nativeAdn.width - Advertisement.closeBtn.width / 2;
    //                 Advertisement.closeBtn.y = Advertisement.closeBtn.height / 2;
    //                 Advertisement.closeBtn.visible = true;
    //                 // Advertisement.closeBtn.mouseEnabled = true;
    //                 // Advertisement.closeBtn.mouseThrough = false;  
    //                 Advertisement.closeBtn.loadImage('res/atlas/btn_close.png');
    //                 Advertisement.nativeAdn.addChild(Advertisement.closeBtn);

    //                 // Advertisement.nativeAdn.on(Laya.Event.MOUSE_UP,Advertisement.nativeAdn,reportAdClick);
    //                 // Advertisement.closeBtn.on(Laya.Event.MOUSE_UP,Advertisement.closeBtn,close_Btn);
    //             }
    //             //Advertisement.imag.visible = true;
    //             // //},0.3);
    //             //Advertisement.nativeAdn.loadImage(res.adList[0].imgUrlList[0]);
    //             Advertisement.nativeAdn.texture = res.adList[0].imgUrlList[0];
    //             console.log(Advertisement.nativeAdn.texture, '原生广告图片');
    //             //Advertisement.closet = false;
    //             //Advertisement.nativeAdn.texture = texture;
    //             //Advertisement.nativeAdl.text = res.adList[0].title;
    //             //console.log( Advertisement.imag,'图片');
    //             // var dialog = new Image(res.adList[0].imgUrlList[0]);
    //             // dialog.pos(0,0);
    //             // dialog.anchorX = 0;
    //             // dialog.anchorY = 0;
    //             // dialog.width = 640;
    //             // dialog.height = 480;

    //             // Advertisement.nativeAdn.addChild(dialog);
    //             // console.log(dialog);
    //             // console.log(dialog.source);
    //             // Laya.loader.load('http://pfs.pinduoduo.com/phone_adx/5f5d6df62b38bd897bab7dec3e1455be.jpg?sign=q-sign-algorithm%3Dsha1%26q-ak%3DoHMACf6FzEmrUMOe8Hman8EKSbi2WB3e%26q-sign-time%3D1599709456%3B1600055056%26q-key-time%3D1599709456%3B1600055056%26q-header-list%3D%26q-url-param-list%3D%26q-signature%3D6f0bf19129f54fd2b744802a36a6ec721c5094a1',Laya.Handler.create(this, function(){
    //             //   let texture = Laya.loader.getRes('http://pfs.pinduoduo.com/phone_adx/5f5d6df62b38bd897bab7dec3e1455be.jpg?sign=q-sign-algorithm%3Dsha1%26q-ak%3DoHMACf6FzEmrUMOe8Hman8EKSbi2WB3e%26q-sign-time%3D1599709456%3B1600055056%26q-key-time%3D1599709456%3B1600055056%26q-header-list%3D%26q-url-param-list%3D%26q-signature%3D6f0bf19129f54fd2b744802a36a6ec721c5094a1');
    //             //   console.log(texture);
    //             //   let sp = new Laya.Sprite();
    //             //   sp.texture = texture;
    //             //   Laya.stage.addChild(sp);
    //             // }));
    //             //  Advertisement.imag.skin = res.adList[0].imgUrlList[0];
    //             //  console.log(Advertisement.imag.skin,'图片皮肤显示');
    //             //  console.log( Advertisement.imag,'图片');
    //             if (Advertisement.adLabel == null) {
    //                 let te = new Laya.Label();
    //                 te.text = "广告";
    //                 te.fontSize = 30;
    //                 te.color = "#FFFFFF";
    //                 te.bottom = 0;
    //                 te.right = 0;
    //                 Advertisement.adLabel = te;
    //                 Advertisement.nativeAdn.addChild(te);
    //             }
    //             // if(Advertisement.advs == "shop")
    //             // {
    //             //   Advertisement.nativeAdn.x = Laya.stage.width/2;
    //             //   Advertisement.nativeAdn.y = Laya.stage.height/3.5;
    //             // }
    //             // else
    //             // {
    //             //   Advertisement.nativeAdn.x = Laya.stage.width/2;
    //             //   Advertisement.nativeAdn.y = Laya.stage.height/2.5;
    //             // }
    //             Advertisement.nativeAdn.visible = true;
    //             Advertisement.nativeAdn.on(Laya.Event.MOUSE_UP, Advertisement.nativeAdn, reportAdClick);
    //             Advertisement.closeBtn.on(Laya.Event.MOUSE_DOWN, Advertisement.closeBtn, close_Btn);
    //             // }));
    //         }
    //     })
    //     // 注意：需要先调用reportAdShow上报广告曝光，才能调用reportAdClick去上报点击！！！
    //     function close_Btn() {
    //         Advertisement.nativeAdn.visible = false;
    //         Advertisement.closet = true;
    //     }
    //     function reportAdShow() {
    //         nativeAd.reportAdShow({ adId: Advertisement.adId });
    //     }
    //     function reportAdClick() {
    //         if (Advertisement.closet) {
    //             Advertisement.closet = false;
    //             return;
    //         }
    //         // if(Advertisement.nativeAdtouch)
    //         // {
    //         //   return;
    //         // }
    //         // Advertisement.nativeAdtouch = true;
    //         nativeAd.reportAdClick({ adId: Advertisement.adId });
    //     }
    // }

    // //Cocos OPPO原生
    // Advertisement.insertAdverV = function () {
    //     Advertisement.native = false;
    //     Advertisement.resNode.scheduleOnce(function () {
    //         Advertisement.native = true;
    //     }, 10)
    //     let nativeAd = qg.createNativeAd({
    //         posId: window.nativeAdId,
    //     });
    //     let adLoad = nativeAd.load();
    //     adLoad && adLoad.then(() => {
    //         console.log('原生广告读取完成', JSON.stringify(res));
    //     }).catch(err => {
    //         console.log('加载失败', JSON.stringify(err));
    //     })
    //     nativeAd.onLoad(function (res) {
    //         console.log('原生广告加载完成', JSON.stringify(res));
    //         if (res && res.adList) {
    //             Advertisement.adId = res.adList[0].adId;
    //             // cc.loader.load(res.adList[0].imgUrlList[0], function (err, texture) {
    //             cc.assetManager.loadRemote(res.adList[0].iconUrlList[0], { ext: '.png' }, function (err, texture) {
    //                 console.log(11111111);
    //                 if (err) {
    //                     console.log(222222222);
    //                     console.log(err);
    //                 }
    //                 console.log(33333333);
    //                 // Use texture to create sprite frame
    //                 var sprite = new cc.SpriteFrame(texture);
    //                 reportAdShow();
    //                 // Advertisement.resNode.scheduleOnce(function(){
    //                 Advertisement.nativeAdn.active = true;
    //                 // },0.3);
    //                 Advertisement.nativeAdimg.getComponent(cc.Sprite).spriteFrame = sprite;
    //                 Advertisement.nativeAdl.getComponent(cc.Label).string = res.adList[0].title;
    //                 Advertisement.nativeAdn.on(cc.Node.EventType.TOUCH_START, reportAdClick, Advertisement.nativeAdn);
    //             });
    //         }
    //     })
    //     // 注意：需要先调用reportAdShow上报广告曝光，才能调用reportAdClick去上报点击！！！
    //     function reportAdShow() {
    //         nativeAd.reportAdShow({ adId: Advertisement.adId });
    //     }
    //     function reportAdClick() {
    //         // if(Advertisement.nativeAdtouch)
    //         // {
    //         //   return;
    //         // }
    //         Advertisement.nativeAdtouch = true;
    //         nativeAd.reportAdClick({ adId: Advertisement.adId });
    //     }
    //     // this.customAd.show().then(() => {
    //     //     console.log("show success");
    //     // }).catch((error) => {
    //     //     console.log("show fail with:" + error.errCode + "," + error.errMsg);
    //     // });
    // }
    //#endregion

    //#region 通用
    //获取当前是周几
    Advertisement.getWeekDate = function () {
        var now = new Date();
        var day = now.getDay();
        var weeks = new Array(
            "周日",
            "周一",
            "周二",
            "周三",
            "周四",
            "周五",
            "周六",
        );
        var week = weeks[day];
        console.log(week);
        return week;
    };

    //  import Advertisement = require('');
    // import Advertisement from "";
    // let Advertisement = require("Advertisement_API");
    // Advertisement.rewarda = 'reward1';
    // Advertisement.videop = this;
    // Advertisement.videoAdverV();
    // //VIVO激励视频

    Advertisement.videoAdverV = function (e, t) {
        Advertisement.videop = e;
        Advertisement.failVideop = t;

        if (Laya.Browser.onVVMiniGame || Laya.Browser.onQGMiniGame || Laya.Browser.onHWMiniGame) {
            if (Advertisement.videoAd == null) {
                Advertisement.videoAd = qg.createRewardedVideoAd({
                    posId: window.videoAdId //输入广告ID
                });
                Advertisement.videoAd.onLoad(() => {
                    console.log("激励视频已加载");
                    // cc.audioEngine.pauseAll();
                    var adshow = Advertisement.videoAd.show();
                    // 调用then和catch之前需要对show的结果做下判空处理，防止出错（如果没有判空，在平台版本为1052以及以下的手机上将会出现错误）
                    Advertisement.reward = true;
                    adshow && adshow.then(() => {
                        console.log("激励视频广告显示成功");
                    }).catch(err => {
                        console.log("激励视频广告显示失败", err);
                        Advertisement.errorNode.opacity = 255;
                        setTimeout(() => {
                            Advertisement.errorNode.opacity = 0;
                        }, 3000);
                    });
                });
                Advertisement.videoAd.onError(err => {
                    console.log("激励视频异常", err);
                });
                Advertisement.videoAd.onClose(res => {
                    if (res && res.isEnded) {
                        if (Advertisement.reward) //判断是否发放过奖励
                        {
                            Advertisement.reward = false;
                            // cc.audioEngine.resumeAll();

                            Advertisement.videop && Advertisement.videop();
                            Advertisement.videop = null;
                            Advertisement.failVideop = null;
                        }
                    } else {
                        console.log("播放中途退出，不下发游戏奖励");
                        // cc.audioEngine.resumeAll();

                        Advertisement.failVideop && Advertisement.failVideop();
                        Advertisement.videop = null;
                        Advertisement.failVideop = null;
                    }
                });
            }
            var adload = Advertisement.videoAd.load();

            // 调用then和catch之前需要对load的结果做下判空处理，防止出错（如果没有判空，在平台版本为1052以及以下的手机上将会出现错误）
            adload && adload.then(() => {
                console.log("激励视频广告加载成功");
            }).catch(err => {
                console.log("激励视频广告加载失败", err);
                // Advertisement.errorNode.opacity = 255;
                // setTimeout(() => {
                //     Advertisement.errorNode.opacity = 0;
                // }, 3000);
                qg.showToast({
                    message: "当前无广告，请稍后尝试"
                });
            });
        } else {
            e && e();
        }
    };

    Advertisement.bannerDestroy = function () {
        if (Advertisement.bannerAd != null) {
            Advertisement.bannerAd.destroy();
            Advertisement.bannerAd = null;
            Advertisement.bannersize = false;
        }
    };

    // module.exports = Advertisement;

    var View = Laya.View;
    var Dialog = Laya.Dialog;
    var Scene = Laya.Scene;
    var REG = Laya.ClassUtils.regClass;
    class failView_AccidentUI extends View {
    	constructor() {
    		super();
    	}
    	createChildren() {
    		super.createChildren();
    		this.loadScene("Accident/View/failView_Accident");
    	}
    }
    REG("ui.Accident.View.failView_AccidentUI", failView_AccidentUI);
    class garageView_AccidentUI extends View {
    	constructor() {
    		super();
    	}
    	createChildren() {
    		super.createChildren();
    		this.loadScene("Accident/View/garageView_Accident");
    	}
    }
    REG("ui.Accident.View.garageView_AccidentUI", garageView_AccidentUI);
    class settingView_AccidentUI extends View {
    	constructor() {
    		super();
    	}
    	createChildren() {
    		super.createChildren();
    		this.loadScene("Accident/View/settingView_Accident");
    	}
    }
    REG("ui.Accident.View.settingView_AccidentUI", settingView_AccidentUI);
    class successView_AccidentUI extends View {
    	constructor() {
    		super();
    	}
    	createChildren() {
    		super.createChildren();
    		this.loadScene("Accident/View/successView_Accident");
    	}
    }
    REG("ui.Accident.View.successView_AccidentUI", successView_AccidentUI);
    class updateLog_AccidentUI extends View {
    	constructor() {
    		super();
    	}
    	createChildren() {
    		super.createChildren();
    		this.loadScene("Accident/View/updateLog_Accident");
    	}
    }
    REG("ui.Accident.View.updateLog_AccidentUI", updateLog_AccidentUI);
    class failView_Accident2UI extends View {
    	constructor() {
    		super();
    	}
    	createChildren() {
    		super.createChildren();
    		this.loadScene("Accident2/View/failView_Accident2");
    	}
    }
    REG("ui.Accident2.View.failView_Accident2UI", failView_Accident2UI);
    class garageView_Accident2UI extends View {
    	constructor() {
    		super();
    	}
    	createChildren() {
    		super.createChildren();
    		this.loadScene("Accident2/View/garageView_Accident2");
    	}
    }
    REG("ui.Accident2.View.garageView_Accident2UI", garageView_Accident2UI);
    class settingView_Accident2UI extends View {
    	constructor() {
    		super();
    	}
    	createChildren() {
    		super.createChildren();
    		this.loadScene("Accident2/View/settingView_Accident2");
    	}
    }
    REG("ui.Accident2.View.settingView_Accident2UI", settingView_Accident2UI);
    class successView_Accident2UI extends View {
    	constructor() {
    		super();
    	}
    	createChildren() {
    		super.createChildren();
    		this.loadScene("Accident2/View/successView_Accident2");
    	}
    }
    REG("ui.Accident2.View.successView_Accident2UI", successView_Accident2UI);
    class AgeNoticeUI extends View {
    	constructor() {
    		super();
    	}
    	createChildren() {
    		super.createChildren();
    		this.createView(AgeNoticeUI.uiView);
    	}
    }
    AgeNoticeUI.uiView = { "type": "View", "props": { "width": 720, "top": 0, "right": 0, "left": 0, "height": 1280, "bottom": 0 }, "compId": 2, "child": [{ "type": "Image", "props": { "top": -100, "skin": "native/hei.png", "right": -100, "left": -100, "bottom": -100, "alpha": 0.5 }, "compId": 5 }, { "type": "Image", "props": { "width": 351, "skin": "jkgg/ageNoticeBg.png", "scaleY": 1.3, "scaleX": 1.3, "height": 585, "centerY": 0, "centerX": 0 }, "compId": 3, "child": [{ "type": "Label", "props": { "y": 76, "wordWrap": true, "width": 283, "text": "1. 本游戏是一款玩法简单的休闲益智类游戏，适用于年满16周岁及以上用户，建议未成年在家长监护下使用游戏产品，并鼓励家长根据未成年人的实际情况管理其游戏行为。\\n2. 本游戏基于轻松休闲的玩法，画面色彩鲜明，配乐明快，剧情简单鲜明。游戏中场景及任务形象均采用了Q版画风，无血腥画面。\\n3.本游戏中有实名认证系统，所有网络游戏用户必须使用真实有效身份信息进行认证，认证为未成年人的用户将接受以下管理：未成年人仅在周五、周六、周日和法定节假日节假日每日的20时至21时被允许登录，其他时间一律不允许登录。\\n", "height": 392, "fontSize": 20, "color": "#060606", "centerX": -1 }, "compId": 6 }, { "type": "Image", "props": { "var": "closeBtn", "skin": "jkgg/ageNoticeClose.png", "centerX": 0, "bottom": 30 }, "compId": 4 }] }], "loadList": ["native/hei.png", "jkgg/ageNoticeBg.png", "jkgg/ageNoticeClose.png"], "loadList3D": [] };
    REG("ui.ADSDK.AgeNoticeUI", AgeNoticeUI);
    class deskTopUI extends View {
    	constructor() {
    		super();
    	}
    	createChildren() {
    		super.createChildren();
    		this.loadScene("ADSDK/deskTop");
    	}
    }
    REG("ui.ADSDK.deskTopUI", deskTopUI);
    class GamePortalAdUIUI extends View {
    	constructor() {
    		super();
    	}
    	createChildren() {
    		super.createChildren();
    		this.loadScene("ADSDK/GamePortalAdUI");
    	}
    }
    REG("ui.ADSDK.GamePortalAdUIUI", GamePortalAdUIUI);
    class iconNativeUI extends View {
    	constructor() {
    		super();
    	}
    	createChildren() {
    		super.createChildren();
    		this.loadScene("ADSDK/iconNative");
    	}
    }
    REG("ui.ADSDK.iconNativeUI", iconNativeUI);
    class JKGGUI extends View {
    	constructor() {
    		super();
    	}
    	createChildren() {
    		super.createChildren();
    		this.loadScene("ADSDK/JKGG");
    	}
    }
    REG("ui.ADSDK.JKGGUI", JKGGUI);
    class yszcUI extends Scene {
    	constructor() {
    		super();
    	}
    	createChildren() {
    		super.createChildren();
    		this.createView(yszcUI.uiView);
    	}
    }
    yszcUI.uiView = { "type": "Scene", "props": { "width": 720, "height": 1280, "autoDestroyAtClosed": true }, "compId": 2, "child": [{ "type": "Image", "props": { "top": -1000, "skin": "native/hei.png", "right": -999, "name": "heidi", "left": -1001, "bottom": -1000 }, "compId": 10 }, { "type": "Image", "props": { "var": "YSSMstr1", "top": 90, "skin": "native/word1.png", "centerX": 0 }, "compId": 35, "child": [{ "type": "Label", "props": { "y": 1548, "var": "dh1", "valign": "middle", "text": "18061692241", "right": 0, "fontSize": 25, "font": "Microsoft YaHei", "color": "#ffffff", "bold": true, "align": "center" }, "compId": 37 }, { "type": "Label", "props": { "y": 1650, "var": "gs1", "valign": "middle", "text": "南京离啸威网络科技有限公司", "right": 0, "fontSize": 25, "font": "Microsoft YaHei", "color": "#ffffff", "bold": true, "align": "center" }, "compId": 38 }, { "type": "Label", "props": { "y": 1695, "var": "rq1", "valign": "middle", "text": "2022年3月24日", "right": 0, "fontSize": 25, "font": "Microsoft YaHei", "color": "#ffffff", "bold": true, "align": "center" }, "compId": 42 }] }, { "type": "Image", "props": { "visible": false, "var": "YSSMstr2", "top": 90, "skin": "native/word2.png", "scaleY": 0.9, "scaleX": 0.9, "centerX": 0 }, "compId": 46, "child": [{ "type": "Label", "props": { "y": 2428, "var": "dh2", "valign": "middle", "text": "18061692241", "right": 98, "fontSize": 25, "font": "Microsoft YaHei", "color": "#ffffff", "bold": true, "align": "center" }, "compId": 47 }, { "type": "Label", "props": { "y": 2509, "var": "gs2", "valign": "middle", "text": "南京离啸威网络科技有限公司", "right": 17, "fontSize": 25, "font": "Microsoft YaHei", "color": "#ffffff", "bold": true, "align": "center" }, "compId": 48 }, { "type": "Label", "props": { "y": 2545, "width": 183, "var": "rq2", "valign": "middle", "text": "2022年3月24日", "right": 17, "height": 1, "fontSize": 25, "font": "Microsoft YaHei", "color": "#ffffff", "bold": true, "align": "center" }, "compId": 49 }] }, { "type": "Image", "props": { "top": 100, "skin": "native/kuang.png", "right": 100, "left": 100, "bottom": 100 }, "compId": 41, "child": [{ "type": "Image", "props": { "var": "topHei", "top": -1500, "skin": "native/hei.png", "right": -100, "left": -100, "height": 1500 }, "compId": 39 }, { "type": "Image", "props": { "var": "bottomHei", "skin": "native/hei.png", "right": -100, "left": -100, "height": 1500, "bottom": -1500 }, "compId": 40 }, { "type": "Label", "props": { "var": "title", "top": -65, "text": "隐私政策", "fontSize": 40, "color": "#ffffff", "centerX": 0, "bold": true }, "compId": 28 }] }, { "type": "Image", "props": { "width": 54, "visible": true, "var": "closeBtn", "top": 36, "skin": "native/native_3.png", "left": 140, "height": 54 }, "compId": 31 }, { "type": "Image", "props": { "width": 170, "visible": true, "var": "closeBtn1", "skin": "native/qr.png", "height": 65, "centerX": 0, "bottom": 20 }, "compId": 50 }, { "type": "Image", "props": { "width": 170, "var": "queding", "skin": "native/qr.png", "height": 65, "centerX": 175, "bottom": 20 }, "compId": 24 }, { "type": "Image", "props": { "width": 170, "var": "jujue", "skin": "native/jj.png", "height": 65, "centerX": -175, "bottom": 20 }, "compId": 29 }], "loadList": ["native/hei.png", "native/word1.png", "native/word2.png", "native/kuang.png", "native/native_3.png", "native/qr.png", "native/jj.png"], "loadList3D": [] };
    REG("ui.ADSDK.yszcUI", yszcUI);
    class GameTip1_ChuZuCheUI extends View {
    	constructor() {
    		super();
    	}
    	createChildren() {
    		super.createChildren();
    		this.createView(GameTip1_ChuZuCheUI.uiView);
    	}
    }
    GameTip1_ChuZuCheUI.uiView = { "type": "View", "props": { "width": 1280, "top": 0, "right": 0, "left": 0, "height": 720, "bottom": 0 }, "compId": 2, "child": [{ "type": "Image", "props": { "y": 0, "x": 0, "var": "tipImg", "skin": "ChuZuChe/UIRes/tsz_1.png", "anchorY": 0.5, "anchorX": 0.5 }, "compId": 4 }], "animations": [{ "nodes": [{ "target": 4, "keyframes": { "y": [{ "value": 0, "tweenMethod": "linearNone", "tween": true, "target": 4, "key": "y", "index": 0 }, { "value": 0, "tweenMethod": "linearNone", "tween": true, "target": 4, "key": "y", "index": 5 }, { "value": 0, "tweenMethod": "linearNone", "tween": true, "target": 4, "key": "y", "index": 10 }, { "value": -100, "tweenMethod": "linearNone", "tween": true, "target": 4, "key": "y", "index": 30 }], "x": [{ "value": 0, "tweenMethod": "linearNone", "tween": true, "target": 4, "key": "x", "index": 0 }], "scaleY": [{ "value": 0, "tweenMethod": "linearNone", "tween": true, "target": 4, "key": "scaleY", "index": 0 }, { "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 4, "key": "scaleY", "index": 5 }], "scaleX": [{ "value": 0, "tweenMethod": "linearNone", "tween": true, "target": 4, "key": "scaleX", "index": 0 }, { "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 4, "key": "scaleX", "index": 5 }], "alpha": [{ "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 4, "key": "alpha", "index": 0 }, { "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 4, "key": "alpha", "index": 5 }, { "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 4, "key": "alpha", "index": 20 }, { "value": 0, "tweenMethod": "linearNone", "tween": true, "target": 4, "key": "alpha", "index": 30 }] } }], "name": "in", "id": 1, "frameRate": 24, "action": 1 }], "loadList": ["ChuZuChe/UIRes/tsz_1.png"], "loadList3D": [] };
    REG("ui.ChuZuChe.UI.Prefab.GameTip1_ChuZuCheUI", GameTip1_ChuZuCheUI);
    class GameTip_ChuZuCheUI extends View {
    	constructor() {
    		super();
    	}
    	createChildren() {
    		super.createChildren();
    		this.createView(GameTip_ChuZuCheUI.uiView);
    	}
    }
    GameTip_ChuZuCheUI.uiView = { "type": "View", "props": { "width": 1280, "height": 720 }, "compId": 2, "child": [{ "type": "Label", "props": { "y": 0, "x": 0, "var": "value", "valign": "middle", "text": "没有足够的现金", "strokeColor": "#7d5000", "stroke": 5, "fontSize": 40, "font": "SimSun", "color": "#ffc100", "bold": true, "anchorY": 0.5, "anchorX": 0.5, "align": "center" }, "compId": 3 }], "animations": [{ "nodes": [{ "target": 3, "keyframes": { "y": [{ "value": 0, "tweenMethod": "linearNone", "tween": true, "target": 3, "key": "y", "index": 0 }, { "value": -50, "tweenMethod": "linearNone", "tween": true, "target": 3, "key": "y", "index": 30 }], "x": [{ "value": 0, "tweenMethod": "linearNone", "tween": true, "target": 3, "key": "x", "index": 0 }], "scaleY": [{ "value": 0, "tweenMethod": "linearNone", "tween": true, "target": 3, "key": "scaleY", "index": 0 }, { "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 3, "key": "scaleY", "index": 5 }], "scaleX": [{ "value": 0, "tweenMethod": "linearNone", "tween": true, "target": 3, "key": "scaleX", "index": 0 }, { "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 3, "key": "scaleX", "index": 5 }], "alpha": [{ "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 3, "key": "alpha", "index": 0 }, { "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 3, "key": "alpha", "index": 20 }, { "value": 0, "tweenMethod": "linearNone", "tween": true, "target": 3, "key": "alpha", "index": 30 }] } }], "name": "in", "id": 1, "frameRate": 24, "action": 1 }], "loadList": [], "loadList3D": [] };
    REG("ui.ChuZuChe.UI.Prefab.GameTip_ChuZuCheUI", GameTip_ChuZuCheUI);
    class qian_ChuZuCheUI extends View {
    	constructor() {
    		super();
    	}
    	createChildren() {
    		super.createChildren();
    		this.createView(qian_ChuZuCheUI.uiView);
    	}
    }
    qian_ChuZuCheUI.uiView = { "type": "View", "props": { "width": 1280, "runtime": "ChuZuChe/GoldText.js", "height": 720 }, "compId": 2, "child": [{ "type": "Box", "props": { "top": 0, "right": 0, "left": 0, "bottom": 0 }, "compId": 3, "child": [{ "type": "Box", "props": { "y": 0, "width": 1280, "height": 720, "centerX": 0 }, "compId": 7, "child": [{ "type": "Image", "props": { "y": 23, "x": 588, "skin": "ChuZuChe/UIRes/zjm_chaopiao.png" }, "compId": 5, "child": [{ "type": "Label", "props": { "y": 0, "x": 68, "width": 102, "var": "qianTex", "text": "9999", "strokeColor": "#000000", "stroke": 4, "height": 35, "fontSize": 30, "color": "#ffe58c" }, "compId": 6 }] }] }] }], "animations": [{ "nodes": [{ "target": 7, "keyframes": { "top": [{ "value": 0, "tweenMethod": "linearNone", "tween": true, "target": 7, "key": "top", "index": 0 }, { "value": 340, "tweenMethod": "linearNone", "tween": true, "target": 7, "key": "top", "index": 12 }, { "value": 330, "tweenMethod": "linearNone", "tween": true, "target": 7, "key": "top", "index": 14 }, { "value": 340, "tweenMethod": "linearNone", "tween": true, "target": 7, "label": null, "key": "top", "index": 16 }, { "value": 340, "tweenMethod": "linearNone", "tween": true, "target": 7, "label": null, "key": "top", "index": 48 }, { "value": 340, "tweenMethod": "linearNone", "tween": true, "target": 7, "label": null, "key": "top", "index": 54 }], "alpha": [{ "value": 0, "tweenMethod": "linearNone", "tween": true, "target": 7, "key": "alpha", "index": 0 }, { "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 7, "key": "alpha", "index": 3 }, { "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 7, "key": "alpha", "index": 14 }, { "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 7, "label": null, "key": "alpha", "index": 48 }, { "value": 0, "tweenMethod": "linearNone", "tween": true, "target": 7, "key": "alpha", "index": 54 }] } }], "name": "qianAni", "id": 1, "frameRate": 24, "action": 1 }], "loadList": ["ChuZuChe/UIRes/zjm_chaopiao.png"], "loadList3D": [] };
    REG("ui.ChuZuChe.UIPanel.qian_ChuZuCheUI", qian_ChuZuCheUI);
    class Rocker_ChuZuCheUI extends View {
    	constructor() {
    		super();
    	}
    	createChildren() {
    		super.createChildren();
    		this.createView(Rocker_ChuZuCheUI.uiView);
    	}
    }
    Rocker_ChuZuCheUI.uiView = { "type": "View", "props": { "width": 300, "height": 80 }, "compId": 2, "child": [{ "type": "Image", "props": { "y": 0, "x": 0, "skin": "ChuZuChe/UIRes/fxb3.png" }, "compId": 3 }, { "type": "Image", "props": { "y": 30, "var": "knob", "stateNum": 1, "skin": "ChuZuChe/UIRes/fxb.png", "anchorY": 0.5, "anchorX": 0.5 }, "compId": 4 }], "loadList": ["ChuZuChe/UIRes/fxb3.png", "ChuZuChe/UIRes/fxb.png"], "loadList3D": [] };
    REG("ui.ChuZuChe.UIPanel.Rocker_ChuZuCheUI", Rocker_ChuZuCheUI);
    class sureVideoUI extends View {
    	constructor() {
    		super();
    	}
    	createChildren() {
    		super.createChildren();
    		this.loadScene("ChuZuChe/UIPanel/sureVideo");
    	}
    }
    REG("ui.ChuZuChe.UIPanel.sureVideoUI", sureVideoUI);
    class tishi5_ChuZuCheUI extends Scene {
    	constructor() {
    		super();
    	}
    	createChildren() {
    		super.createChildren();
    		this.createView(tishi5_ChuZuCheUI.uiView);
    	}
    }
    tishi5_ChuZuCheUI.uiView = { "type": "Scene", "props": { "width": 1280, "height": 720 }, "compId": 2, "child": [{ "type": "Image", "props": { "top": -100, "right": -100, "name": "bg", "left": -100, "bottom": -100 }, "compId": 15 }, { "type": "Box", "props": { "top": 0, "right": 0, "left": 0, "bottom": 0 }, "compId": 17, "child": [{ "type": "Box", "props": { "y": 574, "centerX": 0, "anchorY": 0.5, "anchorX": 0.5 }, "compId": 18, "child": [{ "type": "Image", "props": { "var": "chaopiao", "skin": "ChuZuChe/UIRes/ewewewew.png", "centerX": 0 }, "compId": 3, "child": [{ "type": "Image", "props": { "y": 59.5, "x": 157, "visible": false, "var": "Tip03", "skin": "ChuZuChe/UIRes/tishi11.png" }, "compId": 25 }, { "type": "Image", "props": { "y": 72.5, "x": 204, "visible": false, "var": "Tip02", "skin": "ChuZuChe/UIRes/xxd.png" }, "compId": 26 }, { "type": "Image", "props": { "y": 50.5, "x": 157, "visible": false, "var": "Tip01", "skin": "ChuZuChe/UIRes/zcts_1.png" }, "compId": 19 }, { "type": "Image", "props": { "y": 70, "x": 173, "visible": false, "var": "Tip04", "skin": "ChuZuChe/UIRes/ip04.png" }, "compId": 28 }, { "type": "Image", "props": { "y": 49, "x": 157, "visible": false, "var": "Tip05", "skin": "ChuZuChe/UIRes/ip05.png" }, "compId": 31 }, { "type": "Image", "props": { "y": 73, "x": 192, "visible": false, "var": "Tip06", "skin": "ChuZuChe/UIRes/ip06.png" }, "compId": 32 }, { "type": "Image", "props": { "y": 49, "x": 169, "visible": false, "var": "Tip07", "skin": "ChuZuChe/UIRes/ip07.png" }, "compId": 33 }, { "type": "Image", "props": { "y": 52, "x": 169, "visible": false, "var": "Tip08", "skin": "ChuZuChe/UIRes/ip08.png" }, "compId": 34 }, { "type": "Image", "props": { "y": 56, "x": 158, "visible": false, "var": "Tip09", "skin": "ChuZuChe/UIRes/ip09.png" }, "compId": 35 }, { "type": "Image", "props": { "y": 53, "x": 157, "visible": false, "var": "Tip10", "skin": "ChuZuChe/UIRes/ip10.png" }, "compId": 36 }, { "type": "Image", "props": { "y": 73, "x": 186, "visible": false, "var": "Tip11", "skin": "ChuZuChe/UIRes/ms11.png" }, "compId": 37 }, { "type": "Image", "props": { "y": 35.5, "x": 31, "var": "iconImg", "skin": "ChuZuChe/UIRes/gqjq_tx.png" }, "compId": 24 }] }] }] }], "animations": [{ "nodes": [{ "target": 18, "keyframes": { "scaleY": [{ "value": 0, "tweenMethod": "backOut", "tween": true, "target": 18, "key": "scaleY", "index": 0 }, { "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 18, "key": "scaleY", "index": 12 }, { "value": 1, "tweenMethod": "backIn", "tween": true, "target": 18, "label": null, "key": "scaleY", "index": 48 }, { "value": 0, "tweenMethod": "backOut", "tween": true, "target": 18, "label": null, "key": "scaleY", "index": 60 }], "scaleX": [{ "value": 0, "tweenMethod": "backOut", "tween": true, "target": 18, "key": "scaleX", "index": 0 }, { "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 18, "key": "scaleX", "index": 12 }, { "value": 1, "tweenMethod": "backIn", "tween": true, "target": 18, "label": null, "key": "scaleX", "index": 48 }, { "value": 0, "tweenMethod": "backOut", "tween": true, "target": 18, "label": null, "key": "scaleX", "index": 60 }] } }], "name": "tanchuAni", "id": 1, "frameRate": 24, "action": 1 }], "loadList": ["ChuZuChe/UIRes/ewewewew.png", "ChuZuChe/UIRes/tishi11.png", "ChuZuChe/UIRes/xxd.png", "ChuZuChe/UIRes/zcts_1.png", "ChuZuChe/UIRes/ip04.png", "ChuZuChe/UIRes/ip05.png", "ChuZuChe/UIRes/ip06.png", "ChuZuChe/UIRes/ip07.png", "ChuZuChe/UIRes/ip08.png", "ChuZuChe/UIRes/ip09.png", "ChuZuChe/UIRes/ip10.png", "ChuZuChe/UIRes/ms11.png", "ChuZuChe/UIRes/gqjq_tx.png"], "loadList3D": [] };
    REG("ui.ChuZuChe.UIPanel.tishi5_ChuZuCheUI", tishi5_ChuZuCheUI);
    class BackBtnUI extends View {
    	constructor() {
    		super();
    	}
    	createChildren() {
    		super.createChildren();
    		this.loadScene("Collection/BackBtn");
    	}
    }
    REG("ui.Collection.BackBtnUI", BackBtnUI);

    class BackBtn extends BackBtnUI {

    	constructor() {
    		super();
    	}

    	onEnable() {
    		this.width = Laya.stage.width;
    		this.height = Laya.stage.height;

    		console.log("this.width:", this.width);
    		console.log("this.height:", this.height);

    		if (Laya.stage.screenMode == "vertical") {
    			this.closeBtn.top = this.height / 12;
    			this.closeBtn.scaleX = 2;
    			this.closeBtn.scaleY = 2;
    		}

    		this.zOrder = 9999;

    		this.closeBtn.on(Laya.Event.CLICK, this, function () {
    			//原生
    			console.log("返回主页");
    			Advertisement.insertAdverV3();

    			Laya.stage.offAll(Laya.Event.MOUSE_DOWN);
    			Laya.stage.offAll(Laya.Event.MOUSE_UP);
    			Laya.stage.offAll(Laya.Event.CLICK);
    			Laya.timer.scale = 1;
    			var self = this;
    			if (Laya.Browser.onMiniGame) {
    				wx.setDeviceOrientation({
    					value: "landscape",
    					success: function () {
    						if (Laya.stage.screenMode == "vertical") {
    							// WeChatUtil.InitCustomSingle1(true);
    							// WeChatUtil.InitCustomSingle2(true);
    							// WeChatUtil.InitCustom53(false);
    						}
    						Laya.stage.scaleMode = "fixedheight";
    						Laya.stage.screenMode = "horizontal";
    						GameManager_Collection.BackBtn = null;
    						Laya.timer.once(1, this, function () {
    							Laya.Scene.open("Collection/CollectionGamesScene.scene");
    							self.destroy();
    						}.bind(this));
    					},
    					fail: function (res) {
    						console.warn("转换横竖屏失败：" + res);
    					},
    					complete: function (res) {
    						console.warn("转换横竖屏");
    					}
    				});
    			} else {
    				Laya.stage.scaleMode = "fixedheight";
    				Laya.stage.screenMode = "horizontal";
    				GameManager_Collection.BackBtn = null;
    				Laya.timer.once(1, this, function () {
    					Laya.Scene.open("Collection/CollectionGamesScene.scene");
    					this.destroy();
    				}.bind(this));
    			}
    		});
    	}

    	onDisable() {

    	}
    }

    class LabelUtils {
    	static getBaseUrl() {
    		if (LabelUtils._ISDEBUG) {
    			return this._DEBUG_BASE_URL;
    		}
    		return this._RELEASE_BASE_URL;
    	}

    	/**
    	 * 在没有获取到标签配置之前统一返回false
    	 * 在没有获取到是否是特殊省份时统一返回false
    	 *
    	 *
    	 * @param key
    	 * @returns {boolean}
    	 */
    	static getLabel(key) {
    		console.log("即将获取标签:::" + key);
    		if (!key || !LabelUtils.initLabelSuccess || !LabelUtils.initIsSpecial) {
    			return false;
    		}
    		console.log("正在获取标签>>>>:::" + key);

    		if (LabelUtils.isSpecial) {
    			if (LabelUtils.labels.special.length > 0) {
    				for (let i = 0, t = LabelUtils.labels.special.length; i < t; i++) {
    					let val = LabelUtils.labels.special[i];
    					// console.log(val.switchname + ">>>" + val.switchvalue + ">>>>key::" + key);
    					if (val.switchname == key) {
    						let b = val.switchvalue == 1;
    						console.log(key + "::" + b);
    						return b;
    					}
    				}
    				return false;


    			} else {
    				return false;
    			}
    		} else {
    			if (LabelUtils.labels.common.length > 0) {
    				for (let i = 0, t = LabelUtils.labels.common.length; i < t; i++) {
    					let val = LabelUtils.labels.common[i];
    					//   console.log(val.switchname + ">>>" + val.switchvalue + ">>>>key::" + key);

    					if (val.switchname == key) {
    						let b = val.switchvalue == 1;
    						console.log(key + "::" + b);
    						return b;
    					}
    				}
    				return false;
    			} else {
    				return false;
    			}
    		}


    	}
    	static getValue(key, defaultValue) {


    		if (LabelUtils.labels && LabelUtils.labels.hasOwnProperty("selfswitch")) {

    			for (let i = 0; i < LabelUtils.labels.selfswitch.length; i++) {
    				let val = LabelUtils.labels.selfswitch[i];


    				if (val.switchname == key) {

    					let regFloat = /(-?\d+)(\.\d+)?/;//浮点数


    					let isFloatStr = regFloat.test(val.switchvalue);
    					if (isFloatStr) {

    						console.log("是个浮点");
    						let number = parseFloat(val.switchvalue);

    						return isNaN(number) ? val.switchvalue : number;


    					}

    					let regInt = /-?\d+/;//整数


    					let isIntStr = regInt.test(val.switchvalue);
    					if (isIntStr) {
    						console.log("是个整数");

    						let number1 = parseInt(val.switchvalue);
    						return isNaN(number1) ? val.switchvalue : number1;


    					}
    					return val.switchvalue;
    				}


    			}
    			return defaultValue;

    		} else {
    			return defaultValue;
    		}
    	}
    	/**
    	 * 初始化步骤：
    	 *  1、异步执行ip定位，获取服务器标签配置，获取服务器上省份列表
    	 *  2、之后会判断当前省份是否是在屏蔽列表中，判断完成之后真正初始化完成
    	 *  3、
    	 * @param labelName
    	 */
    	static initLabel(labelName) {
    		console.log("新标签初始化");
    		console.log("initLabel:" + labelName);

    		if (!!labelName && labelName.length > 0) {
    			LabelUtils._labelName = labelName;
    		}
    		console.log("initLabel:  start");

    		this._getMyLocation();
    		this._fetchLabel();
    		this._fetchLocationList();

    	}
    	/**
    	 * 重新刷新标签配置  从服务器重新获取标签配置
    	 */
    	static refreshLabelConfig() {
    		if (this.canRefresh) {
    			this._fetchLabel();

    		}
    	}

    	/**
    	 * 初始化是否是特殊省份
    	 * @private
    	 */
    	static _initIsSpecial() {

    		LabelUtils.isSpecial = false;
    		let tmpId = 0;
    		if (LabelUtils.location && LabelUtils.initLabelSuccess && LabelUtils.locationList) {
    			for (let i = 0; i < LabelUtils.locationList.length; i++) {

    				if (LabelUtils.locationList[i].name.indexOf(LabelUtils.location) != -1) {
    					tmpId = this.locationList[i].id;
    					// console.log(this.location + "...." + this.locationList[i].name)
    					break;
    				}
    			}
    			if (LabelUtils.labels.blocked) {
    				let split = LabelUtils.labels.blocked.split(",");
    				if (split) {
    					for (let i = 0; i < split.length; i++) {
    						if (tmpId == split[i]) {
    							LabelUtils.isSpecial = true;
    							break
    						}

    					}
    				}

    			}
    		}
    		LabelUtils.initIsSpecial = true;
    		console.log("特殊省份isSpecial:" + LabelUtils.isSpecial);
    	}
    	static _fetchLocationList() {



    		console.log("get Province List");
    		let item = Laya.LocalStorage.getItem("labelConfigCity");
    		if (item != undefined && item != null && item != "") {

    			LabelUtils.locationList = JSON.parse(item);
    			console.log("_fetchLocationList Success from local");
    			LabelUtils._initIsSpecial();
    		} else {
    			LabelUtils._httpGets(this.getBaseUrl() + "/configcity.json", false, function (res) {
    				//console.log("_fetchLocationList Resp:>>" + res)
    				LabelUtils._retryTimeLocationList++;

    				if (res) {
    					let parse = JSON.parse(res);
    					if (parse.code == 1000) {
    						LabelUtils.locationList = parse.data;
    						console.log("_fetchLocationList Success");
    						Laya.LocalStorage.setItem("labelConfigCity", JSON.stringify(LabelUtils.locationList));
    						LabelUtils._initIsSpecial();
    					} else {
    						//  if (self._retryTime < 15) {
    						LabelUtils._fetchLocationList();
    						//}

    					}
    				} else {
    					LabelUtils._fetchLocationList();
    				}

    			});
    		}

    	}
    	static _fetchLabel() {
    		console.log("start   _fetchLabel");
    		LabelUtils._retryTime++;

    		LabelUtils._httpGets(this.getBaseUrl() + "/" + this._labelName + ".json?t=" + new Date().getTime(), false, function (res) {

    			//console.log("_fetchLabel Resp:>>" + res);
    			if (res != -1) {

    				let parse = JSON.parse(res);
    				if (!!parse && parse.code == 1000) {
    					LabelUtils.labels = parse.data;
    					LabelUtils.initLabelSuccess = true;
    					console.log("initLabel Success");
    					LabelUtils._initIsSpecial();
    					LabelUtils.canRefresh = true;
    				} else {
    					Laya.timer.frameOnce(60 * LabelUtils._retryTime, this, function () {
    						LabelUtils._fetchLabel();
    					});

    				}


    			} else {
    				Laya.timer.frameOnce(60, this, function () {
    					LabelUtils._fetchLabel();
    				});
    			}

    		});

    	}
    	static _getMyLocation() {
    		console.log("label:getLocation");
    		let self = this;
    		this._httpGetsLocation("https://m.sjzebc.com/ip/ip", function (res) {
    			//  console.log(res + ">>>>>>>>>>>");
    			if (res == -2) {
    				console.error("初始化位置失败了");
    			} else if (res != -1) {

    				// console.log(res);

    				if (res && res.indexOf("City") != -1) {

    					console.log("解析了1");
    					let s = JSON.parse(res).City;


    					console.log(s);
    					if (s.indexOf("省") != -1) {
    						s = s.substring(0, s.indexOf("省"));
    					} else if (s.indexOf("市") != -1) {
    						s = s.substring(0, s.indexOf("市"));
    					} else {
    						s = s.substring(0, 2);
    					}
    					console.log(s);
    					self.location = s;
    					self._initIsSpecial();

    				} else if (res && res.indexOf("Country") != -1) {

    					console.log("解析了2");
    					let s = JSON.parse(res).Country;


    					console.log(s);
    					if (s.indexOf("省") != -1) {
    						s = s.substring(0, s.indexOf("省"));
    					} else if (s.indexOf("市") != -1) {
    						s = s.substring(0, s.indexOf("市"));
    					} else {
    						s = s.substring(0, 2);
    					}
    					console.log(s);
    					self.location = s;
    					self._initIsSpecial();

    				} else {
    					console.log("没有解析了");


    				}


    			} else {
    				console.error("初始化位置失败了22");

    			}


    		});
    		console.log("label:getLocation  End");
    	}

    	static _httpGetsLocation(url, callback) {
    		console.log("label:_httpGetsLocation 1111 ");
    		// var xhr = new Laya.HttpRequest();
    		// xhr.http.timeout = 10000;//设置超时时间；
    		// xhr.once(Laya.Event.COMPLETE,this,function(e)
    		// {
    		//     var respone = e ;
    		//     console.log("服务器返回完成："+respone);
    		//     callback(respone);
    		// });
    		// xhr.once(Laya.Event.ERROR,this,function(data)
    		// {
    		//     console.log("服务器返回错误："+data);
    		//     callback(-1);
    		// });
    		// xhr.on(Laya.Event.PROGRESS,this,function(data)
    		// {
    		//     console.log("服务器返回："+data);
    		// });
    		// var h = ["Content-Type", "application/x-www-form-urlencoded"] ;
    		// xhr.send(url,"","get","text");
    		LabelUtils._httpGets(url, "", callback);
    	}

    	static _httpGets(url, needHeader, callback) {
    		console.log("label:HttpGets  ");

    		if (window["wx"]) {
    			var xhr = new Laya.HttpRequest();
    			xhr.http.timeout = 10000;//设置超时时间；
    			xhr.once(Laya.Event.COMPLETE, this, function (e) {
    				var respone = e;
    				console.log("服务器返回完成：" + respone);
    				callback(respone);
    			});
    			xhr.once(Laya.Event.ERROR, this, function (data) {
    				console.log("服务器返回错误：" + data);
    				callback(-1);
    			});
    			xhr.on(Laya.Event.PROGRESS, this, function (data) {
    				console.log("服务器返回：" + data);
    			});
    			xhr.send(url, "", "get", "text");
    		} else {
    			var xhr = new XMLHttpRequest();
    			xhr.addEventListener("load", function () {
    				if (xhr.responseText) {
    					callback(xhr.responseText);
    				} else {
    					callback(-1);
    				}
    				console.log("服务器返回完成：" + xhr.responseText);
    			});
    			xhr.open("GET", url);
    			xhr.send();
    		}
    	}

    }
    LabelUtils._ISDEBUG = false;
    LabelUtils._RELEASE_BASE_URL = "http://qygres.17666.mobi/label";
    LabelUtils._DEBUG_BASE_URL = "http://192.168.0.242:19800/label";
    LabelUtils._labelName = "";
    LabelUtils.location = "";
    LabelUtils.labels = null;
    LabelUtils._retryTime = 0;
    LabelUtils.isSpecial = false;
    LabelUtils._retryTimeLocationList = 0;
    LabelUtils.locationList = [];
    LabelUtils.initLabelSuccess = false;
    LabelUtils.initIsSpecial = false;

    class md5 {
    	/*
    	 * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message
    	 * Digest Algorithm, as defined in RFC 1321.
    	 * Version 2.1 Copyright (C) Paul Johnston 1999 - 2002.
    	 * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
    	 * Distributed under the BSD License
    	 * See http://pajhome.org.uk/crypt/md5 for more info.
    	 */

    	/*
    	 * Configurable variables. You may need to tweak these to be compatible with
    	 * the server-side, but the defaults work in most cases.
    	 */

    	/*
    	 * These are the functions you'll usually want to call
    	 * They take string arguments and return either hex or base-64 encoded strings
    	 */
    	static hex_md5(s) { return md5.binl2hex(md5.core_md5(md5.str2binl(s), s.length * md5.chrsz)); }
    	static b64_md5(s) { return md5.binl2b64(md5.core_md5(md5.str2binl(s), s.length * md5.chrsz)); }
    	static str_md5(s) { return md5.binl2str(md5.core_md5(md5.str2binl(s), s.length * md5.chrsz)); }
    	static hex_hmac_md5(key, data) { return md5.binl2hex(md5.core_hmac_md5(key, data)); }
    	static b64_hmac_md5(key, data) { return md5.binl2b64(md5.core_hmac_md5(key, data)); }
    	static str_hmac_md5(key, data) { return md5.binl2str(md5.core_hmac_md5(key, data)); }

    	/*
    	 * Perform a simple self-test to see if the VM is working
    	 */
    	static md5_vm_test() {
    		return md5.hex_md5("abc") == "900150983cd24fb0d6963f7d28e17f72";
    	}

    	/*
    	 * Calculate the MD5 of an array of little-endian words, and a bit length
    	 */
    	static core_md5(x, len) {
    		/* append padding */
    		x[len >> 5] |= 0x80 << ((len) % 32);
    		x[(((len + 64) >>> 9) << 4) + 14] = len;

    		var a = 1732584193;
    		var b = -271733879;
    		var c = -1732584194;
    		var d = 271733878;

    		for (var i = 0; i < x.length; i += 16) {
    			var olda = a;
    			var oldb = b;
    			var oldc = c;
    			var oldd = d;

    			a = md5.md5_ff(a, b, c, d, x[i + 0], 7, -680876936);
    			d = md5.md5_ff(d, a, b, c, x[i + 1], 12, -389564586);
    			c = md5.md5_ff(c, d, a, b, x[i + 2], 17, 606105819);
    			b = md5.md5_ff(b, c, d, a, x[i + 3], 22, -1044525330);
    			a = md5.md5_ff(a, b, c, d, x[i + 4], 7, -176418897);
    			d = md5.md5_ff(d, a, b, c, x[i + 5], 12, 1200080426);
    			c = md5.md5_ff(c, d, a, b, x[i + 6], 17, -1473231341);
    			b = md5.md5_ff(b, c, d, a, x[i + 7], 22, -45705983);
    			a = md5.md5_ff(a, b, c, d, x[i + 8], 7, 1770035416);
    			d = md5.md5_ff(d, a, b, c, x[i + 9], 12, -1958414417);
    			c = md5.md5_ff(c, d, a, b, x[i + 10], 17, -42063);
    			b = md5.md5_ff(b, c, d, a, x[i + 11], 22, -1990404162);
    			a = md5.md5_ff(a, b, c, d, x[i + 12], 7, 1804603682);
    			d = md5.md5_ff(d, a, b, c, x[i + 13], 12, -40341101);
    			c = md5.md5_ff(c, d, a, b, x[i + 14], 17, -1502002290);
    			b = md5.md5_ff(b, c, d, a, x[i + 15], 22, 1236535329);

    			a = md5.md5_gg(a, b, c, d, x[i + 1], 5, -165796510);
    			d = md5.md5_gg(d, a, b, c, x[i + 6], 9, -1069501632);
    			c = md5.md5_gg(c, d, a, b, x[i + 11], 14, 643717713);
    			b = md5.md5_gg(b, c, d, a, x[i + 0], 20, -373897302);
    			a = md5.md5_gg(a, b, c, d, x[i + 5], 5, -701558691);
    			d = md5.md5_gg(d, a, b, c, x[i + 10], 9, 38016083);
    			c = md5.md5_gg(c, d, a, b, x[i + 15], 14, -660478335);
    			b = md5.md5_gg(b, c, d, a, x[i + 4], 20, -405537848);
    			a = md5.md5_gg(a, b, c, d, x[i + 9], 5, 568446438);
    			d = md5.md5_gg(d, a, b, c, x[i + 14], 9, -1019803690);
    			c = md5.md5_gg(c, d, a, b, x[i + 3], 14, -187363961);
    			b = md5.md5_gg(b, c, d, a, x[i + 8], 20, 1163531501);
    			a = md5.md5_gg(a, b, c, d, x[i + 13], 5, -1444681467);
    			d = md5.md5_gg(d, a, b, c, x[i + 2], 9, -51403784);
    			c = md5.md5_gg(c, d, a, b, x[i + 7], 14, 1735328473);
    			b = md5.md5_gg(b, c, d, a, x[i + 12], 20, -1926607734);

    			a = md5.md5_hh(a, b, c, d, x[i + 5], 4, -378558);
    			d = md5.md5_hh(d, a, b, c, x[i + 8], 11, -2022574463);
    			c = md5.md5_hh(c, d, a, b, x[i + 11], 16, 1839030562);
    			b = md5.md5_hh(b, c, d, a, x[i + 14], 23, -35309556);
    			a = md5.md5_hh(a, b, c, d, x[i + 1], 4, -1530992060);
    			d = md5.md5_hh(d, a, b, c, x[i + 4], 11, 1272893353);
    			c = md5.md5_hh(c, d, a, b, x[i + 7], 16, -155497632);
    			b = md5.md5_hh(b, c, d, a, x[i + 10], 23, -1094730640);
    			a = md5.md5_hh(a, b, c, d, x[i + 13], 4, 681279174);
    			d = md5.md5_hh(d, a, b, c, x[i + 0], 11, -358537222);
    			c = md5.md5_hh(c, d, a, b, x[i + 3], 16, -722521979);
    			b = md5.md5_hh(b, c, d, a, x[i + 6], 23, 76029189);
    			a = md5.md5_hh(a, b, c, d, x[i + 9], 4, -640364487);
    			d = md5.md5_hh(d, a, b, c, x[i + 12], 11, -421815835);
    			c = md5.md5_hh(c, d, a, b, x[i + 15], 16, 530742520);
    			b = md5.md5_hh(b, c, d, a, x[i + 2], 23, -995338651);

    			a = md5.md5_ii(a, b, c, d, x[i + 0], 6, -198630844);
    			d = md5.md5_ii(d, a, b, c, x[i + 7], 10, 1126891415);
    			c = md5.md5_ii(c, d, a, b, x[i + 14], 15, -1416354905);
    			b = md5.md5_ii(b, c, d, a, x[i + 5], 21, -57434055);
    			a = md5.md5_ii(a, b, c, d, x[i + 12], 6, 1700485571);
    			d = md5.md5_ii(d, a, b, c, x[i + 3], 10, -1894986606);
    			c = md5.md5_ii(c, d, a, b, x[i + 10], 15, -1051523);
    			b = md5.md5_ii(b, c, d, a, x[i + 1], 21, -2054922799);
    			a = md5.md5_ii(a, b, c, d, x[i + 8], 6, 1873313359);
    			d = md5.md5_ii(d, a, b, c, x[i + 15], 10, -30611744);
    			c = md5.md5_ii(c, d, a, b, x[i + 6], 15, -1560198380);
    			b = md5.md5_ii(b, c, d, a, x[i + 13], 21, 1309151649);
    			a = md5.md5_ii(a, b, c, d, x[i + 4], 6, -145523070);
    			d = md5.md5_ii(d, a, b, c, x[i + 11], 10, -1120210379);
    			c = md5.md5_ii(c, d, a, b, x[i + 2], 15, 718787259);
    			b = md5.md5_ii(b, c, d, a, x[i + 9], 21, -343485551);

    			a = md5.safe_add(a, olda);
    			b = md5.safe_add(b, oldb);
    			c = md5.safe_add(c, oldc);
    			d = md5.safe_add(d, oldd);
    		}
    		return Array(a, b, c, d);

    	}

    	/*
    	 * These functions implement the four basic operations the algorithm uses.
    	 */
    	static md5_cmn(q, a, b, x, s, t) {
    		return md5.safe_add(md5.bit_rol(md5.safe_add(md5.safe_add(a, q), md5.safe_add(x, t)), s), b);
    	}
    	static md5_ff(a, b, c, d, x, s, t) {
    		return md5.md5_cmn((b & c) | ((~b) & d), a, b, x, s, t);
    	}
    	static md5_gg(a, b, c, d, x, s, t) {
    		return md5.md5_cmn((b & d) | (c & (~d)), a, b, x, s, t);
    	}
    	static md5_hh(a, b, c, d, x, s, t) {
    		return md5.md5_cmn(b ^ c ^ d, a, b, x, s, t);
    	}
    	static md5_ii(a, b, c, d, x, s, t) {
    		return md5.md5_cmn(c ^ (b | (~d)), a, b, x, s, t);
    	}

    	/*
    	 * Calculate the HMAC-MD5, of a key and some data
    	 */
    	static core_hmac_md5(key, data) {
    		var bkey = md5.str2binl(key);
    		if (bkey.length > 16) bkey = md5.core_md5(bkey, key.length * md5.chrsz);

    		var ipad = Array(16), opad = Array(16);
    		for (var i = 0; i < 16; i++) {
    			ipad[i] = bkey[i] ^ 0x36363636;
    			opad[i] = bkey[i] ^ 0x5C5C5C5C;
    		}

    		var hash = md5.core_md5(ipad.concat(md5.str2binl(data)), 512 + data.length * md5.chrsz);
    		return md5.core_md5(opad.concat(hash), 512 + 128);
    	}

    	/*
    	 * Add integers, wrapping at 2^32. This uses 16-bit operations internally
    	 * to work around bugs in some JS interpreters.
    	 */
    	static safe_add(x, y) {
    		var lsw = (x & 0xFFFF) + (y & 0xFFFF);
    		var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
    		return (msw << 16) | (lsw & 0xFFFF);
    	}

    	/*
    	 * Bitwise rotate a 32-bit number to the left.
    	 */
    	static bit_rol(num, cnt) {
    		return (num << cnt) | (num >>> (32 - cnt));
    	}

    	/*
    	 * Convert a string to an array of little-endian words
    	 * If md5.chrsz is ASCII, characters >255 have their hi-byte silently ignored.
    	 */
    	static str2binl(str) {
    		var bin = Array();
    		var mask = (1 << md5.chrsz) - 1;
    		for (var i = 0; i < str.length * md5.chrsz; i += md5.chrsz)
    			bin[i >> 5] |= (str.charCodeAt(i / md5.chrsz) & mask) << (i % 32);
    		return bin;
    	}

    	/*
    	 * Convert an array of little-endian words to a string
    	 */
    	static binl2str(bin) {
    		var str = "";
    		var mask = (1 << md5.chrsz) - 1;
    		for (var i = 0; i < bin.length * 32; i += md5.chrsz)
    			str += String.fromCharCode((bin[i >> 5] >>> (i % 32)) & mask);
    		return str;
    	}

    	/*
    	 * Convert an array of little-endian words to a hex string.
    	 */
    	static binl2hex(binarray) {
    		var hex_tab = md5.hexcase ? "0123456789ABCDEF" : "0123456789abcdef";
    		var str = "";
    		for (var i = 0; i < binarray.length * 4; i++) {
    			str += hex_tab.charAt((binarray[i >> 2] >> ((i % 4) * 8 + 4)) & 0xF) +
    				hex_tab.charAt((binarray[i >> 2] >> ((i % 4) * 8)) & 0xF);
    		}
    		return str;
    	}

    	/*
    	 * Convert an array of little-endian words to a base-64 string
    	 */
    	static binl2b64(binarray) {
    		var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
    		var str = "";
    		for (var i = 0; i < binarray.length * 4; i += 3) {
    			var triplet = (((binarray[i >> 2] >> 8 * (i % 4)) & 0xFF) << 16)
    				| (((binarray[i + 1 >> 2] >> 8 * ((i + 1) % 4)) & 0xFF) << 8)
    				| ((binarray[i + 2 >> 2] >> 8 * ((i + 2) % 4)) & 0xFF);
    			for (var j = 0; j < 4; j++) {
    				if (i * 8 + j * 6 > binarray.length * 32) str += md5.b64pad;
    				else str += tab.charAt((triplet >> 6 * (3 - j)) & 0x3F);
    			}
    		}
    		return str;
    	}
    }
    md5.hexcase = 0;
    md5.b64pad = "";
    md5.chrsz = 8;

    class OCPX {
    	static Init(pkgName, callback1 = null) {
    		OCPX.pkgName = pkgName;
    		if (Laya.Browser.onQGMiniGame) {
    			console.log("OCPX初始化     包名:" + OCPX.pkgName);
    			console.log("gggy的值是:  ", LabelUtils.getLabel("gggy"));
    			if (!LabelUtils.getLabel("gggy")) {
    				if (callback1) {
    					callback1();
    				}
    			}
    			qg.getDeviceId({
    				success: function (data) {
    					console.log(parseInt(data.deviceId));
    					if (parseInt(data.deviceId.length) < 64) {
    						console.log("获取到的是IMEI");
    						OCPX.imeiFlag = true;
    						let temp = md5.hex_md5(data.deviceId).toString();
    						OCPX.deviceId = data.deviceId;
    						OCPX.firstUpdate(temp, "", callback1);
    					} else {
    						console.log("获取到的是OAID");
    						OCPX.imeiFlag = false;
    						OCPX.deviceId = data.deviceId;
    						OCPX.firstUpdate("", data.deviceId, callback1);
    					}
    					if (OCPX.deviceId == null || OCPX.deviceId == "null") {
    						OCPX.deviceId = "";
    					}
    					console.log(`handling success: ${JSON.stringify(data)}`);
    				},
    				fail: function (data, code) {
    					console.log(`handling fail, code = ${code}`);
    				},
    			});
    			OCPX.reportTime = LabelUtils.getValue("gjxwsj", 5);
    			console.log("标签设置的广告达成次数为：       " + OCPX.reportTime);
    			// setTimeout(() => {
    			//     if (OCPX.imeiFlag) {
    			//         OCPX.keyActicon(md5.hex_md5(OCPX.deviceId).toString(), "");
    			//     } else {
    			//         OCPX.keyActicon("", OCPX.deviceId);
    			//     }
    			// }, OCPX.reportTime * 1000);
    		}
    	}
    	static timesReach() {
    		if (OCPX.imeiFlag) {
    			OCPX.keyActicon(md5.hex_md5(OCPX.deviceId).toString(), "");
    		} else {
    			OCPX.keyActicon("", OCPX.deviceId);
    		}
    	}
    	static checkNumber(theObj) {
    		var reg = /^[0-9]+\.?[0-9]*$/;
    		if (reg.test(theObj)) {
    			return true;
    		}
    		return false;
    	}
    	static keyActicon(imei = "", oaid = "") {
    		console.log("准备上报关键行为       " + "imei     " + imei + "        oaid    " + oaid);
    		if (OVHAdsManager.GetData("oppoUpdateFlag")) {
    			console.log("已经上报过一次了，不能再上报");
    			return;
    		}
    		if (OCPX.isUploadFlag) {
    			console.log("当前正在上传关键行为，不能重复执行上传");
    			return;
    		}
    		OCPX.isUploadFlag = true;
    		let url = "https://admonitpk-click-admonitor-pmmgoghavw.cn-hangzhou.fcapp.run/?imei=" + imei + "&OAID=" + oaid + "&orpn=" + OCPX.pkgName + "&event=keyaction&mversion=102";
    		// let url = "https://admonitpk-click-admonitor-pmmgoghavw.cn-hangzhou.fcapp.run/?imei=" + "&OAID=" + "BE98F074C61F4BEB94B358157776E693654370c810e25db810f6fae7fe93ea6b" + "&orpn=com.zlcr.xdhpsn.nearme.gamecenter&event=keyaction&mversion=102";
    		var xhr = new XMLHttpRequest();
    		console.log("URL: " + url);
    		xhr.open("GET", url, true);
    		xhr.onreadystatechange = function () {

    			if (xhr.readyState == 4 && (xhr.status >= 200 && xhr.status < 400)) {
    				if (OCPX.checkNumber(xhr.responseText)) {
    					var response = JSON.parse(xhr.responseText);
    					console.log("达成关键行为       " + JSON.stringify(response));
    					if (JSON.stringify(response) == "0") {
    						console.log("成功上报       " + JSON.stringify(response));
    						OVHAdsManager.SetData("oppoUpdateFlag", true);
    					} else if (JSON.stringify(response) == "1") {
    						console.log("成功上报但回传失败       " + JSON.stringify(response));
    						OVHAdsManager.SetData("oppoUpdateFlag", true);
    					}
    					else {
    						console.log("达成关键行为但是数据有问题       " + JSON.stringify(response));
    						OCPX.keyActiconRetryTimes++;
    						if (OCPX.keyActiconRetryTimes < 3) {
    							console.log("关键行为重试次数没到2次，准备再次上报");
    							setTimeout(() => {
    								OCPX.isUploadFlag = false;
    								OCPX.keyActicon(imei, oaid);
    							}, 3000);
    						}
    					}
    				} else {
    					console.log("xhr.responseText:   ", xhr.responseText);
    					if (xhr.responseText == "keyaction重复上传") {
    						OVHAdsManager.SetData("oppoUpdateFlag", true);
    					}
    				}
    			} else if (xhr.readyState == 4) {
    				console.log(xhr.statusText);
    				console.log(xhr.responseText);
    				OCPX.keyActiconRetryTimes++;
    				if (OCPX.keyActiconRetryTimes < 3) {
    					console.log("关键行为重试次数没到2次，准备再次上报");
    					setTimeout(() => {
    						OCPX.isUploadFlag = false;
    						OCPX.keyActicon(imei, oaid);
    					}, 3000);
    				}
    			}

    		}.bind(this);

    		xhr.onerror = function (e) {
    			console.log("error: " + e);
    			OCPX.keyActiconRetryTimes++;
    			if (OCPX.keyActiconRetryTimes < 3) {
    				console.log("关键行为重试次数没到2次，准备再次上报");
    				setTimeout(() => {
    					OCPX.isUploadFlag = false;
    					OCPX.keyActicon(imei, oaid);
    				}, 3000);
    			}
    		}.bind(this);
    		xhr.send();
    	}

    	static firstUpdate(imei = "", oaid = "", callback = null) {
    		let url = "https://admonitpk-click-admonitor-pmmgoghavw.cn-hangzhou.fcapp.run/?imei=" + imei + "&OAID=" + oaid + "&orpn=" + OCPX.pkgName + "&event=start&mversion=102";
    		// let url = "https://admonitpk-click-admonitor-pmmgoghavw.cn-hangzhou.fcapp.run/?imei=" + "&OAID=" + "BE98F074C61F4BEB94B358157776E693654370c810e25db810f6fae7fe93ea6b" + "&orpn=com.zlcr.xdhpsn.nearme.gamecenter&event=start&mversion=102";
    		var xhr = new XMLHttpRequest();
    		console.log("URL: " + url);
    		xhr.open("GET", url, true);
    		xhr.onreadystatechange = function () {

    			if (xhr.readyState == 4 && (xhr.status >= 200 && xhr.status < 400)) {

    				var response = JSON.parse(xhr.responseText);
    				console.log("用户开启游戏   " + JSON.stringify(response));
    				if (JSON.stringify(response) == "0") {
    					if (LabelUtils.getLabel("gggy")) {
    						if (callback) {
    							callback();
    						}
    					}
    				} else if (JSON.stringify(response) == "1") {

    				} else {
    					OCPX.firstRetryTimes++;
    					if (OCPX.firstRetryTimes < 3) {
    						console.log("first行为重试次数没到2次，准备重新上报");
    						setTimeout(() => {
    							OCPX.firstUpdate(imei, oaid, callback);
    						}, 3000);
    					}
    				}



    			} else if (xhr.readyState == 4) {

    				console.log(xhr.statusText);
    				console.log(xhr.responseText);
    				OCPX.firstRetryTimes++;
    				if (OCPX.firstRetryTimes < 3) {
    					console.log("first行为重试次数没到2次，准备重新上报");
    					setTimeout(() => {
    						OCPX.firstUpdate(imei, oaid, callback);
    					}, 3000);
    				}
    			}

    		}.bind(this);

    		xhr.onerror = function (e) {
    			console.log("error: " + e);
    			OCPX.firstRetryTimes++;
    			if (OCPX.firstRetryTimes < 3) {
    				console.log("first行为重试次数没到2次，准备重新上报");
    				setTimeout(() => {
    					OCPX.firstUpdate(imei, oaid, callback);
    				}, 3000);
    			}
    		}.bind(this);
    		xhr.send();
    	}

    	static getParmasURL(t_url, params_json) { //拼接完整URL
    		let f_str = t_url + '?' + oppoAds.getStrParmas(params_json);
    		return f_str;
    	}

    	static sortLogArray(t_array) {
    		t_array.sort(function (itemA, itemB) {
    			return parseInt(itemA["__time__"]) - parseInt(itemB["__time__"]);
    		});

    		let f_array = [];
    		for (let n = 0; n < t_array.length; n++) {
    			f_array.push(JSON.parse(t_array[n].message));
    		}
    		return f_array;

    	}

    	static getStrParmas(params_json) { //注意value值的转码
    		let tmp_keys = Object.keys(params_json);
    		let result_str = "";
    		for (let k = 0; k < tmp_keys.length - 1; k++) {
    			let tk = tmp_keys[k];

    			result_str += tk + "=" + params_json[tk] + "&";
    		}


    		let last_tk = tmp_keys[tmp_keys.length - 1];
    		result_str += last_tk + "=" + params_json[last_tk];
    		return result_str;

    	}
    }
    OCPX.imeiFlag = false;
    OCPX.deviceId = null;
    OCPX.reportTime = 0;
    OCPX.pkgName = "";
    OCPX.firstRetryTimes = 0;
    OCPX.keyActiconRetryTimes = 0;
    OCPX.isUploadFlag = false;

    class iconNative extends iconNativeUI {

    	constructor(posID) {
    		super();
    		this.posID = posID;
    		this.NativeChaping = null;
    		this.nativeDatas = null;
    		this.refreshTimer = null;
    	}

    	onEnable() {
    		console.log("iconNative");

    		this.width = Laya.stage.width;
    		this.height = Laya.stage.height;
    		this.zOrder = 998;
    		this.InitNative();
    	}

    	InitNative() {
    		var self = this;
    		console.log("初始化 iconNative");
    		if (self.NativeChaping != null) {
    			self.NativeChaping.destroy();
    			self.NativeChaping = null;
    			self.nativeDatas = null;
    		}
    		self.NativeChaping = qg.createNativeAd({
    			adUnitId: self.posID,
    		});
    		self.NativeChaping.onLoad(function (res) {
    			self.bg.skin = "native/native_2.png";
    			console.log("oppoAd iconNative 广告加载成功");
    			self.nativeDatas = res.adList[0];
    			console.log("oppoAd iconNative:" + JSON.stringify(self.nativeDatas));
    			self.bg.skin = self.nativeDatas.icon;
    			self.BaoGuangShangBao();
    			self.NativeChaping.offError();
    			self.NativeChaping.offLoad();
    			self.bg.on(Laya.Event.CLICK, self, self.touchGGBtn);
    			oppoAds.nativeAd_icon_JS = self;
    			// console.log("刷新时间:" + oppoAds.tpjg);
    			// self.reFresh();
    		});
    		self.NativeChaping.load();
    		self.NativeChaping.onError((e) => {
    			console.error('oppoAd load iconNative error:' + JSON.stringify(e));
    			self.quitBtn();
    			self.NativeChaping.offError();
    			self.NativeChaping.offLoad();
    			self.nativeDatas = null;
    		});
    	}

    	touchGGBtn() {
    		let self = this;
    		self.NativeChaping.reportAdClick({
    			adId: self.nativeDatas.adId
    		}); //点击上报  
    		self.quitBtn();
    	}

    	quitBtn() {
    		oppoAds.nativeAd_icon_JS = null;
    		clearInterval(this.refreshTimer);
    		this.destroy();
    		setTimeout(() => {
    			Laya.stage.addChild(new iconNative(this.posID));
    		}, oppoAds.tpjg * 1000);
    	}

    	reFresh() {
    		clearInterval(this.refreshTimer);
    		this.refreshTimer = setInterval(() => {
    			var self = this;
    			var nativeIcon = qg.createNativeAd({
    				adUnitId: self.posID,
    			});
    			nativeIcon.onLoad(function (res) {
    				console.log("oppoAd iconNative 刷新成功");
    				self.nativeDatas = res.adList[0];
    				console.log("oppoAd iconNative:" + JSON.stringify(self.nativeDatas));
    				self.bg.skin = self.nativeDatas.icon;
    				self.BaoGuangShangBao();
    				nativeIcon.offError();
    				nativeIcon.offLoad();
    			});
    			nativeIcon.load();
    			nativeIcon.onError((e) => {
    				console.error(' load iconNative 刷新获取失败:' + JSON.stringify(e));
    			});
    		}, oppoAds.tpjg * 1000);
    	}

    	BaoGuangShangBao() {
    		console.log('曝光上报');
    		var times = OVHAdsManager.GetData("ADTimes");
    		times++;
    		console.log("当前达成广告次数为：       " + times);
    		OVHAdsManager.SetData("ADTimes", times);
    		if (times < OCPX.reportTime) {
    			console.log("广告达成次数加一并且记录");
    		} else {
    			console.log("广告达成次数到了，准备上报keyaction");
    			OCPX.timesReach();
    		}
    		this.NativeChaping.reportAdShow({
    			adId: this.nativeDatas.adId
    		}); //广告曝光上报
    	}

    	onDisable() {

    	}
    }

    class oppoAds extends Laya.Script {
    	/**
    	 * 初始化OPPO RPK广告组件
    	 * @param customAd_banner_ID 原生模板广告(banner)ID
    	 * @param customAd_interstitial_ID 原生模板广告(插屏)ID
    	 * @param nativeAd_icon_ID 原生自渲染(icon)ID
    	 * @param VideoAd_ID 激励视频ID
    	 */
    	static Init(customAd_banner_ID, customAd_interstitial_ID, nativeAd_icon_ID, VideoAd_ID, gamePortalAd_ID) {
    		oppoAds.customAd_banner_ID = customAd_banner_ID;
    		oppoAds.customAd_interstitial_ID = customAd_interstitial_ID;
    		oppoAds.nativeAd_icon_ID = nativeAd_icon_ID;
    		oppoAds.VideoAd_ID = VideoAd_ID;
    		oppoAds.gamePortalAd_ID = gamePortalAd_ID;

    		console.log("oppoAd customAd_banner_ID:" + oppoAds.customAd_banner_ID);
    		console.log("oppoAd customAd_interstitial_ID:" + oppoAds.customAd_interstitial_ID);
    		console.log("oppoAd nativeAd_icon_ID:" + oppoAds.nativeAd_icon_ID);
    		console.log("oppoAd VideoAd_ID:" + oppoAds.VideoAd_ID);
    		console.log("oppoAd gamePortalAd_ID:" + oppoAds.gamePortalAd_ID);

    		if (Laya.Browser.onQGMiniGame) {
    			oppoAds.screenWidth = qg.getSystemInfoSync().screenWidth;
    			oppoAds.screenHeight = qg.getSystemInfoSync().screenHeight;
    			if (oppoAds.screenWidth > oppoAds.screenHeight) {
    				oppoAds.minWidth = oppoAds.screenHeight;
    			} else {
    				oppoAds.minWidth = oppoAds.screenWidth;
    			}
    			console.log("oppoAds.minWidth:" + oppoAds.minWidth);
    			qg.onShow(function () {
    				console.log('oppoAd 前台运行');
    				if (oppoAds.closeNative) {
    					console.log("oppoAd 点击原生跳转返回游戏重新计时");
    					oppoAds.closeNative = false;
    					oppoAds.showTouch();
    				}
    			});
    			qg.onHide(function () {
    				console.log('oppoAd 后台运行');
    			});
    		}

    		oppoAds.ggkqsj = LabelUtils.getValue("ggkqsj", -1);
    		if (oppoAds.ggkqsj != -1 && LabelUtils.getLabel("ggzkg")) {
    			oppoAds.tpjg = LabelUtils.getValue("tpjg", 60);
    			oppoAds.ysjg = LabelUtils.getValue("ysjg", 60);
    			oppoAds.jlsp = LabelUtils.getValue("jlsp", 60);
    			oppoAds.ggsx = LabelUtils.getValue("ggsx", 1212);
    			console.log("oppoAd (tpjg:" + oppoAds.tpjg + "  ysjg:" + oppoAds.ysjg + "  jlsp:" + oppoAds.jlsp + "  ggsx:" + oppoAds.ggsx + ")");

    			oppoAds.InitCustomAd_Interstitial();
    			oppoAds.InitVideoAd();
    			oppoAds.InitCustomAd_banner();
    		} else {
    			console.log("oppoAd ggkqsj数值为-1或未创建,ggzkg开关未开或未创建");
    		}
    	}

    	/**
    	 * 初始化展示广告
    	 */
    	static InitShowAD() {
    		if (oppoAds.ggkqsj != -1 && LabelUtils.getLabel("ggzkg")) {
    			setTimeout(() => {
    				oppoAds.showCustomAd_Interstitial();
    				Laya.stage.addChild(new iconNative(oppoAds.nativeAd_icon_ID));
    				oppoAds.showCustomAd_banner();
    				oppoAds.showTouch();
    			}, oppoAds.ggkqsj * 1000);
    		}
    	}

    	/**
    	 * 初始化原生模板广告(banner)
    	 * @param isTop 位置(true:顶部居中、false:底部居中)
    	 */
    	static InitCustomAd_banner(isTop = false) {
    		if (Laya.Browser.onQGMiniGame) {
    			// if (isTop) {
    			//     oppoAds.customAd_banner = qg.createCustomAd({
    			//         adUnitId: oppoAds.customAd_banner_ID,
    			//         style: {
    			//             top: 0,
    			//         },
    			//     });
    			// } else {
    			//     oppoAds.customAd_banner = qg.createCustomAd({
    			//         adUnitId: oppoAds.customAd_banner_ID,
    			//     });
    			// }
    			// oppoAds.customAd_banner.onLoad(() => {
    			//     console.log("oppoAd customAd_banner load success");
    			// });
    			// oppoAds.customAd_banner.onError((err) => {
    			//     console.log("oppoAd customAd_banner load err:" + JSON.stringify(err));
    			//     oppoAds.CustomAd_banner_Timer();
    			// });
    			// oppoAds.customAd_banner.onShow(() => {
    			//     var times = OVHAdsManager.GetData("ADTimes");
    			//     times++;
    			//     console.log("当前达成广告次数为：       " + times);
    			//     OVHAdsManager.SetData("ADTimes", times);
    			//     if (times < OCPX.reportTime) {
    			//         console.log("广告达成次数加一并且记录");
    			//     } else {
    			//         console.log("广告达成次数到了，准备上报keyaction");
    			//         OCPX.timesReach();
    			//     }
    			//     clearInterval(oppoAds.customAd_bannerTimeInterval);
    			//     oppoAds.customAd_bannerTimeInterval = setInterval(() => {
    			//         oppoAds.showCustomAd_banner();
    			//     }, oppoAds.tpjg * 1000);
    			// });
    			// oppoAds.customAd_banner.onHide(() => {
    			//     console.log("oppoAd customAd_banner close");
    			//     clearInterval(oppoAds.customAd_bannerTimeInterval);
    			//     oppoAds.CustomAd_banner_Timer();
    			// });
    			if (isTop) {
    				oppoAds.customAd_banner = qg.createBannerAd({
    					adUnitId: oppoAds.customAd_banner_ID,
    					style: {
    						top: 0,
    					},
    				});
    			} else {
    				oppoAds.customAd_banner = qg.createBannerAd({
    					adUnitId: oppoAds.customAd_banner_ID,
    				});
    			}
    			oppoAds.customAd_banner.onLoad(() => {
    				console.log("成功创建banner广告");
    			});
    			oppoAds.customAd_banner.onError((err) => {
    				console.log("oppoAd customAd_banner load err:" + JSON.stringify(err));
    				oppoAds.CustomAd_banner_Timer();
    			});
    			oppoAds.customAd_banner.onHide(() => {
    				console.log("oppoAd customAd_banner close");
    				clearInterval(oppoAds.customAd_bannerTimeInterval);
    				oppoAds.CustomAd_banner_Timer();
    			});
    		}
    	}

    	/**
    	 * 展示原生模板广告(banner)
    	 * @returns 
    	 */
    	static showCustomAd_banner() {
    		if (Laya.Browser.onQGMiniGame) {
    			if (oppoAds.customAd_interstitial_isShow) {
    				console.log("不展示banner");
    				return;
    			}
    			if (oppoAds.customAd_banner != null) {
    				console.log("展示banner");
    				oppoAds.customAd_banner.show().then(() => {
    					console.log("oppoAd customAd_banner show success");
    					var times = OVHAdsManager.GetData("ADTimes");
    					times++;
    					console.log("当前达成广告次数为：       " + times);
    					OVHAdsManager.SetData("ADTimes", times);
    					if (times < OCPX.reportTime) {
    						console.log("广告达成次数加一并且记录");
    					} else {
    						console.log("广告达成次数到了，准备上报keyaction");
    						OCPX.timesReach();
    					}
    					clearInterval(oppoAds.customAd_bannerTimeInterval);
    					oppoAds.customAd_bannerTimeInterval = setInterval(() => {
    						oppoAds.showCustomAd_banner();
    					}, oppoAds.tpjg * 1000);
    				}).catch((error) => {
    					console.log("oppoAd customAd_banner show fail with:" + error.errCode + "," + error.errMsg);
    					oppoAds.CustomAd_banner_Timer();
    				});
    			} else {
    				oppoAds.CustomAd_banner_Timer();
    			}
    		}
    	}

    	/**
    	 * 隐藏原生模板广告(banner)
    	 */
    	static hideCustomAd_banner() {
    		if (Laya.Browser.onQGMiniGame) {
    			if (oppoAds.customAd_banner != null) {
    				oppoAds.customAd_banner.hide();
    			}
    		}
    	}

    	/**
    	 * 原生模板广告(banner)计时器
    	 */
    	static CustomAd_banner_Timer() {
    		clearTimeout(oppoAds.customAd_bannerTimeOut);
    		oppoAds.customAd_bannerTimeOut = setTimeout(() => {
    			oppoAds.showCustomAd_banner();
    		}, oppoAds.tpjg * 1000);
    	}

    	/**
    	 * 初始化原生模板广告(插屏)
    	 */
    	static InitCustomAd_Interstitial() {
    		if (Laya.Browser.onQGMiniGame) {
    			if (oppoAds.customAd_interstitial != null) {
    				oppoAds.customAd_interstitial.destroy();
    			}
    			oppoAds.customAd_interstitial = qg.createCustomAd({
    				adUnitId: oppoAds.customAd_interstitial_ID,
    				style: {
    					top: oppoAds.screenHeight / 2 - oppoAds.minWidth * 0.8 / 2,
    					left: oppoAds.screenWidth / 2 - oppoAds.minWidth * 0.8 / 2,
    					width: oppoAds.minWidth * 0.8,
    				},
    			});

    			oppoAds.customAd_interstitial.onShow(() => {
    				oppoAds.customAd_interstitial_isShow = true;
    				var times = OVHAdsManager.GetData("ADTimes");
    				times++;
    				console.log("当前达成广告次数为：       " + times);
    				OVHAdsManager.SetData("ADTimes", times);
    				if (times < OCPX.reportTime) {
    					console.log("广告达成次数加一并且记录");
    				} else {
    					console.log("广告达成次数到了，准备上报keyaction");
    					OCPX.timesReach();
    				}
    				oppoAds.hideCustomAd_banner();
    			});

    			oppoAds.customAd_interstitial.onLoad(() => {
    				console.log("oppoAd customAd_interstitial load success");
    			});

    			oppoAds.customAd_interstitial.onError((err) => {
    				console.log("oppoAd customAd_interstitial load err:" + JSON.stringify(err));
    			});

    			oppoAds.customAd_interstitial.onHide(() => {
    				oppoAds.customAd_interstitial_isShow = false;
    				console.log("oppoAd customAd_interstitial close");
    				oppoAds.CustomAd_Interstitial_Timer();
    				oppoAds.showCustomAd_banner();
    			});
    		}
    	}

    	/**
    	 * 展示原生模板广告(插屏)
    	 */
    	static showCustomAd_Interstitial() {
    		if (Laya.Browser.onQGMiniGame) {
    			if (oppoAds.customAd_interstitial != null) {
    				oppoAds.customAd_interstitial.show().then(() => {
    					console.log("oppoAd customAd_interstitial show success");
    				}).catch((error) => {
    					console.log("oppoAd customAd_interstitial show fail with:" + error.errCode + "," + error.errMsg);
    					oppoAds.CustomAd_Interstitial_Timer();
    				});
    			}
    		}
    	}

    	/**
    	 * 原生模板广告(插屏)计时器
    	 */
    	static CustomAd_Interstitial_Timer() {
    		oppoAds.InitCustomAd_Interstitial();
    		clearTimeout(oppoAds.customAd_interstitialTimer);
    		oppoAds.customAd_interstitialTimer = setTimeout(() => {
    			oppoAds.showCustomAd_Interstitial();
    		}, oppoAds.ysjg * 1000);
    	}

    	/**
    	 * 初始化激励视频
    	 */
    	static InitVideoAd() {
    		if (Laya.Browser.onQGMiniGame) {
    			if (oppoAds.rewardedVideoAd != null) {
    				oppoAds.rewardedVideoAd.destroy();
    				oppoAds.rewardedVideoAd = null;
    			}
    			oppoAds.rewardedVideoAd = qg.createRewardedVideoAd({
    				adUnitId: oppoAds.VideoAd_ID,
    			});
    			oppoAds.rewardedVideoAd.onLoad(function () {
    				console.log("oppoAd 激励视频加载成功");
    				oppoAds.showVideo = true;
    			});
    			oppoAds.rewardedVideoAd.onError(function (err) {
    				console.error("oppoAd 激励视频加载失败" + JSON.stringify(err));
    				oppoAds.showVideo = false;
    			});
    			oppoAds.rewardedVideoAd.onClose(function (res) {
    				oppoAds.rewardedVideoAd.load();
    				if (res.isEnded) {
    					var times = OVHAdsManager.GetData("ADTimes");
    					times++;
    					console.log("当前达成广告次数为：       " + times);
    					OVHAdsManager.SetData("ADTimes", times);
    					if (times < OCPX.reportTime) {
    						console.log("广告达成次数加一并且记录");
    					} else {
    						console.log("广告达成次数到了，准备上报keyaction");
    						OCPX.timesReach();
    					}
    				}
    				oppoAds.showTouch();
    			});
    			oppoAds.rewardedVideoAd.load();
    		}
    	}

    	/**
    	 * 展示激励视频
    	 * @param errCallback 展示失败回调
    	 */
    	static showVideoAd(errCallback = null) {
    		if (Laya.Browser.onQGMiniGame) {
    			if (oppoAds.showVideo) {
    				oppoAds.rewardedVideoAd.show().then(function () {
    					console.log("oppoAd 激励视频展示成功");
    				}).catch((err) => {
    					console.log("oppoAd show video fail:" + JSON.stringify(err));
    					if (errCallback) {
    						errCallback();
    					}
    				});
    			} else {
    				oppoAds.InitVideoAd();
    				if (errCallback) {
    					errCallback();
    				}
    			}
    		}
    	}

    	/**
    	 * 到点误触
    	 * @param {*} isSkip 是否跳过延迟
    	 */
    	static showTouch(isSkip = false) {
    		clearTimeout(oppoAds.native_video_Timer);
    		if (isSkip) {
    			oppoAds.Touch();
    		} else {
    			oppoAds.TouchTimer();
    		}
    	}

    	/**
    	 * 误触延迟
    	 */
    	static TouchTimer() {
    		clearTimeout(oppoAds.native_video_Timer);
    		oppoAds.native_video_Timer = setTimeout(() => {
    			oppoAds.Touch();
    		}, oppoAds.jlsp * 1000);
    	}

    	/**
    	 * 误触
    	 */
    	static Touch() {
    		var ggsx = oppoAds.ggsx.toString();
    		oppoAds.Ad_Index++;
    		var Ad_Index = oppoAds.Ad_Index % ggsx.length;
    		Ad_Index = parseInt(ggsx.charAt(Ad_Index));
    		console.log("oppoAd 到点误触广告序号:" + Ad_Index);
    		switch (Ad_Index) {
    			case 1:
    				console.log("oppoAd oppoAds.nativeAd_icon_JS:", oppoAds.nativeAd_icon_JS);
    				if (oppoAds.nativeAd_icon_JS != null) {
    					oppoAds.closeNative = true;
    					oppoAds.nativeAd_icon_JS.touchGGBtn();
    				} else {
    					// console.log("oppoAd 原生自渲染(icon)广告获取失败,将要用下一个顺序广告替换");
    					setTimeout(() => {
    						oppoAds.showTouch(true);
    					}, 1000);
    				}
    				break;
    			case 2:
    				oppoAds.showVideoAd(function () {
    					// console.log("oppoAd 激励视频广告展示失败,将要用下一个顺序广告替换");
    					setTimeout(() => {
    						oppoAds.showTouch(true);
    					}, 1000);
    				}.bind(this));
    				break;
    		}
    	}

    	/**
    	 * 展示九宫格
    	 */
    	static showGamePortalAd() {
    		if (qg.getSystemInfoSync().platformVersionCode >= 1076) {
    			if (oppoAds.gamePortalAd != null) {
    				oppoAds.gamePortalAd.destroy();
    				oppoAds.gamePortalAd = null;
    			}
    			oppoAds.gamePortalAd = qg.createGamePortalAd({
    				adUnitId: oppoAds.gamePortalAd_ID
    			});

    			oppoAds.gamePortalAd.onClose(function () {
    				// oppoAds.isShowGamePortalAd = false;
    			});

    			oppoAds.gamePortalAd.load().then(function () {
    				console.log('互推盒子九宫格广告加载成功');
    				oppoAds.gamePortalAd.show().then(function () {
    					console.log('oppoAd gamePortalAd show success');
    				}).catch(function (error) {
    					console.log('oppoAd gamePortalAd show fail:' + JSON.stringify(error));
    					qg.showToast({
    						title: '努力加载中，请稍后再试~',
    						icon: 'none',
    						duration: 2000
    					});
    				});
    			}).catch(function (error) {
    				console.log("oppoAd gamePortalAd load fail:" + JSON.stringify(error));
    				qg.showToast({
    					title: '努力加载中，请稍后再试~',
    					icon: 'none',
    					duration: 2000
    				});
    			});
    		}

    	}
    }
    ////////////////////////////////////////////////////////////////////////////////////////////////
    oppoAds.screenWidth = null;
    oppoAds.screenHeight = null;
    oppoAds.minWidth = null;
    ////////////////////////////////////////////////////////////////////////////////////////////////
    //标签
    oppoAds.ggkqsj = -1;
    oppoAds.tpjg = 60;
    oppoAds.ysjg = 60;
    oppoAds.jlsp = 60;
    oppoAds.ggsx = 1212;
    ////////////////////////////////////////////////////////////////////////////////////////////////
    //激励视频
    oppoAds.rewardedVideoAd = null;                                     //激励视频广告组件
    oppoAds.VideoAd_ID = null;                                          //激励视频广告ID
    oppoAds.showVideo = true;                                           //激励视频是否预加载成功
    oppoAds.VideoTimer = null;                                          //激励视频计时器
    ////////////////////////////////////////////////////////////////////////////////////////////////
    //原生模板
    oppoAds.customAd_banner = null;                                     //原生模板广告(banner)广告组件
    oppoAds.customAd_banner_ID = null;                                  //原生模板广告(banner)广告ID
    oppoAds.customAd_bannerTimeOut = null;                              //原生模板广告(banner)关闭重新展示计时器
    oppoAds.customAd_bannerTimeInterval = null;                         //原生模板广告(banner)刷新计时器

    oppoAds.customAd_interstitial = null;                               //原生模板广告(插屏)广告组件
    oppoAds.customAd_interstitial_ID = null;                            //原生模板广告(插屏)广告ID
    oppoAds.customAd_interstitial_isShow = false;                       //原生模板广告(插屏)是否正在展示
    oppoAds.customAd_interstitialTimer = null;                          //原生模板广告(插屏)计时器
    ////////////////////////////////////////////////////////////////////////////////////////////////
    //icon
    oppoAds.nativeAd_icon = null;                                        //原生自渲染(icon)广告组件
    oppoAds.nativeAd_icon_ID = null;                                    //原生自渲染(icon)广告参数
    oppoAds.nativeAd_icon_JS = null;                                    //原生自渲染(icon)广告组件脚本
    ////////////////////////////////////////////////////////////////////////////////////////////////
    //九宫格
    oppoAds.gamePortalAd = null;                                        //原生自渲染(icon)广告组件
    oppoAds.gamePortalAd_ID = null;                                     //原生自渲染(icon)广告参数
    ////////////////////////////////////////////////////////////////////////////////////////////////
    oppoAds.native_video_Timer = null;
    oppoAds.Ad_Index = -1;
    oppoAds.closeNative = false;

    class deskTop extends deskTopUI {

    	constructor() {
    		super();
    	}

    	onEnable() {
    		this.width = Laya.stage.width;
    		this.height = Laya.stage.height;
    		this.zOrder = 999;

    		this.addIconBtn.on(Laya.Event.CLICK, this, this.addIcon);
    		this.moreGameBtn.on(Laya.Event.CLICK, this, this.moreGame);

    		if (Laya.Browser.onVVMiniGame) {
    			this.addIconBtn.visible = false;
    			if (LabelUtils.getLabel("tjzm")) {
    				var desktopiconsj = LabelUtils.getValue("tjzmsj", 30);
    				console.log("添加桌面时间:" + desktopiconsj);
    				setTimeout(function () {
    					this.Init();
    				}.bind(this), desktopiconsj * 1000);
    			}
    		} else if (Laya.Browser.onQGMiniGame) {
    			this.Init();
    		} else {
    			this.addIconBtn.visible = false;
    		}

    		this.addIconBtn.visible = false;
    		this.moreGameBtn.visible = false;
    	}

    	Init() {
    		this.addIconBtn.visible = true;
    		var self = this;
    		qg.hasShortcutInstalled({
    			success: function (res) {
    				if (res == false) {
    					self.addIconBtn.visible = true;
    				} else {
    					console.log("OPPO:判断桌面图标存在");
    					self.addIconBtn.visible = false;
    				}
    			},
    			fail: function (err) {
    				console.log("OPPO:判断桌面图标失败" + JSON.stringify(err));
    			},
    			complete: function () { }
    		});
    		Laya.timer.loop(30000, this, function () {
    			qg.hasShortcutInstalled({
    				success: function (res) {
    					if (res == false) {
    						self.addIconBtn.visible = true;
    					} else {
    						self.addIconBtn.visible = false;
    					}
    				},
    				fail: function (err) { },
    				complete: function () { }
    			});
    		});
    	}

    	moreGame() {
    		console.log("点击更多游戏");
    		if (Laya.Browser.onQGMiniGame) {
    			oppoAds.showGamePortalAd();
    		} else if (Laya.Browser.onVVMiniGame) {
    			if (qg.createBoxPortalAd) {
    				OVHAdsManager.closeBanner();
    				OVHAdsManager.closeGameBannerAd();
    				if (OVHAdsManager.gamePortalAd1 != null) {
    					OVHAdsManager.gamePortalAd1.show().then(function () {
    						console.log('show success');
    					}).catch(function (error) {
    						console.log('show fail with:' + error.errCode + ',' + error.errMsg);
    						OVHAdsManager.gamePortalAd1 = null;
    					});
    					return;
    				}
    				var marginTop = 0;
    				switch (OVHAdsManager.orientation) {
    					case "horizontal":
    						marginTop = 500;
    						break;
    					case "vertical":
    						marginTop = 100;
    						break;
    				}
    				OVHAdsManager.gamePortalAd1 = qg.createBoxPortalAd({
    					posId: OVHAdsManager.posID5,
    					image: '',
    					marginTop: marginTop
    				});
    				OVHAdsManager.gamePortalAd1.onError(function (err) {
    					console.log("按钮盒子九宫格广告加载失败", JSON.stringify(err));
    					OVHAdsManager.gamePortalAd1 = null;
    					qg.showToast({
    						message: '努力加载中，请稍后再试~',
    						duration: 0
    					});
    				});
    				OVHAdsManager.gamePortalAd1.onClose(function () {
    					OVHAdsManager.isShowGamePortalAd = false;
    				});
    				// 广告数据加载成功后展示
    				OVHAdsManager.gamePortalAd1.show().then(function () {
    					console.log('show success');
    				});
    				OVHAdsManager.gamePortalAd1.onShow(function (err) {
    					OVHAdsManager.isShowGamePortalAd = true;
    				});
    			} else {
    				console.log('暂不支持互推盒子相关 API');
    			}
    		}
    	}

    	addIcon() {
    		console.log("点击添加");
    		if (Laya.Browser.onQGMiniGame || Laya.Browser.onVVMiniGame) {
    			var self = this;
    			qg.installShortcut({
    				success: function () {
    					console.log("创建桌面图标成功");
    					self.addIconBtn.visible = false;
    					// 执行用户创建图标奖励
    				},
    				fail: function (err) {
    					self.addIconBtn.visible = false;
    					console.log("创建桌面图标失败:", JSON.stringify(err));
    					if (Laya.Browser.onVVMiniGame) {
    						qg.showToast({
    							message: '添加失败，请稍后再试~',
    							duration: 0
    						});
    					} else if (Laya.Browser.onQGMiniGame) {
    						qg.showToast({
    							title: '添加失败，请稍后再试~',
    							icon: 'none',
    							duration: 2000
    						});
    					}
    				},
    				complete: function () { }
    			});
    		}
    	}

    	onDisable() {
    	}
    }

    class GamePortalAdUI extends GamePortalAdUIUI {

    	constructor() {
    		super();
    	}

    	onEnable() {
    		console.log("GamePortalAdUI");

    		OVHAdsManager.SDKUtilGamePortalAdUI = this;
    		this.width = Laya.stage.width;
    		this.height = Laya.stage.height;
    		this.zOrder = 999;
    		this.closeBtn.on(Laya.Event.CLICK, this, this.clickClose);

    		var marginTop = 0;
    		switch (OVHAdsManager.orientation) {
    			case "horizontal":
    				marginTop = 100;
    				break;
    			case "vertical":
    				marginTop = 400;
    				break;
    		}
    		this.closeBtn.top = marginTop;
    		this.bg.top = marginTop - 10;
    		this.bg.bottom = marginTop - 10;
    	}

    	clickClose() {
    		this.destroy();
    	}

    	Destroy() {
    		this.destroy();
    	}

    	onDisable() {
    		OVHAdsManager.SDKUtilGamePortalAdUI = null;
    	}
    }

    class JKGG extends JKGGUI {

    	constructor(closeCallback) {
    		super();
    		this.closeCallback = closeCallback;
    	}

    	onEnable() {
    		console.log("JKGG");

    		this.width = Laya.stage.width;
    		this.height = Laya.stage.height;
    		this.zOrder = 997;

    		this.RZZZR.text = OVHAdsManager.ConstantsJSON["RZZZR"];
    		this.ZZH.text = OVHAdsManager.ConstantsJSON["ZZH"];

    		this.noticeBtn.on(Laya.Event.CLICK, this, this.showAgeNotice);

    		setTimeout(() => {
    			this.destroy();
    			if (this.closeCallback != null) {
    				this.closeCallback();
    			}
    		}, 3000);
    	}

    	showAgeNotice() {
    		OVHAdsManager.showAgeNotice();
    	}

    	onDisable() {
    	}
    }

    class AgeNotice extends AgeNoticeUI {

    	constructor() {
    		super();
    	}

    	onEnable() {
    		console.log("AgeNotice");

    		this.width = Laya.stage.width;
    		this.height = Laya.stage.height;
    		this.zOrder = 9999;

    		this.closeBtn.on(Laya.Event.CLICK, this, function () {
    			this.destroy();
    		});
    	}

    	onDisable() {
    	}
    }

    class yszc extends yszcUI {

    	constructor(callback = null) {
    		super();
    		this.callback = callback;
    	}

    	onEnable() {
    		console.log("yszc");

    		this.width = Laya.stage.width;
    		this.height = Laya.stage.height;
    		this.zOrder = 9998;
    		console.log("this.width:" + this.width);
    		console.log("this.height:" + this.height);
    		if (this.width > this.height) {
    			this.YSSMstr1.visible = true;
    			this.YSSMstr2.visible = false;
    		} else {
    			this.YSSMstr1.visible = false;
    			this.YSSMstr2.visible = true;
    		}
    		this.YSSMstr1.on(Laya.Event.MOUSE_DOWN, this, this.startScrollText);
    		this.YSSMstr2.on(Laya.Event.MOUSE_DOWN, this, this.startScrollText);

    		this.dh1.text = OVHAdsManager.ConstantsJSON["Tel"];
    		this.gs1.text = OVHAdsManager.ConstantsJSON["Company"];
    		this.rq1.text = OVHAdsManager.ConstantsJSON["Date"];

    		this.dh2.text = OVHAdsManager.ConstantsJSON["Tel"];
    		this.gs2.text = OVHAdsManager.ConstantsJSON["Company"];
    		this.rq2.text = OVHAdsManager.ConstantsJSON["Date"];

    		this.jujue.on(Laya.Event.CLICK, this, function () {
    			this.destroy();
    			this.quitGame();
    		});

    		this.queding.on(Laya.Event.CLICK, this, function () {
    			this.destroy();
    			if (this.callback) {
    				this.callback();
    			}
    		});

    		this.closeBtn.on(Laya.Event.CLICK, this, function () {
    			this.destroy();
    		});
    		this.closeBtn1.on(Laya.Event.CLICK, this, function () {
    			this.destroy();
    		});
    		if (OVHAdsManager.YSZCBtn) {
    			this.jujue.visible = true;
    			this.queding.visible = true;
    			this.closeBtn.visible = false;
    			this.closeBtn1.visible = false;
    		} else {
    			this.jujue.visible = false;
    			this.queding.visible = false;
    			this.closeBtn.visible = true;
    			this.closeBtn1.visible = true;
    		}

    		this.destroy();
    		if (this.callback) {
    			this.callback();
    		}
    	}


    	quitGame() {
    		qg.exitApplication({
    			success: function () {
    				console.log("exitApplication success");
    			},
    			fail: function () {
    				console.log("exitApplication fail");
    			},
    			complete: function () {
    				console.log("exitApplication complete");
    			}
    		});
    	}

    	onDisable() {

    	}

    	startScrollText() {
    		if (this.width > this.height) {
    			this.prevY = this.YSSMstr1.mouseY;
    		} else {
    			this.prevY = this.YSSMstr2.mouseY;
    		}
    		Laya.stage.on(Laya.Event.MOUSE_MOVE, this, this.scrollText);
    		Laya.stage.on(Laya.Event.MOUSE_UP, this, this.finishScrollText);
    	}

    	/* 停止滚动文本 */
    	finishScrollText() {
    		Laya.stage.off(Laya.Event.MOUSE_MOVE, this, this.scrollText);
    		Laya.stage.off(Laya.Event.MOUSE_UP, this, this.finishScrollText);
    	}

    	/* 鼠标滚动文本 */
    	scrollText() {
    		if (this.width > this.height) {
    			var nowY = this.YSSMstr1.mouseY;
    			this.YSSMstr1.y -= (this.prevY - nowY) / 2;
    			this.prevY = nowY;
    		} else {
    			var nowY = this.YSSMstr2.mouseY;
    			this.YSSMstr2.y -= (this.prevY - nowY) / 2;
    			this.prevY = nowY;
    		}
    	}
    }

    class OVHAdsManager {
    	/**
    	 * 初始化SDK
    	 * @param url 参数文件所在地址
    	 * @param callback 初始化回调
    	 * @param loadingScene 首页面加载场景文件
    	 */
    	static Init(url, callback = null, loadingScene = null) {
    		if (loadingScene != null) {
    			loadingScene.visible = false;
    			setTimeout(() => {
    				loadingScene.visible = true;
    			}, 100);
    		}
    		var config = [
    			url,
    		];
    		Laya.loader.load(config, Laya.Handler.create(this, function () {
    			OVHAdsManager.ConstantsJSON = Laya.loader.getRes(config[0]);
    			console.log("ConstantsJSON:", JSON.stringify(OVHAdsManager.ConstantsJSON));
    			GameManager_Collection.GameName = OVHAdsManager.ConstantsJSON["GameName"];
    			GameManager_Collection.CDNFileName = OVHAdsManager.ConstantsJSON["CDNFileName"];
    			GameManager_Collection.FileName = OVHAdsManager.ConstantsJSON["CDNFileName"] + "101";
    			GameManager_Collection.timeStamp = OVHAdsManager.ConstantsJSON["timeStamp"];
    			LabelUtils.initLabel(OVHAdsManager.ConstantsJSON["LabelID"]);
    			if (loadingScene != null) {
    				OVHAdsManager.showJKGG(callback);
    			} else if (callback != null) {
    				callback();
    			}

    			if (Laya.Browser.onQGMiniGame) {
    				setTimeout(() => {
    					oppoAds.Init(OVHAdsManager.ConstantsJSON["customAd_banner_ID"], OVHAdsManager.ConstantsJSON["customAd_interstitial_ID"], OVHAdsManager.ConstantsJSON["nativeAd_icon_ID"], OVHAdsManager.ConstantsJSON["VideoAd_ID"], OVHAdsManager.ConstantsJSON["gamePortalAd_ID"]);
    				}, 1000);
    			}
    		}.bind(this)));
    	}

    	/**
    	 * 展示健康公告
    	 * @param callback 展示完成回调
    	 */
    	static showJKGG(callback) {
    		console.log(callback);
    		Laya.stage.addChild(new JKGG(callback));
    	}

    	/**
    	 * 展示适龄提示
    	 */
    	static showAgeNotice() {
    		console.log("展示适龄提示");
    		Laya.stage.addChild(new AgeNotice());
    	}

    	/**
    	 * 随机一个数
    	 * @param min 最小值
    	 * @param max 最大值
    	 * @returns 返回随机数
    	 */
    	static random(min, max) {
    		return Math.floor(Math.random() * (max + 1 - min)) + min;
    	}

    	/**
    	 * 初始化展示广告
    	 */
    	static InitConstants() {
    		if (Laya.Browser.onVVMiniGame) {
    			OVHAdsManager.InitLabel(OVHAdsManager.ConstantsJSON["LabelID"], OVHAdsManager.ConstantsJSON["platform"], OVHAdsManager.ConstantsJSON["CustomID"], OVHAdsManager.ConstantsJSON["InterstitialID"], OVHAdsManager.ConstantsJSON["BannerID"], OVHAdsManager.ConstantsJSON["VideoID"], OVHAdsManager.ConstantsJSON["GamePortalID"], OVHAdsManager.ConstantsJSON["GameBannerID"], "bottom");
    			OVHAdsManager.InitCustomAD();
    		} else if (Laya.Browser.onQGMiniGame) {
    			var s = Laya.LocalStorage.getItem("OVHManagerData" + OVHAdsManager.version);
    			var day = new Date().getDate();
    			if (s) {
    				OVHAdsManager.UserData = JSON.parse(s);
    				//新的一天
    				if (OVHAdsManager.UserData.curDay != day) {
    					console.log("新的一天！！！！");
    					OVHAdsManager.UserData.curDay = day;
    					OVHAdsManager.SetData("ADTimes", 0);
    				}
    			} else {
    				OVHAdsManager.SaveData();
    				OVHAdsManager.UserData.curDay = day;
    			}
    			console.log("OVHAdsManager.UserData         ", OVHAdsManager.UserData);

    			OVHAdsManager.pkgName = OVHAdsManager.ConstantsJSON["pkgName"];
    			OVHAdsManager.orientation = GameConfig.screenMode;
    			console.log("=================================================包名========================================================");
    			console.log("pkgName:" + OVHAdsManager.pkgName);
    			console.log("================================================横竖屏=======================================================");
    			console.log("orientation:" + GameConfig.screenMode);
    			console.log("=============================================================================================================");

    			setTimeout(() => {
    				Laya.stage.addChild(new deskTop());
    				OCPX.Init(OVHAdsManager.pkgName, function () {
    					oppoAds.InitShowAD();
    				}.bind(this));
    			}, 1000);
    		}
    	}

    	static InitLabel(labelName, platform, customID, interstitialID, bannerID = null, videoID = null, GamePortalID = null, GameBannerID = null, site = "bottom") {//labelName：标签名   platform：渠道(vivo oppo huawei)    customID：参数1   interstitialID：参数2/vivo渠道插屏参数   bannerID：vivo渠道banner参数   videoID：vivo渠道激励视频参数  site:banner位置（bottom top）
    		OVHAdsManager.platform = platform;
    		OVHAdsManager.posID1 = customID;
    		OVHAdsManager.posID2 = interstitialID;
    		OVHAdsManager.posID3 = bannerID;
    		OVHAdsManager.posID4 = videoID;
    		OVHAdsManager.posID5 = GamePortalID;
    		OVHAdsManager.posID6 = GameBannerID;
    		OVHAdsManager.orientation = GameConfig.screenMode;
    		OVHAdsManager.site = site;
    		console.log("===============================================广告参数======================================================");
    		console.log("platform:" + OVHAdsManager.platform);
    		console.log("customID:" + OVHAdsManager.posID1);
    		console.log("interstitialID(oppo渠道该参数和customID一致):" + OVHAdsManager.posID2);
    		console.log("bannerID:" + OVHAdsManager.posID3);
    		console.log("videoID:" + OVHAdsManager.posID4);
    		console.log("GamePortalID:" + OVHAdsManager.posID5);
    		console.log("GameBannerID:" + OVHAdsManager.posID6);
    		console.log("================================================横竖屏=======================================================");
    		console.log("orientation:" + GameConfig.screenMode);
    		console.log("=============================================================================================================");

    		// if (OVHAdsManager.platform != null) {
    		// 	qg.onShow(function () {
    		// 		console.log('前台运行');
    		// 		if (OVHAdsManager.SDKUtil != null) {
    		// 			OVHAdsManager.SDKUtil.BaoGuangShangBao();
    		// 		}
    		// 		if (OVHAdsManager.SDKUtilIcon != null) {
    		// 			OVHAdsManager.SDKUtilIcon.BaoGuangShangBao();
    		// 		}
    		// 		if (Laya.Browser.onQGMiniGame) {
    		// 			if (OVHAdsManager.closeNative) {
    		// 				console.log("点击原生跳转返回游戏");
    		// 				OVHAdsManager.closeNative = false;
    		// 				OVHAdsManager.TimeInterval();
    		// 			}
    		// 		}
    		// 	});
    		// 	qg.onHide(function () {
    		// 		console.log('后台运行');
    		// 	});
    		// }

    		// OVHAdsManager.InitVideoAd();

    		// setTimeout(() => {
    		// 	Laya.stage.addChild(new deskTop());
    		// 	if (LabelUtils.getLabel("ys")) {
    		// 		var tlsj = LabelUtils.getValue("yskqsj", 60);
    		// 		OVHAdsManager.gailv = LabelUtils.getValue("yswd", 0);
    		// 		OVHAdsManager.ysgl = LabelUtils.getValue("ysgl", 100);
    		// 		OVHAdsManager.tpgl = LabelUtils.getValue("tpgl", 100);

    		// 		console.log("套路时间为:" + tlsj + "              概率为: " + OVHAdsManager.gailv + "        原生概率为: " + OVHAdsManager.ysgl);

    		// 		OVHAdsManager.tlsjTime = setTimeout(() => {
    		// 			if (Laya.Browser.onVVMiniGame) {
    		// 				if (OVHAdsManager.random(1, 100) <= OVHAdsManager.ysgl) {
    		// 					if (!OVHAdsManager.isShowGamePortalAd) {
    		// 						OVHAdsManager.showCustomAd();
    		// 					} else {
    		// 						console.log("当前页面有九宫格广告显示");
    		// 					}
    		// 				} else {
    		// 					if (!OVHAdsManager.isShowGamePortalAd) {
    		// 						OVHAdsManager.showGamePortalAd();
    		// 					} else {
    		// 						console.log("当前页面有九宫格广告显示");
    		// 					}
    		// 				}
    		// 			}
    		// 			OVHAdsManager.TimeInterval();
    		// 		}, tlsj * 1000);
    		// 	}

    		// 	if (LabelUtils.getLabel("tp")) {
    		// 		var tpkqsj = LabelUtils.getValue("tpkqsj", 60);
    		// 		setTimeout(() => {
    		// 			OVHAdsManager.startTP = true;
    		// 			OVHAdsManager.BannerTimeInterval();
    		// 		}, tpkqsj * 1000);
    		// 	}
    		// }, 1000);
    	}
    	//////////////////////////////////////////////////////////////
    	static NativeAd() {//显示原生
    		// if (OVHAdsManager.platform == null) {
    		// 	console.log("平台未定义，请先定义平台");
    		// } else {
    		// 	switch (OVHAdsManager.platform) {
    		// 		case "oppo":
    		// 			OVHAdsManager.showNative("ADSDK/oppoNative");
    		// 			break;
    		// 		case "vivo":
    		// 			OVHAdsManager.showNative("ADSDK/vivoNative");
    		// 			break;
    		// 		case "huawei":
    		// 			OVHAdsManager.showNative("ADSDK/huaweiNative");
    		// 			break;
    		// 	}
    		// }
    	}

    	static closeNativeAd() {//关闭原生
    		// if (OVHAdsManager.platform == null) {
    		// 	console.log("平台未定义，请先定义平台");
    		// } else {
    		// 	if (OVHAdsManager.SDKUtil != null) {
    		// 		OVHAdsManager.SDKUtil.hideAD();
    		// 	}
    		// }
    	}

    	static InitNative() {
    		// if (OVHAdsManager.NativeChaping != null) {
    		// 	if (OVHAdsManager.platform != "vivo") {
    		// 		OVHAdsManager.NativeChaping.destroy();
    		// 	}
    		// 	OVHAdsManager.NativeChaping = null;
    		// 	OVHAdsManager.nativeDatas = null;
    		// }
    		// OVHAdsManager.NativeChaping = qg.createNativeAd({
    		// 	adUnitId: OVHAdsManager.posID1,
    		// });
    		// OVHAdsManager.NativeChaping.onLoad(function (res) {
    		// 	console.log(OVHAdsManager.platform + "原生广告加载成功");
    		// 	OVHAdsManager.nativeDatas = res.adList[0];
    		// 	OVHAdsManager.NativeChaping.offError();
    		// 	OVHAdsManager.NativeChaping.offLoad();
    		// });
    		// OVHAdsManager.NativeChaping.load();
    		// OVHAdsManager.NativeChaping.onError((e) => {
    		// 	console.error(OVHAdsManager.platform + ' load native error:' + JSON.stringify(e));
    		// 	OVHAdsManager.NativeChaping.offError();
    		// 	OVHAdsManager.NativeChaping.offLoad();
    		// 	OVHAdsManager.nativeDatas = null;
    		// });
    	}

    	static showNative(sceneName) {
    		// if (OVHAdsManager.SDKUtil != null) {
    		// 	return;
    		// }
    		// if (OVHAdsManager.nativeDatas != null) {
    		// 	console.log(OVHAdsManager.platform + "原生广告显示成功");
    		// 	var _adId = OVHAdsManager.nativeDatas.adId;
    		// 	var tempSceneName = sceneName + ".scene";
    		// 	// Laya.Scene.open(tempSceneName, false, OVHAdsManager.nativeDatas);
    		// 	// Laya.stage.addChild(new oppoNativeJS())
    		// 	OVHAdsManager.NativeChaping.reportAdShow({
    		// 		adId: _adId
    		// 	}); //广告曝光上报
    		// } else {
    		// 	console.error(OVHAdsManager.platform + ' show native error');
    		// 	OVHAdsManager.showVideoAd();
    		// 	OVHAdsManager.InitNative();
    		// }
    	}

    	static showNativeIcon(top = 200, right = 20) {//显示原生icon （top：靠上距离 right:靠右距离）
    		// if (OVHAdsManager.platform == null) {
    		// 	console.log("平台未定义，请先定义平台");
    		// } else {
    		// 	if (Laya.Browser.onVVMiniGame || Laya.Browser.onQGMiniGame) {
    		// 		console.log("请勿使用原生自渲染icon");
    		// 	} else {
    		// 		if (OVHAdsManager.SDKUtilIcon != null) {
    		// 			return;
    		// 		}
    		// 		OVHAdsManager.layout = [top, right];
    		// 		if (OVHAdsManager.NativeIcon != null) {
    		// 			if (OVHAdsManager.platform != "vivo") {
    		// 				OVHAdsManager.NativeIcon.destroy();
    		// 			}
    		// 			OVHAdsManager.NativeIcon = null;
    		// 		}
    		// 		OVHAdsManager.NativeIcon = qg.createNativeAd({
    		// 			adUnitId: OVHAdsManager.posID2,
    		// 		});

    		// 		OVHAdsManager.NativeIcon.onLoad(function (res) {
    		// 			console.log(OVHAdsManager.platform + "原生icon加载成功");
    		// 			var nativeDatas = res.adList[0];
    		// 			var _adId = nativeDatas.adId;
    		// 			Laya.Scene.open("ADSDK/nativeIcon.scene", false, nativeDatas);
    		// 			OVHAdsManager.NativeIcon.reportAdShow({
    		// 				adId: _adId
    		// 			}); //广告曝光上报
    		// 			OVHAdsManager.NativeIcon.offError();
    		// 			OVHAdsManager.NativeIcon.offLoad();
    		// 		});

    		// 		OVHAdsManager.NativeIcon.load();
    		// 		OVHAdsManager.NativeIcon.onError((e) => {
    		// 			console.error(OVHAdsManager.platform + 'icon load ad error:' + JSON.stringify(e));
    		// 			OVHAdsManager.NativeIcon.offError();
    		// 			OVHAdsManager.NativeIcon.offLoad();
    		// 		});
    		// 	}
    		// }
    	}
    	/////////////////////////////////////////////////////////////////////////////////////////
    	// static closeNativeIcon() {
    	//     if (OVHAdsManager.platform == null) {
    	//         console.log("平台未定义，请先定义平台");
    	//     } else {
    	//         if (OVHAdsManager.SDKUtilIcon != null) {
    	//             OVHAdsManager.SDKUtilIcon.quitBtn();
    	//         }
    	//     }
    	// }

    	static showYSSM(callback = null, showBtn = false) {
    		OVHAdsManager.YSZCBtn = showBtn;
    		Laya.stage.addChild(new yszc(callback));
    	}

    	static InitCustomAD() {
    		// if (Laya.Browser.onVVMiniGame) {
    		// 	if (qg.createCustomAd) {
    		// 		if (OVHAdsManager.NativeChaping != null) {
    		// 			OVHAdsManager.NativeChaping.destroy();
    		// 			OVHAdsManager.NativeChaping = null;
    		// 		}
    		// 		var data = qg.getSystemInfoSync();
    		// 		var windwoWidth = data.safeArea.width;
    		// 		var windwoHeight = data.safeArea.height;
    		// 		OVHAdsManager.NativeChaping = qg.createCustomAd({
    		// 			posId: OVHAdsManager.posID1,
    		// 			style: {
    		// 				left: windwoWidth / 2 - 1280 / 2 + 100,
    		// 				top: windwoHeight / 2 - 720 / 2 - 10
    		// 			}
    		// 		});
    		// 		OVHAdsManager.NativeChaping.onLoad(() => {
    		// 			console.log("原生广告加载成功");
    		// 		});
    		// 		OVHAdsManager.NativeChaping.onError(err => {
    		// 			console.log("原生广告加载失败", JSON.stringify(err));
    		// 			OVHAdsManager.NativeChaping = null;
    		// 		});
    		// 		OVHAdsManager.NativeChaping.onClose(() => {
    		// 			OVHAdsManager.isShowCustom = false;
    		// 			OVHAdsManager.InitCustomAD();
    		// 			OVHAdsManager.TimeInterval();
    		// 		});
    		// 	}
    		// } else {
    		// 	console.log("非VIVO平台，请勿使用原生模板广告");
    		// }
    	}

    	static showCustomAd() {
    		// if (Laya.Browser.onVVMiniGame) {
    		// 	if (!OVHAdsManager.isShowGamePortalAd && !OVHAdsManager.isShowCustom) {
    		// 		if (OVHAdsManager.NativeChaping != null) {
    		// 			OVHAdsManager.isShowCustom = true;
    		// 			OVHAdsManager.NativeChaping.show().then(() => {
    		// 				console.log('原生广告展示完成');
    		// 				OVHAdsManager.isShowCustom = true;
    		// 				OVHAdsManager.closeBanner();
    		// 				OVHAdsManager.closeGameBannerAd();
    		// 				OVHAdsManager.clearTimeInterval();
    		// 			}).catch((err) => {
    		// 				console.log('原生广告展示失败:', JSON.stringify(err));
    		// 				OVHAdsManager.isShowCustom = false;
    		// 				OVHAdsManager.showVideoAd();
    		// 				OVHAdsManager.InitCustomAD();
    		// 			});
    		// 		} else {
    		// 			console.log('原生广告加载失败');
    		// 			OVHAdsManager.showVideoAd();
    		// 			OVHAdsManager.InitCustomAD();
    		// 		}
    		// 	} else {
    		// 		console.log("当前页面有原生或者插屏显示");
    		// 	}
    		// } else {
    		// 	console.log("非VIVO平台，请勿使用原生模板广告");
    		// }
    	}

    	///////////////////////////banner///////////////////////////////
    	static showBanner() {
    		// if (OVHAdsManager.isShowGamePortalAd || OVHAdsManager.SDKUtil != null || OVHAdsManager.isShowCustom) {
    		// 	return;
    		// }
    		// if (Laya.Browser.onVVMiniGame) {
    		// 	if (OVHAdsManager.bannerAd != null) {
    		// 		OVHAdsManager.bannerAd.destroy();
    		// 		OVHAdsManager.bannerAd = null;
    		// 	}
    		// 	var tpjg = LabelUtils.getValue("tpjg", 60);
    		// 	console.log("Banner时间为:" + tpjg);
    		// 	if (OVHAdsManager.site == "bottom") {
    		// 		OVHAdsManager.bannerAd = qg.createBannerAd({
    		// 			adUnitId: OVHAdsManager.posID3,
    		// 			style: {},
    		// 			adIntervals: tpjg,
    		// 		});
    		// 	} else if (OVHAdsManager.site == "top") {
    		// 		OVHAdsManager.bannerAd = qg.createBannerAd({
    		// 			adUnitId: OVHAdsManager.posID3,
    		// 			adIntervals: tpjg,
    		// 		});
    		// 	}
    		// 	OVHAdsManager.bannerAd.onError((err) => {
    		// 		console.log('banner报错 ' + JSON.stringify(err));
    		// 		OVHAdsManager.isShowBanner = false;
    		// 		if (OVHAdsManager.TPFlag) {
    		// 			OVHAdsManager.TPFlag = false;
    		// 			OVHAdsManager.showGameBannerAd();
    		// 		}
    		// 	});
    		// 	OVHAdsManager.bannerAd.onLoad(() => {
    		// 		console.log('banner 加载成功');
    		// 		OVHAdsManager.bannerAd.show().then(function () {
    		// 			console.log("banner show success:");
    		// 			OVHAdsManager.isShowBanner = true;
    		// 			OVHAdsManager.closeGameBannerAd();
    		// 		}).catch(() => {
    		// 			console.log("banner show err:" + JSON.stringify(err));
    		// 			OVHAdsManager.isShowBanner = false;
    		// 			if (OVHAdsManager.TPFlag) {
    		// 				OVHAdsManager.TPFlag = false;
    		// 				OVHAdsManager.showGameBannerAd();
    		// 			}
    		// 		});
    		// 	});
    		// 	OVHAdsManager.bannerAd.onClose(() => {

    		// 	});
    		// }
    	}

    	static closeBanner() {
    		// if (OVHAdsManager.bannerAd != null) {
    		// 	OVHAdsManager.bannerAd.hide();
    		// 	OVHAdsManager.isShowBanner = false;
    		// 	console.log("隐藏banner");
    		// }
    	}

    	/**初始化激励视频广告 */
    	static InitVideoAd() {
    		// console.log("初始化激励视频:" + OVHAdsManager.platform);
    		// if (Laya.Browser.onVVMiniGame) {
    		// 	if (OVHAdsManager.rewardedVideoAd != null) {
    		// 		OVHAdsManager.rewardedVideoAd.destroy();
    		// 		OVHAdsManager.rewardedVideoAd = null;
    		// 	}
    		// 	OVHAdsManager.rewardedVideoAd = qg.createRewardedVideoAd({
    		// 		adUnitId: OVHAdsManager.posID4,
    		// 	});
    		// 	OVHAdsManager.rewardedVideoAd.onLoad(function () {
    		// 		console.log("激励视频加载成功");
    		// 		OVHAdsManager.showVideo = true;
    		// 	});
    		// 	OVHAdsManager.rewardedVideoAd.onError(function (err) {
    		// 		console.error("激励视频加载失败" + JSON.stringify(err));
    		// 		OVHAdsManager.showVideo = false;
    		// 	});
    		// 	OVHAdsManager.rewardedVideoAd.onClose(function (res) {
    		// 		OVHAdsManager.rewardedVideoAd.load();
    		// 		OVHAdsManager.TimeInterval();
    		// 		if (res.isEnd) {
    		// 			if (OVHAdsManager.successCallBack) {
    		// 				OVHAdsManager.successCallBack();
    		// 				OVHAdsManager.successCallBack = null;
    		// 			}
    		// 		} else {
    		// 			if (OVHAdsManager.cancelCallBack) {
    		// 				OVHAdsManager.cancelCallBack();
    		// 				OVHAdsManager.cancelCallBack = null;
    		// 			}
    		// 		}
    		// 	});
    		// 	OVHAdsManager.rewardedVideoAd.load();
    		// }
    	}

    	/**显示激励视频广告 */
    	static showVideoAd(successCallBack, errCallBack, cancelCallBack) {
    		// OVHAdsManager.successCallBack = successCallBack;
    		// OVHAdsManager.errCallBack = errCallBack;
    		// OVHAdsManager.cancelCallBack = cancelCallBack;

    		// console.log("OVHAdsManager.showVideo:" + OVHAdsManager.showVideo);
    		// if (OVHAdsManager.showVideo) {
    		// 	if (Laya.Browser.onVVMiniGame) {
    		// 		OVHAdsManager.rewardedVideoAd.show().then(function () {
    		// 			OVHAdsManager.clearTimeInterval();
    		// 		}).catch((err) => {
    		// 			console.log("show video fail:" + JSON.stringify(err));
    		// 			OVHAdsManager.showGamePortalAd();
    		// 			OVHAdsManager.InitVideoAd();
    		// 			if (successCallBack) {
    		// 				if (errCallBack) {
    		// 					errCallBack();
    		// 				}
    		// 				if (Laya.Browser.onVVMiniGame) {
    		// 					qg.showToast({
    		// 						message: '视频加载失败，请稍后再试',
    		// 						duration: 0
    		// 					});
    		// 				}
    		// 			}
    		// 		});
    		// 	}
    		// } else {
    		// 	OVHAdsManager.showGamePortalAd();
    		// 	OVHAdsManager.InitVideoAd();
    		// 	if (successCallBack) {
    		// 		if (errCallBack) {
    		// 			errCallBack();
    		// 		}
    		// 		if (Laya.Browser.onVVMiniGame) {
    		// 			qg.showToast({
    		// 				message: '视频加载失败，请稍后再试',
    		// 				duration: 0
    		// 			});
    		// 		}
    		// 	}
    		// }
    	}

    	static showGamePortalAd(TimeInterval = true) {
    		// if (Laya.Browser.onVVMiniGame) {
    		// 	if (!OVHAdsManager.isShowCustom) {
    		// 		var marginTop = 0;
    		// 		switch (OVHAdsManager.orientation) {
    		// 			case "horizontal":
    		// 				marginTop = 100;
    		// 				break;
    		// 			case "vertical":
    		// 				marginTop = 500;
    		// 				break;
    		// 		}
    		// 		if (qg.createBoxPortalAd) {
    		// 			if (OVHAdsManager.gamePortalAd1 != null) {
    		// 				OVHAdsManager.gamePortalAd1.hide();
    		// 			}
    		// 			OVHAdsManager.gamePortalAd = qg.createBoxPortalAd({
    		// 				posId: OVHAdsManager.posID5,
    		// 				image: '/bg.png',
    		// 				marginTop: marginTop
    		// 			});
    		// 			OVHAdsManager.gamePortalAd.onError(function (err) {
    		// 				console.log("盒子九宫格广告加载失败", JSON.stringify(err));
    		// 			});
    		// 			OVHAdsManager.gamePortalAd.onClose(function () {
    		// 				OVHAdsManager.closeGamePortalAd();
    		// 				OVHAdsManager.TimeInterval();
    		// 			});
    		// 			// 广告数据加载成功后展示
    		// 			OVHAdsManager.gamePortalAd.onLoad(function () {
    		// 				console.log('互推盒子九宫格广告加载成功');
    		// 				OVHAdsManager.closeBanner();
    		// 				OVHAdsManager.closeGameBannerAd();
    		// 				OVHAdsManager.gamePortalAd.show().then(function () {
    		// 					console.log('show success');
    		// 					// Laya.Scene.open("ADSDK/GamePortalAdUI.scene", false);
    		// 					Laya.stage.addChild(new GamePortalAdUI());
    		// 					OVHAdsManager.isShowGamePortalAd = true;
    		// 					OVHAdsManager.clearTimeInterval();
    		// 				});
    		// 			});

    		// 			OVHAdsManager.gamePortalAd.onShow(function (err) {
    		// 				OVHAdsManager.closeBanner();
    		// 				OVHAdsManager.closeGameBannerAd();
    		// 			});
    		// 		} else {
    		// 			console.log('暂不支持互推盒子相关 API');
    		// 		}
    		// 	} else {
    		// 		console.log('当前页面有原生广告显示，不显示九宫格');
    		// 	}
    		// }
    	}

    	static closeGamePortalAd() {
    		// if (Laya.Browser.onVVMiniGame) {
    		// 	if (OVHAdsManager.gamePortalAd != null) {
    		// 		OVHAdsManager.gamePortalAd.destroy();
    		// 		OVHAdsManager.gamePortalAd = null;
    		// 		OVHAdsManager.isShowGamePortalAd = false;
    		// 	}
    		// }
    	}

    	static showGameBannerAd() {
    		// if (OVHAdsManager.isShowGamePortalAd || OVHAdsManager.SDKUtil != null || OVHAdsManager.isShowCustom) {
    		// 	return;
    		// }
    		// if (Laya.Browser.onVVMiniGame) {
    		// 	OVHAdsManager.closeBanner();
    		// 	if (qg.createBoxBannerAd) {
    		// 		if (OVHAdsManager.gameBannerAd != null) {
    		// 			OVHAdsManager.gameBannerAd.destroy();
    		// 			OVHAdsManager.gameBannerAd = null;
    		// 		}
    		// 		OVHAdsManager.gameBannerAd = qg.createBoxBannerAd({
    		// 			posId: OVHAdsManager.posID6
    		// 		});
    		// 		OVHAdsManager.gameBannerAd.onError(function (err) {
    		// 			console.log("盒子横幅广告加载失败", JSON.stringify(err));
    		// 			if (OVHAdsManager.TPFlag) {
    		// 				OVHAdsManager.TPFlag = false;
    		// 				OVHAdsManager.showBanner();
    		// 			}
    		// 		});
    		// 		OVHAdsManager.gameBannerAd.onLoad(function () {
    		// 			console.log('互推盒子横幅广告加载成功');
    		// 			OVHAdsManager.gameBannerAd.show().then(function () {
    		// 				console.log('show success');
    		// 				OVHAdsManager.isShowGameBannerAd = true;
    		// 			}).catch((err) => {
    		// 				console.log('show fail:' + JSON.stringify(err));
    		// 				if (OVHAdsManager.TPFlag) {
    		// 					OVHAdsManager.TPFlag = false;
    		// 					OVHAdsManager.showBanner();
    		// 				}
    		// 			});
    		// 		});
    		// 	} else {
    		// 		console.log('暂不支持互推盒子相关 API');
    		// 	}
    		// }
    	}

    	static closeGameBannerAd() {
    		// if (Laya.Browser.onVVMiniGame) {
    		// 	OVHAdsManager.isShowGameBannerAd = false;
    		// 	if (OVHAdsManager.gameBannerAd != null) {
    		// 		OVHAdsManager.gameBannerAd.hide();
    		// 	}
    		// 	console.log('gameBannerAd hide success');
    		// }
    	}

    	static clearTimeInterval() {
    		// if (OVHAdsManager.sjTime != null) {
    		// 	console.log("清除计时器");
    		// 	clearInterval(OVHAdsManager.sjTime);
    		// 	OVHAdsManager.sjTime = null;
    		// }
    	}

    	static TimeInterval() {
    		// if (OVHAdsManager.sjTime != null) {
    		// 	clearInterval(OVHAdsManager.sjTime);
    		// 	OVHAdsManager.sjTime = null;
    		// }
    		// console.log("重新开始计时");
    		// var sj = LabelUtils.getValue("ysjg", 30);
    		// OVHAdsManager.sjTime = setInterval(() => {
    		// 	if (Laya.Browser.onVVMiniGame) {
    		// 		if (OVHAdsManager.random(1, 100) <= OVHAdsManager.ysgl) {
    		// 			if (!OVHAdsManager.isShowGamePortalAd) {
    		// 				OVHAdsManager.showCustomAd();
    		// 			} else {
    		// 				console.log("当前页面有九宫格广告显示");
    		// 			}
    		// 		} else {
    		// 			if (!OVHAdsManager.isShowGamePortalAd) {
    		// 				OVHAdsManager.showGamePortalAd();
    		// 			} else {
    		// 				console.log("当前页面有九宫格广告显示");
    		// 			}
    		// 		}
    		// 	}
    		// }, sj * 1000);
    	}

    	static BannerTimeInterval() {
    		// if (OVHAdsManager.startTP) {
    		// 	OVHAdsManager.TPFlag = true;
    		// 	if (OVHAdsManager.random(1, 100) <= OVHAdsManager.tpgl) {
    		// 		OVHAdsManager.showBanner();
    		// 	} else {
    		// 		OVHAdsManager.showGameBannerAd();
    		// 	}

    		// 	if (OVHAdsManager.BannerTimer != null) {
    		// 		console.log("清除banner计时器");
    		// 		clearInterval(OVHAdsManager.BannerTimer);
    		// 		OVHAdsManager.BannerTimer = null;
    		// 	}
    		// 	var tpjg = LabelUtils.getValue("tpjg", 60);
    		// 	OVHAdsManager.BannerTimer = setInterval(() => {
    		// 		OVHAdsManager.TPFlag = true;
    		// 		if (OVHAdsManager.random(1, 100) <= OVHAdsManager.tpgl) {
    		// 			OVHAdsManager.showBanner();
    		// 		} else {
    		// 			OVHAdsManager.showGameBannerAd();
    		// 		}
    		// 	}, tpjg * 1000);
    		// } else {
    		// 	console.log("还没有到banner开启时间");
    		// }
    	}


    	static SaveData() {
    		var data = JSON.stringify(OVHAdsManager.UserData);
    		Laya.LocalStorage.setItem("OVHManagerData" + OVHAdsManager.version, data);
    	}
    	static GetData(key) {
    		if (OVHAdsManager.UserData) {
    			if (OVHAdsManager.UserData[key] != null)
    				return OVHAdsManager.UserData[key];
    		}
    		return null;
    	}
    	static SetData(key, val) {
    		OVHAdsManager.UserData[key] = val;
    		OVHAdsManager.SaveData();
    	}
    }
    OVHAdsManager.UserData = {
    	"oppoUpdateFlag": false,
    	"ADTimes": 0,
    };
    OVHAdsManager.version = "0.0.2";

    OVHAdsManager.platform = null;  //      平台
    OVHAdsManager.posID1 = null;    //      原生插屏参数
    OVHAdsManager.posID2 = null;    //      原生icon参数/插屏参数（vivo）
    OVHAdsManager.posID3 = null;    //      banner参数
    OVHAdsManager.posID4 = null;    //      激励视频参数
    OVHAdsManager.posID5 = null;    //      九宫格
    OVHAdsManager.posID6 = null;    //      横幅

    OVHAdsManager.NativeChaping = null;//原生组件
    OVHAdsManager.NativeIcon = null;//原生组件
    OVHAdsManager.InterstitialAd = null;//原生组件
    OVHAdsManager.bannerAd = null;
    OVHAdsManager.SDKUtil = null;
    OVHAdsManager.SDKUtilIcon = null;
    OVHAdsManager.gamePortalAd = null;
    OVHAdsManager.gamePortalAd1 = null;
    OVHAdsManager.gameBannerAd = null;
    OVHAdsManager.rewardedVideoAd = null;

    OVHAdsManager.gailv = 0;
    OVHAdsManager.ysgl = 100;
    OVHAdsManager.tpgl = 100;
    OVHAdsManager.YSZCBtn = false;
    OVHAdsManager.showVideo = false;
    OVHAdsManager.nativeDatas = null;
    OVHAdsManager.site = "bottom";
    OVHAdsManager.TPFlag = false;
    OVHAdsManager.closeNative = false;
    OVHAdsManager.startTP = false;

    OVHAdsManager.tlsjTime = null;
    OVHAdsManager.sjTime = null;
    OVHAdsManager.BannerTimer = null;
    OVHAdsManager.spsjTime = null;

    OVHAdsManager.layout = [];
    OVHAdsManager.ConstantsJSON = null;

    OVHAdsManager.isShowGameBannerAd = false;
    OVHAdsManager.isShowGamePortalAd = false;
    OVHAdsManager.isShowCustom = false;
    OVHAdsManager.isInterstitial = false;
    OVHAdsManager.isShowBanner = false;

    OVHAdsManager.orientation = "vertical"; //horizontal /vertical

    OVHAdsManager.TPAds = [null, null, null, null];
    OVHAdsManager.tpjg = 60;

    OVHAdsManager.pkgName = "";

    OVHAdsManager.successCallBack = null;
    OVHAdsManager.errCallBack = null;
    OVHAdsManager.cancelCallBack = null;

    class GameManager_Collection {
    	/**
    	 * 展示激励视频
    	 * @param {*} successcallback 成功回调
    	 * @param {*} failcallback 失败回调
    	 * @param {*} cancelcallback 取消回调
    	 */
    	static showVideo(successcallback, failcallback, cancelcallback) {
    		// if (Laya.Browser.onVVMiniGame) {
    		//     // OVHAdsManager.showVideoAd(successcallback, failcallback, cancelcallback);
    		//     if (successcallback) {
    		//         successcallback();
    		//     }
    		// } else if (Laya.Browser.onQGMiniGame) {
    		//     // oppoAds.showVideoAd(null, true, successcallback, failcallback, cancelcallback);
    		//     if (successcallback) {
    		//         successcallback();
    		//     }
    		// } else {
    		//     if (successcallback) {
    		//         successcallback();
    		//     }
    		// }

    		//激励
    		if (Laya.Browser.onVVMiniGame || Laya.Browser.onQGMiniGame || Laya.Browser.onHWMiniGame) {
    			console.log("小游戏激励");
    			// successcallback();

    			Advertisement.videoAdverV(successcallback);
    		} else {
    			console.log("网页激励");
    			successcallback();
    		}
    	}

    	/**
    	 * 显示返回主页按钮
    	 */
    	static showBackBtn() {
    		if (GameManager_Collection.gq && GameManager_Collection.BackBtn == null) {
    			console.warn("添加按钮");
    			GameManager_Collection.BackBtn = Laya.stage.addChild(new BackBtn());
    		}
    	}

    	/**
    	 * 隐藏返回主页按钮
    	 */
    	static hideBackBtn() {
    		if (GameManager_Collection.BackBtn) {
    			GameManager_Collection.BackBtn.destroy();
    			GameManager_Collection.BackBtn = null;
    		}
    	}
    }
    GameManager_Collection.clickCallback = null;
    GameManager_Collection.GameConfig = null;
    GameManager_Collection.GameID = 0;
    GameManager_Collection.gq = false;
    GameManager_Collection.BackBtn = null;
    GameManager_Collection.CDNFileName = "XXHMMNQ";
    GameManager_Collection.CDNFileVersion = "1.0.1";
    GameManager_Collection.FileName = "XXHMMNQ101";
    GameManager_Collection.timeStamp = "1685006708";
    GameManager_Collection.GameName = "行星毁灭模拟器";

    class GameData {
    	/**
    	 * 初始化本地数据
    	 * @param successcallback 完成回调
    	 */
    	static InitData(successcallback) {
    		var AccidentData = Laya.LocalStorage.getItem("Accident");
    		if (AccidentData) {
    			console.log("============老用户============");
    			GameData.AccidentData = JSON.parse(AccidentData);
    			var day = new Date().getDate();
    			if (GameData.GetData("curDay") != day) {
    				console.log("============新的一天============");
    				GameData.SetData("curDay", day);
    			}
    		} else {
    			console.log("============新用户============");
    			GameData.SaveData();
    		}
    		var config = [
    			"res/Accident/JSON/car.json",
    		];

    		Laya.loader.load(config, Laya.Handler.create(this, function () {
    			for (var key in config) {
    				GameData.JSONData = Laya.loader.getRes(config[key]);
    			}
    			console.log(GameData.JSONData);
    			successcallback();
    		}));
    	}

    	/**
    	 * 保存数据
    	 */
    	static SaveData() {
    		var AccidentData = JSON.stringify(GameData.AccidentData);
    		Laya.LocalStorage.setItem("Accident", AccidentData);
    	}

    	/**
    	 * 获取数据
    	 * @param key 数据名称
    	 * @returns 返回数据
    	 */
    	static GetData(key) {
    		return GameData.AccidentData[key];
    	}

    	/**
    	 * 设置数据
    	 * @param key 数据名称
    	 * @param value 数据
    	 */
    	static SetData(key, value) {
    		GameData.AccidentData[key] = value;
    		GameData.SaveData();
    	}
    }
    GameData.AccidentData = {
    	"yssm": 0,                                                              //隐私声明
    	"curDay": 0,                                                            //日期
    	"sound": 0,                                                             //声音
    	"Car": [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],    //车辆解锁
    	"ChoseCarID": 1,
    	"road": [],
    	"updateLog": 0,
    };
    GameData.JSONData = null;

    class GameManager {

    	static OpenSound() {
    		Laya.SoundManager.muted = false;
    	}

    	static CloseSound() {
    		Laya.SoundManager.muted = true;
    	}

    	/**
    	* 播放声音
    	* @param name 音频名称
    	* @param loop 循环（1：不循环   2：循环）
    	* @param callback 播放完成回调
    	*/
    	static PlaySound(name, loop = 1, callback = null) {
    		if (GameData.GetData("sound") == 1) {
    			return;
    		}
    		GameManager.stopSound(name);
    		var sn = "res/Accident/Music/" + name + ".mp3";
    		var soundManager = Laya.SoundManager.playSound(sn, loop, Laya.Handler.create(this, () => {
    			GameManager.clearSoundManager(name);
    			if (callback) {
    				callback();
    			}
    		}));
    		GameManager.hasPlayedSoundManager.push(soundManager);
    	}

    	/**
    	* 清除音乐控制器
    	* @param name 音频名称
    	*/
    	static clearSoundManager(name) {
    		var sn = "res/Accident/Music/" + name + ".mp3";
    		for (var key in GameManager.hasPlayedSoundManager) {
    			if (GameManager.hasPlayedSoundManager[key] != null) {
    				if (GameManager.hasPlayedSoundManager[key].url.indexOf(sn) != -1) {
    					GameManager.hasPlayedSoundManager.splice(key, 1);
    				}
    			} else {
    				GameManager.hasPlayedSoundManager.splice(key, 1);
    			}
    		}
    	}

    	/**
    	* 停止播放声音
    	* @param name 音频名称
    	*/
    	static stopSound(name) {
    		var sn = "res/Accident/Music/" + name + ".mp3";
    		for (var key in GameManager.hasPlayedSoundManager) {
    			if (GameManager.hasPlayedSoundManager[key] != null) {
    				if (GameManager.hasPlayedSoundManager[key].url.indexOf(sn) != -1) {
    					GameManager.hasPlayedSoundManager[key].stop();
    				}
    			} else {
    				GameManager.hasPlayedSoundManager.splice(key, 1);
    			}
    		}
    	}

    	/**
    	* 暂停播放声音
    	* @param name 音频名称
    	*/
    	static pauseSound(name) {
    		var sn = "res/Accident/Music/" + name + ".mp3";
    		for (var key in GameManager.hasPlayedSoundManager) {
    			if (GameManager.hasPlayedSoundManager[key] != null) {
    				if (GameManager.hasPlayedSoundManager[key].url.indexOf(sn) != -1) {
    					if (!GameManager.hasPlayedSoundManager[key].isStopped) {
    						// console.log("暂停声音：" + name);
    						GameManager.hasPlayedSoundManager[key].pause();
    					}
    				}
    			} else {
    				GameManager.hasPlayedSoundManager.splice(key, 1);
    			}
    		}
    	}

    	/**
    	* 继续播放声音
    	* @param name 音频名称
    	*/
    	static resumeSound(name) {
    		var sn = "res/Accident/Music/" + name + ".mp3";
    		for (var key in GameManager.hasPlayedSoundManager) {
    			if (GameManager.hasPlayedSoundManager[key] != null) {
    				if (GameManager.hasPlayedSoundManager[key].url.indexOf(sn) != -1) {
    					if (GameManager.hasPlayedSoundManager[key].isStopped) {
    						// console.log("继续声音：" + name);
    						GameManager.hasPlayedSoundManager[key].resume();
    					};
    				}
    			} else {
    				GameManager.hasPlayedSoundManager.splice(key, 1);
    			}
    		}
    	}

    	/**
    	* 播放背景声音
    	* @param name 音频名称
    	*/
    	static PlayMusic(name) {
    		if (GameData.GetData("sound") == 1) {
    			return;
    		}
    		Laya.SoundManager.stopAll();
    		var sn = "res/Accident/Music/" + name + ".mp3";
    		Laya.SoundManager.playMusic(sn, 0);
    		if (GameData.GetData("sound") == 1) {
    			GameManager.CloseSound();
    		}
    	}
    	/**
    	 * 随机一个数
    	 * @param min 最小值
    	 * @param max 最大值
    	 * @returns 返回随机数
    	 */
    	static random(min, max) {
    		return Math.floor(Math.random() * (max + 1 - min)) + min;
    	}

    	static createRay(position1, position2, distance = 10000) {
    		let tmp = new Laya.Vector3(0, 0, 0);
    		Laya.Vector3.subtract(position1, position2, tmp);
    		let dst = new Laya.Vector3(0, 0, 0);
    		Laya.Vector3.normalize(tmp, dst);
    		let _ray = new Laya.Ray(position1, dst);
    		var outHitRusult = new Laya.HitResult();
    		GameManager.Scene.physicsSimulation.rayCast(_ray, outHitRusult, distance);

    		if (outHitRusult.succeeded) {
    			var name = outHitRusult.collider.owner.name;
    			// console.log(outHitRusult);
    			return outHitRusult;
    		}
    		return null;
    	}

    	static createRay_List(position1, position2) {
    		let tmp = new Laya.Vector3(0, 0, 0);
    		Laya.Vector3.subtract(position1, position2, tmp);
    		let dst = new Laya.Vector3(0, 0, 0);
    		Laya.Vector3.normalize(tmp, dst);
    		var ray = new Laya.Ray(position1, dst);
    		var outHitRusult = [];
    		GameManager.resScene.physicsSimulation.rayCastAll(ray, outHitRusult);
    		if (outHitRusult.length != 0) {
    			return outHitRusult;
    		}
    		return null;
    	}

    	static createEffect(name, postiton) {
    		var effect = Laya.Sprite3D.instantiate(GameManager.resModel.getChildByName(name), GameManager.Scene);
    		effect.transform.position = new Laya.Vector3(postiton.x, 4, postiton.z);
    	}

    	static createAbandonedCar(name, postiton, rotation) {
    		var AbandonedCar = Laya.Sprite3D.instantiate(GameManager.resModel.getChildByName("crash").getChildByName(name), GameManager.Scene);
    		AbandonedCar.transform.position = postiton;
    		AbandonedCar.transform.rotationEuler = new Laya.Vector3(0, rotation.y, 0);
    	}
    }
    GameManager.hasPlayedSoundManager = [];
    ////////////////////////////////////////////////////////////////////////////////////////////
    GameManager.resScene = null;            //场景资源
    GameManager.resScene_garage = null;     //车房资源
    GameManager.Scene = null;
    GameManager.resModel = null;            //预制体资源
    ////////////////////////////////////////////////////////////////////////////////////////////
    //3D物体
    GameManager.Camera = null;              //场景摄像机
    GameManager.Car = null;
    GameManager.garageScene = null;         //车房
    ////////////////////////////////////////////////////////////////////////////////////////////
    //3D物体脚本
    GameManager.CarJS = null;
    ////////////////////////////////////////////////////////////////////////////////////////////
    //参数
    GameManager.onGroundDis_B = 0.7;         //后轮落地距离
    GameManager.onGroundDis_F = 6.5;         //前轮落地距离
    GameManager.type1 = [12, 13];           //suv车型编号
    GameManager.type2 = [14, 15, 16, 17];   //大巴车型编号
    GameManager.roadRandom = 0;

    GameManager.isClickLeftBtn = false;     //是否点击左方向按钮
    GameManager.isClickRightBtn = false;    //是否点击右方向按钮
    GameManager.isClickUpBtn = false;       //是否点击上方向按钮
    GameManager.createGarageTime = null;
    GameManager.isSuccess = false;
    GameManager.isPause = false;
    ////////////////////////////////////////////////////////////////////////////////////////////
    //场景脚本
    GameManager.gameScene = null;
    GameManager.settingView = null;         //设置界面脚本
    GameManager.failView = null;            //失败界面脚本
    GameManager.successView = null;         //成功界面脚本
    GameManager.updateLogView = null;

    class CarTrigger extends Laya.Script3D {

    	constructor() {
    		super();
    		///////////////////////////////////////////////////////////////////////////////////////////////
    		//3D组件
    		this.trigger = null;                            //触发器
    		///////////////////////////////////////////////////////////////////////////////////////////////
    		//参数
    		this.name = null;                               //名称
    		this.isTrigger = false;                         //是否触发
    		this.outHitRusult = null;                       //
    		this.hitName = null;
    		this.hitName_f = null;

    		this.distance = null;
    		this.showLog = false;
    	}

    	onEnable() {
    		this.trigger = this.owner;
    		this.name = this.trigger.name;

    		//WF_T
    		//WR_T
    		if (this.name == "WF_T") {
    			this.showLog = true;
    		}
    	}

    	onUpdate() {
    		if (this.name == "WR_T") {
    			var position1 = new Laya.Vector3(this.trigger.transform.position.x, this.trigger.transform.position.y + 2, this.trigger.transform.position.z);
    			var position2 = new Laya.Vector3(this.trigger.transform.position.x, this.trigger.transform.position.y, this.trigger.transform.position.z);
    			this.outHitRusult = GameManager.createRay(position2, position1);

    			if (this.outHitRusult != null) {
    				this.hitName = this.outHitRusult.collider.owner.name;
    				var point = this.outHitRusult.point;
    				var distance = Laya.Vector3.distance(position2, point);

    				this.distance = distance;
    				this.isTrigger = true;
    			} else {
    				this.distance = null;
    				this.isTrigger = false;
    			}
    		} else if (this.name == "WF_T") {
    			var position1 = new Laya.Vector3(this.trigger.transform.position.x, this.trigger.transform.position.y + 6, this.trigger.transform.position.z + 1);
    			var position2 = new Laya.Vector3(this.trigger.transform.position.x, this.trigger.transform.position.y + 4, this.trigger.transform.position.z + 1);

    			// let lineSprite = GameManager.Scene.addChild(new Laya.PixelLineSprite3D(1));
    			// lineSprite.addLine(position1, position2, Laya.Color.RED, Laya.Color.RED);

    			this.outHitRusult = GameManager.createRay_List(position2, position1);
    			var outHitRusult = this.withOutRusult(this.outHitRusult, "road_1");
    			if (outHitRusult) {
    				this.hitName_f = true;
    			} else {
    				this.hitName_f = false;
    			}

    			var position1 = new Laya.Vector3(this.trigger.transform.position.x, this.trigger.transform.position.y + 6, this.trigger.transform.position.z);
    			var position2 = new Laya.Vector3(this.trigger.transform.position.x, this.trigger.transform.position.y + 4, this.trigger.transform.position.z);

    			this.outHitRusult = GameManager.createRay_List(position2, position1);
    			var outHitRusult = this.getHitRusult(this.outHitRusult, "road_1");

    			this.distance = null;
    			this.isTrigger = false;
    			if (outHitRusult) {
    				this.hitName = outHitRusult.collider.owner.name;
    				var point = outHitRusult.point;
    				var distance = Laya.Vector3.distance(position1, point);

    				// let lineSprite = GameManager.Scene.addChild(new Laya.PixelLineSprite3D(1));
    				// lineSprite.addLine(position2, point, Laya.Color.RED, Laya.Color.RED);

    				this.distance = distance;
    				this.isTrigger = true;
    			} else {
    				outHitRusult = this.getHitRusult(this.outHitRusult, "ground");
    				if (outHitRusult) {
    					this.hitName = outHitRusult.collider.owner.name;
    					var point = outHitRusult.point;
    					var distance = Laya.Vector3.distance(position1, point);

    					// let lineSprite = GameManager.Scene.addChild(new Laya.PixelLineSprite3D(1));
    					// lineSprite.addLine(position2, point, Laya.Color.RED, Laya.Color.RED);

    					this.distance = distance;
    					this.isTrigger = true;
    				}
    			}
    		}
    	}

    	/**
    	 * 是否在地面上方
    	 * @param {*} outHitRusult 射线穿透数组
    	 * @param {*} name 名称
    	 * @returns 
    	 */
    	getHitRusult(outHitRusult, name) {
    		if (outHitRusult) {
    			for (var key in outHitRusult) {
    				var rayName = outHitRusult[key].collider.owner.name;
    				if (rayName == name) {
    					return outHitRusult[key]
    				}
    			}
    			return null;
    		} else {
    			return null;
    		}
    	}

    	/**
    	 * 剔除
    	 * @param {*} outHitRusult 射线穿透数组
    	 * @param {*} name 名称
    	 * @returns 
    	 */
    	withOutRusult(outHitRusult, name) {
    		if (outHitRusult) {
    			for (var key in outHitRusult) {
    				var rayName = outHitRusult[key].collider.owner.name;
    				if (rayName == name) {
    					return true;
    				}
    			}
    			return false;
    		} else {
    			return false;
    		}
    	}

    	onDisable() {
    	}
    }

    class failView extends failView_AccidentUI {

    	constructor() {
    		super();
    	}

    	onEnable() {
    		//原生
    		console.log("失败");
    		Advertisement.insertAdverV();

    		if (GameManager.settingView != null) {
    			GameManager.settingView.clickClose();
    		}

    		GameManager.failView = this;
    		this.width = Laya.stage.width;
    		this.height = Laya.stage.height;

    		this.reStartBtn.on(Laya.Event.CLICK, this, this.clickRestart);
    		this.indexBtn.on(Laya.Event.CLICK, this, this.clickIndex);
    	}

    	/**
    	 * 点击重新开始
    	 */
    	clickRestart() {
    		console.log("clickRestart");

    		GameManager.PlaySound("clickBtn");
    		if (GameManager.gameScene != null) {
    			GameManager.gameScene.clickRestart();
    			this.destroy();
    		} else {
    			console.error("游戏场景不存在");
    		}
    	}

    	/**
    	 * 返回主页面
    	 */
    	clickIndex() {
    		//原生
    		console.log("返回首页");
    		Advertisement.insertAdverV3();

    		GameManager.PlaySound("clickBtn");
    		Laya.Scene.open("Accident/Scene/mainScene.scene");
    		this.destroy();
    	}

    	onDisable() {
    		GameManager.failView = null;
    	}
    }

    class garageView extends garageView_AccidentUI {

    	constructor(selectCarID) {
    		super();
    		this.selectCarID = selectCarID;
    		this.carlist = null;
    		this.camera = null;
    		this.direction = 1;
    		this.choseCarID = selectCarID;
    		this.selectCarModel = null;
    	}

    	onEnable() {
    		//原生
    		console.log("车库");
    		Advertisement.insertAdverV3();

    		GameManager.garageView = this;
    		this.width = Laya.stage.width;
    		this.height = Laya.stage.height;

    		this.selectCarBtn.on(Laya.Event.CLICK, this, this.clickSelectCar);
    		this.startBtn.on(Laya.Event.CLICK, this, this.clickStart);
    		this.lockBtn.on(Laya.Event.CLICK, this, this.clickUnLock);
    		this.moveCameraStage.on(Laya.Event.MOUSE_DOWN, this, this.touchReSet);
    		this.moveCameraStage.on(Laya.Event.MOUSE_MOVE, this, this.rotateCamera);
    		this.moveCameraStage.on(Laya.Event.MOUSE_UP, this, function () {
    			this.isTouch = false;
    			Laya.timer.loop(1, this, this.updateCamera);
    		}.bind(this));

    		GameManager.garageScene = Laya.stage.addChildAt(GameManager.resScene_garage, 1);
    		this.carlist = GameManager.garageScene.getChildByName("Cars")._children;
    		this.camera = GameManager.garageScene.getChildByName("CameraCenter");

    		Laya.timer.loop(1, this, this.updateCamera);

    		this.carlockData = GameData.GetData("Car");
    		this.InitCarList();
    		this.createCar();
    	}

    	/**
    	 * 初始化车辆列表
    	 */
    	InitCarList() {
    		this.CarList.hScrollBarSkin = "";
    		this.CarList.renderHandler = new Laya.Handler(this, this.selectCarListen);
    		this.CarList.array = [];
    		let CarListarray = [];


    		for (var key in GameData.JSONData) {
    			let obj = {};

    			obj['carBg'] = { visible: true };
    			obj['carImage1'] = { visible: true, skin: "Accident/CarImage/" + GameData.JSONData[key].image };
    			obj['carName1'] = { visible: true, text: GameData.JSONData[key].name };
    			obj['lockbg1'] = { visible: this.carlockData[key - 1] == 1 ? false : true };

    			obj['selectBg'] = { visible: false };
    			obj['carImage2'] = { visible: false, skin: "Accident/CarImage/" + GameData.JSONData[key].image };
    			obj['carName2'] = { visible: false, text: GameData.JSONData[key].name };
    			obj['lockbg2'] = { visible: false };

    			obj['carID'] = { text: key };
    			CarListarray.push(obj);
    		}
    		this.CarList.array = CarListarray;

    		this.CarList.scrollTo(this.selectCarID - 1);
    		this.setSelect(this.selectCarID - 1, true);
    	}

    	/**
    	 * 列表添加监听事件
    	 * @param {*} cell 列表box对象
    	 */
    	selectCarListen(cell) {
    		GameManager.PlaySound("clickBtn");
    		let selectCarBtn = cell.getChildByName("carBg");
    		selectCarBtn.offAll();
    		let carID = parseInt(cell.getChildByName("carID").text);
    		selectCarBtn.on(Laya.Event.CLICK, this, this.selectCar, [carID]);
    	}

    	/**
    	 * 选择车辆
    	 * @param {*} carID 车辆ID
    	 */
    	selectCar(carID) {
    		GameManager.PlaySound("clickBtn");
    		this.setSelect(this.selectCarID - 1, false);
    		this.selectCarID = carID;
    		this.setSelect(carID - 1, true);
    		this.createCar();
    	}

    	/**
    	 * 选择列表
    	 * @param {*} selectID 选择ID
    	 * @param {*} isSelect 是否选中
    	 */
    	setSelect(selectID, isSelect) {
    		var cell = this.CarList.getItem(selectID);
    		cell['carBg'].visible = !isSelect;
    		cell['carImage1'].visible = !isSelect;
    		cell['carName1'].visible = !isSelect;

    		cell['selectBg'].visible = isSelect;
    		cell['carImage2'].visible = isSelect;
    		cell['carName2'].visible = isSelect;

    		if (this.carlockData[selectID] == 1) {
    			cell['lockbg1'].visible = false;
    			cell['lockbg2'].visible = false;
    			this.lockBtn.visible = false;
    		} else {
    			cell['lockbg1'].visible = !isSelect;
    			cell['lockbg2'].visible = isSelect;
    			this.lockBtn.visible = true;
    		}

    		this.CarList.setItem(selectID, cell);

    		this.introduce.text = GameData.JSONData[selectID + 1].introduce;

    		if (isSelect) {
    			if (this.selectCarID == this.choseCarID) {
    				this.selectCarBtn.visible = false;
    			} else {
    				this.selectCarBtn.visible = true;
    			}
    		}
    	}

    	/**
    	 * 重置点击
    	 */
    	touchReSet() {
    		this.deltaX = 0;
    		this.lastX = -1;
    		Laya.timer.clear(this, this.updateCamera);
    		this.isTouch = true;
    	}

    	/**
    	 * 手动旋转相机
    	 */
    	rotateCamera() {
    		if (this.isTouch) {
    			if (this.lastX != -1) {
    				this.deltaX = Laya.stage.mouseX - this.lastX;
    				this.camera.transform.rotate(new Laya.Vector3(0, -this.deltaX * 0.5, 0), true, false);
    				if (Math.abs(this.deltaX) != 0) {
    					this.direction = -this.deltaX / Math.abs(this.deltaX);
    				}
    			}
    			this.lastX = Laya.stage.mouseX;
    		}
    	}

    	/**
    	 * 旋转相机
    	 */
    	updateCamera() {
    		this.camera.transform.rotate(new Laya.Vector3(0, this.direction * 0.3, 0), true, false);
    	}

    	/**
    	 * 方向按钮监听
    	 * @param {*} directioName 方向名称
    	 */
    	clickDirectionBtn(directioName = "") {
    		GameManager.PlaySound("clickBtn");
    		switch (directioName) {
    			case "left":
    				this.selectCarID--;
    				if (this.selectCarID < 0) {
    					this.selectCarID = this.carlist.length;
    				}
    				break;
    			case "right":
    				this.selectCarID++;
    				if (this.selectCarID > this.carlist.length) {
    					this.selectCarID = 1;
    				}
    				break;
    		}
    		this.createCar();
    	}

    	/**
    	 * 展示车辆
    	 */
    	createCar() {
    		if (this.selectCarModel) {
    			this.selectCarModel.destroy();
    		}
    		this.selectCarModel = Laya.Sprite3D.instantiate(GameManager.resModel.getChildByName("Car_" + this.selectCarID).getChildByName("car"), GameManager.garageScene);
    		this.selectCarModel.transform.localPosition = new Laya.Vector3(0, 0, 0);
    		this.selectCarModel.transform.localRotation = new Laya.Vector3(0, 0, 0);
    		this.selectCarModel.transform.setWorldLossyScale(new Laya.Vector3(5, 5, 5));
    	}

    	/**
    	 * 点击选择车辆
    	 */
    	clickSelectCar() {
    		GameManager.PlaySound("clickBtn");
    		this.choseCarID = this.selectCarID;
    		this.selectCarBtn.visible = false;
    		GameData.SetData("ChoseCarID", this.choseCarID);
    	}

    	searchRoadList(roadData, roadRandom) {
    		for (var key in roadData) {
    			if (roadData[key] == roadRandom) {
    				return true
    			}
    		}
    		return false;
    	}

    	/**
    	 * 点击开始游戏
    	 */
    	clickStart() {
    		var roadData = GameData.GetData("road");
    		if (roadData.length <= 15) {
    			do {
    				GameManager.roadRandom = GameManager.random(1, 15);
    			} while (this.searchRoadList(roadData, GameManager.roadRandom));
    			// GameManager.roadRandom = 15;
    		} else {
    			GameManager.roadRandom = GameManager.random(1, 15);
    		}

    		console.log("赛道：" + GameManager.roadRandom);

    		GameManager.resScene.getChildByName("road").getChildByName("road_" + GameManager.roadRandom).active = true;

    		GameManager.PlaySound("clickBtn");
    		if (GameManager.Scene == null) {
    			GameManager.Scene = Laya.stage.addChildAt(GameManager.resScene, 0);
    		}

    		var CrashCube = GameManager.Scene.getChildByName("CrashCube")._children;
    		console.log(GameManager.Scene.getChildByName("CrashCube"));
    		for (var key in CrashCube) {
    			CrashCube[key].active = false;
    		}

    		var crashcubeID = GameManager.random(0, CrashCube.length - 1);
    		CrashCube[crashcubeID].active = true;

    		if (GameManager.gameScene != null) {
    			GameManager.gameScene.choseCar(this.choseCarID);
    			GameManager.gameScene.BtnUI.visible = true;
    		}
    		this.destroy();
    	}

    	/**
    	 * 点击解锁
    	 */
    	clickUnLock() {
    		GameManager.PlaySound("clickBtn");
    		GameManager_Collection.showVideo(function () {
    			this.carlockData[this.selectCarID - 1] = 1;
    			GameData.SetData("Car", this.carlockData);
    			this.setSelect(this.selectCarID - 1, true);
    		}.bind(this));
    	}

    	/**
    	 * 脚本摧毁
    	 */
    	onDisable() {
    		GameManager.garageScene.destroy();
    		Laya.Resource.destroyUnusedResources();
    		GameManager.garageView = null;
    	}
    }

    class successView extends successView_AccidentUI {

    	constructor() {
    		super();
    	}

    	onEnable() {
    		//原生
    		console.log("胜利");
    		Advertisement.insertAdverV();

    		if (GameManager.settingView != null) {
    			GameManager.settingView.clickClose();
    		}
    		GameManager.successView = this;

    		var car = GameData.GetData("Car");
    		for (var key in car) {
    			if (car[key] == 0) {
    				car[key] = 1;
    				break;
    			}
    		}
    		GameData.SetData("Car", car);

    		this.width = Laya.stage.width;
    		this.height = Laya.stage.height;

    		this.continueBtn.on(Laya.Event.CLICK, this, this.clickClose);
    		this.indexBtn.on(Laya.Event.CLICK, this, this.clickIndex);

    		var roadData = GameData.GetData("road");
    		roadData.push(GameManager.roadRandom);
    		GameData.SetData("road", roadData);
    	}

    	/**
    	 * 关闭
    	 */
    	clickClose() {

    		GameManager.PlaySound("clickBtn");
    		if (GameManager.gameScene != null) {
    			Laya.stage.addChild(new garageView(GameManager.gameScene.selectCarID));
    			GameManager.gameScene.BtnUI.visible = false;
    			GameManager.Scene.getChildByName("road").getChildByName("road_" + GameManager.roadRandom).active = false;
    		}
    		this.destroy();
    	}

    	/**
    	 * 返回主页面
    	 */
    	clickIndex() {
    		//原生
    		console.log("返回首页");
    		Advertisement.insertAdverV3();

    		GameManager.PlaySound("clickBtn");
    		Laya.Scene.open("Accident/Scene/mainScene.scene");
    		this.destroy();
    	}

    	onDisable() {
    		GameManager.successView = null;
    	}
    }

    class Car extends Laya.Script3D {

    	constructor() {
    		super();
    		///////////////////////////////////////////////////////////////////////////////////////////////
    		//3D组件
    		this.car = null;                            //车
    		this.CarTrigger_F = null;                   //前轮触发器
    		this.CarTrigger_B = null;                   //后轮触发器
    		///////////////////////////////////////////////////////////////////////////////////////////////
    		//脚本
    		this.CarTrigger_F_JS = null;                //前轮触发器脚本
    		this.CarTrigger_B_JS = null;                //后轮触发器脚本
    		///////////////////////////////////////////////////////////////////////////////////////////////
    		//参数
    		this.name = null;                           //名称
    		this.carID = 0;                             //车辆ID
    		this.GravitySpeed = 0;                      //重力速度
    		this.GravitySpeed_accelerat = 0.002;        //重力加速度
    		this.GravityPause = true;                   //是否停止下落
    		this.carSpeed = 0;                          //车速
    		this.carAcceleratSpeed = 0;                 //加速度
    		this.carAcceleratSpeed_ratio = 1;           //加速度系数
    		this.carSpeed_accelerat = 0.000001;         //加速度
    		this.wheelsSpeed = 50;                       //轮胎旋转速率
    		this.carSlope = 0;                          //车辆斜率
    		this.keyDownList = [];                      //按下键盘
    		this.rotateAngle = 0;                       //转弯角度
    		this.RotateLimit = 1;                       //限制转弯车速
    		this.MaxAccelerateRotate = 1;                //达到限制转弯加速度
    		this.AccelerateRotate = 1;                  //转弯加速度

    		this.decelerate_wheels = 0.1;               //轮胎腾空减速
    		this.decelerate_car = 0.001;                //车辆腾空减速
    		this.stopKeyWheelRotate = false;            //放开键盘腾空后轮减速判断

    		this.type = "";

    		this.speed_a = 1;
    		this.speed_rotate = 1;
    		this.speed_up = 1;

    		this.isDJ = true;
    		this.isRotate = false;
    		this.dValue = 2;
    	}

    	/**
    	 * 摧毁车辆
    	 */
    	destroyCar() {
    		switch (this.type) {
    			case "crash_":
    				GameManager.stopSound("car_up");
    				GameManager.stopSound("car");
    				break;
    			case "crash_minibus":
    				GameManager.stopSound("suv_up");
    				GameManager.stopSound("suv");
    				break;
    			case "crash_bus":
    				GameManager.stopSound("bus_up");
    				GameManager.stopSound("bus");
    				break;
    		}
    		this.CarTrigger_F.destroy();
    		this.CarTrigger_B.destroy();
    		this.car.destroy();
    	}
    	/**
    	 * 触发器碰撞回调
    	 * @param {*} collider 触发器对象
    	 */
    	onTriggerEnter(collider) {
    		console.log(collider.owner.name);
    		if (collider.owner.name.indexOf("CrashCube") != -1) {
    			GameManager.isSuccess = true;
    		}

    		if (collider.owner.name == "ground") {
    			GameManager.createEffect("boom_22", this.car.getChildByName("car").transform.position);
    			var maxRandom = 2;
    			if (this.type == "crash_") {
    				maxRandom = 2;
    			}
    			var random = GameManager.random(1, maxRandom);
    			var crashName = this.type + random;
    			GameManager.createAbandonedCar(crashName, this.car.getChildByName("car").transform.position, this.car.getChildByName("car").transform.rotationEuler);
    			GameManager.PlaySound("boom");
    			this.destroyCar();
    			if (GameManager.isSuccess) {
    				Laya.Scene3D.load("res/Accident/Unity/LayaScene_Scene_hangar_Accident/Conventional/Scene_hangar_Accident.ls", Laya.Handler.create(this, function (scene) {
    					GameManager.resScene_garage = scene;
    					if (GameManager.gameScene != null) {
    						if (GameManager.garageView == null) {
    							Laya.stage.addChild(new successView());
    						}
    					}
    				}));
    			} else {
    				clearTimeout(GameManager.createGarageTime);
    				GameManager.createGarageTime = setTimeout(() => {
    					if (!GameManager.garageView) {
    						Laya.stage.addChild(new failView());
    					}
    				}, 2000);
    			}
    		}
    	}

    	onEnable() {
    		this.car = this.owner;
    		this.name = this.car.name;
    		this.InitCar();
    		this.carID = this.name.replace(/[^\d]/g, "");
    		this.type = this.setType();
    		GameManager.isSuccess = false;
    		for (var key = 1; key <= 3; key++) {
    			GameManager.gameScene.timeUI.getChildByName(key + "").visible = false;
    		}
    		this.timeUI = 3;
    		GameManager.gameScene.timeUI.getChildByName(this.timeUI + "").visible = true;
    		GameManager.isPause = true;
    		Laya.timer.loop(1000, this, this.timeOut);

    		var carJSON = GameData.JSONData[this.carID];
    		this.speed_a = carJSON.speed_a;
    		this.speed_rotate = carJSON.speed_rotate;
    		this.speed_up = carJSON.speed_up;
    		console.log(carJSON);

    		switch (this.type) {
    			case "crash_":
    				GameManager.PlaySound("car", 0);
    				break;
    			case "crash_minibus":
    				GameManager.PlaySound("suv", 0);
    				break;
    			case "crash_bus":
    				GameManager.PlaySound("bus", 0);
    				break;
    		}
    		this.isDJ = true;
    	}

    	timeOut() {
    		console.log(GameManager.settingView);
    		if (GameManager.settingView == null) {
    			GameManager.gameScene.timeUI.getChildByName(this.timeUI + "").visible = false;
    			this.timeUI--;
    			if (this.timeUI == 0) {
    				GameManager.isPause = false;
    				Laya.timer.clear(this, this.timeOut);
    			} else {
    				GameManager.gameScene.timeUI.getChildByName(this.timeUI + "").visible = true;
    			}
    		}
    	}

    	/**
    	 * 设置车辆类型
    	 * @returns 
    	 */
    	setType() {
    		for (var key in GameManager.type1) {
    			if (GameManager.type1[key] == this.carID) {
    				return "crash_minibus";
    			}
    		}

    		for (var key in GameManager.type2) {
    			if (GameManager.type2[key] == this.carID) {
    				return "crash_bus";
    			}
    		}

    		return "crash_"
    	}

    	/**
    	 * 初始化车
    	 */
    	InitCar() {
    		this.CarTrigger_F = this.car.getChildByName("car").getChildByName("WF_T");
    		this.CarTrigger_B = this.car.getChildByName("car").getChildByName("WR_T");
    		this.CarTrigger_F_JS = this.CarTrigger_F.addComponent(CarTrigger);
    		this.CarTrigger_B_JS = this.CarTrigger_B.addComponent(CarTrigger);

    		this.Wheels_FL = this.car.getChildByName("car").getChildByName("Wheels_FL");
    		this.Wheels_FR = this.car.getChildByName("car").getChildByName("Wheels_FR");

    		this.Wheels_FL_roate = this.car.getChildByName("car").getChildByName("Wheels_FL").getChildByName("Wheels_FL_LOD0");
    		this.Wheels_FR_roate = this.car.getChildByName("car").getChildByName("Wheels_FR").getChildByName("Wheels_FR_LOD0");
    		this.Wheels_RL_roate = this.car.getChildByName("car").getChildByName("Wheels_RL");
    		this.Wheels_RR_roate = this.car.getChildByName("car").getChildByName("Wheels_RR");
    		this.choseCamera(GameManager.gameScene.cameraIndex);
    		this.StartGravity();
    		this.listenKeyboard();
    		Laya.timer.loop(1, this, this.Keyboard);
    	}

    	/**
    	 * 摄像机开始跟随
    	 */
    	StartCameraMove(posName) {
    		Laya.timer.clear(this, this.CameraMove);
    		Laya.timer.loop(1, this, this.CameraMove, [posName]);
    	}

    	/**
    	 * 选择摄像机位置
    	 */
    	choseCamera(cameraIndex) {
    		switch (cameraIndex) {
    			case 0:
    				this.StartCameraMove("back");
    				break;
    			case 1:
    				this.StartCameraMove("left_front");
    				break;
    			case 2:
    				this.StartCameraMove("right_front");
    				break;
    			case 3:
    				this.StartCameraMove("back_right");
    				break;
    			case 4:
    				this.StartCameraMove("left");
    				break;
    			case 5:
    				this.StartCameraMove("right");
    				break;
    		}
    	}
    	/**
    	 * 摄像机跟随更新
    	 */
    	CameraMove(posName) {
    		var distance = Laya.Vector3.distance(this.Wheels_FL.transform.position, this.Wheels_RL_roate.transform.position);
    		var position = new Laya.Vector3(this.car.transform.position.x, this.car.transform.position.y + 0.5, this.car.transform.position.z + (distance / 2));
    		switch (posName) {
    			case "left_front":
    				GameManager.Camera.transform.position = new Laya.Vector3(this.car.transform.position.x + 10, this.car.transform.position.y + 5, this.car.transform.position.z + 10);
    				GameManager.Camera.transform.lookAt(position, new Laya.Vector3(0, 1, 0));
    				GameManager.Camera.transform.rotate(new Laya.Vector3(0, 0, 0), true, false);
    				break;
    			case "right_front":
    				GameManager.Camera.transform.position = new Laya.Vector3(this.car.transform.position.x - 10, this.car.transform.position.y + 5, this.car.transform.position.z + 10);
    				GameManager.Camera.transform.lookAt(position, new Laya.Vector3(0, 1, 0));
    				GameManager.Camera.transform.rotate(new Laya.Vector3(0, 0, 0), true, false);
    				break;
    			case "back":
    				GameManager.Camera.transform.position = new Laya.Vector3(this.car.transform.position.x, this.car.transform.position.y + 4, this.car.transform.position.z - 5);
    				GameManager.Camera.transform.lookAt(position, new Laya.Vector3(0, 1, 0));
    				GameManager.Camera.transform.rotate(new Laya.Vector3(-8, 0, 0), true, false);
    				break;
    			case "back_right":
    				GameManager.Camera.transform.position = new Laya.Vector3(this.car.transform.position.x - 12, this.car.transform.position.y + 11, this.car.transform.position.z - 12);
    				GameManager.Camera.transform.lookAt(position, new Laya.Vector3(0, 1, 0));
    				GameManager.Camera.transform.rotate(new Laya.Vector3(-8, 0, 0), true, false);
    				break;
    			case "left":
    				GameManager.Camera.transform.position = new Laya.Vector3(this.car.transform.position.x + 15, this.car.transform.position.y + 0.5, this.car.transform.position.z + (distance / 2));
    				GameManager.Camera.transform.lookAt(position, new Laya.Vector3(0, 1, 0));
    				GameManager.Camera.transform.rotate(new Laya.Vector3(0, 0, 0), true, false);
    				break;
    			case "right":
    				GameManager.Camera.transform.position = new Laya.Vector3(this.car.transform.position.x - 15, this.car.transform.position.y + 0.5, this.car.transform.position.z + (distance / 2));
    				GameManager.Camera.transform.lookAt(position, new Laya.Vector3(0, 1, 0));
    				GameManager.Camera.transform.rotate(new Laya.Vector3(0, 0, 0), true, false);
    				break;
    		}
    	}

    	/**
    	 * 初始化重力
    	 */
    	setGravity() {
    		if (GameManager.settingView != null || GameManager.isPause) {
    			return;
    		}
    		this.GravitySpeed += this.GravitySpeed_accelerat + this.GravitySpeed * 0.00001;
    		this.car.transform.position = new Laya.Vector3(this.car.transform.position.x, this.car.transform.position.y - this.GravitySpeed, this.car.transform.position.z);
    		if (this.CarTrigger_B_JS.isTrigger && this.CarTrigger_B_JS.distance <= GameManager.onGroundDis_B && (this.CarTrigger_B_JS.hitName == "road_1" || this.CarTrigger_B_JS.hitName == "ground")) {
    			this.PauseGravity();
    			Laya.timer.loop(1, this, this.CarRotate);
    			if (this.CarTrigger_B_JS.hitName == "road_1") {
    				this.StartCarTranslate();
    			}
    		}
    	}

    	/**
    	 * 开启重力(开始下落)
    	 */
    	StartGravity() {
    		if (this.GravityPause) {
    			this.GravitySpeed = 0;
    			Laya.timer.loop(1, this, this.setGravity);
    			this.GravityPause = false;
    		}
    	}

    	/**
    	 * 关闭重力(停止下落)
    	 */
    	PauseGravity() {
    		if (!this.GravityPause) {
    			Laya.timer.clear(this, this.setGravity);
    			this.GravityPause = true;
    			GameManager.PlaySound("onGround");
    		}
    	}

    	/**
    	 * 前后旋转车辆
    	 */
    	CarRotate() {
    		if (GameManager.settingView != null || GameManager.isPause) {
    			return;
    		}
    		if (this.CarTrigger_F_JS.isTrigger && this.CarTrigger_F_JS.hitName == "road_1") {
    			if (this.CarTrigger_F_JS.hitName_f) {
    				if (!this.isRotate) {
    					GameManager.PlaySound("onGround");
    					this.isRotate = true;
    				}
    				var dValue = this.CarTrigger_F_JS.distance - GameManager.onGroundDis_F;
    				this.dValue = dValue;
    				// console.log(dValue);
    				if (dValue < 2) {
    					this.car.transform.rotate(new Laya.Vector3(dValue * this.carSpeed * 16, 0, 0), true, false);
    					this.carSlope += dValue * this.carSpeed * 16;
    				}
    			}
    		} else {
    			if (this.CarTrigger_B_JS.isTrigger && this.CarTrigger_B_JS.distance <= GameManager.onGroundDis_B && this.CarTrigger_B_JS.hitName == "ground") {
    				var dValue = this.CarTrigger_F_JS.distance - GameManager.onGroundDis_F;
    				this.car.transform.rotate(new Laya.Vector3(dValue * this.GravitySpeed * 16, 0, 0), true, false);
    				this.carSlope += dValue * this.GravitySpeed * 16;
    			}
    		}
    	}

    	/**
    	 * 车体位移
    	 */
    	CarTranslate() {
    		if (GameManager.settingView != null || GameManager.isPause) {
    			return;
    		}
    		if (this.CarTrigger_B_JS.isTrigger && this.CarTrigger_B_JS.hitName == "road_1" && this.dValue < 2) {
    			this.carAcceleratSpeed += this.carSpeed_accelerat * this.carAcceleratSpeed_ratio * this.speed_a;
    			this.carSpeed += this.carAcceleratSpeed + this.carSlope * 0.0001;

    			var direction = new Laya.Vector3(0, 0, 0);
    			this.car.getChildByName("car").transform.getForward(direction);
    			this.car.transform.translate(new Laya.Vector3(-direction.x * this.carSpeed, -direction.y * this.carSpeed, -direction.z * this.carSpeed), false);

    			var a = this.carSpeed * (0 - this.rotateAngle) * 0.05;
    			this.car.transform.rotate(new Laya.Vector3(0, -a * 0.03, 0));

    			this.Wheels_RL_roate.transform.rotate(new Laya.Vector3(this.wheelsSpeed * this.carSpeed, 0, 0), true, false);
    			this.Wheels_RR_roate.transform.rotate(new Laya.Vector3(this.wheelsSpeed * this.carSpeed, 0, 0), true, false);
    			this.temWheelsSspeed_B = this.wheelsSpeed * this.carSpeed;
    		} else {
    			this.Wheels_B_TimeOUT();
    			if (this.CarTrigger_B_JS.isTrigger && this.CarTrigger_B_JS.distance <= GameManager.onGroundDis_B && this.CarTrigger_B_JS.hitName == "ground") {
    				// this.PauseGravity();
    			} else {
    				this.CarTranslate_TimeOUT();
    				this.StartGravity();
    			}
    		}

    		if (this.CarTrigger_F_JS.isTrigger && this.CarTrigger_F_JS.hitName == "road_1") {
    			this.Wheels_FL_roate.transform.rotate(new Laya.Vector3(this.wheelsSpeed * this.carSpeed, 0, 0), true, false);
    			this.Wheels_FR_roate.transform.rotate(new Laya.Vector3(this.wheelsSpeed * this.carSpeed, 0, 0), true, false);
    			this.temWheelsSspeed_F = this.wheelsSpeed * this.carSpeed;
    		} else {
    			this.stopKeyWheelRotate = true;
    			this.Wheels_F_TimeOUT();
    		}
    	}

    	/**
    	 * 开始车体位移
    	 */
    	StartCarTranslate() {
    		if (this.carSpeed == 0) {
    			this.carSpeed = this.GravitySpeed;
    			console.log("初速度:" + this.carSpeed);
    		}
    		Laya.timer.loop(1, this, this.CarTranslate);
    	}

    	/**
    	 * 车辆前轮腾空倒计时
    	 */
    	Wheels_F_TimeOUT() {
    		if (GameManager.settingView != null || GameManager.isPause) {
    			return;
    		}
    		this.temWheelsSspeed_F -= this.decelerate_wheels;
    		if (this.temWheelsSspeed_F > 0.0001) {
    			this.Wheels_FL_roate.transform.rotate(new Laya.Vector3(this.temWheelsSspeed_F, 0, 0), true, false);
    			this.Wheels_FR_roate.transform.rotate(new Laya.Vector3(this.temWheelsSspeed_F, 0, 0), true, false);
    		}
    	}

    	/**
    	 * 车辆后轮腾空倒计时
    	 */
    	Wheels_B_TimeOUT() {
    		if (GameManager.settingView != null || GameManager.isPause) {
    			return;
    		}
    		this.temWheelsSspeed_B -= this.decelerate_wheels;
    		if (this.temWheelsSspeed_B > 0.0001) {
    			this.Wheels_RL_roate.transform.rotate(new Laya.Vector3(this.temWheelsSspeed_B, 0, 0), true, false);
    			this.Wheels_RR_roate.transform.rotate(new Laya.Vector3(this.temWheelsSspeed_B, 0, 0), true, false);
    		}
    	}

    	/**
    	 * 车辆腾空后前进倒计时
    	 */
    	CarTranslate_TimeOUT() {
    		if (GameManager.settingView != null || GameManager.isPause) {
    			return;
    		}
    		this.carSpeed -= this.decelerate_car;
    		if (this.carSpeed > 0.0001) {
    			var direction = new Laya.Vector3(0, 0, 0);
    			this.car.getChildByName("car").transform.getForward(direction);
    			this.car.transform.translate(new Laya.Vector3(-direction.x * this.carSpeed, -direction.y * this.carSpeed, -direction.z * this.carSpeed), false);
    		}
    	}

    	/**
    	 * 按键盘更新
    	 */
    	Keyboard() {
    		if (GameManager.gameScene != null) {
    			var speedNum = parseInt(this.carSpeed * 100 * 1.5);
    			if (speedNum < 0) {
    				speedNum = 0;
    			}
    			GameManager.gameScene.speedNum.text = speedNum;
    		}
    		if (GameManager.settingView != null || GameManager.isPause) {
    			return;
    		}
    		if (this.keyDownList[87] || GameManager.isClickUpBtn) {
    			this.speedUp();
    		} else {
    			if (!this.isDJ) {
    				this.isDJ = true;
    				switch (this.type) {
    					case "crash_":
    						GameManager.stopSound("car_up");
    						GameManager.PlaySound("car", 0);
    						break;
    					case "crash_minibus":
    						GameManager.stopSound("suv_up");
    						GameManager.PlaySound("suv", 0);
    						break;
    					case "crash_bus":
    						GameManager.stopSound("bus_up");
    						GameManager.PlaySound("bus", 0);
    						break;
    				}
    			}
    			if (!this.stopKeyWheelRotate) {
    				this.carAcceleratSpeed_ratio = 1;
    				this.temWheelsSspeed_B -= this.decelerate_wheels;
    				if (this.temWheelsSspeed_B > 0.0001) {
    					this.Wheels_RL_roate.transform.rotate(new Laya.Vector3(this.temWheelsSspeed_B, 0, 0), true, false);
    					this.Wheels_RR_roate.transform.rotate(new Laya.Vector3(this.temWheelsSspeed_B, 0, 0), true, false);
    				}
    			}
    		}

    		this.Wheels_FL.transform.localRotationEulerY = this.rotateAngle;
    		this.Wheels_FR.transform.localRotationEulerY = this.rotateAngle;

    		if (!this.keyDownList[37] && !this.keyDownList[39] && !this.keyDownList[65] && !this.keyDownList[68] && !GameManager.isClickLeftBtn && !GameManager.isClickRightBtn) {
    			this.rotateAngle += (0 - this.rotateAngle) * 0.2;
    		} else {
    			if (this.keyDownList[65] || this.keyDownList[37] || GameManager.isClickLeftBtn) {
    				console.log("左转");
    				this.left();
    			}
    			if (this.keyDownList[68] || this.keyDownList[39] || GameManager.isClickRightBtn) {
    				console.log("右转");
    				this.right();
    			}
    		}
    	}

    	/**
    	 * 左转
    	 */
    	left() {
    		if (this.carSpeed >= this.RotateLimit) {
    			this.rotateAngle += this.MaxAccelerateRotate;
    		} else {
    			this.rotateAngle += this.AccelerateRotate * this.speed_rotate;
    		}
    		if (this.rotateAngle >= 30) {
    			this.rotateAngle = 30;
    		}
    	}

    	/**
    	 * 右转
    	 */
    	right() {
    		if (this.carSpeed >= this.RotateLimit) {
    			this.rotateAngle -= this.MaxAccelerateRotate;
    		} else {
    			this.rotateAngle -= this.AccelerateRotate * this.speed_rotate;
    		}
    		if (this.rotateAngle <= -30) {
    			this.rotateAngle = -30;
    		}
    	}

    	/**
    	 * 加速
    	 */
    	speedUp() {
    		if (GameManager.settingView != null || GameManager.isPause) {
    			return;
    		}
    		if (this.isDJ) {
    			this.isDJ = false;
    			switch (this.type) {
    				case "crash_":
    					GameManager.stopSound("car");
    					GameManager.PlaySound("car_up", 0);
    					break;
    				case "crash_minibus":
    					GameManager.stopSound("suv");
    					GameManager.PlaySound("suv_up", 0);
    					break;
    				case "crash_bus":
    					GameManager.stopSound("bus");
    					GameManager.PlaySound("bus_up", 0);
    					break;
    			}
    		}
    		if (this.CarTrigger_B_JS.isTrigger && this.CarTrigger_B_JS.distance <= GameManager.onGroundDis_B) {
    			this.carAcceleratSpeed_ratio = 10 * this.speed_up;
    		} else {
    			this.stopKeyWheelRotate = false;
    			this.Wheels_RL_roate.transform.rotate(new Laya.Vector3(10 * this.speed_up, 0, 0), true, false);
    			this.Wheels_RR_roate.transform.rotate(new Laya.Vector3(10 * this.speed_up, 0, 0), true, false);
    			this.temWheelsSspeed_B = 10 * this.speed_up;
    		}
    	}

    	/**
    	 * 添加键盘监听事件
    	 */
    	listenKeyboard() {
    		console.log("设置键盘监听事件");
    		//添加键盘按下事件,一直按着某按键则会不断触发
    		Laya.stage.on(Laya.Event.KEY_DOWN, this, this.onKeyDown);
    		//添加键盘抬起事件
    		Laya.stage.on(Laya.Event.KEY_UP, this, this.onKeyUp);
    	}

    	/**
    	 * 按下键盘
    	 * @param {*} e 
    	 */
    	onKeyDown(e) {
    		this.keyDownList[e["keyCode"]] = true;
    	}

    	/**
    	 * 抬起键盘
    	 * @param {*} e 
    	 */
    	onKeyUp(e) {
    		delete this.keyDownList[e["keyCode"]];
    	}


    	onDisable() {

    	}

    }

    class settingView extends settingView_AccidentUI {

    	constructor() {
    		super();
    	}

    	onEnable() {
    		//原生
    		console.log("设置");
    		Advertisement.insertAdverV3();

    		GameManager.settingView = this;
    		this.width = Laya.stage.width;
    		this.height = Laya.stage.height;

    		var musicIndex = GameData.GetData("sound");
    		this.musicBtn.selectedIndex = musicIndex;

    		this.musicBtn.on(Laya.Event.CLICK, this, this.clickMusic);
    		this.continueBtn.on(Laya.Event.CLICK, this, this.clickClose);
    		this.reStartBtn.on(Laya.Event.CLICK, this, this.clickReStart);
    		this.indexBtn.on(Laya.Event.CLICK, this, this.clickIndex);

    		switch (GameManager.CarJS.type) {
    			case "crash_":
    				GameManager.stopSound("car_up");
    				GameManager.stopSound("car");
    				break;
    			case "crash_minibus":
    				GameManager.stopSound("suv_up");
    				GameManager.stopSound("suv");
    				break;
    			case "crash_bus":
    				GameManager.stopSound("bus_up");
    				GameManager.stopSound("bus");
    				break;
    		}
    	}

    	/**
    	 * 设置音乐
    	 */
    	clickMusic() {
    		var musicIndex = this.musicBtn.selectedIndex;
    		if (musicIndex == 0) {
    			GameManager.OpenSound();
    		} else if (musicIndex == 1) {
    			GameManager.PlaySound("clickBtn");
    			GameManager.CloseSound();
    		}
    		GameData.SetData("sound", musicIndex);
    		GameManager.PlayMusic("bgm");
    	}

    	/**
    	 * 关闭
    	 */
    	clickClose() {
    		GameManager.PlaySound("clickBtn");
    		this.destroy();
    		switch (GameManager.CarJS.type) {
    			case "crash_":
    				GameManager.PlaySound("car", 0);
    				break;
    			case "crash_minibus":
    				GameManager.PlaySound("suv", 0);
    				break;
    			case "crash_bus":
    				GameManager.PlaySound("bus", 0);
    				break;
    		}
    	}

    	/**
    	 * 继续
    	 */
    	clickReStart() {
    		GameManager.PlaySound("clickBtn");
    		if (GameManager.gameScene != null) {
    			clearTimeout(GameManager.createGarageTime);
    			GameManager.gameScene.clickRestart();
    			this.destroy();
    		} else {
    			console.error("游戏场景不存在");
    		}
    	}

    	/**
    	 * 返回主界面
    	 */
    	clickIndex() {
    		//原生
    		console.log("返回首页");
    		Advertisement.insertAdverV3();

    		GameManager.PlaySound("clickBtn");
    		clearTimeout(GameManager.createGarageTime);
    		Laya.Scene.open("Accident/Scene/mainScene.scene");
    		this.destroy();
    	}

    	onDisable() {
    		GameManager.settingView = null;
    	}
    }

    class gameScene extends Laya.Scene {

    	constructor() {
    		super();
    		this.loadValue = 0;
    		this.selectCarID = 1;
    		this.cameraIndex = 0;
    	}

    	onEnable() {
    		GameManager_Collection.showBackBtn();
    		GameManager.gameScene = this;
    		this.width = Laya.stage.width;
    		this.height = Laya.stage.height;
    		this.cameraBtn.on(Laya.Event.CLICK, this, this.choseCamera);

    		this.leftBtn.on(Laya.Event.MOUSE_DOWN, this, this.clickDirectionBtn, ["left"]);
    		this.leftBtn.on(Laya.Event.MOUSE_UP, this, this.unclaspDirectionBtn, ["left"]);
    		this.leftBtn.on(Laya.Event.MOUSE_OUT, this, this.unclaspDirectionBtn, ["left"]);

    		this.rightBtn.on(Laya.Event.MOUSE_DOWN, this, this.clickDirectionBtn, ["right"]);
    		this.rightBtn.on(Laya.Event.MOUSE_UP, this, this.unclaspDirectionBtn, ["right"]);
    		this.rightBtn.on(Laya.Event.MOUSE_OUT, this, this.unclaspDirectionBtn, ["right"]);

    		this.upBtn.on(Laya.Event.MOUSE_DOWN, this, this.clickDirectionBtn, ["up"]);
    		this.upBtn.on(Laya.Event.MOUSE_UP, this, this.unclaspDirectionBtn, ["up"]);
    		this.upBtn.on(Laya.Event.MOUSE_OUT, this, this.unclaspDirectionBtn, ["up"]);

    		this.pauseBtn.on(Laya.Event.CLICK, this, function () {
    			GameManager.PlaySound("clickBtn");
    			Laya.stage.addChild(new settingView());
    		}.bind(this));
    		this.reStartBtn.on(Laya.Event.CLICK, this, this.clickRestart);

    		var CarLockData = GameData.GetData("ChoseCarID");
    		this.selectCarID = CarLockData;
    		Laya.stage.addChild(new garageView(this.selectCarID));
    	}

    	/**
    	 * 重新开始
    	 */
    	clickRestart() {
    		GameManager.PlaySound("clickBtn");
    		GameManager.CarJS.destroyCar();
    		this.choseCar(this.selectCarID);
    		GameManager.gameScene.BtnUI.visible = true;
    		clearTimeout(GameManager.createGarageTime);
    	}

    	/**
    	 * 点击方向按钮
    	 * @param {*} btnName 按钮名称
    	 */
    	clickDirectionBtn(btnName) {
    		// console.log("按下" + btnName + "按钮");
    		switch (btnName) {
    			case "left":
    				GameManager.isClickLeftBtn = true;
    				break;
    			case "right":
    				GameManager.isClickRightBtn = true;
    				break;
    			case "up":
    				GameManager.isClickUpBtn = true;
    				break;
    		}
    	}

    	/**
    	 * 松开方向按钮
    	 * @param {*} btnName 按钮名称
    	 */
    	unclaspDirectionBtn(btnName) {
    		// console.log("松开" + btnName + "按钮");
    		switch (btnName) {
    			case "left":
    				GameManager.isClickLeftBtn = false;
    				break;
    			case "right":
    				GameManager.isClickRightBtn = false;
    				break;
    			case "up":
    				GameManager.isClickUpBtn = false;
    				break;
    		}
    	}

    	/**
    	 * 变换摄像机视角
    	 */
    	choseCamera() {
    		GameManager.PlaySound("clickBtn");
    		if (GameManager.CarJS != null) {
    			this.cameraIndex++;
    			if (this.cameraIndex > 3) {
    				this.cameraIndex = 0;
    			}
    			GameManager.CarJS.choseCamera(this.cameraIndex);
    		}
    	}

    	/**
    	 * 选择车辆
    	 */
    	choseCar(selectCarID) {
    		this.selectCarID = selectCarID;
    		GameManager.Car = Laya.Sprite3D.instantiate(GameManager.resModel.getChildByName("Car_" + this.selectCarID), GameManager.Scene);
    		GameManager.Car.transform.position = GameManager.Scene.getChildByName("born").transform.position;
    		GameManager.Car.transform.rotation = GameManager.Scene.getChildByName("born").transform.rotation;
    		GameManager.CarJS = GameManager.Car.addComponent(Car);
    		GameManager.Camera.active = true;
    	}

    	onDisable() {
    		if (GameManager.garageView) {
    			Laya.timer.clearAll(GameManager.garageView);
    			GameManager.garageView.destroy();
    			GameManager.garageView = null;
    		}

    		if (GameManager.settingView) {
    			Laya.timer.clearAll(GameManager.settingView);
    			GameManager.settingView.destroy();
    			GameManager.settingView = null;
    		}

    		if (GameManager.failView) {
    			Laya.timer.clearAll(GameManager.failView);
    			GameManager.failView.destroy();
    			GameManager.failView = null;
    		}

    		if (GameManager.successView) {
    			Laya.timer.clearAll(GameManager.successView);
    			GameManager.successView.destroy();
    			GameManager.successView = null;
    		}

    		if (GameManager.Scene) {
    			Laya.timer.clearAll(GameManager.Scene);
    			GameManager.Scene.destroy();
    			GameManager.Scene = null;
    		}
    		GameManager.gameScene = null;
    		clearTimeout(GameManager.createGarageTime);

    		Laya.timer.scale = 1;
    		Laya.timer.clearAll(this);
    	}
    }

    class loadingScene extends Laya.Scene {

    	constructor() {
    		super();
    		this.loadValue = 0;
    		this.updateLoadValue = 0;
    		this.isLoading = false;
    	}

    	onEnable() {
    		if (GameManager_Collection.GameConfig) {
    			if (GameManager_Collection.gq) {
    				this.logo.skin = GameManager_Collection.GameConfig.gamesLogo[GameManager_Collection.GameID];
    			} else {
    				this.logo.skin = "Collection/AllGameScene/logo.png";
    			}
    		}

    		this.width = Laya.stage.width;
    		this.height = Laya.stage.height;
    		Laya.timer.loop(1, this, this.update);

    		this.loadValue = 1;
    		this.isLoading = true;
    	}

    	update() {
    		this.updateLoadValue += 0.01;
    		if (this.updateLoadValue > this.loadValue) {
    			this.updateLoadValue = this.loadValue;
    		}
    		this.loadBar.mask.graphics.clear();
    		this.loadBar.mask.graphics.drawRect(0, 0, this.loadBar.width * this.updateLoadValue, this.loadBar.height, "#ff0000", null, 1);

    		if (this.updateLoadValue >= 1 && this.isLoading) {
    			Laya.timer.clear(this, this.update);
    			this.loadStr.text = "正在进入场景";
    			this.toIndex();
    		}
    	}

    	/**
    	 * 前往主界面
    	 */
    	toIndex() {
    		GameData.InitData(function () {
    			GameManager.PlayMusic("bgm");
    			Laya.Scene.open("Accident/Scene/mainScene.scene");
    		}.bind(this));
    	}

    	onDisable() {
    		Laya.timer.scale = 1;
    		Laya.timer.clearAll(this);
    	}
    }

    class updateLog extends updateLog_AccidentUI {

    	constructor() {
    		super();
    	}

    	onEnable() {
    		console.log("updateLog");

    		GameManager.updateLogView = this;
    		this.width = Laya.stage.width;
    		this.height = Laya.stage.height;
    		this.continueBtn.on(Laya.Event.CLICK, this, this.clickClose);
    	}

    	/**
    	 * 关闭
    	 */
    	clickClose() {
    		GameData.SetData("updateLog", 1);
    		GameManager.PlaySound("clickBtn");
    		this.destroy();
    	}

    	onDisable() {
    		GameManager.updateLogView = null;
    	}
    }

    class mainScene extends Laya.Scene {

    	constructor() {
    		super();
    		this.loadValue = 0;
    		this.updateLoadValue = 0;
    		this.resource = [];
    	}

    	onEnable() {
    		if (GameManager_Collection.GameConfig) {
    			if (GameManager_Collection.gq) {
    				this.logo.skin = GameManager_Collection.GameConfig.gamesLogo[GameManager_Collection.GameID];
    			} else {
    				this.logo.skin = "Collection/AllGameScene/logo.png";
    			}
    		}

    		GameManager_Collection.showBackBtn();

    		this.width = Laya.stage.width;
    		this.height = Laya.stage.height;
    		this.InitBtn();
    		this.loadScene();

    		if (GameData.GetData("updateLog") == 0) {
    			Laya.stage.addChild(new updateLog());
    		}
    	}

    	/**
    	 * 加载场景
    	 */
    	loadScene() {
    		this.resource = [
    			"res/Accident/Unity/LayaScene_Scene_Accident_1/Conventional/Scene_Accident_1.ls",
    			"res/Accident/Unity/LayaScene_Object_Accident/Conventional/Object_Accident.lh",
    			"res/Accident/Unity/LayaScene_Scene_hangar_Accident/Conventional/Scene_hangar_Accident.ls",
    		];
    		Laya.loader.create(this.resource, Laya.Handler.create(this, this.onPreLoadFinish),
    			Laya.Handler.create(this, function (value) {
    				this.loadValue = value;
    			})
    		);
    	}

    	/**
    	 * 场景加载成功回调
    	 */
    	onPreLoadFinish() {
    		GameManager.resScene = Laya.Loader.getRes(this.resource[0].url);
    		GameManager.resModel = Laya.Loader.getRes(this.resource[1].url);
    		GameManager.resScene_garage = Laya.Loader.getRes(this.resource[2].url);
    		GameManager.Camera = GameManager.resScene.getChildByName("Main Camera");
    		GameManager.Camera.active = false;

    		var roadList = GameManager.resScene.getChildByName("road")._children;
    		for (var key in roadList) {
    			roadList[key].active = false;
    		}
    	}

    	/**
    	 * 初始化按钮点击事件
    	 */
    	InitBtn() {
    		this.startBtn.on(Laya.Event.CLICK, this, this.clickStart);
    	}

    	/**
    	 * 点击开始
    	 */
    	clickStart() {
    		GameManager_Collection.hideBackBtn();
    		GameManager.PlaySound("clickBtn");
    		this.loadingUI.visible = true;
    		Laya.timer.loop(1, this, this.update);
    	}

    	update() {
    		this.updateLoadValue += 0.01;
    		if (this.updateLoadValue > this.loadValue) {
    			this.updateLoadValue = this.loadValue;
    		}

    		this.loadBar.mask.graphics.clear();
    		this.loadBar.mask.graphics.drawRect(0, 0, this.loadBar.width * this.updateLoadValue, this.loadBar.height, "#ff0000", null, 1);
    		this.loadNum.text = parseInt(this.updateLoadValue * 100) + "%";

    		if (this.updateLoadValue >= 1) {
    			Laya.timer.clear(this, this.update);
    			this.loadStr.text = "正在加载资源";
    			Laya.Scene.open("Accident/Scene/gameScene.scene");
    		}
    	}

    	onDisable() {
    		Laya.timer.scale = 1;
    		Laya.timer.clearAll(this);
    		if (GameManager.updateLogView) {
    			GameManager.updateLogView.destroy();
    			GameManager.updateLogView = null;
    		}
    	}
    }

    class GameData$1 {
    	/**
    	 * 初始化本地数据
    	 * @param successcallback 完成回调
    	 */
    	static InitData(successcallback) {
    		var AccidentData = Laya.LocalStorage.getItem("Accident2");
    		if (AccidentData) {
    			console.log("============老用户============");
    			GameData$1.AccidentData = JSON.parse(AccidentData);
    			var day = new Date().getDate();
    			if (GameData$1.GetData("curDay") != day) {
    				console.log("============新的一天============");
    				GameData$1.SetData("curDay", day);
    			}
    		} else {
    			console.log("============新用户============");
    			GameData$1.SaveData();
    		}
    		var config = [
    			"res/Accident2/JSON/car.json",
    		];

    		Laya.loader.load(config, Laya.Handler.create(this, function () {
    			for (var key in config) {
    				GameData$1.JSONData = Laya.loader.getRes(config[key]);
    			}
    			console.log(GameData$1.JSONData);
    			successcallback();
    		}));
    	}

    	/**
    	 * 保存数据
    	 */
    	static SaveData() {
    		var AccidentData = JSON.stringify(GameData$1.AccidentData);
    		Laya.LocalStorage.setItem("Accident2", AccidentData);
    	}

    	/**
    	 * 获取数据
    	 * @param key 数据名称
    	 * @returns 返回数据
    	 */
    	static GetData(key) {
    		return GameData$1.AccidentData[key];
    	}

    	/**
    	 * 设置数据
    	 * @param key 数据名称
    	 * @param value 数据
    	 */
    	static SetData(key, value) {
    		GameData$1.AccidentData[key] = value;
    		GameData$1.SaveData();
    	}
    }
    GameData$1.AccidentData = {
    	"yssm": 0,                                                              //隐私声明
    	"curDay": 0,                                                            //日期
    	"sound": 0,                                                             //声音
    	"Car": [1, 0, 0, 0, 0, 0, 0, 0],                                        //车辆解锁
    	"ChoseCarID": 1,
    	"firstGame": true
    };
    GameData$1.JSONData = null;

    class GameManager$1 {

    	static OpenSound() {
    		Laya.SoundManager.muted = false;
    	}

    	static CloseSound() {
    		Laya.SoundManager.muted = true;
    	}

    	/**
    	* 播放声音
    	* @param name 音频名称
    	* @param loop 循环（1：不循环   0：循环）
    	* @param callback 播放完成回调
    	*/
    	static PlaySound(name, loop = 1, callback = null) {
    		if (GameData$1.GetData("sound") == 1) {
    			return;
    		}
    		console.log(name);
    		GameManager$1.stopSound(name);
    		var sn = "res/Accident2/Music/" + name + ".wav";
    		var soundManager = Laya.SoundManager.playSound(sn, loop, Laya.Handler.create(this, () => {
    			GameManager$1.clearSoundManager(name);
    			if (callback) {
    				callback();
    			}
    		}));
    		GameManager$1.hasPlayedSoundManager.push(soundManager);
    	}

    	/**
    	* 清除音乐控制器
    	* @param name 音频名称
    	*/
    	static clearSoundManager(name) {
    		var sn = "res/Accident2/Music/" + name + ".wav";
    		for (var key in GameManager$1.hasPlayedSoundManager) {
    			if (GameManager$1.hasPlayedSoundManager[key] != null) {
    				if (GameManager$1.hasPlayedSoundManager[key].url.indexOf(sn) != -1) {
    					GameManager$1.hasPlayedSoundManager.splice(key, 1);
    				}
    			} else {
    				GameManager$1.hasPlayedSoundManager.splice(key, 1);
    			}
    		}
    	}

    	/**
    	* 停止播放声音
    	* @param name 音频名称
    	*/
    	static stopSound(name) {
    		var sn = "res/Accident2/Music/" + name + ".wav";
    		for (var key in GameManager$1.hasPlayedSoundManager) {
    			if (GameManager$1.hasPlayedSoundManager[key] != null) {
    				if (GameManager$1.hasPlayedSoundManager[key].url.indexOf(sn) != -1) {
    					GameManager$1.hasPlayedSoundManager[key].stop();
    				}
    			} else {
    				GameManager$1.hasPlayedSoundManager.splice(key, 1);
    			}
    		}
    	}

    	/**
    	* 暂停播放声音
    	* @param name 音频名称
    	*/
    	static pauseSound(name) {
    		var sn = "res/Accident2/Music/" + name + ".wav";
    		for (var key in GameManager$1.hasPlayedSoundManager) {
    			if (GameManager$1.hasPlayedSoundManager[key] != null) {
    				if (GameManager$1.hasPlayedSoundManager[key].url.indexOf(sn) != -1) {
    					if (!GameManager$1.hasPlayedSoundManager[key].isStopped) {
    						// console.log("暂停声音：" + name);
    						GameManager$1.hasPlayedSoundManager[key].pause();
    					}
    				}
    			} else {
    				GameManager$1.hasPlayedSoundManager.splice(key, 1);
    			}
    		}
    	}

    	/**
    	* 继续播放声音
    	* @param name 音频名称
    	*/
    	static resumeSound(name) {
    		var sn = "res/Accident2/Music/" + name + ".wav";
    		for (var key in GameManager$1.hasPlayedSoundManager) {
    			if (GameManager$1.hasPlayedSoundManager[key] != null) {
    				if (GameManager$1.hasPlayedSoundManager[key].url.indexOf(sn) != -1) {
    					if (GameManager$1.hasPlayedSoundManager[key].isStopped) {
    						// console.log("继续声音：" + name);
    						GameManager$1.hasPlayedSoundManager[key].resume();
    					};
    				}
    			} else {
    				GameManager$1.hasPlayedSoundManager.splice(key, 1);
    			}
    		}
    	}

    	/**
    	* 播放背景声音
    	* @param name 音频名称
    	*/
    	static PlayMusic(name) {
    		if (GameData$1.GetData("sound") == 1) {
    			return;
    		}
    		Laya.SoundManager.stopAll();
    		var sn = "res/Accident2/Music/" + name + ".wav";
    		console.log("播放音乐(" + name + ")");
    		Laya.SoundManager.playMusic(sn, 0);
    		if (GameData$1.GetData("sound") == 1) {
    			GameManager$1.CloseSound();
    		}
    	}
    	/**
    	 * 随机一个数
    	 * @param min 最小值
    	 * @param max 最大值
    	 * @returns 返回随机数
    	 */
    	static random(min, max) {
    		return Math.floor(Math.random() * (max + 1 - min)) + min;
    	}

    	static createRay(position1, position2, distance = 10000) {
    		let tmp = new Laya.Vector3(0, 0, 0);
    		Laya.Vector3.subtract(position1, position2, tmp);
    		let dst = new Laya.Vector3(0, 0, 0);
    		Laya.Vector3.normalize(tmp, dst);
    		let _ray = new Laya.Ray(position1, dst);
    		var outHitRusult = new Laya.HitResult();
    		GameManager$1.Scene.physicsSimulation.rayCast(_ray, outHitRusult, distance);

    		if (outHitRusult.succeeded) {
    			var name = outHitRusult.collider.owner.name;
    			// console.log(outHitRusult);
    			return outHitRusult;
    		}
    		return null;
    	}

    	static createRay_List(position1, position2) {
    		if (GameManager$1.CarJS.flyTime > 0) {
    			return null;
    		}
    		let tmp = new Laya.Vector3(0, 0, 0);
    		Laya.Vector3.subtract(position1, position2, tmp);
    		let dst = new Laya.Vector3(0, 0, 0);
    		Laya.Vector3.normalize(tmp, dst);
    		var ray = new Laya.Ray(position1, dst);
    		var outHitRusult = [];
    		GameManager$1.resScene.physicsSimulation.rayCastAll(ray, outHitRusult, 999, Laya.Physics3DUtils.COLLISIONFILTERGROUP_CUSTOMFILTER1, Laya.Physics3DUtils.COLLISIONFILTERGROUP_CUSTOMFILTER1);
    		if (outHitRusult.length != 0) {
    			return outHitRusult;
    		}
    		return null;
    	}

    	static createRay_Ground() {
    		let ray = new Laya.Ray(new Laya.Vector3(GameManager$1.Car.transform.position.x, 100, GameManager$1.Car.transform.position.z), new Laya.Vector3(0, -1, 0));
    		var outHitRusult = [];
    		GameManager$1.resScene.physicsSimulation.rayCastAll(ray, outHitRusult, 999);
    		if (outHitRusult.length == 0) {
    			GameManager$1.groundhigh = 0;
    			// console.log("没照到地面");
    		}
    		else {
    			for (let i = 0; i < outHitRusult.length; i++) {
    				let r = outHitRusult[i];
    				if (r.succeeded && r.collider.owner.layer == 2) {
    					if (GameManager$1.groundhigh != r.point.y) {
    						// console.log("现在地面的高度是   " + r.point.y);
    						GameManager$1.groundhigh = r.point.y;
    					}
    				}
    			}
    		}

    	}

    	static createEffect(name, postiton) {
    		var effect = Laya.Sprite3D.instantiate(GameManager$1.resModel.getChildByName(name), GameManager$1.Scene);
    		effect.transform.position = new Laya.Vector3(postiton.x, 4, postiton.z);
    	}

    	static createAbandonedCar(name, postiton, rotation) {
    		var AbandonedCar = Laya.Sprite3D.instantiate(GameManager$1.resModel.getChildByName("crash").getChildByName(name), GameManager$1.Scene);
    		AbandonedCar.transform.position = postiton;
    		AbandonedCar.transform.rotationEuler = new Laya.Vector3(0, rotation.y, 0);
    	}
    	static delAbandonedCar() {
    		for (var key in GameManager$1.Scene._children) {
    			if (GameManager$1.Scene._children[key].name == "boom_22" || GameManager$1.Scene._children[key].name.indexOf("crash_") != -1) {
    				GameManager$1.Scene._children[key].destroy();
    			}
    		}
    	}
    }
    GameManager$1.hasPlayedSoundManager = [];
    ////////////////////////////////////////////////////////////////////////////////////////////
    GameManager$1.resScene = null;            //场景资源
    GameManager$1.resScene_garage = null;     //车房资源
    GameManager$1.Scene = null;
    GameManager$1.resModel = null;            //预制体资源
    ////////////////////////////////////////////////////////////////////////////////////////////
    //3D物体
    GameManager$1.Camera = null;              //场景摄像机
    GameManager$1.Car = null;
    GameManager$1.garageScene = null;         //车房
    ////////////////////////////////////////////////////////////////////////////////////////////
    //3D物体脚本
    GameManager$1.CarJS = null;
    ////////////////////////////////////////////////////////////////////////////////////////////
    //参数
    GameManager$1.onGroundDis_B = 0.7;         //后轮落地距离
    GameManager$1.onGroundDis_F = 6.5;         //前轮落地距离
    GameManager$1.type1 = [12, 13];           //suv车型编号
    GameManager$1.type2 = [14, 15, 16, 17];   //大巴车型编号

    GameManager$1.isClickLeftBtn = false;     //是否点击左方向按钮
    GameManager$1.isClickRightBtn = false;    //是否点击右方向按钮
    GameManager$1.isClickUpBtn = false;       //是否点击上方向按钮
    GameManager$1.isClickDownBtn = false;     //是否点击减速按钮
    GameManager$1.isSuccess = false;
    GameManager$1.isPause = false;
    ////////////////////////////////////////////////////////////////////////////////////////////
    //场景脚本
    GameManager$1.gameScene = null;
    GameManager$1.settingView = null;         //设置界面脚本
    GameManager$1.failView = null;            //失败界面脚本
    GameManager$1.successView = null;         //成功界面脚本



    GameManager$1.flyFlag = false;            //汽车撞飞标识
    GameManager$1.cantmoveFlag = false;       //不能前进标识
    GameManager$1.cantBackFlag = false;       //不能倒退标识
    GameManager$1.stopFlyFlag = false;        //停止汽车飞标识
    GameManager$1.maxY = 0;
    GameManager$1.carPos = "zheng";           //车辆正反 
    GameManager$1.groundhigh = 0;             //地面高度
    GameManager$1.fTakeUpFlag = false;        //前轮抬起标识
    GameManager$1.mapList = [];               //已经玩过的地图列表

    class CarTrigger$1 extends Laya.Script3D {

    	constructor() {
    		super();
    		///////////////////////////////////////////////////////////////////////////////////////////////
    		//3D组件
    		this.trigger = null;                            //触发器
    		///////////////////////////////////////////////////////////////////////////////////////////////
    		//参数
    		this.name = null;                               //名称
    		this.isTrigger = false;                         //是否触发
    		this.outHitRusult = null;                       //
    		this.hitName = null;
    		this.hitName_f = null;

    		this.distance = null;
    		this.showLog = false;
    		// console.log("============进入监听器==============");
    	}

    	onEnable() {
    		this.trigger = this.owner;
    		this.name = this.trigger.name;

    		//WF_T
    		//WR_T
    		if (this.name == "WF_T") {
    			this.showLog = true;
    		}
    	}

    	onUpdate() {
    		// GameManager.createRay_Ground();
    		if (GameManager$1.gameScene != null) {
    			var speedNum;
    			if (GameManager$1.CarJS.carSpeed > 0) {
    				speedNum = parseInt(GameManager$1.CarJS.carSpeed * 5);
    			} else {
    				speedNum = parseInt(GameManager$1.CarJS.carSpeed * 3);
    			}
    			GameManager$1.gameScene.speedNum.text = Math.abs(speedNum.toFixed(1));
    		}
    		if (this.name == "P2") {
    			var position1 = new Laya.Vector3(this.trigger.transform.position.x, this.trigger.transform.position.y + 6, this.trigger.transform.position.z);
    			var position2 = new Laya.Vector3(this.trigger.transform.position.x, this.trigger.transform.position.y + 4, this.trigger.transform.position.z);
    			this.outHitRusult = GameManager$1.createRay_List(position2, position1);

    			if (this.outHitRusult) {
    				for (var key in this.outHitRusult) {
    					var point = this.outHitRusult[key].point;
    					if (point.y > 3.1) {
    						this.b_hight = point.y;
    					} else {
    						this.b_hight = 3.1;
    					}
    				}
    			} else {
    				this.b_hight = 3.1;
    			}

    			if (this.outHitRusult == null && GameManager$1.Car.transform.position.y > 3.5) {
    				if (GameManager$1.carPos == "zheng") {
    					GameManager$1.CarJS.StartGravity();
    				} else {
    					if (GameManager$1.Car.transform.position.y > 5.5) {
    						GameManager$1.CarJS.StartGravity();
    					}
    				}
    				GameManager$1.maxY = 0;
    			} else if (this.outHitRusult && GameManager$1.Car.transform.position.y > 4) {
    				var maxY = -999;
    				for (var key in this.outHitRusult) {
    					var point = this.outHitRusult[key].point;
    					if (point.y > maxY) {
    						maxY = point.y;
    					}
    				}
    				GameManager$1.maxY = maxY;
    				// console.log("maxY   " + maxY + "    GameManager.Car.transform.position.y    " + GameManager.Car.transform.position.y);
    				if (GameManager$1.carPos == "zheng") {
    					if (maxY + 1.5 < GameManager$1.Car.transform.position.y) {
    						// console.log("准备开启重力");
    						GameManager$1.CarJS.StartGravity();
    					}
    				}
    			}
    		} else if (this.name == "P1") {//WF_T
    			var position1 = new Laya.Vector3(this.trigger.transform.position.x, this.trigger.transform.position.y + 6, this.trigger.transform.position.z);
    			var position2 = new Laya.Vector3(this.trigger.transform.position.x, this.trigger.transform.position.y + 4, this.trigger.transform.position.z);
    			// console.log(this.trigger.transform.position.y);  //6.407349735498428

    			// let lineSprite = GameManager.Scene.addChild(new Laya.PixelLineSprite3D(1));
    			// lineSprite.addLine(position1, position2, Laya.Color.RED, Laya.Color.RED);

    			this.outHitRusult = GameManager$1.createRay_List(position2, position1);
    			// console.log("============================================");
    			if (this.outHitRusult) {
    				for (var key in this.outHitRusult) {
    					// console.log(this.outHitRusult[key].collider.owner.name);
    					var point = this.outHitRusult[key].point;
    					// console.log(point.y);
    					// console.log(Laya.Vector3.distance(position1, point));
    					if (point.y > 3.1) {
    						if (Math.abs(point.y - GameManager$1.Car.transform.position.y) < 1) {
    							GameManager$1.Car.transform.position = new Laya.Vector3(GameManager$1.Car.transform.position.x, point.y + 1, GameManager$1.Car.transform.position.z);
    						}
    						// GameManager.Car.transform.position = new Laya.Vector3(GameManager.Car.transform.position.x, point.y + 1.5, GameManager.Car.transform.position.z);
    						this.f_hight = point.y;
    					}
    					else {
    						this.f_hight = 3.1;
    					}
    					// console.log(this.outHitRusult[key].collider.owner.getComponent(Laya.Rigidbody3D).canCollideWith);
    				}
    			} else {
    				// if (GameManager.CarJS.GravityPause) {
    				//     GameManager.Car.transform.position = new Laya.Vector3(GameManager.Car.transform.position.x, GameManager.groundhigh + 1, GameManager.Car.transform.position.z);
    				// }
    				GameManager$1.CarJS.carTakeOff();
    				this.f_hight = 3.1;
    			}
    		} else if (this.name == "P3") {
    			var position1 = new Laya.Vector3(this.trigger.transform.position.x, this.trigger.transform.position.y + 6, this.trigger.transform.position.z);
    			var position2 = new Laya.Vector3(this.trigger.transform.position.x, this.trigger.transform.position.y + 4, this.trigger.transform.position.z);
    			this.outHitRusult = GameManager$1.createRay_List(position2, position1);
    			if (this.outHitRusult) {
    				for (var key in this.outHitRusult) {
    					var point = this.outHitRusult[key].point;
    					if (point.y > 3.1) {
    						this.l_hight = point.y;
    					} else {
    						this.l_hight = 3.1;
    					}
    				}
    			} else {
    				this.l_hight = 3.1;
    			}
    		} else if (this.name == "P4") {
    			var position1 = new Laya.Vector3(this.trigger.transform.position.x, this.trigger.transform.position.y + 6, this.trigger.transform.position.z);
    			var position2 = new Laya.Vector3(this.trigger.transform.position.x, this.trigger.transform.position.y + 4, this.trigger.transform.position.z);
    			this.outHitRusult = GameManager$1.createRay_List(position2, position1);
    			if (this.outHitRusult) {
    				for (var key in this.outHitRusult) {
    					var point = this.outHitRusult[key].point;
    					if (point.y > 3.1) {
    						this.r_hight = point.y;
    					} else {
    						this.r_hight = 3.1;
    					}
    				}
    			} else {
    				this.r_hight = 3.1;
    			}
    		}
    	}

    	/**
    	 * 是否在地面上方
    	 * @param {*} outHitRusult 射线穿透数组
    	 * @param {*} name 名称
    	 * @returns 
    	 */
    	getHitRusult(outHitRusult, name) {
    		if (outHitRusult) {
    			for (var key in outHitRusult) {
    				var rayName = outHitRusult[key].collider.owner.name;
    				if (rayName == name) {
    					return outHitRusult[key]
    				}
    			}
    			return null;
    		} else {
    			return null;
    		}
    	}

    	/**
    	 * 剔除
    	 * @param {*} outHitRusult 射线穿透数组
    	 * @param {*} name 名称
    	 * @returns 
    	 */
    	withOutRusult(outHitRusult, name) {
    		if (outHitRusult) {
    			for (var key in outHitRusult) {
    				var rayName = outHitRusult[key].collider.owner.name;
    				if (rayName == name) {
    					return true;
    				}
    			}
    			return false;
    		} else {
    			return false;
    		}
    	}

    	onDisable() {
    	}

    	onTriggerEnter(other) {
    		// console.log("other.owner.name " + other.owner.name);
    	}
    }

    class failView$1 extends failView_Accident2UI {

    	constructor() {
    		super();
    	}

    	onEnable() {
    		//原生
    		console.log("失败2");
    		Advertisement.insertAdverV();

    		if (GameManager$1.settingView != null) {
    			GameManager$1.settingView.clickClose();
    		}

    		GameManager$1.failView = this;
    		this.width = Laya.stage.width;
    		this.height = Laya.stage.height;

    		this.reStartBtn.on(Laya.Event.CLICK, this, this.clickRestart);
    		this.indexBtn.on(Laya.Event.CLICK, this, this.clickIndex);
    	}

    	/**
    	 * 点击重新开始
    	 */
    	clickRestart() {

    		GameManager$1.PlaySound("clickBtn");
    		if (GameManager$1.gameScene != null) {
    			GameManager$1.gameScene.clickRestart();
    			this.destroy();
    		} else {
    			console.error("游戏场景不存在");
    		}
    	}

    	/**
    	 * 返回主页面
    	 */
    	clickIndex() {
    		//原生
    		console.log("返回首页");
    		Advertisement.insertAdverV3();

    		GameManager$1.PlaySound("clickBtn");
    		if (GameManager$1.resScene) {
    			GameManager$1.resScene.destroy();
    			GameManager$1.resScene = null;
    		}
    		Laya.Scene.open("Accident2/Scene/mainScene.scene");
    		this.destroy();
    	}

    	onDisable() {
    		GameManager$1.failView = null;
    	}
    }

    class TriggerCollisionScript extends Laya.Script3D {
    	constructor() {
    		super();
    		this.controller = null;
    		this.name;
    	}
    	onEnable() {
    		this.name = this.owner.name;
    		console.log(this.name);
    	}
    	onTriggerEnter(other) {
    		if (other.owner.name == "End") {
    			GameManager$1.gameScene.playerSuccess();
    			// GameManager.CarJS.carSpeed = GameManager.CarJS.carSpeed * 0.1;
    		} else {
    			if (GameManager$1.gameScene.successFlag) {
    				GameManager$1.CarJS.carSpeed = 0;
    			} else {
    				switch (this.name) {
    					case "T_FL":
    						if (GameManager$1.CarJS.carSpeed > 30) {
    							if (!GameManager$1.flyFlag) {
    								GameManager$1.flyFlag = true;
    								if (other.owner.name == "wall_1") {
    									GameManager$1.CarJS.countAngle(1);
    								} else if (other.owner.name == "wall_1 (1)") {
    									GameManager$1.CarJS.countAngle(2);
    								} else {
    									GameManager$1.CarJS.startFly(-60);
    								}
    								GameManager$1.stopFlyFlag = true;
    								console.log("左边碰撞，往右飞");
    								GameManager$1.CarJS.Car_2.active = false;
    								GameManager$1.CarJS.car_2_FL.active = true;

    							} else {
    								if (!GameManager$1.stopFlyFlag) {
    									Laya.timer.clear(GameManager$1.CarJS, GameManager$1.CarJS.carFltHigh);
    									GameManager$1.stopFlyFlag = true;
    									GameManager$1.CarJS.flyTime = 0;
    									Laya.timer.clear(GameManager$1.CarJS, GameManager$1.CarJS.testC1Rotate);
    									console.log("左边又碰到东西了");
    									GameManager$1.CarJS.getHuiZheng();
    								}
    							}
    						}
    						break;
    					case "T_FR":
    						if (GameManager$1.CarJS.carSpeed > 30) {
    							if (!GameManager$1.flyFlag) {
    								GameManager$1.flyFlag = true;
    								if (other.owner.name == "wall_1") {
    									GameManager$1.CarJS.countAngle(1);
    								} else if (other.owner.name == "wall_1 (1)") {
    									GameManager$1.CarJS.countAngle(2);
    								} else {
    									GameManager$1.CarJS.startFly(60);
    								}
    								GameManager$1.stopFlyFlag = true;
    								console.log("右边碰撞，往左飞");
    								GameManager$1.CarJS.Car_2.active = false;
    								GameManager$1.CarJS.car_2_FR.active = true;
    								if (other.owner.name == "wall_1 (1)") {
    									GameManager$1.CarJS.countAngle(2);
    								}
    							} else {
    								if (!GameManager$1.stopFlyFlag) {
    									Laya.timer.clear(GameManager$1.CarJS, GameManager$1.CarJS.carFltHigh);
    									GameManager$1.stopFlyFlag = true;
    									GameManager$1.CarJS.flyTime = 0;
    									Laya.timer.clear(GameManager$1.CarJS, GameManager$1.CarJS.testC1Rotate);
    									console.log("右边又碰到东西了");
    									GameManager$1.CarJS.getHuiZheng();
    								}
    							}
    						}
    						break;
    					case "T_M":
    						if (GameManager$1.CarJS.carSpeed > 30) {
    							if (!GameManager$1.flyFlag) {
    								GameManager$1.flyFlag = true;
    								if (other.owner.name == "wall_1") {
    									GameManager$1.CarJS.countAngle(1);
    								} else if (other.owner.name == "wall_1 (1)") {
    									GameManager$1.CarJS.countAngle(2);
    								} else {
    									GameManager$1.CarJS.startFly(0);
    								}
    								GameManager$1.stopFlyFlag = true;
    								console.log("中间碰撞，前滚翻");
    								GameManager$1.CarJS.Car_2.active = false;
    								GameManager$1.CarJS.car_2_All.active = true;
    							} else {
    								if (!GameManager$1.stopFlyFlag) {
    									Laya.timer.clear(GameManager$1.CarJS, GameManager$1.CarJS.carFltHigh);
    									GameManager$1.stopFlyFlag = true;
    									GameManager$1.CarJS.flyTime = 0;
    									Laya.timer.clear(GameManager$1.CarJS, GameManager$1.CarJS.testC1Rotate);
    									console.log("中间又碰到东西了");
    									GameManager$1.CarJS.getHuiZheng();
    								}
    							}
    						}
    						break;
    				}
    			}
    		}
    	}

    	onTriggerStay(other) {
    		if (GameManager$1.flyFlag)
    			return;
    		if (this.name != "T_B") {
    			if (!GameManager$1.cantmoveFlag && other.owner.name != "End") {
    				console.log("停止前进");
    				GameManager$1.CarJS.carSpeed = 0;
    				GameManager$1.cantmoveFlag = true;
    			}
    		} else {
    			if (!GameManager$1.cantBackFlag && other.owner.name != "End") {
    				console.log("停止后退");
    				GameManager$1.CarJS.carSpeed = 0;
    				GameManager$1.cantBackFlag = true;
    			}
    		}
    	}

    	onTriggerExit(other) {
    		if (this.name != "T_B") {
    			if (GameManager$1.cantmoveFlag && other.owner.name != "End" && !GameManager$1.flyFlag) {
    				GameManager$1.cantmoveFlag = false;
    			}
    		} else {
    			if (GameManager$1.cantBackFlag && other.owner.name != "End" && !GameManager$1.flyFlag) {
    				GameManager$1.cantBackFlag = false;
    			}
    		}
    	}
    	onCollisionEnter(collision) {
    	}
    	onCollisionStay(collision) {
    	}
    	onCollisionExit(collision) {
    	}
    }

    class Car$1 extends Laya.Script3D {

    	constructor() {
    		super();
    		///////////////////////////////////////////////////////////////////////////////////////////////
    		//3D组件
    		this.car = null;                            //车
    		this.CarTrigger_F = null;                   //前轮触发器
    		this.CarTrigger_B = null;                   //后轮触发器
    		///////////////////////////////////////////////////////////////////////////////////////////////
    		//脚本
    		this.CarTrigger_F_JS = null;                //前轮触发器脚本
    		this.CarTrigger_B_JS = null;                //后轮触发器脚本
    		///////////////////////////////////////////////////////////////////////////////////////////////
    		//参数
    		this.name = null;                           //名称
    		this.carID = 0;                             //车辆ID
    		this.GravitySpeed = 0;                      //重力速度
    		this.GravitySpeed_accelerat = 0.002;        //重力加速度
    		this.GravityPause = true;                   //是否停止下落
    		this.carSpeed = 0;                          //车速
    		this.carAcceleratSpeed = 0.1 * 5;                 //加速度
    		this.carAcceleratSpeed_ratio = 1;           //加速度系数
    		this.carSpeed_accelerat = 0.000001;         //加速度
    		this.wheelsSpeed = 1;                       //轮胎旋转速率
    		this.carSlope = 0;                          //车辆斜率
    		this.keyDownList = [];                      //按下键盘
    		this.rotateAngle = 0;                       //转弯角度
    		this.RotateLimit = 1;                       //限制转弯车速
    		this.MaxAccelerateRotate = 1;                //达到限制转弯加速度
    		this.AccelerateRotate = 1;                  //转弯加速度

    		this.decelerate_wheels = 0.1;               //轮胎腾空减速
    		this.decelerate_car = 0.001;                //车辆腾空减速
    		this.stopKeyWheelRotate = false;            //放开键盘腾空后轮减速判断
    		this.startFlyHigh = 0;                      //汽车刚开始飞的高度
    		this.gameFail = false;                      //游戏失败标识
    		this.Car_2 = null;
    		this.car_2_All = null;
    		this.car_2_FL = null;
    		this.car_2_FR = null;
    		this.car_2_Left = null;
    		this.car_2_Right = null;

    		this.flySpeed = 0;
    		this.flyTime = 0;


    		this.xnum = 0;
    		this.znum = 0;

    		this.type = "";

    		this.speed_a = 1;
    		this.speed_rotate = 1;
    		this.speed_up = 1;

    		this.isDJ = true;
    		this.isRotate = false;
    		this.testFlag = false;
    		this.carRotateFlag = false;
    		this.checkFlag = false;

    	}

    	/**
    	 * 摧毁车辆
    	 */
    	destroyCar() {
    		// switch (this.type) {
    		//     case "crash_":
    		GameManager$1.stopSound("car_up");
    		GameManager$1.stopSound("car");
    		//         break;
    		//     case "crash_minibus":
    		//         GameManager.stopSound("suv_up");
    		//         GameManager.stopSound("suv");
    		//         break;
    		//     case "crash_bus":
    		//         GameManager.stopSound("bus_up");
    		//         GameManager.stopSound("bus");
    		//         break;
    		// }
    		this.CarTrigger_F.destroy();
    		this.CarTrigger_B.destroy();
    		this.car.destroy();
    	}

    	onEnable() {
    		this.car = this.owner;
    		this.name = this.car.name;
    		this.InitCar();
    		// this.carID = this.name.replace(/[^\d]/g, "");
    		// this.type = this.setType();
    		// GameManager.isSuccess = false;
    		// for (var key = 1; key <= 3; key++) {
    		//     GameManager.gameScene.timeUI.getChildByName(key + "").visible = false;
    		// }
    		// this.timeUI = 3;
    		// GameManager.gameScene.timeUI.getChildByName(this.timeUI + "").visible = true;
    		// GameManager.isPause = true;
    		// Laya.timer.frameLoop(1000, this, this.timeOut);

    		// var carJSON = GameData.JSONData[this.carID];
    		// this.speed_a = carJSON.speed_a;
    		// this.speed_rotate = carJSON.speed_rotate;
    		// this.speed_up = carJSON.speed_up;
    		// console.log(carJSON);

    		// switch (this.type) {
    		//     case "crash_":
    		GameManager$1.PlaySound("car", 0);
    		//         break;
    		//     case "crash_minibus":
    		//         GameManager.PlaySound("suv", 0);
    		//         break;
    		//     case "crash_bus":
    		//         GameManager.PlaySound("bus", 0);
    		//         break;
    		// }
    		// this.isDJ = true;
    	}

    	/**
    	* 初始化车
    	*/
    	InitCar() {
    		this.carAcceleratSpeed = 0.5 * GameData$1.JSONData[GameData$1.GetData("ChoseCarID")].speed_a;


    		this.CarTrigger_F = this.car.getChildAt(0).getChildAt(0).getChildAt(0).getChildAt(0).getChildByName("P1");
    		this.CarTrigger_B = this.car.getChildAt(0).getChildAt(0).getChildAt(0).getChildAt(0).getChildByName("P2");
    		this.CarTrigger_L = this.car.getChildAt(0).getChildAt(0).getChildAt(0).getChildAt(0).getChildByName("P3");
    		this.CarTrigger_R = this.car.getChildAt(0).getChildAt(0).getChildAt(0).getChildAt(0).getChildByName("P4");

    		this.CarTrigger_FL = this.car.getChildAt(0).getChildAt(0).getChildAt(0).getChildAt(0).getChildByName("T_FL");
    		this.CarTrigger_RL = this.car.getChildAt(0).getChildAt(0).getChildAt(0).getChildAt(0).getChildByName("T_FR");
    		this.CarTrigger_M = this.car.getChildAt(0).getChildAt(0).getChildAt(0).getChildAt(0).getChildByName("T_M");
    		this.CarTrigger_Top = this.car.getChildAt(0).getChildAt(0).getChildAt(0).getChildAt(0).getChildByName("T_Top");
    		this.CarTrigger_TB = this.car.getChildAt(0).getChildAt(0).getChildAt(0).getChildAt(0).getChildByName("T_B");
    		this.CarTrigger_FL.getComponent(Laya.Rigidbody3D).canCollideWith = Laya.Physics3DUtils.COLLISIONFILTERGROUP_CUSTOMFILTER1;
    		this.CarTrigger_FL.getComponent(Laya.Rigidbody3D).collisionGroup = Laya.Physics3DUtils.COLLISIONFILTERGROUP_CUSTOMFILTER2;
    		this.CarTrigger_RL.getComponent(Laya.Rigidbody3D).canCollideWith = Laya.Physics3DUtils.COLLISIONFILTERGROUP_CUSTOMFILTER1;
    		this.CarTrigger_RL.getComponent(Laya.Rigidbody3D).collisionGroup = Laya.Physics3DUtils.COLLISIONFILTERGROUP_CUSTOMFILTER2;
    		this.CarTrigger_M.getComponent(Laya.Rigidbody3D).canCollideWith = Laya.Physics3DUtils.COLLISIONFILTERGROUP_CUSTOMFILTER1;
    		this.CarTrigger_M.getComponent(Laya.Rigidbody3D).collisionGroup = Laya.Physics3DUtils.COLLISIONFILTERGROUP_CUSTOMFILTER2;
    		this.CarTrigger_TB.getComponent(Laya.Rigidbody3D).canCollideWith = Laya.Physics3DUtils.COLLISIONFILTERGROUP_CUSTOMFILTER1;
    		this.CarTrigger_TB.getComponent(Laya.Rigidbody3D).collisionGroup = Laya.Physics3DUtils.COLLISIONFILTERGROUP_CUSTOMFILTER2;
    		this.CarTrigger_FL_JS = this.CarTrigger_FL.addComponent(TriggerCollisionScript);
    		this.CarTrigger_RL_JS = this.CarTrigger_RL.addComponent(TriggerCollisionScript);
    		this.CarTrigger_M_JS = this.CarTrigger_M.addComponent(TriggerCollisionScript);
    		this.CarTrigger_TB_JS = this.CarTrigger_TB.addComponent(TriggerCollisionScript);

    		this.CarTrigger_F_JS = this.CarTrigger_F.addComponent(CarTrigger$1);
    		this.CarTrigger_B_JS = this.CarTrigger_B.addComponent(CarTrigger$1);
    		this.CarTrigger_L_JS = this.CarTrigger_L.addComponent(CarTrigger$1);
    		this.CarTrigger_R_JS = this.CarTrigger_R.addComponent(CarTrigger$1);


    		this.StartGravity();
    		this.listenKeyboard();
    		Laya.timer.frameLoop(1, this, this.Keyboard);
    		this.StartCameraMove("back");
    		this.Car_2 = this.car.getChildAt(0).getChildAt(0).getChildAt(0).getChildByName("car_2_New");
    		this.car_2_All = this.car.getChildAt(0).getChildAt(0).getChildAt(0).getChildByName("car_2_All");
    		this.car_2_FL = this.car.getChildAt(0).getChildAt(0).getChildAt(0).getChildByName("car_2_FL");
    		this.car_2_FR = this.car.getChildAt(0).getChildAt(0).getChildAt(0).getChildByName("car_2_FR");
    		this.car_2_Left = this.car.getChildAt(0).getChildAt(0).getChildAt(0).getChildByName("car_2_Left");
    		this.car_2_Right = this.car.getChildAt(0).getChildAt(0).getChildAt(0).getChildByName("car_2_Right");
    		this.car_2_All.active = false;
    		this.car_2_FL.active = false;
    		this.car_2_FR.active = false;
    		this.car_2_Left.active = false;
    		this.car_2_Right.active = false;

    		this.Wheels_FL = this.car.getChildAt(0).getChildAt(0).getChildAt(0).getChildAt(0).getChildByName("Wheels_FL");
    		this.Wheels_FR = this.car.getChildAt(0).getChildAt(0).getChildAt(0).getChildAt(0).getChildByName("Wheels_FR");

    		this.Wheels_FL_roate = this.car.getChildAt(0).getChildAt(0).getChildAt(0).getChildAt(0).getChildByName("Wheels_FL").getChildAt(0);
    		this.Wheels_FR_roate = this.car.getChildAt(0).getChildAt(0).getChildAt(0).getChildAt(0).getChildByName("Wheels_FR").getChildAt(0);
    		this.Wheels_RL_roate = this.car.getChildAt(0).getChildAt(0).getChildAt(0).getChildAt(0).getChildByName("Wheels_RL");
    		this.Wheels_RR_roate = this.car.getChildAt(0).getChildAt(0).getChildAt(0).getChildAt(0).getChildByName("Wheels_RR");


    		var box = this.car.getChildAt(0).getChildAt(0).getChildAt(0).addChild(new Laya.MeshSprite3D(Laya.PrimitiveMesh.createBox(0.1, 0.1, 0.1), "pos"));
    		box.transform.position = new Laya.Vector3(this.car.getChildAt(0).getChildAt(0).getChildAt(0).transform.position.x, this.car.getChildAt(0).getChildAt(0).getChildAt(0).transform.position.y + 4, this.car.getChildAt(0).getChildAt(0).getChildAt(0).transform.position.z - 8);
    		console.log(this.car);
    	}

    	/**
    	 * 摄像机开始跟随
    	 */
    	StartCameraMove(posName) {
    		Laya.timer.clear(this, this.CameraMove);
    		Laya.timer.frameLoop(1, this, this.CameraMove, [posName]);
    	}

    	/**
    	 * 选择摄像机位置
    	 */
    	choseCamera(cameraIndex) {
    		switch (cameraIndex) {
    			case 0:
    				this.StartCameraMove("back");
    				break;
    			case 1:
    				this.StartCameraMove("left_front");
    				break;
    			case 2:
    				this.StartCameraMove("right_front");
    				break;
    			case 3:
    				this.StartCameraMove("back_right");
    				break;
    			case 4:
    				this.StartCameraMove("left");
    				break;
    			case 5:
    				this.StartCameraMove("right");
    				break;
    		}
    	}
    	/**
    	 * 摄像机跟随更新
    	 */
    	CameraMove(posName) {
    		// var distance = Laya.Vector3.distance(this.Wheels_FL.transform.position, this.Wheels_RL_roate.transform.position);
    		var position = new Laya.Vector3(this.car.getChildAt(0).getChildAt(0).getChildAt(0).transform.position.x, this.car.getChildAt(0).getChildAt(0).getChildAt(0).transform.position.y + 0.5, this.car.getChildAt(0).getChildAt(0).getChildAt(0).transform.position.z);
    		switch (posName) {
    			case "left_front":
    				GameManager$1.Camera.transform.position = new Laya.Vector3(this.car.transform.position.x + 10, this.car.transform.position.y + 5, this.car.transform.position.z + 10);
    				GameManager$1.Camera.transform.lookAt(position, new Laya.Vector3(0, 1, 0));
    				GameManager$1.Camera.transform.rotate(new Laya.Vector3(0, 0, 0), true, false);
    				break;
    			case "right_front":
    				GameManager$1.Camera.transform.position = new Laya.Vector3(this.car.transform.position.x - 10, this.car.transform.position.y + 5, this.car.transform.position.z + 10);
    				GameManager$1.Camera.transform.lookAt(position, new Laya.Vector3(0, 1, 0));
    				GameManager$1.Camera.transform.rotate(new Laya.Vector3(0, 0, 0), true, false);
    				break;
    			case "back":
    				var x;
    				var y;
    				var z;
    				x = this.car.getChildAt(0).getChildAt(0).getChildAt(0).getChildByName("pos").transform.position.x;
    				y = this.car.getChildAt(0).getChildAt(0).getChildAt(0).getChildByName("pos").transform.position.y;
    				z = this.car.getChildAt(0).getChildAt(0).getChildAt(0).getChildByName("pos").transform.position.z;
    				if (x > 15) {
    					x = 15;
    				}
    				if (x < -5) {
    					x = -5;
    				}
    				if (z < -120) {
    					z = -120;
    				}
    				if (z > 360) {
    					z = 360;
    				}
    				if (GameManager$1.maxY > 3.5) {
    					y = GameManager$1.maxY + 6;
    				}
    				GameManager$1.Camera.transform.position = new Laya.Vector3(x, y, z);
    				GameManager$1.Camera.transform.lookAt(position, new Laya.Vector3(0, 1, 0));
    				GameManager$1.Camera.transform.rotate(new Laya.Vector3(5, 0, 0), true, false);
    				// if (this.car.transform.position.x > 21 || this.car.transform.position.x < -8.7 || this.car.transform.position.z < -124 || this.car.transform.position.z > 368)
    				break;
    			case "back_right":
    				GameManager$1.Camera.transform.position = new Laya.Vector3(this.car.transform.position.x - 12, this.car.transform.position.y + 11, this.car.transform.position.z - 12);
    				GameManager$1.Camera.transform.lookAt(position, new Laya.Vector3(0, 1, 0));
    				GameManager$1.Camera.transform.rotate(new Laya.Vector3(-8, 0, 0), true, false);
    				break;
    			case "left":
    				GameManager$1.Camera.transform.position = new Laya.Vector3(this.car.transform.position.x + 15, this.car.transform.position.y + 0.5, this.car.transform.position.z + (distance / 2));
    				GameManager$1.Camera.transform.lookAt(position, new Laya.Vector3(0, 1, 0));
    				GameManager$1.Camera.transform.rotate(new Laya.Vector3(0, 0, 0), true, false);
    				break;
    			case "right":
    				GameManager$1.Camera.transform.position = new Laya.Vector3(this.car.transform.position.x - 15, this.car.transform.position.y + 0.5, this.car.transform.position.z + (distance / 2));
    				GameManager$1.Camera.transform.lookAt(position, new Laya.Vector3(0, 1, 0));
    				GameManager$1.Camera.transform.rotate(new Laya.Vector3(0, 0, 0), true, false);
    				break;
    			case "test":
    				GameManager$1.Camera.transform.position = new Laya.Vector3(this.car.transform.position.x, this.car.transform.position.y + 4, this.car.transform.position.z - 15);
    				GameManager$1.Camera.transform.lookAt(position, new Laya.Vector3(0, 1, 0));
    				GameManager$1.Camera.transform.rotate(new Laya.Vector3(20, 0, 0), true, false);
    				break;
    		}
    	}

    	/**
    	* 初始化重力
    	*/
    	setGravity() {
    		// if (GameManager.settingView != null || GameManager.isPause) {
    		//     return;
    		// }
    		if (this.CarTrigger_Top.transform.position.y < 4.4)
    			return;
    		this.GravitySpeed += this.GravitySpeed_accelerat + this.GravitySpeed * 0.00001;
    		this.car.transform.position = new Laya.Vector3(this.car.transform.position.x, this.car.transform.position.y - this.GravitySpeed, this.car.transform.position.z);
    		// if (this.CarTrigger_B_JS.isTrigger && this.CarTrigger_B_JS.distance <= GameManager.onGroundDis_B && (this.CarTrigger_B_JS.hitName == "road_1" || this.CarTrigger_B_JS.hitName == "ground")) {
    		//     this.PauseGravity();
    		// Laya.timer.clear(this, this.CarRotate);
    		if (!this.carRotateFlag) {
    			this.carRotateFlag = true;
    			Laya.timer.frameLoop(1, this, this.CarRotate);
    		}
    		//     if (this.CarTrigger_B_JS.hitName == "road_1") {
    		//         this.StartCarTranslate();
    		//     }
    		// }
    		if (this.CarTrigger_F.transform.position.y < 4.29) {
    			if (this.car.transform.position.y <= 3.1 || this.Wheels_RL_roate.transform.position.y < 3.622) {
    				this.PauseGravity();
    			}
    		} else {
    			if (this.car.transform.position.y <= 3.1 || this.Wheels_RL_roate.transform.position.y < 3.622) {
    				this.PauseGravity();
    			}
    			// }
    		}
    	}

    	/**
    	 * 开启重力(开始下落)
    	 */
    	StartGravity() {
    		if (this.testFlag) {
    			return;
    		}
    		// console.log("开启重力");
    		if (this.CarTrigger_F.transform.position.y < 4.29) {
    			if (this.car.transform.position.y > 4) {
    				if (this.GravityPause && this.flyTime <= 0) {
    					this.GravitySpeed = 0;
    					this.GravityPause = false;
    					Laya.timer.frameLoop(1, this, this.setGravity);
    				}
    			}
    		} else {
    			if (this.car.transform.position.y > 4) {
    				if (this.GravityPause && this.flyTime <= 0) {
    					this.GravitySpeed = 0;
    					this.GravityPause = false;
    					Laya.timer.frameLoop(1, this, this.setGravity);
    				}
    			}
    		}



    	}

    	/**
    	 * 关闭重力(停止下落)
    	 */
    	PauseGravity() {
    		if (!this.GravityPause) {
    			Laya.timer.clear(this, this.setGravity);
    			this.GravityPause = true;
    			if (GameManager$1.carPos == "zheng") {
    				if (this.Wheels_RL_roate.transform.position.y < 3.5) {
    					this.car.transform.position = new Laya.Vector3(this.car.transform.position.x, 3.5, this.car.transform.position.z);
    				}
    			} else {
    				this.car.transform.position = new Laya.Vector3(this.car.transform.position.x, this.car.transform.position.y + 3, this.car.transform.position.z);
    			}
    			// console.log("this.CarTrigger_F.transform.position.y    " + this.CarTrigger_F.transform.position.y);
    			// console.log("this.CarTrigger_FL.transform.position.y    " + this.CarTrigger_FL.transform.position.y);
    			// console.log("this.CarTrigger_RL.transform.position.y    " + this.CarTrigger_RL.transform.position.y);
    			// console.log("this.CarTrigger_M.transform.position.y    " + this.CarTrigger_M.transform.position.y);
    			// console.log(this.Wheels_RL_roate.transform.position.y);//3.625
    			// console.log(this.Wheels_RR_roate.transform.position.y);//3.622
    			// console.log(this.CarTrigger_Top.transform.position.y + "        " + GameManager.maxY);//4.447
    			// console.log("this.car.getChildAt(0).getChildAt(0).getChildAt(0).transform.position.y    " + this.car.getChildAt(0).getChildAt(0).getChildAt(0).transform.position.y);//3.25
    			// GameManager.PlaySound("onGround");
    		}
    	}

    	/**
    	 * 车体位移
    	 */
    	CarTranslate() {
    		if (GameManager$1.settingView != null || GameManager$1.isPause) {
    			return;
    		}
    		if (this.carSpeed > 0 && GameManager$1.cantmoveFlag)
    			return;
    		// if (this.carSpeed < 0 && GameManager.cantBackFlag)
    		//     return;
    		// if (this.CarTrigger_B_JS.isTrigger && this.CarTrigger_B_JS.hitName == "road_1") {
    		this.carAcceleratSpeed += this.carSpeed_accelerat * this.carAcceleratSpeed_ratio * this.speed_a;
    		// this.carSpeed += this.carAcceleratSpeed + this.carSlope * 0.0001;
    		var spt = this.carSpeed * Laya.timer.delta / 1000;
    		var direction = new Laya.Vector3(0, 0, 0);
    		this.car.transform.getForward(direction);
    		this.car.transform.translate(new Laya.Vector3(-direction.x * spt, -direction.y * spt, -direction.z * spt), false);

    		// var a = this.carSpeed * (0 - this.rotateAngle) * 0.05;
    		// this.car.transform.rotate(new Laya.Vector3(0, -a * 0.03, 0));

    		this.Wheels_RL_roate.transform.rotate(new Laya.Vector3(this.wheelsSpeed * this.carSpeed, 0, 0), true, false);
    		this.Wheels_RR_roate.transform.rotate(new Laya.Vector3(this.wheelsSpeed * this.carSpeed, 0, 0), true, false);
    		this.Wheels_FL_roate.transform.rotate(new Laya.Vector3(this.wheelsSpeed * this.carSpeed, 0, 0), true, false);
    		this.Wheels_FR_roate.transform.rotate(new Laya.Vector3(this.wheelsSpeed * this.carSpeed, 0, 0), true, false);
    		this.temWheelsSspeed_B = this.wheelsSpeed * this.carSpeed;
    		// } else {
    		//     this.Wheels_B_TimeOUT();
    		//     if (this.CarTrigger_B_JS.isTrigger && this.CarTrigger_B_JS.distance <= GameManager.onGroundDis_B && this.CarTrigger_B_JS.hitName == "ground") {
    		//         // this.PauseGravity();
    		//     } else {
    		//         this.CarTranslate_TimeOUT();
    		//         this.StartGravity();
    		//     }
    		// }

    		// if (this.CarTrigger_F_JS.isTrigger && this.CarTrigger_F_JS.hitName == "road_1") {
    		//     this.Wheels_FL_roate.transform.rotate(new Laya.Vector3(this.wheelsSpeed * this.carSpeed, 0, 0), true, false);
    		//     this.Wheels_FR_roate.transform.rotate(new Laya.Vector3(this.wheelsSpeed * this.carSpeed, 0, 0), true, false);
    		//     this.temWheelsSspeed_F = this.wheelsSpeed * this.carSpeed;
    		// } else {
    		//     this.stopKeyWheelRotate = true;
    		//     this.Wheels_F_TimeOUT();
    		// }

    		// console.log(this.CarTrigger_F_JS.f_hight + "    " + this.CarTrigger_B_JS.b_hight);
    	}

    	/**
    	 * 开始车体位移
    	 */
    	StartCarTranslate() {
    		if (this.carSpeed == 0) {
    			this.carSpeed = this.GravitySpeed;
    			console.log("初速度:" + this.carSpeed);
    		}
    		Laya.timer.frameLoop(1, this, this.CarTranslate);
    	}

    	/**
    	 * 按键盘更新
    	 */
    	Keyboard() {
    		// if (GameManager.gameScene != null) {
    		// var speedNum = parseInt(this.carSpeed * 7);
    		// if (speedNum < 0) {
    		//     speedNum = 0;
    		// }
    		// }
    		if ((this.keyDownList[87] || GameManager$1.isClickUpBtn) && !GameManager$1.gameScene.successFlag) {
    			this.speedUp();
    		} else if (!this.keyDownList[83] && !GameManager$1.isClickDownBtn) {

    			if (this.carSpeed > 0) {
    				this.carSpeed -= 0.3;
    			}
    			else {
    				this.carSpeed = 0;
    			}
    			this.CarTranslate();
    		}
    		if ((this.keyDownList[83] || GameManager$1.isClickDownBtn) && !GameManager$1.gameScene.successFlag) {
    			this.speedDown();
    		}

    		this.Wheels_FL.transform.localRotationEulerY = this.rotateAngle;
    		this.Wheels_FR.transform.localRotationEulerY = this.rotateAngle;

    		if (!this.keyDownList[37] && !this.keyDownList[39] && !this.keyDownList[65] && !this.keyDownList[68] && !GameManager$1.isClickLeftBtn && !GameManager$1.isClickRightBtn) {
    			this.rotateAngle += (0 - this.rotateAngle) * 0.2;
    		} else {
    			if (this.keyDownList[65] || this.keyDownList[37] || GameManager$1.isClickLeftBtn) {
    				// console.log("左转");
    				this.left();
    			}
    			if (this.keyDownList[68] || this.keyDownList[39] || GameManager$1.isClickRightBtn) {
    				// console.log("右转");
    				this.right();
    			}
    		}
    	}
    	/**
       * 左转
       */
    	left() {
    		if (GameManager$1.maxY == 0 && GameManager$1.Car.transform.position.y > 4.5)
    			return;
    		if (this.rotateAngle < 0) {
    			this.rotateAngle = 0;
    		}
    		if (this.carSpeed >= this.RotateLimit) {
    			this.rotateAngle += 0.2 * GameData$1.JSONData[GameData$1.GetData("ChoseCarID")].speed_rotate;
    		} else {
    			this.rotateAngle += 0.3 * GameData$1.JSONData[GameData$1.GetData("ChoseCarID")].speed_rotate;
    		}
    		if (this.rotateAngle >= 20) {
    			this.rotateAngle = 20;
    		}
    		if (this.carSpeed != 0) {
    			if (this.carSpeed > 0) {
    				this.car.transform.rotate(new Laya.Vector3(0, this.rotateAngle / 3, 0), false, false);
    			} else if (this.carSpeed < 0) {
    				this.car.transform.rotate(new Laya.Vector3(0, -this.rotateAngle / 3, 0), false, false);
    			}
    		}
    	}

    	/**
    	 * 右转
    	 */
    	right() {
    		if (GameManager$1.maxY == 0 && GameManager$1.Car.transform.position.y > 4.5)
    			return;
    		if (this.rotateAngle > 0) {
    			this.rotateAngle = 0;
    		}
    		if (this.carSpeed >= this.RotateLimit) {
    			this.rotateAngle -= 0.2 * GameData$1.JSONData[GameData$1.GetData("ChoseCarID")].speed_rotate;
    		} else {
    			this.rotateAngle -= 0.3 * GameData$1.JSONData[GameData$1.GetData("ChoseCarID")].speed_rotate;
    		}
    		if (this.rotateAngle <= -20) {
    			this.rotateAngle = -20;
    		}
    		if (this.carSpeed != 0) {
    			if (this.carSpeed > 0) {
    				this.car.transform.rotate(new Laya.Vector3(0, this.rotateAngle / 10, 0), false, false);
    			} else if (this.carSpeed < 0) {
    				this.car.transform.rotate(new Laya.Vector3(0, -this.rotateAngle / 10, 0), false, false);
    			}
    		}
    	}

    	/**
    	 * 前后旋转车辆
    	 */
    	CarRotate() {
    		if (GameManager$1.flyFlag)
    			return;
    		if ((this.CarTrigger_F_JS.f_hight - 0.1 > this.CarTrigger_B_JS.b_hight || this.CarTrigger_F_JS.f_hight + 0.1 < this.CarTrigger_B_JS.b_hight) && GameManager$1.Car.transform.position.y > 1) {
    			var high = Math.abs(this.CarTrigger_F_JS.f_hight - this.CarTrigger_B_JS.b_hight);
    			var r = Laya.Vector3.distance(this.car.getChildAt(0).getChildAt(0).getChildAt(0).getChildAt(0).getChildByName("P1").transform.position, this.car.getChildAt(0).getChildAt(0).getChildAt(0).getChildAt(0).getChildByName("P2").transform.position);
    			var asin = Math.round(Math.asin(high / r) * 180 / Math.PI);
    			if (this.CarTrigger_F_JS.f_hight < this.CarTrigger_B_JS.b_hight) {
    				asin = -asin;
    			}
    			if (Math.abs(asin) > 30) {
    				asin = 0;
    			}
    			if (asin > 0 && !GameManager$1.fTakeUpFlag) {
    				GameManager$1.fTakeUpFlag = true;
    			}
    			if (asin == 0 && GameManager$1.maxY > 0 && !GameManager$1.fTakeUpFlag) {
    				GameManager$1.fTakeUpFlag = true;
    			}
    			if (asin < 0 || GameManager$1.maxY == 0) {
    				GameManager$1.fTakeUpFlag = false;
    			}
    			if (asin) {
    				var fuyang = asin / 180 * Math.PI;
    				var v = new Laya.Vector3(0, 0, 0);
    				var v1 = new Laya.Vector3(0, 0, 0);
    				this.car.getChildAt(0).getChildAt(0).getChildAt(0).transform.rotation.getYawPitchRoll(v);
    				this.car.getChildAt(0).getChildAt(0).getChildAt(0).getChildByName("car_2_New").transform.rotation.getYawPitchRoll(v1);
    				var q1 = new Laya.Quaternion(0, 0, 0, 1);
    				Laya.Quaternion.createFromYawPitchRoll(v1.x, v.y - fuyang, v1.z, q1);
    				var q = new Laya.Quaternion(0, 0, 0, 1);
    				Laya.Quaternion.slerp(this.car.getChildAt(0).getChildAt(0).getChildAt(0).getChildByName("car_2_New").transform.rotation, q1, 0.1, q);
    				this.car.getChildAt(0).getChildAt(0).getChildAt(0).getChildByName("car_2_New").transform.rotation = q;
    			}
    		} else {
    			if (GameManager$1.Car.transform.position.y < 4) {
    				GameManager$1.Car.transform.position = new Laya.Vector3(GameManager$1.Car.transform.position.x, 4, GameManager$1.Car.transform.position.z);
    			}
    			var v = new Laya.Vector3(0, 0, 0);
    			this.car.getChildAt(0).getChildAt(0).getChildAt(0).transform.rotation.getYawPitchRoll(v);
    			var q1 = new Laya.Quaternion(0, 0, 0, 1);
    			Laya.Quaternion.createFromYawPitchRoll(v.x, v.y, v.z, q1);
    			var q = new Laya.Quaternion(0, 0, 0, 1);
    			Laya.Quaternion.slerp(this.car.getChildAt(0).getChildAt(0).getChildAt(0).getChildByName("car_2_New").transform.rotation, q1, 0.2, q);
    			this.car.getChildAt(0).getChildAt(0).getChildAt(0).getChildByName("car_2_New").transform.rotation = q;
    		}


    		if ((this.CarTrigger_L_JS.l_hight - 0.02 > this.CarTrigger_R_JS.r_hight || this.CarTrigger_L_JS.l_hight + 0.02 < this.CarTrigger_R_JS.r_hight)) {
    			var high = Math.abs(this.CarTrigger_L_JS.l_hight - this.CarTrigger_R_JS.r_hight);
    			var r = Laya.Vector3.distance(this.car.getChildAt(0).getChildAt(0).getChildAt(0).getChildAt(0).getChildByName("P3").transform.position, this.car.getChildAt(0).getChildAt(0).getChildAt(0).getChildAt(0).getChildByName("P4").transform.position);
    			var asin = Math.round(Math.asin(high / r) * 180 / Math.PI);
    			if (this.CarTrigger_L_JS.l_hight < this.CarTrigger_R_JS.r_hight) {
    				asin = -asin;
    			}
    			if (Math.abs(asin) > 30) {
    				asin = 0;
    			}
    			if (asin) {
    				var fuyang = asin / 180 * Math.PI;
    				var v = new Laya.Vector3(0, 0, 0);
    				var v1 = new Laya.Vector3(0, 0, 0);
    				this.car.getChildAt(0).getChildAt(0).getChildAt(0).transform.rotation.getYawPitchRoll(v);
    				this.car.getChildAt(0).getChildAt(0).getChildAt(0).getChildByName("car_2_New").transform.rotation.getYawPitchRoll(v1);
    				var q1 = new Laya.Quaternion(0, 0, 0, 1);
    				Laya.Quaternion.createFromYawPitchRoll(v1.x, v1.y, v.z + fuyang, q1);
    				var q = new Laya.Quaternion(0, 0, 0, 1);
    				Laya.Quaternion.slerp(this.car.getChildAt(0).getChildAt(0).getChildAt(0).getChildByName("car_2_New").transform.rotation, q1, 0.1, q);
    				this.car.getChildAt(0).getChildAt(0).getChildAt(0).getChildByName("car_2_New").transform.rotation = q;
    			}
    		} else {
    			var v = new Laya.Vector3(0, 0, 0);
    			this.car.getChildAt(0).getChildAt(0).getChildAt(0).transform.rotation.getYawPitchRoll(v);
    			var q1 = new Laya.Quaternion(0, 0, 0, 1);
    			Laya.Quaternion.createFromYawPitchRoll(v.x, v.y, v.z, q1);
    			var q = new Laya.Quaternion(0, 0, 0, 1);
    			Laya.Quaternion.slerp(this.car.getChildAt(0).getChildAt(0).getChildAt(0).getChildByName("car_2_New").transform.rotation, q1, 0.2, q);
    			this.car.getChildAt(0).getChildAt(0).getChildAt(0).getChildByName("car_2_New").transform.rotation = q;
    		}

    		// this.car.transform.rotate(new Laya.Vector3(-0.1, 0, 0), true, false);

    		// if (GameManager.settingView != null || GameManager.isPause) {
    		//     return;
    		// }
    		// if (this.CarTrigger_F_JS.isTrigger && this.CarTrigger_F_JS.hitName == "road_1") {
    		//     if (this.CarTrigger_F_JS.hitName_f) {
    		//         if (!this.isRotate) {
    		//             GameManager.PlaySound("onGround");
    		//             this.isRotate = true;
    		//         }
    		//         var dValue = this.CarTrigger_F_JS.distance - GameManager.onGroundDis_F;
    		//         this.car.transform.rotate(new Laya.Vector3(dValue * this.carSpeed * 16, 0, 0), true, false);
    		//         this.carSlope += dValue * this.carSpeed * 16;
    		//     }
    		// } else {
    		//     if (this.CarTrigger_B_JS.isTrigger && this.CarTrigger_B_JS.distance <= GameManager.onGroundDis_B && this.CarTrigger_B_JS.hitName == "ground") {
    		//         var dValue = this.CarTrigger_F_JS.distance - GameManager.onGroundDis_F;
    		//         this.car.transform.rotate(new Laya.Vector3(dValue * this.GravitySpeed * 16, 0, 0), true, false);
    		//         this.carSlope += dValue * this.GravitySpeed * 16;
    		//     }
    		// }
    	}

    	/**
    	 * 加速
    	 */
    	speedUp() {
    		// if (GameManager.settingView != null || GameManager.isPause) {
    		//     return;
    		// }
    		if (GameManager$1.cantmoveFlag)
    			return;
    		if (this.carSpeed < 50) {
    			this.carSpeed += this.carAcceleratSpeed;
    		} else {
    			this.carSpeed = 50;
    		}
    		this.CarTranslate();
    		if (this.isDJ) {
    			this.isDJ = false;
    			// switch (this.type) {
    			//     case "crash_":
    			GameManager$1.stopSound("car");
    			GameManager$1.PlaySound("car_up", 0);
    			//         break;
    			//     case "crash_minibus":
    			//         // GameManager.stopSound("suv");
    			//         // GameManager.PlaySound("suv_up", 0);
    			//         break;
    			//     case "crash_bus":
    			//         // GameManager.stopSound("bus");
    			//         // GameManager.PlaySound("bus_up", 0);
    			//         break;
    			// }
    		}
    		// if (this.CarTrigger_B_JS.isTrigger && this.CarTrigger_B_JS.distance <= GameManager.onGroundDis_B) {
    		//     this.carAcceleratSpeed_ratio = 10 * this.speed_up;
    		// } else {
    		this.stopKeyWheelRotate = false;
    		// this.Wheels_RL_roate.transform.rotate(new Laya.Vector3(10 * this.speed_up, 0, 0), true, false);
    		// this.Wheels_RR_roate.transform.rotate(new Laya.Vector3(10 * this.speed_up, 0, 0), true, false);
    		this.temWheelsSspeed_B = 10 * this.speed_up;
    		// }
    	}

    	/**
    	 * 减速
    	 */
    	speedDown() {
    		// if (GameManager.settingView != null || GameManager.isPause) {
    		//     return;
    		// }
    		if (GameManager$1.cantBackFlag)
    			return;
    		if (!this.isDJ) {
    			this.isDJ = true;
    			GameManager$1.PlaySound("car", 0);
    			GameManager$1.stopSound("car_up");
    		}
    		if (this.carSpeed > 0) {
    			this.carSpeed -= this.carAcceleratSpeed * 5;
    		} else if (this.carSpeed > -10) {
    			this.carSpeed -= this.carAcceleratSpeed;
    		} else {
    			this.carSpeed = -10;
    		}
    		this.CarTranslate();
    	}

    	/**
    	 * 添加键盘监听事件
    	 */
    	listenKeyboard() {
    		console.log("设置键盘监听事件");
    		//添加键盘按下事件,一直按着某按键则会不断触发
    		Laya.stage.on(Laya.Event.KEY_DOWN, this, this.onKeyDown);
    		//添加键盘抬起事件
    		Laya.stage.on(Laya.Event.KEY_UP, this, this.onKeyUp);
    	}

    	/**
    	 * 按下键盘
    	 * @param {*} e 
    	 */
    	onKeyDown(e) {
    		this.keyDownList[e["keyCode"]] = true;
    	}

    	/**
    	 * 抬起键盘
    	 * @param {*} e 
    	 */
    	onKeyUp(e) {
    		delete this.keyDownList[e["keyCode"]];
    	}

    	testC1Rotate() {
    		// if (this.jiaodu > 0) {
    		//     this.car.transform.rotate(new Laya.Vector3(0, this.rotateAngle, 0), false, false);
    		// } else if (this.jiaodu < 0) {
    		//     this.car.transform.rotate(new Laya.Vector3(0, this.rotateAngle, 0), false, false);
    		// }
    		// console.log(this.Wheels_RL_roate.transform.position.y);
    		if (this.carSpeed > 0 && this.Wheels_RL_roate.transform.position.y > 3.5) {
    			var jiaodu = 10 * this.carSpeed / 50;
    			if (jiaodu < 2) {
    				jiaodu = 2;
    			}
    			// jiaodu = 150;
    			this.carSpeed -= 0.2;
    			// this.carSpeed = 0;
    			// this.flyTime = 0;
    			var fuyang = jiaodu / 180 * Math.PI;
    			var q = new Laya.Quaternion(0, 0, 0, 1);
    			this.car.getChildAt(0).getChildAt(0).transform.rotation.rotateX(fuyang, q);
    			this.car.getChildAt(0).getChildAt(0).transform.rotation = q;
    			this.car.getChildAt(0).getChildAt(0).getChildAt(0).transform.rotation.rotateZ(fuyang / 2, q);
    			this.car.getChildAt(0).getChildAt(0).getChildAt(0).transform.rotation = q;
    			this.xnum += jiaodu;
    			this.znum += jiaodu / 2;
    		}
    		else {
    			this.getHuiZheng();
    		}
    		this.CarTranslate();
    	}
    	getHuiZheng() {
    		this.carSpeed = 0;
    		Laya.timer.clear(this, this.testC1Rotate);
    		console.log("this.xnum    " + this.xnum + "     this.znum      " + this.znum);
    		var wanzheng = this.xnum % 360;
    		if (wanzheng < 90) {
    			wanzheng = -wanzheng;
    		} else if (wanzheng < 180) {
    			wanzheng = 180 - wanzheng;
    		} else if (wanzheng < 270) {
    			wanzheng = -(wanzheng - 180);
    		} else {
    			wanzheng = 360 - wanzheng;
    		}

    		var wanzheng1 = this.znum % 360;
    		if (wanzheng1 < 90) {
    			wanzheng1 = -wanzheng1;
    		} else if (wanzheng1 < 180) {
    			wanzheng1 = 180 - wanzheng1;
    		} else if (wanzheng1 < 270) {
    			wanzheng1 = -(wanzheng1 - 180);
    		} else {
    			wanzheng1 = 360 - wanzheng1;
    		}
    		this.huizheng = wanzheng;
    		this.huizheng1 = wanzheng1;
    		Laya.timer.frameLoop(1, this, this.reRotate);
    		Laya.timer.frameLoop(1, this, this.reRotate1);
    	}
    	reRotate() {
    		if (this.huizheng > 0) {
    			var fuyang;
    			// if (this.huizheng > 1) {
    			//     fuyang = this.huizheng * 0.1 / 180 * Math.PI;
    			//     this.huizheng -= this.huizheng * 0.1;
    			// } else {
    			//     fuyang = 1 / 180 * Math.PI;
    			//     this.huizheng -= 1;
    			// }
    			// fuyang = this.huizheng / 180 * Math.PI;
    			// this.huizheng = 0;

    			this.huizheng -= 3;
    			fuyang = 3 / 180 * Math.PI;

    			var q = new Laya.Quaternion(0, 0, 0, 1);
    			this.car.getChildAt(0).getChildAt(0).transform.rotation.rotateX(fuyang, q);
    			this.car.getChildAt(0).getChildAt(0).transform.rotation = q;
    			// this.car.getChildAt(0).getChildAt(0).getChildAt(0).transform.rotation.rotateZ(fuyang, q);
    			// this.car.getChildAt(0).getChildAt(0).getChildAt(0).transform.rotation = q;
    			if (this.huizheng <= 3) {
    				this.checkCarPosition();
    			}
    			if (this.huizheng <= 0) {
    				// this.checkCarPosition();
    				this.huizheng = 0;
    				Laya.timer.clear(this, this.reRotate);
    				Laya.timer.clear(this, this.checkCarInRoad);
    			}
    		} else {
    			var fuyang;
    			// if (this.huizheng < -1) {
    			//     fuyang = this.huizheng * 0.1 / 180 * Math.PI;
    			//     this.huizheng -= this.huizheng * 0.1;
    			// } else {
    			//     fuyang = 1 / 180 * Math.PI;
    			//     this.huizheng += 1;
    			// }
    			// fuyang = this.huizheng / 180 * Math.PI;
    			// this.huizheng = 0;

    			this.huizheng += 3;
    			fuyang = 3 / 180 * Math.PI;


    			var q = new Laya.Quaternion(0, 0, 0, 1);
    			this.car.getChildAt(0).getChildAt(0).transform.rotation.rotateX(-fuyang, q);
    			this.car.getChildAt(0).getChildAt(0).transform.rotation = q;
    			// this.car.getChildAt(0).getChildAt(0).getChildAt(0).transform.rotation.rotateZ(-fuyang, q);
    			// this.car.getChildAt(0).getChildAt(0).getChildAt(0).transform.rotation = q;
    			if (this.huizheng >= -3) {
    				this.checkCarPosition();
    			}
    			if (this.huizheng >= 0) {
    				// this.checkCarPosition();
    				this.huizheng = 0;
    				Laya.timer.clear(this, this.reRotate);
    				Laya.timer.clear(this, this.checkCarInRoad);
    			}
    		}
    	}

    	reRotate1() {
    		if (this.huizheng1 > 0) {
    			var fuyang;
    			// if (this.huizheng1 > 1) {
    			//     fuyang = this.huizheng1 * 0.1 / 180 * Math.PI;
    			//     this.huizheng1 -= this.huizheng1 * 0.1;
    			// } else {
    			//     fuyang = 1 / 180 * Math.PI;
    			//     this.huizheng1 -= 1;
    			// }
    			// fuyang = this.huizheng1 / 180 * Math.PI;
    			// this.huizheng1 = 0;

    			this.huizheng1 -= 3;
    			fuyang = 3 / 180 * Math.PI;


    			var q = new Laya.Quaternion(0, 0, 0, 1);
    			this.car.getChildAt(0).getChildAt(0).getChildAt(0).transform.rotation.rotateZ(fuyang, q);
    			this.car.getChildAt(0).getChildAt(0).getChildAt(0).transform.rotation = q;
    			if (this.huizheng1 <= 0) {
    				// this.checkCarPosition();
    				this.huizheng1 = 0;
    				Laya.timer.clear(this, this.reRotate1);
    			}
    		} else {
    			var fuyang;
    			// if (this.huizheng1 < -1) {
    			//     fuyang = this.huizheng1 * 0.1 / 180 * Math.PI;
    			//     this.huizheng1 -= this.huizheng1 * 0.1;
    			// } else {
    			//     this.huizheng1 += 1;
    			//     fuyang = 1 / 180 * Math.PI;
    			// }
    			// fuyang = this.huizheng1 / 180 * Math.PI;
    			// this.huizheng1 = 0;

    			this.huizheng1 += 3;
    			fuyang = 3 / 180 * Math.PI;

    			var q = new Laya.Quaternion(0, 0, 0, 1);
    			this.car.getChildAt(0).getChildAt(0).getChildAt(0).transform.rotation.rotateZ(-fuyang, q);
    			this.car.getChildAt(0).getChildAt(0).getChildAt(0).transform.rotation = q;
    			if (this.huizheng1 >= 0) {
    				// this.checkCarPosition();
    				this.huizheng1 = 0;
    				Laya.timer.clear(this, this.reRotate1);
    			}
    		}
    	}
    	startFly(jiaodu = 0) {
    		console.log(this.carSpeed);
    		// console.log("jiaodu    " + jiaodu);
    		// this.car.transform.rotate(new Laya.Vector3(0, jiaodu, 0), false, false);
    		// this.carSpeed = 0;
    		if (this.carSpeed > 30) {
    			this.startFlyHigh = this.car.transform.position.y;
    			// console.log("this.startFlyHigh   " + this.startFlyHigh);
    			this.flyTime = 2000 * this.carSpeed / 50;
    			this.flySpeed = 2 * this.carSpeed / 50 / 5;
    			Laya.timer.clear(this, this.Keyboard);
    			this.StartCameraMove("test");
    			Laya.timer.clear(this, this.CarRotate);
    			Laya.timer.frameLoop(1, this, this.testC1Rotate);
    			Laya.timer.frameLoop(1, this, this.carFltHigh);
    			Laya.timer.frameOnce(2, this, function () {
    				Laya.timer.frameLoop(1, this, this.checkCarInRoad);
    			});
    			this.car.transform.rotate(new Laya.Vector3(0, jiaodu * this.carSpeed / 50, 0), false, false);
    			Laya.stage.off(Laya.Event.KEY_DOWN, this, this.onKeyDown);
    			Laya.stage.off(Laya.Event.KEY_UP, this, this.onKeyUp);
    		} else {
    			GameManager$1.flyFlag = false;
    			this.carSpeed = 0;
    		}
    	}
    	carFltHigh() {
    		if (this.flyTime > 0) {
    			if (this.carSpeed < 3) {
    				this.flyTime = 0;
    				Laya.timer.clear(this, this.carFltHigh);
    				return;
    			}
    			// console.log("this.flyTime    " + this.flyTime);
    			this.flyTime = this.flyTime - Laya.timer.delta;
    			// console.log("this.car.transform.position.y      " + this.car.transform.position.y);
    			if (GameManager$1.stopFlyFlag) {
    				if (this.car.transform.position.y > this.startFlyHigh + 5) {
    					GameManager$1.stopFlyFlag = false;
    				} else {
    					this.car.transform.position = new Laya.Vector3(this.car.transform.position.x, this.car.transform.position.y + this.flySpeed / 2, this.car.transform.position.z);
    				}
    			}
    		} else {
    			this.flyTime = 0;
    			Laya.timer.clear(this, this.carFltHigh);
    		}
    	}
    	checkCarInRoad() {
    		if (this.car.transform.position.x > 18 || this.car.transform.position.x < -7 && !this.checkFlag) {
    			this.checkFlag = true;
    			Laya.timer.frameOnce(2, this, function () {
    				this.checkFlag = false;
    			});
    			// Laya.timer.clear(this, this.checkCarInRoad);
    			// Laya.timer.clear(this, this.carFltHigh);
    			// GameManager.stopFlyFlag = true;
    			// this.flyTime = 0;
    			// Laya.timer.clear(this, this.testC1Rotate);
    			// console.log("要飞出场景了     ", this.car.transform.position.x + "     剩余飞行时间     " + this.flyTime);
    			if (this.flyTime <= 500) {
    				this.flyTime += 200;
    			}
    			// this.getHuiZheng();


    			if (this.car.transform.position.x > 17.5) {
    				this.flyCountAngle(1);
    				this.changeCarModel();
    			} else if (this.car.transform.position.x < -6.5) {
    				this.flyCountAngle(2);
    				this.changeCarModel();
    			}
    		}
    	}

    	changeCarModel() {
    		if (this.car_2_FL.active) {
    			this.car_2_FL.active = false;
    			this.car_2_Left.active = true;
    		}
    		if (this.car_2_FR.active) {
    			this.car_2_FR.active = false;
    			this.car_2_Right.active = true;
    		}
    		if (this.car_2_Right.active || this.car_2_Left.active) {
    			this.car_2_Left.active = false;
    			this.car_2_Right.active = false;
    			this.car_2_All.active = true;
    		}
    	}

    	countAngle(id = 1) {
    		var wall = new Laya.Vector3(0, 0, 0);
    		var car = new Laya.Vector3(0, 0, 0);
    		var cos;
    		var angle;
    		Laya.Vector3.subtract(new Laya.Vector3(this.CarTrigger_F.transform.position.x, 0, this.CarTrigger_F.transform.position.z), new Laya.Vector3(this.CarTrigger_B.transform.position.x, 0, this.CarTrigger_B.transform.position.z), car);
    		switch (id) {
    			case 1:
    				Laya.Vector3.subtract(new Laya.Vector3(21, 0, 368), new Laya.Vector3(21, 0, -128), wall);
    				break;
    			case 2:
    				Laya.Vector3.subtract(new Laya.Vector3(-11, 0, 368), new Laya.Vector3(-11, 0, -128), wall);
    				break;
    		}
    		// console.log("wall   ", wall);
    		// console.log("car   ", car);
    		cos = (wall.x * car.x + wall.z * car.z) / (Math.sqrt(Math.pow(wall.x, 2) + Math.pow(wall.z, 2)) * Math.sqrt(Math.pow(car.x, 2) + Math.pow(car.z, 2)));
    		// console.log("cos    " + cos);
    		angle = Math.acos(cos) * 180 / Math.PI;
    		// console.log("angle   " + angle);
    		if (id == 1) {
    			this.startFly(- angle * 2);
    		} else {
    			this.startFly(angle * 2);
    		}
    	}

    	flyCountAngle(id = 1) {
    		var wall = new Laya.Vector3(0, 0, 0);
    		var car = new Laya.Vector3(0, 0, 0);
    		var cos;
    		var angle;
    		if (this.carSpeed > 3) {
    			this.carSpeed = this.carSpeed * 0.9;
    			Laya.Vector3.subtract(new Laya.Vector3(this.CarTrigger_F.transform.position.x, 0, this.CarTrigger_F.transform.position.z), new Laya.Vector3(this.CarTrigger_B.transform.position.x, 0, this.CarTrigger_B.transform.position.z), car);
    			switch (id) {
    				case 1:
    					Laya.Vector3.subtract(new Laya.Vector3(21, 0, 368), new Laya.Vector3(21, 0, -128), wall);
    					break;
    				case 2:
    					Laya.Vector3.subtract(new Laya.Vector3(-11, 0, 368), new Laya.Vector3(-11, 0, -128), wall);
    					break;
    			}
    			// console.log("wall   ", wall);
    			// console.log("car   ", car);
    			cos = (wall.x * car.x + wall.z * car.z) / (Math.sqrt(Math.pow(wall.x, 2) + Math.pow(wall.z, 2)) * Math.sqrt(Math.pow(car.x, 2) + Math.pow(car.z, 2)));
    			// console.log("cos    " + cos);
    			angle = Math.acos(cos) * 180 / Math.PI;
    			// console.log("angle   " + angle);
    			if (id == 1) {
    				this.car.transform.rotate(new Laya.Vector3(0, -(180 - angle * 2) * this.carSpeed / 50, 0), false, false);
    			} else {
    				this.car.transform.rotate(new Laya.Vector3(0, (180 - angle * 2) * this.carSpeed / 50, 0), false, false);
    			}
    		} else {
    			this.carSpeed = 0;
    			this.flyTime = 0;
    		}
    	}

    	checkCarPosition() {
    		if (this.CarTrigger_M.transform.position.y < this.CarTrigger_Top.transform.position.y) {
    			GameManager$1.carPos = "zheng";
    			console.log("现在车身是正的");
    		} else {
    			GameManager$1.carPos = "fan";
    			console.log("现在车身是翻过来的    " + GameManager$1.maxY);
    			if (GameManager$1.maxY > 0) {
    				this.testFlag = true;
    				if (GameManager$1.maxY > 0) {
    					this.car.transform.position = new Laya.Vector3(this.car.transform.position.x, GameManager$1.maxY + 3, this.car.transform.position.z);
    				} else {
    					this.car.transform.position = new Laya.Vector3(this.car.transform.position.x, this.car.transform.position.y + 3, this.car.transform.position.z);
    				}
    				this.PauseGravity();
    			}
    		}
    		if (!this.gameFail) {
    			this.gameFail = true;
    			GameManager$1.stopSound("car");
    			GameManager$1.stopSound("car_up");
    			this.isDJ = true;
    			Laya.stage.addChild(new failView$1());
    		}
    	}

    	carTakeOff() {
    		if (GameManager$1.fTakeUpFlag && this.carSpeed >= 10) {
    			this.testFlag = true;
    			Laya.timer.frameLoop(1, this, this.takeCarFly);
    			Laya.timer.once(500, this, function () {
    				Laya.timer.clear(this, this.takeCarFly);
    				this.testFlag = false;
    			});
    		}
    	}

    	takeCarFly() {
    		this.car.transform.position = new Laya.Vector3(this.car.transform.position.x, this.car.transform.position.y + 0.01 * this.carSpeed / 10, this.car.transform.position.z);
    		if (this.carSpeed < 10) {
    			Laya.timer.clear(this, this.takeCarFly);
    			this.testFlag = false;
    		}
    	}

    	reSetCar() {
    		if (!this.isDJ) {
    			this.isDJ = true;
    			GameManager$1.PlaySound("car", 0);
    			GameManager$1.stopSound("car_up");
    		}
    		this.car.getChildAt(0).getChildAt(0).transform.localRotation = new Laya.Vector3(0, 0, 0);
    		this.car.getChildAt(0).getChildAt(0).getChildAt(0).transform.localRotation = new Laya.Vector3(0, 0, 0);
    		Laya.timer.clear(this, this.Keyboard);
    		Laya.stage.off(Laya.Event.KEY_DOWN, this, this.onKeyDown);
    		Laya.stage.off(Laya.Event.KEY_UP, this, this.onKeyUp);
    		this.gameFail = false;
    		GameManager$1.maxY = 0;
    		this.carSpeed = 0;
    		this.flyTime = 0;
    		this.huizheng = 0;
    		this.huizheng1 = 0;
    		this.xnum = 0;
    		this.znum = 0;
    		this.startFlyHigh = 0;
    		this.carRotateFlag = false;
    		GameManager$1.flyFlag = false;
    		GameManager$1.cantmoveFlag = false;
    		GameManager$1.cantBackFlag = false;
    		GameManager$1.stopFlyFlag = false;
    		GameManager$1.fTakeUpFlag = false;
    		this.testFlag = false;
    		GameManager$1.carPos = "zheng";
    		this.keyDownList = [];
    		this.listenKeyboard();
    		Laya.timer.frameLoop(1, this, this.Keyboard);
    		this.StartCameraMove("back");
    		Laya.timer.clear(this, this.testC1Rotate);
    		Laya.timer.clear(this, this.reRotate1);
    		Laya.timer.clear(this, this.reRotate);
    		Laya.timer.clear(this, this.checkCarInRoad);
    		Laya.timer.clear(this, this.carFltHigh);
    		Laya.timer.clear(this, this.takeCarFly);
    		this.Car_2.active = true;
    		this.car_2_All.active = false;
    		this.car_2_FL.active = false;
    		this.car_2_FR.active = false;
    		this.car_2_Left.active = false;
    		this.car_2_Right.active = false;
    		GameManager$1.gameScene.successFlag = false;
    		this.checkFlag = false;
    	}
    }

    class settingView$1 extends settingView_Accident2UI {

    	constructor() {
    		super();
    	}

    	onEnable() {
    		//原生
    		console.log("设置2");
    		Advertisement.insertAdverV3();

    		GameManager$1.settingView = this;
    		this.width = Laya.stage.width;
    		this.height = Laya.stage.height;

    		var musicIndex = GameData$1.GetData("sound");
    		this.musicBtn.selectedIndex = musicIndex;

    		this.musicBtn.on(Laya.Event.CLICK, this, this.clickMusic);
    		this.continueBtn.on(Laya.Event.CLICK, this, this.clickClose);
    		this.reStartBtn.on(Laya.Event.CLICK, this, this.clickReStart);
    		this.indexBtn.on(Laya.Event.CLICK, this, this.clickIndex);

    		// switch (GameManager.CarJS.type) {
    		//     case "crash_":
    		GameManager$1.stopSound("car_up");
    		GameManager$1.stopSound("car");
    		//         break;
    		//     case "crash_minibus":
    		//         // GameManager.stopSound("suv_up");
    		//         // GameManager.stopSound("suv");
    		//         break;
    		//     case "crash_bus":
    		//         // GameManager.stopSound("bus_up");
    		//         // GameManager.stopSound("bus");
    		//         break;
    		// }
    	}

    	/**
    	 * 设置音乐
    	 */
    	clickMusic() {
    		var musicIndex = this.musicBtn.selectedIndex;
    		if (musicIndex == 0) {
    			GameManager$1.OpenSound();
    		} else if (musicIndex == 1) {
    			GameManager$1.PlaySound("clickBtn");
    			GameManager$1.CloseSound();
    		}
    		GameData$1.SetData("sound", musicIndex);
    		GameManager$1.PlayMusic("bgm");
    	}

    	/**
    	 * 关闭
    	 */
    	clickClose() {
    		GameManager$1.PlaySound("clickBtn");
    		this.destroy();
    		switch (GameManager$1.CarJS.type) {
    			case "crash_":
    				GameManager$1.PlaySound("car", 0);
    				break;
    			case "crash_minibus":
    				GameManager$1.PlaySound("suv", 0);
    				break;
    			case "crash_bus":
    				GameManager$1.PlaySound("bus", 0);
    				break;
    		}
    	}

    	/**
    	 * 继续
    	 */
    	clickReStart() {
    		GameManager$1.PlaySound("clickBtn");
    		if (GameManager$1.gameScene != null) {
    			GameManager$1.gameScene.clickRestart();
    			this.destroy();
    		} else {
    			console.error("游戏场景不存在");
    		}
    	}

    	/**
    	 * 返回主界面
    	 */
    	clickIndex() {
    		//原生
    		console.log("返回首页");
    		Advertisement.insertAdverV3();

    		GameManager$1.PlaySound("clickBtn");
    		Laya.Scene.open("Accident2/Scene/mainScene.scene");
    		if (GameManager$1.resScene) {
    			GameManager$1.resScene.destroy();
    			GameManager$1.resScene = null;
    		}
    		this.destroy();
    	}

    	onDisable() {
    		GameManager$1.settingView = null;
    	}
    }

    class successView$1 extends successView_Accident2UI {

    	constructor() {
    		super();
    	}

    	onEnable() {
    		//原生
    		console.log("胜利2");
    		Advertisement.insertAdverV();

    		if (GameManager$1.settingView != null) {
    			GameManager$1.settingView.clickClose();
    		}
    		GameManager$1.successView = this;
    		this.width = Laya.stage.width;
    		this.height = Laya.stage.height;
    		var id = this.findUnlockCar();
    		var carList = GameData$1.GetData("Car");
    		carList[id] = 1;
    		GameData$1.SetData("Car", carList);
    		this.continueBtn.on(Laya.Event.CLICK, this, this.clickClose);
    		this.indexBtn.on(Laya.Event.CLICK, this, this.clickIndex);
    	}

    	/**
    	 * 关闭
    	 */
    	clickClose() {
    		GameManager$1.PlaySound("clickBtn");
    		if (GameManager$1.resScene) {
    			GameManager$1.resScene.destroy();
    			GameManager$1.resScene = null;
    		}
    		Laya.Scene.open("Accident2/Scene/mainScene.scene", true, true);
    		this.destroy();
    	}

    	/**
    	 * 返回主页面
    	 */
    	clickIndex() {
    		//原生
    		console.log("返回首页");
    		Advertisement.insertAdverV3();

    		GameManager$1.PlaySound("clickBtn");
    		if (GameManager$1.resScene) {
    			GameManager$1.resScene.destroy();
    			GameManager$1.resScene = null;
    		}
    		Laya.Scene.open("Accident2/Scene/mainScene.scene");
    		this.destroy();
    	}

    	findUnlockCar() {
    		var carList = GameData$1.GetData("Car");
    		for (var key in carList) {
    			if (carList[key] == 0) {
    				return key;
    			}
    		}
    		return 0;
    	}

    	onDisable() {
    		GameManager$1.successView = null;
    	}
    }

    class gameScene$1 extends Laya.Scene {
    	constructor() {
    		super();
    		this.loadValue = 0;
    		this.selectCarID = 1;
    		this.cameraIndex = 0;
    	}
    	onEnable() {
    		GameManager$1.gameScene = this;
    		GameManager_Collection.showBackBtn();
    		this.width = Laya.stage.width;
    		this.height = Laya.stage.height;
    		this.successFlag = false;
    		// this.cameraBtn.on(Laya.Event.CLICK, this, this.choseCamera);

    		this.leftBtn.on(Laya.Event.MOUSE_DOWN, this, this.clickDirectionBtn, ["left"]);
    		this.leftBtn.on(Laya.Event.MOUSE_UP, this, this.unclaspDirectionBtn, ["left"]);
    		this.leftBtn.on(Laya.Event.MOUSE_OUT, this, this.unclaspDirectionBtn, ["left"]);

    		this.rightBtn.on(Laya.Event.MOUSE_DOWN, this, this.clickDirectionBtn, ["right"]);
    		this.rightBtn.on(Laya.Event.MOUSE_UP, this, this.unclaspDirectionBtn, ["right"]);
    		this.rightBtn.on(Laya.Event.MOUSE_OUT, this, this.unclaspDirectionBtn, ["right"]);

    		this.upBtn.on(Laya.Event.MOUSE_DOWN, this, this.clickDirectionBtn, ["up"]);
    		this.upBtn.on(Laya.Event.MOUSE_UP, this, this.unclaspDirectionBtn, ["up"]);
    		this.upBtn.on(Laya.Event.MOUSE_OUT, this, this.unclaspDirectionBtn, ["up"]);

    		this.downBtn.on(Laya.Event.MOUSE_DOWN, this, this.clickDirectionBtn, ["down"]);
    		this.downBtn.on(Laya.Event.MOUSE_UP, this, this.unclaspDirectionBtn, ["down"]);
    		this.downBtn.on(Laya.Event.MOUSE_OUT, this, this.unclaspDirectionBtn, ["down"]);

    		this.pauseBtn.on(Laya.Event.CLICK, this, function () {
    			GameManager$1.PlaySound("clickBtn");
    			Laya.stage.addChild(new settingView$1());
    		}.bind(this));
    		this.reStartBtn.on(Laya.Event.CLICK, this, this.clickRestart);
    		GameManager$1.Scene = Laya.stage.addChildAt(GameManager$1.resScene, 0);
    		this.createCar();
    		this.setCancollideWith();
    		// var CarLockData = GameData.GetData("ChoseCarID");
    		// this.selectCarID = CarLockData;
    		// Laya.stage.addChild(new garageView(this.selectCarID));


    		// var asin30 = Math.round(Math.asin(0.5) * 180 / Math.PI)
    		// console.log(asin30);
    	}

    	openPause_noUI() {
    		Laya.timer.scale = 0.0001;
    	}

    	closePause() {
    		Laya.timer.scale = 1;
    	}
    	/**
    	 * 重新开始
    	 */
    	clickRestart() {
    		GameManager$1.PlaySound("clickBtn");
    		GameManager$1.Car.transform.position = GameManager$1.Scene.getChildByName("Born").transform.position;
    		GameManager$1.Car.transform.rotation = GameManager$1.Scene.getChildByName("Born").transform.rotation;
    		GameManager$1.CarJS.reSetCar();
    	}

    	/**
    	 * 点击方向按钮
    	 * @param {*} btnName 按钮名称
    	 */
    	clickDirectionBtn(btnName) {
    		// console.log("按下" + btnName + "按钮");
    		switch (btnName) {
    			case "left":
    				GameManager$1.isClickLeftBtn = true;
    				break;
    			case "right":
    				GameManager$1.isClickRightBtn = true;
    				break;
    			case "up":
    				GameManager$1.isClickUpBtn = true;
    				break;
    			case "down":
    				GameManager$1.isClickDownBtn = true;
    				break;
    		}
    	}

    	/**
    	 * 松开方向按钮
    	 * @param {*} btnName 按钮名称
    	 */
    	unclaspDirectionBtn(btnName) {
    		// console.log("松开" + btnName + "按钮");
    		switch (btnName) {
    			case "left":
    				GameManager$1.isClickLeftBtn = false;
    				break;
    			case "right":
    				GameManager$1.isClickRightBtn = false;
    				break;
    			case "up":
    				GameManager$1.isClickUpBtn = false;
    				break;
    			case "down":
    				GameManager$1.isClickDownBtn = false;
    				break;
    		}
    	}

    	setCancollideWith() {
    		for (var key in GameManager$1.Scene.getChildByName("Props")._children) {
    			GameManager$1.Scene.getChildByName("Props")._children[key].getComponent(Laya.Rigidbody3D).canCollideWith = Laya.Physics3DUtils.COLLISIONFILTERGROUP_CUSTOMFILTER2;
    			GameManager$1.Scene.getChildByName("Props")._children[key].getComponent(Laya.Rigidbody3D).collisionGroup = Laya.Physics3DUtils.COLLISIONFILTERGROUP_CUSTOMFILTER1;
    		}
    		for (var key in GameManager$1.Scene.getChildByName("Ramp")._children) {
    			GameManager$1.Scene.getChildByName("Ramp")._children[key].getComponent(Laya.Rigidbody3D).canCollideWith = Laya.Physics3DUtils.COLLISIONFILTERGROUP_CUSTOMFILTER1;
    			GameManager$1.Scene.getChildByName("Ramp")._children[key].getComponent(Laya.Rigidbody3D).collisionGroup = Laya.Physics3DUtils.COLLISIONFILTERGROUP_CUSTOMFILTER1;
    		}
    	}
    	createCar() {
    		console.log(GameManager$1.resModel);
    		GameManager$1.Car = Laya.Sprite3D.instantiate(GameManager$1.resModel.getChildByName("car" + GameData$1.GetData("ChoseCarID")), GameManager$1.Scene);
    		GameManager$1.Car.transform.position = GameManager$1.Scene.getChildByName("Born").transform.position;
    		GameManager$1.Car.transform.rotation = GameManager$1.Scene.getChildByName("Born").transform.rotation;
    		GameManager$1.CarJS = GameManager$1.Car.addComponent(Car$1);
    		GameManager$1.Camera.active = true;
    	}

    	playerSuccess() {
    		if (!this.successFlag) {
    			this.successFlag = true;
    			GameManager$1.stopSound("car");
    			GameManager$1.stopSound("car_up");
    			Laya.stage.addChild(new successView$1());
    		}
    	}

    	onDisable() {
    		Laya.timer.scale = 1;
    		Laya.timer.clearAll(this);
    		if (GameManager$1.garageView) {
    			Laya.timer.clearAll(GameManager$1.garageView);
    			GameManager$1.garageView.destroy();
    			GameManager$1.garageView = null;
    		}

    		if (GameManager$1.settingView) {
    			Laya.timer.clearAll(GameManager$1.settingView);
    			GameManager$1.settingView.destroy();
    			GameManager$1.settingView = null;
    		}

    		if (GameManager$1.failView) {
    			Laya.timer.clearAll(GameManager$1.failView);
    			GameManager$1.failView.destroy();
    			GameManager$1.failView = null;
    		}

    		if (GameManager$1.successView) {
    			Laya.timer.clearAll(GameManager$1.successView);
    			GameManager$1.successView.destroy();
    			GameManager$1.successView = null;
    		}

    		if (GameManager$1.Scene) {
    			Laya.timer.clearAll(GameManager$1.Scene);
    			GameManager$1.Scene.destroy();
    			GameManager$1.Scene = null;
    		}
    	}
    }

    class loadingScene$1 extends Laya.Scene {
    	constructor() {
    		super();
    		this.loadValue = 0;
    		this.updateLoadValue = 0;
    		this.isLoading = false;
    	}
    	onEnable() {
    		this.width = Laya.stage.width;
    		this.height = Laya.stage.height;
    		GameManager_Collection.hideBackBtn();
    		Laya.timer.loop(1, this, this.update);
    		this.isLoading = true;
    		this.loadValue = 1;
    	}

    	update() {
    		this.updateLoadValue += 0.01;
    		if (this.updateLoadValue > this.loadValue) {
    			this.updateLoadValue = this.loadValue;
    		}
    		this.loadBar.mask.graphics.clear();
    		this.loadBar.mask.graphics.drawRect(0, 0, this.loadBar.width * this.updateLoadValue, this.loadBar.height, "#ff0000", null, 1);

    		if (this.updateLoadValue >= 1 && this.isLoading) {
    			Laya.timer.clear(this, this.update);
    			this.loadStr.text = "正在加载数据";
    			this.toIndex();
    		}
    	}
    	/**
    	 * 前往主界面
    	 */
    	toIndex() {
    		GameData$1.InitData(function () {
    			GameManager$1.PlayMusic("bgm");
    			Laya.Scene.open("Accident2/Scene/mainScene.scene");
    		}.bind(this));
    	}
    	onDisable() {
    		Laya.timer.scale = 1;
    		Laya.timer.clearAll(this);
    		if (GameManager$1.garageView) {
    			Laya.timer.clearAll(GameManager$1.garageView);
    			GameManager$1.garageView.destroy();
    			GameManager$1.garageView = null;
    		}

    		if (GameManager$1.settingView) {
    			Laya.timer.clearAll(GameManager$1.settingView);
    			GameManager$1.settingView.destroy();
    			GameManager$1.settingView = null;
    		}

    		if (GameManager$1.failView) {
    			Laya.timer.clearAll(GameManager$1.failView);
    			GameManager$1.failView.destroy();
    			GameManager$1.failView = null;
    		}

    		if (GameManager$1.successView) {
    			Laya.timer.clearAll(GameManager$1.successView);
    			GameManager$1.successView.destroy();
    			GameManager$1.successView = null;
    		}

    		if (GameManager$1.Scene) {
    			Laya.timer.clearAll(GameManager$1.Scene);
    			GameManager$1.Scene.destroy();
    			GameManager$1.Scene = null;
    		}
    	}
    }

    class garageView$1 extends garageView_Accident2UI {

    	constructor(selectCarID) {
    		super();
    		this.selectCarID = selectCarID;
    		this.carlist = null;
    		this.camera = null;
    		this.direction = 1;
    		this.choseCarID = selectCarID;
    		this.selectCarModel = null;
    	}

    	onEnable() {
    		//原生
    		console.log("车库2");
    		Advertisement.insertAdverV3();

    		GameManager$1.garageView = this;
    		this.width = Laya.stage.width;
    		this.height = Laya.stage.height;
    		GameManager$1.mainView.loadingUI.visible = false;
    		this.selectCarBtn.on(Laya.Event.CLICK, this, this.clickSelectCar);
    		this.startBtn.on(Laya.Event.CLICK, this, this.clickStart);
    		this.lockBtn.on(Laya.Event.CLICK, this, this.clickUnLock);
    		this.moveCameraStage.on(Laya.Event.MOUSE_DOWN, this, this.touchReSet);
    		this.moveCameraStage.on(Laya.Event.MOUSE_MOVE, this, this.rotateCamera);
    		this.moveCameraStage.on(Laya.Event.MOUSE_UP, this, function () {
    			this.isTouch = false;
    			Laya.timer.loop(1, this, this.updateCamera);
    		}.bind(this));
    		console.log(GameManager$1.resScene_garage);
    		GameManager$1.garageScene = Laya.stage.addChildAt(GameManager$1.resScene_garage, 1);
    		// console.log(GameManager.hangarModel);
    		for (var key in GameManager$1.hangarModel._children) {
    			var model = Laya.Sprite3D.instantiate(GameManager$1.hangarModel);
    			var car = GameManager$1.resScene_garage.getChildByName("Cars").addChild(model._children[key]);
    			car.transform.localPosition = new Laya.Vector3(0, -0.4, 0);
    		}
    		this.carlist = GameManager$1.garageScene.getChildByName("Cars")._children;
    		this.camera = GameManager$1.garageScene.getChildByName("CameraCenter");
    		// console.log(GameManager.garageScene.getChildByName("Cars"));

    		Laya.timer.loop(1, this, this.updateCamera);

    		this.carlockData = GameData$1.GetData("Car");
    		GameData$1.SetData("ChoseCarID", 1);
    		this.InitCarList();
    		this.createCar();
    	}

    	/**
    	 * 初始化车辆列表
    	 */
    	InitCarList() {
    		this.CarList.hScrollBarSkin = "";
    		this.CarList.renderHandler = new Laya.Handler(this, this.selectCarListen);
    		this.CarList.array = [];
    		let CarListarray = [];


    		for (var key in GameData$1.JSONData) {
    			let obj = {};

    			obj['carBg'] = { visible: true };
    			obj['carImage1'] = { visible: true, skin: "Accident2/CarImage/" + GameData$1.JSONData[key].image };
    			obj['carName1'] = { visible: true, text: GameData$1.JSONData[key].name };
    			obj['lockbg1'] = { visible: this.carlockData[key - 1] == 1 ? false : true };

    			obj['selectBg'] = { visible: false };
    			obj['carImage2'] = { visible: false, skin: "Accident2/CarImage/" + GameData$1.JSONData[key].image };
    			obj['carName2'] = { visible: false, text: GameData$1.JSONData[key].name };
    			obj['lockbg2'] = { visible: false };

    			obj['carID'] = { text: key };
    			CarListarray.push(obj);
    		}
    		this.CarList.array = CarListarray;

    		this.CarList.scrollTo(this.selectCarID - 1);
    		this.setSelect(this.selectCarID - 1, true);
    	}

    	/**
    	 * 列表添加监听事件
    	 * @param {*} cell 列表box对象
    	 */
    	selectCarListen(cell) {
    		let selectCarBtn = cell.getChildByName("carBg");
    		selectCarBtn.offAll();
    		let carID = parseInt(cell.getChildByName("carID").text);
    		selectCarBtn.on(Laya.Event.CLICK, this, this.selectCar, [carID]);
    	}

    	/**
    	 * 选择车辆
    	 * @param {*} carID 车辆ID
    	 */
    	selectCar(carID) {
    		GameManager$1.PlaySound("clickBtn");
    		this.setSelect(this.selectCarID - 1, false);
    		this.selectCarID = carID;
    		this.setSelect(carID - 1, true);
    		this.createCar();
    	}

    	/**
    	 * 选择列表
    	 * @param {*} selectID 选择ID
    	 * @param {*} isSelect 是否选中
    	 */
    	setSelect(selectID, isSelect) {
    		var cell = this.CarList.getItem(selectID);
    		cell['carBg'].visible = !isSelect;
    		cell['carImage1'].visible = !isSelect;
    		cell['carName1'].visible = !isSelect;

    		cell['selectBg'].visible = isSelect;
    		cell['carImage2'].visible = isSelect;
    		cell['carName2'].visible = isSelect;

    		if (this.carlockData[selectID] == 1) {
    			cell['lockbg1'].visible = false;
    			cell['lockbg2'].visible = false;
    			this.lockBtn.visible = false;
    		} else {
    			cell['lockbg1'].visible = !isSelect;
    			cell['lockbg2'].visible = isSelect;
    			this.lockBtn.visible = true;
    		}

    		this.CarList.setItem(selectID, cell);

    		this.introduce.text = GameData$1.JSONData[selectID + 1].introduce;

    		if (isSelect) {
    			if (this.selectCarID == this.choseCarID) {
    				this.selectCarBtn.visible = false;
    			} else {
    				this.selectCarBtn.visible = true;
    			}
    		}
    	}

    	/**
    	 * 重置点击
    	 */
    	touchReSet() {
    		this.deltaX = 0;
    		this.lastX = -1;
    		Laya.timer.clear(this, this.updateCamera);
    		this.isTouch = true;
    	}

    	/**
    	 * 手动旋转相机
    	 */
    	rotateCamera() {
    		if (this.isTouch) {
    			if (this.lastX != -1) {
    				this.deltaX = Laya.stage.mouseX - this.lastX;
    				this.camera.transform.rotate(new Laya.Vector3(0, -this.deltaX * 0.5, 0), true, false);
    				if (Math.abs(this.deltaX) != 0) {
    					this.direction = -this.deltaX / Math.abs(this.deltaX);
    				}
    			}
    			this.lastX = Laya.stage.mouseX;
    		}
    	}

    	/**
    	 * 旋转相机
    	 */
    	updateCamera() {
    		this.camera.transform.rotate(new Laya.Vector3(0, this.direction * 0.3, 0), true, false);
    	}

    	/**
    	 * 方向按钮监听
    	 * @param {*} directioName 方向名称
    	 */
    	clickDirectionBtn(directioName = "") {
    		GameManager$1.PlaySound("clickBtn");
    		switch (directioName) {
    			case "left":
    				this.selectCarID--;
    				if (this.selectCarID < 0) {
    					this.selectCarID = this.carlist.length;
    				}
    				break;
    			case "right":
    				this.selectCarID++;
    				if (this.selectCarID > this.carlist.length) {
    					this.selectCarID = 1;
    				}
    				break;
    		}
    		this.createCar();
    	}

    	/**
    	 * 展示车辆
    	 */
    	createCar() {
    		var car = GameManager$1.garageScene.getChildByName("Cars");
    		for (var key in car._children) {
    			car._children[key].active = false;
    			if ((parseInt(key) + 1) == this.selectCarID) {
    				car._children[key].active = true;
    			}
    		}
    	}

    	/**
    	 * 点击选择车辆
    	 */
    	clickSelectCar() {
    		GameManager$1.PlaySound("clickBtn");
    		this.choseCarID = this.selectCarID;
    		this.selectCarBtn.visible = false;
    		GameData$1.SetData("ChoseCarID", this.choseCarID);
    	}

    	/**
    	 * 点击开始游戏
    	 */
    	clickStart() {
    		// GameManager.PlaySound("clickBtn");
    		// if (GameManager.Scene == null) {
    		//     GameManager.Scene = Laya.stage.addChildAt(GameManager.resScene, 0);
    		// }

    		// var CrashCube = GameManager.Scene.getChildByName("CrashCube")._children;
    		// console.log(GameManager.Scene.getChildByName("CrashCube"));
    		// for (var key in CrashCube) {
    		//     CrashCube[key].active = false;
    		// }

    		// var crashcubeID = GameManager.random(0, CrashCube.length - 1);
    		// CrashCube[crashcubeID].active = true;

    		// if (GameManager.gameScene != null) {
    		//     GameManager.gameScene.choseCar(this.choseCarID);
    		//     GameManager.gameScene.BtnUI.visible = true;
    		// }
    		GameManager$1.mainView.clickReallyStart();
    		this.destroy();
    	}

    	/**
    	 * 点击解锁
    	 */
    	clickUnLock() {
    		GameManager$1.PlaySound("clickBtn");
    		GameManager_Collection.showVideo(function () {
    			this.carlockData[this.selectCarID - 1] = 1;
    			GameData$1.SetData("Car", this.carlockData);
    			this.setSelect(this.selectCarID - 1, true);
    		}.bind(this));
    	}

    	/**
    	 * 脚本摧毁
    	 */
    	onDisable() {
    		GameManager$1.garageScene.destroy();
    		GameManager$1.garageScene = null;
    		GameManager$1.resScene_garage.destroy();
    		GameManager$1.resScene_garage = null;
    		Laya.Resource.destroyUnusedResources();
    		GameManager$1.garageView = null;
    		// Laya.Scene.open("Scene/mainScene.scene");
    	}
    }

    class mainScene$1 extends Laya.Scene {
    	constructor() {
    		super();
    		this.loadValue = 0;
    		this.updateLoadValue = 0;
    		this.resource = [];
    	}
    	onEnable() {

    		this.width = Laya.stage.width;
    		this.height = Laya.stage.height;
    		GameManager$1.mainView = this;
    		if (GameManager_Collection.GameConfig) {
    			if (GameManager_Collection.gq) {
    				this.logo.skin = GameManager_Collection.GameConfig.gamesLogo[GameManager_Collection.GameID];
    			} else {
    				this.logo.skin = "Collection/AllGameScene/logo.png";
    			}
    		}
    		this.startFlag = false;
    		GameManager$1.maxY = 0;
    		GameManager$1.flyFlag = false;
    		GameManager$1.cantmoveFlag = false;
    		GameManager$1.cantBackFlag = false;
    		GameManager$1.stopFlyFlag = false;
    		GameManager$1.fTakeUpFlag = false;
    		GameManager$1.carPos = "zheng";
    		GameManager_Collection.showBackBtn();
    		this.InitBtn();
    		this.loadScene();
    		// this.ageBtn.on(Laya.Event.CLICK, this, function () {
    		//     SDK_apk.showNotice();
    		// });
    	}

    	onOpened(flag = false) {
    		console.log("flag   " + flag);
    		if (flag) {
    			this.clickStart();
    		}
    	}

    	/**
    	* 加载场景
    	*/
    	loadScene() {
    		this.resource = [
    			"res/Accident2/Unity/LayaScene_Scene_hangar_Accident2/Conventional/Scene_hangar_Accident2.ls",
    		];
    		// "res/Accident2/Unity/LayaScene_Scenes_Accident2_1/Conventional/Scenes_Accident2_1.ls",
    		// "res/Accident2/Unity/LayaScene_Scenes_Accident2_2/Conventional/Scenes_Accident2_2.ls",
    		// "res/Accident2/Unity/LayaScene_Scenes_Accident2_3/Conventional/Scenes_Accident2_3.ls",
    		// "res/Accident2/Unity/LayaScene_Scenes_Accident2_4/Conventional/Scenes_Accident2_4.ls",
    		// "res/Accident2/Unity/LayaScene_Scenes_Accident2_5/Conventional/Scenes_Accident2_5.ls",
    		this.mapRes = [
    			"res/Accident2/Unity/LayaScene_Scenes_Accident2_1/Conventional/Scenes_Accident2_1.ls",
    			"res/Accident2/Unity/LayaScene_Scenes_Accident2_2/Conventional/Scenes_Accident2_2.ls",
    			"res/Accident2/Unity/LayaScene_Scenes_Accident2_3/Conventional/Scenes_Accident2_3.ls",
    			"res/Accident2/Unity/LayaScene_Scenes_Accident2_4/Conventional/Scenes_Accident2_4.ls",
    			"res/Accident2/Unity/LayaScene_Scenes_Accident2_5/Conventional/Scenes_Accident2_5.ls",
    		];
    		this.carModelRes = [
    			"res/Accident2/Unity/LayaScene_Object_Accident2_car1/Conventional/Object_Accident2_car1.lh",
    			"res/Accident2/Unity/LayaScene_Object_Accident2_car2/Conventional/Object_Accident2_car2.lh",
    			"res/Accident2/Unity/LayaScene_Object_Accident2_car3/Conventional/Object_Accident2_car3.lh",
    			"res/Accident2/Unity/LayaScene_Object_Accident2_car4/Conventional/Object_Accident2_car4.lh",
    			"res/Accident2/Unity/LayaScene_Object_Accident2_car5/Conventional/Object_Accident2_car5.lh",
    			"res/Accident2/Unity/LayaScene_Object_Accident2_car6/Conventional/Object_Accident2_car6.lh",
    			"res/Accident2/Unity/LayaScene_Object_Accident2_car7/Conventional/Object_Accident2_car7.lh",
    			"res/Accident2/Unity/LayaScene_Object_Accident2_car8/Conventional/Object_Accident2_car8.lh",
    		];
    		// Laya.loader.create(this.resource, Laya.Handler.create(this, this.onPreLoadFinish),
    		//     Laya.Handler.create(this, function (value) {
    		//         this.loadValue = value;
    		//     })
    		// );
    	}

    	/**
    	 * 场景加载成功回调
    	 */
    	onPreLoadFinish() {
    		// GameManager.resModel = Laya.Loader.getRes(this.resource[0].url);
    		GameManager$1.resScene_garage = Laya.Loader.getRes(this.resource[0].url);
    	}

    	/**
    	* 初始化按钮点击事件
    	*/
    	InitBtn() {
    		this.startBtn.on(Laya.Event.CLICK, this, this.clickStart);
    	}

    	/**
    	 * 点击开始
    	 */
    	clickStart() {
    		this.bg.visible = false;
    		this.startBtn.visible = false;
    		this.initHangarModel();
    		this.loadingUI.visible = true;
    		Laya.timer.loop(1, this, this.hangarUpdate);
    		// if (!this.startFlag) {
    		//     this.startFlag = true;
    		//     Laya.Scene3D.load(this.resource[0].url, Laya.Handler.create(this, function (scene) {
    		//         this.startBtn.visible = false;
    		//         this.bg.visible = false;
    		//         GameManager.resScene_garage = scene;
    		//         Laya.stage.addChild(new garageView(1));
    		//     }));

    		var mapNo = this.confirmMap();
    		Laya.loader.create(this.mapRes[mapNo - 1],
    			Laya.Handler.create(this, function () {
    				GameManager$1.resScene = Laya.loader.getRes(this.mapRes[mapNo - 1]);
    				GameManager$1.resScene.getChildByName("Main Camera").active = false;
    				GameManager$1.Camera = GameManager$1.resScene.addChild(new Laya.Camera(0, 0.1, 1000));
    				GameManager$1.Camera.transform.rotation = GameManager$1.resScene.getChildByName("Main Camera").transform.rotation;
    				GameManager$1.Camera.clearColor = null;
    				GameManager$1.Camera.active = false;
    			}));

    		// }
    	}

    	confirmMap() {
    		var mapNo = GameManager$1.random(1, 5);
    		if (GameManager$1.mapList.length < 1) {
    			console.log(GameData$1.GetData("firstGame"));
    			if (GameData$1.GetData("firstGame")) {
    				mapNo = 1;
    				GameData$1.SetData("firstGame", false);
    			}
    			GameManager$1.mapList.push(mapNo);
    			return mapNo;
    		} else {
    			if (GameManager$1.mapList.length == 5) {
    				var lastMap = GameManager$1.mapList[4];
    				if (lastMap != mapNo) {
    					GameManager$1.mapList = [];
    					GameManager$1.mapList.push(mapNo);
    					return mapNo;
    				} else {
    					return this.confirmMap();
    				}
    			} else {
    				for (var key in GameManager$1.mapList) {
    					if (GameManager$1.mapList[key] == mapNo) {
    						return this.confirmMap();
    					}
    				}
    				GameManager$1.mapList.push(mapNo);
    				return mapNo;
    			}
    		}
    	}


    	initHangarModel() {
    		if (GameManager$1.hangarModel) {
    			this.initHangarScene();
    			return;
    		}
    		var path = "res/Accident2/Unity/LayaScene_Scene_hangar_Accident2_7cars/Conventional/Scene_hangar_Accident2_7cars.lh";
    		Laya.loader.create(path,
    			Laya.Handler.create(this, function () {
    				let model = Laya.loader.getRes(path);
    				if (model) {
    					GameManager$1.hangarModel = model;
    				}
    				this.initHangarScene();
    			}), Laya.Handler.create(this, function (v) {
    				this.loadValue = v / 2;
    			}));
    	}

    	initHangarScene() {
    		if (GameManager$1.resScene_garage) {
    			this.loadValue = 1;
    			return;
    		}
    		var path = "res/Accident2/Unity/LayaScene_Scene_hangar_Accident2/Conventional/Scene_hangar_Accident2.ls";
    		Laya.loader.create(path,
    			Laya.Handler.create(this, function () {
    				let model = Laya.loader.getRes(path);
    				if (model) {
    					GameManager$1.resScene_garage = model;
    				}
    			}), Laya.Handler.create(this, function (v) {
    				this.loadValue = 0.5 + v / 2;
    			}));
    	}

    	/**
    	 * 车库真正开始游戏
    	 */
    	clickReallyStart() {
    		GameManager$1.PlaySound("clickBtn");
    		this.loadingUI.visible = true;
    		var carID = GameData$1.GetData("ChoseCarID");
    		Laya.loader.create(this.carModelRes[carID - 1],
    			Laya.Handler.create(this, function () {
    				GameManager$1.resModel = Laya.loader.getRes(this.carModelRes[carID - 1]);
    				Laya.timer.loop(1, this, this.update);
    			}));
    	}

    	hangarUpdate() {
    		this.updateLoadValue += 0.01;
    		if (this.updateLoadValue > this.loadValue) {
    			this.updateLoadValue = this.loadValue;
    		}

    		this.loadBar.mask.graphics.clear();
    		this.loadBar.mask.graphics.drawRect(0, 0, this.loadBar.width * this.updateLoadValue, this.loadBar.height, "#ff0000", null, 1);
    		this.loadNum.text = parseInt(this.updateLoadValue * 100) + "%";

    		if (this.updateLoadValue >= 1) {
    			Laya.timer.clear(this, this.hangarUpdate);
    			this.loadStr.text = "正在加载资源";
    			Laya.stage.addChild(new garageView$1(1));
    		}
    	}

    	update() {
    		this.updateLoadValue += 0.01;
    		if (this.updateLoadValue > this.loadValue) {
    			this.updateLoadValue = this.loadValue;
    		}

    		this.loadBar.mask.graphics.clear();
    		this.loadBar.mask.graphics.drawRect(0, 0, this.loadBar.width * this.updateLoadValue, this.loadBar.height, "#ff0000", null, 1);
    		this.loadNum.text = parseInt(this.updateLoadValue * 100) + "%";

    		if (this.updateLoadValue >= 1) {
    			Laya.timer.clear(this, this.update);
    			this.loadStr.text = "正在加载资源";
    			Laya.Scene.open("Accident2/Scene/gameScene.scene");
    		}
    	}

    	onDisable() {
    		Laya.timer.scale = 1;
    		Laya.timer.clearAll(this);
    		if (GameManager$1.garageView) {
    			Laya.timer.clearAll(GameManager$1.garageView);
    			GameManager$1.garageView.destroy();
    			GameManager$1.garageView = null;
    		}

    		if (GameManager$1.settingView) {
    			Laya.timer.clearAll(GameManager$1.settingView);
    			GameManager$1.settingView.destroy();
    			GameManager$1.settingView = null;
    		}

    		if (GameManager$1.failView) {
    			Laya.timer.clearAll(GameManager$1.failView);
    			GameManager$1.failView.destroy();
    			GameManager$1.failView = null;
    		}

    		if (GameManager$1.successView) {
    			Laya.timer.clearAll(GameManager$1.successView);
    			GameManager$1.successView.destroy();
    			GameManager$1.successView = null;
    		}

    		if (GameManager$1.Scene) {
    			Laya.timer.clearAll(GameManager$1.Scene);
    			GameManager$1.Scene.destroy();
    			GameManager$1.Scene = null;
    		}
    	}
    }

    class HongLvDeng extends Laya.Script3D {

    	constructor() {
    		super();
    	}

    	onEnable() {
    		this.deng01 = [];
    		this.deng02 = [];
    		this.deng01.push(this.owner.getChildByName("1").getChildByName("TX_hongdeng"));
    		this.deng01.push(this.owner.getChildByName("2").getChildByName("TX_hongdeng"));
    		this.deng01.push(this.owner.getChildByName("3").getChildByName("TX_lvdeng"));
    		this.deng01.push(this.owner.getChildByName("4").getChildByName("TX_lvdeng"));

    		this.deng02.push(this.owner.getChildByName("1").getChildByName("TX_lvdeng"));
    		this.deng02.push(this.owner.getChildByName("2").getChildByName("TX_lvdeng"));
    		this.deng02.push(this.owner.getChildByName("3").getChildByName("TX_hongdeng"));
    		this.deng02.push(this.owner.getChildByName("4").getChildByName("TX_hongdeng"));

    		this.checkNum = 0;
    		this.preChecjDir = 0; //第一次碰撞的方向
    		this.checkDir = null;
    		this.isHongDeng = true;
    		if (GameManager$2.RandomInt(0, 100) < 50) {
    			this.isHongDeng = false;
    		}
    		this.ChangeDeng();
    		Laya.timer.frameLoop(600, this, function () {
    			this.isHongDeng = !this.isHongDeng;
    			this.ChangeDeng();
    			this.checkDir = null;
    		});
    	}
    	ChangeDeng() {
    		for (var i = 0; i < 4; i++) {
    			if (this.isHongDeng) {
    				this.deng01[i].active = true;
    				this.deng02[i].active = false;
    			}
    			else {
    				this.deng01[i].active = false;
    				this.deng02[i].active = true;
    			}
    		}

    	}
    	CheckFangXiang(dir) {
    		if (this.preChecjDir == "1" && dir == "4") {
    			return false;
    		}
    		if (this.preChecjDir == "2" && dir == "3") {
    			return false;
    		}
    		if (this.preChecjDir == "3" && dir == "1") {
    			return false;
    		}
    		if (this.preChecjDir == "4" && dir == "2") {
    			return false;
    		}
    		return true;
    	}
    	CheckWeiZhang(name) {
    		var str = name.split("_");
    		if (this.checkDir == null) {
    			if (str[1] == "1" || str[1] == "2") {
    				this.checkDir = true;
    			}
    			else {
    				this.checkDir = false;
    			}
    			this.preChecjDir = str[1];
    		}
    		if (this.isHongDeng == this.checkDir) {
    			this.checkNum += 1;

    		}

    		if (this.checkNum >= 2) {
    			this.checkNum = 0;
    			if (this.isHongDeng == this.checkDir && this.CheckFangXiang(str[1])) {
    				UIManager.ShowGameImgTipUI("1");
    				if (GameManager$2.curPlayer.AIChengKeScript) {

    					GameManager$2.curPlayer.AIChengKeScript.LessXinQing(10);
    				}
    				if (GameManager$2.selectModel == 3) {
    					UIManager.gameUI.showRenWu3();
    					UIManager.ShowZhuangJiTipUI("Tip05");
    				}
    			}
    			this.checkDir = null;
    		}
    	}
    }

    class AIXingRen extends Laya.Script3D {

    	constructor() {
    		super();
    	}

    	Init(LuJingZu) {
    		this.LuJingZu = LuJingZu;
    		this.targetId = 1;
    		this.colneTrans = new Laya.Sprite3D().transform;
    		this.thisTrans = this.owner.transform;
    		this.thisAnimator = this.owner.getComponent(Laya.Animator);
    		this.ChangeNextTargetPos();
    		if (this.targetId != 1) {
    			this.thisAnimator.play("walk");
    		}

    		Laya.timer.frameOnce(60, this, function () {
    			this.state = "move";
    		});

    	}
    	//被车撞
    	BeiZhuang() {
    		if (this.state == "over") {
    			return;
    		}
    		if (GameManager$2.selectModel == 2) {
    			if (GameManager$2.curPlayer.AIChengKeScript) {
    				UIManager.gameUI.showRenWu1();
    				GameManager$2.curPlayer.AIChengKeScript.LessXinQing(20);
    			}

    			PlayerData.LessChaoPiao(500);
    			UIManager.ShowGameImgTipUI("3");
    		}

    		this.thisAnimator.play("daodi");
    		this.state = "over";
    		Laya.timer.frameOnce(60, this, function () {
    			this.owner.destroy();
    		});


    		if (this.owner.getChildByName("Model_nan")) {
    			GameManager$2.PlaySound("shoushangnan");
    		}
    		else if (this.owner.getChildByName("Model_nv")) {
    			GameManager$2.PlaySound("shoushangnv");
    		}
    	}
    	onDisable() {
    	}
    	ChangeNextTargetPos() {
    		this.targetId += 1;
    		var obj = this.LuJingZu.getChildByName("" + this.targetId);
    		if (obj == null) {
    			this.targetId = 1;
    			obj = this.LuJingZu.getChildByName("" + this.targetId);
    			this.thisTrans.position = obj.transform.position;
    			this.thisTrans.rotation = obj.transform.rotation;

    			// this.targetId = 2 ;
    			// obj = this.LuJingZu.getChildByName(""+this.targetId) ;
    		}
    		this.targetPos = obj.transform.position;
    	}
    	onUpdate() {

    		if (GameManager$2.gameState != "run") {
    			return;
    		}
    		switch (this.state) {
    			case "move":
    				this.UpdateMove();
    				break;
    		}
    	}
    	UpdateMove() {
    		this.colneTrans.position = this.thisTrans.position;
    		this.colneTrans.lookAt(this.targetPos, new Laya.Vector3(0, 1, 0));
    		this.colneTrans.rotate(new Laya.Vector3(0, 180, 0), false, false);
    		this.colneTrans.rotationEuler = new Laya.Vector3(0, this.colneTrans.rotationEuler.y, 0);
    		var addSpeed = 0.02;
    		var tq = new Laya.Quaternion(0, 0, 0, 1);
    		Laya.Quaternion.slerp(this.thisTrans.rotation, this.colneTrans.rotation, 0.7 * addSpeed, tq);

    		this.thisTrans.rotation = tq;

    		this.thisTrans.translate(new Laya.Vector3(0, 0, addSpeed));

    		if (Laya.Vector3.distance(this.thisTrans.position, this.targetPos) < 2) {
    			this.ChangeNextTargetPos();
    		}
    	}
    }

    class AICarMove extends Laya.Script3D {

    	constructor() {
    		super();


    	}

    	Init(LuJingZu) {
    		this.stopTime = 60;
    		this.LuJingZu = LuJingZu;
    		this.targetId = 1;
    		this.colneTrans = new Laya.Sprite3D().transform;
    		this.thisTrans = this.owner.transform;
    		this.ChangeNextTargetPos();
    		this.thisRigidbody = this.owner.getComponent(Laya.Rigidbody3D);

    		this.thisRigidbody.friction = 0.6; //摩擦力
    		this.thisRigidbody.linearDamping = 0.8; //线阻力。

    		Laya.timer.frameOnce(60, this, function () {
    			this.state = "move";
    		});

    	}
    	//被车撞
    	BeiZhuang() {
    		if (this.state == "stop") {
    			return;
    		}
    		this.stopTime = 300 * 60;
    		this.state = "stop";

    		if (GameManager$2.curPlayer.moveSpeed > 0.1) {
    			if (GameManager$2.selectModel == 2) {
    				UIManager.gameUI.showRenWu1();
    				GameManager$2.curPlayer.AIChengKeScript.LessXinQing(10);
    				PlayerData.LessChaoPiao(100);
    				UIManager.ShowGameImgTipUI("2");
    				Laya.timer.frameOnce(30, this, function () {
    					GameManager$2.PlaySound("mingdi");
    				});
    			}
    			if (GameManager$2.selectModel == 3) {
    				if (GameManager$2.curPlayer.AIChengKeScript) {
    					UIManager.gameUI.showRenWu1();
    					GameManager$2.curPlayer.AIChengKeScript.LessXinQing(10);
    				}
    			}
    		}
    	}
    	onDisable() {
    	}
    	ChangeNextTargetPos() {
    		this.targetId += 1;
    		var obj = this.LuJingZu.getChildByName("" + this.targetId);
    		if (obj == null) {
    			this.targetId = 1;
    			obj = this.LuJingZu.getChildByName("" + this.targetId);
    		}
    		this.targetPos = obj.transform.position;
    	}
    	onUpdate() {
    		if (GameManager$2.gameState != "run") {
    			return;
    		}
    		switch (this.state) {
    			case "move":
    				this.UpdateMove();
    				break;
    			case "stop":
    				this.stopTime -= 1;
    				if (this.stopTime <= 0) {
    					this.stopTime = 0;
    					this.state = "move";
    				}
    				break;
    		}
    	}
    	UpdateMove() {
    		this.colneTrans.position = this.thisTrans.position;
    		this.colneTrans.lookAt(this.targetPos, new Laya.Vector3(0, 1, 0));
    		this.colneTrans.rotate(new Laya.Vector3(0, 180, 0), false, false);
    		this.colneTrans.rotationEuler = new Laya.Vector3(0, this.colneTrans.rotationEuler.y, 0);
    		var addSpeed = 0.2;
    		var tq = new Laya.Quaternion(0, 0, 0, 1);
    		Laya.Quaternion.slerp(this.thisTrans.rotation, this.colneTrans.rotation, 0.7 * addSpeed, tq);

    		this.thisTrans.rotation = tq;

    		this.thisTrans.translate(new Laya.Vector3(0, 0, addSpeed));

    		if (Laya.Vector3.distance(this.thisTrans.position, this.targetPos) < 2) {
    			this.ChangeNextTargetPos();
    		}
    	}
    }

    class PlayerCollision extends Laya.Script3D {

    	constructor() {
    		super();
    	}
    	CheckJiaYou() {
    		if (Laya.Vector3.distance(GameManager$2.playerTrans.position, this.jiayoupos) > 20) {
    			Laya.timer.clear(this, this.CheckJiaYou);
    		}
    		else {
    			if (GameManager$2.curPlayer.moveSpeed <= 500) {
    				Laya.timer.clear(this, this.CheckJiaYou);
    				if (GameManager$2.selectModel != 4)
    					GameManager$2.curPlayer.lessmovespeed(0);
    				UIManager.ShowUIPanel("tishi1", false);
    				GameManager$2.curPlayer.lessmovespeed(0);
    			}
    		}
    	}
    	onCollisionEnter(collision) {
    		if (PlayerData.isGameing == false)
    			return;
    		var name = collision.other.owner.name;
    		if (name.indexOf("AI_Car") != -1) {
    			collision.other.owner.getComponent(AICarMove).BeiZhuang();
    			GameManager$2.curPlayer.CollisionHuiTan(collision.contacts[0].normal);
    			GameManager$2.PlaySound("zhuangche_2");
    		}
    		else if (name != "dimian") {
    			if (GameManager$2.curPlayer.AIChengKeScript) {
    				UIManager.gameUI.showRenWu1();
    				GameManager$2.curPlayer.AIChengKeScript.LessXinQing(5);
    			}

    			GameManager$2.curPlayer.CollisionHuiTan(collision.contacts[0].normal);
    			GameManager$2.PlaySound("zhuangche_1");
    		}
    	}
    	onTriggerEnter(other) {
    		if (PlayerData.isGameing == false)
    			return;
    		var name = other.owner.name;
    		if (name == "Mubiao_jiayou") {
    			this.jiayoupos = other.owner.transform.position;
    			Laya.timer.clear(this, this.CheckJiaYou);
    			Laya.timer.frameLoop(1, this, this.CheckJiaYou);
    		}
    		else if (name.indexOf("weizhang") != -1) {
    			other.owner.parent.getComponent(HongLvDeng).CheckWeiZhang(name);
    		}

    		if (name.indexOf("Npc") != -1) {
    			other.owner.getComponent(AIXingRen).BeiZhuang();
    			if (GameManager$2.selectModel == 3) {
    				if (GameManager$2.gameState != "over") {
    					if (GameManager$2.renwu_king == 0) {
    						GameManager$2.Fail();
    					}

    				}
    			}
    		}
    	}
    }

    //乘客类
    class AIChengKe extends Laya.Script3D {

    	constructor() {
    		super();
    	}
    	//chengke父节点 接客点索引 目标点索引
    	Init(id, mainid, shunfengid) {
    		this.idx = id;
    		this.mainid = mainid;
    		this.shunfengid = shunfengid;
    		this.colneTrans = new Laya.Sprite3D().transform;
    		this.thisTrans = this.owner.transform;
    		this.thisAnimator = this.owner.getComponent(Laya.Animator);
    		//箭头
    		this.arrowObj = this.owner.getChildByName("Mubiao_renwu");
    		this.state = "wait";
    		this.huishouTime = 0;
    		this.xinqing = 100; //心情
    		this.zhuangjiNum = 0;

    		this.model_people = this.owner.getChildByName("Model");
    	}
    	LessXinQing(num) {
    		if (this.state == "chengche") {
    			this.xinqing -= num;
    			if (this.xinqing <= 0) {
    				this.xinqing = 0;
    			}
    			GameManager$2.xinqing = this.xinqing;
    			let id = GameManager$2.curSelectGuanQia + "-" + GameManager$2.curSelectGuanQia_main;
    			var juqingConfig = GameManager$2.juqingConfig[id];
    			if (juqingConfig.sex == 1) {
    				GameManager$2.PlaySound("nanjianjiao");
    			}
    			else {
    				GameManager$2.PlaySound("nvjianjiao");
    			}
    			this.zhuangjiNum += 1;
    			GameManager$2.zhuangjiNum = this.zhuangjiNum;

    			if (GameManager$2.selectModel == 3) {
    				if (this.zhuangjiNum == 3)//撞击失败
    				{
    					if (GameManager$2.gameState != "over") {
    						if (GameManager$2.renwu_king == 0) {
    							console.log("lnnnnnn,失败了");
    							GameManager$2.Fail();
    						}

    					}
    				}
    				if (this.zhuangjiNum == 1) {
    					UIManager.ShowZhuangJiTipUI("Tip02");
    				}
    				if (this.zhuangjiNum == 2) {
    					UIManager.ShowZhuangJiTipUI("Tip03");
    				}
    			}
    		}
    	}
    	onDisable() {
    		if (this.colneTrans) {
    			this.colneTrans.owner.destroy();
    			this.colneTrans = null;
    		}
    	}
    	onUpdate() {

    		if (GameManager$2.gameState != "run") {
    			return;
    		}
    		switch (this.state) {
    			case "wait":
    				this.WaitCar();
    				break;
    			case "waitshangche":
    				this.WaitShangChe();
    				break;
    			case "chengche":
    				break;
    		}
    	}
    	WaitCar() {
    		let dis = Laya.Vector3.distance(GameManager$2.playerTrans.position, this.thisTrans.position);
    		if (dis < 10) {
    			if (GameManager$2.curPlayer.moveSpeed <= 500) {
    				GameManager$2.curPlayer.WaitShangChe(true);
    				this.ChangeShangCheTarget();
    				this.state = "waitshangche";
    				this.thisAnimator.play("walk");
    				this.arrowObj.active = false;
    			}
    			if (this.koushaoSound == null) {
    				this.koushaoSound = GameManager$2.PlaySound("koushao_" + (GameManager$2.RandomInt(1, 3)));
    			}
    		} else if (dis < 15) {
    			this.huishouTime -= 1;
    			if (this.huishouTime <= 0) {
    				this.huishouTime = 300;
    				this.thisAnimator.play("huishou");
    			}
    			GameManager$2.curPlayer.SetAuto();
    		} else {
    			GameManager$2.curPlayer.SetAuto1();
    		}


    		this.colneTrans.position = this.thisTrans.position;
    		this.colneTrans.lookAt(GameManager$2.playerTrans.position, new Laya.Vector3(0, 1, 0));
    		this.colneTrans.rotate(new Laya.Vector3(0, 180, 0), false, false);
    		this.colneTrans.rotationEuler = new Laya.Vector3(0, this.colneTrans.rotationEuler.y, 0);
    		this.thisTrans.rotation = this.colneTrans.rotation;
    	}
    	WaitXiaChe() {

    	}

    	ChangeShangCheTarget() {
    		var pos1 = GameManager$2.curPlayer.ShangChePos01.position;
    		var pos2 = GameManager$2.curPlayer.ShangChePos02.position;
    		if (Laya.Vector3.distance(pos1, this.thisTrans.position) < Laya.Vector3.distance(pos2, this.thisTrans.position)) {
    			this.shangcheDir = 1;
    			this.targetTrans = GameManager$2.curPlayer.ShangChePos01;
    		}
    		else {
    			this.shangcheDir = 2;
    			this.targetTrans = GameManager$2.curPlayer.ShangChePos02;
    		}

    	}
    	OnArrive() { //xiache
    		console.log("OnArrive");
    		GameManager$2.curPlayer.WaitShangChe(true);
    		this.model_people.active = true;
    		this.state = "xiache";
    		if (this.shangcheDir == 1) {
    			this.thisAnimator.play("xiache");

    			Laya.timer.once(1000, this, function () {
    				this.thisAnimator.play("zaijian");
    			});
    		}
    		else {
    			this.thisAnimator.play("xiache2");
    			Laya.timer.once(1000, this, function () {
    				this.thisAnimator.play("zaijian");
    			});
    		}
    		GameManager$2.PlaySound("kaimen");

    		if (this.shangcheDir == 1) {
    			//下车镜头
    			GameManager$2.CameraMove.isShangChe = true;
    			GameManager$2.CameraMove.isMouseDown = false;
    			GameManager$2.CameraMove.ChengKeShangChe = 1;
    			if (GameManager$2.CameraMove.cheNeiShiJiao) {
    				GameManager$2.curPlayer.ChangeShiJiao();
    			}
    		}
    		else {
    			//下车镜头
    			GameManager$2.CameraMove.isShangChe = true;
    			GameManager$2.CameraMove.isMouseDown = false;
    			GameManager$2.CameraMove.ChengKeShangChe = 2;
    			if (GameManager$2.CameraMove.cheNeiShiJiao) {
    				GameManager$2.curPlayer.ChangeShiJiao();
    			}
    		}

    		Laya.timer.once(3000, this, function () {
    			GameManager$2.CameraMove.ChengKeShangChe = 0;

    			Laya.timer.once(2000, this, function () {
    				GameManager$2.CameraMove.isShangChe = false;
    				GameManager$2.curPlayer.WaitShangChe(false);
    				GameManager$2.curScene.addChild(this.owner);
    				this.thisTrans.position = this.targetTrans.position;
    				this.thisTrans.rotation = this.targetTrans.rotation;
    				UIManager.gameUI.UpdateXinQing(false);
    				Laya.timer.frameOnce(60, this, function () {
    					this.owner.destroy();
    				});
    				GameManager$2.CheckOver();
    			});

    		});
    	}

    	WaitShangChe() {

    		this.colneTrans.position = this.thisTrans.position;
    		this.colneTrans.lookAt(this.targetTrans.position, new Laya.Vector3(0, 1, 0));
    		this.colneTrans.rotate(new Laya.Vector3(0, 180, 0), false, false);
    		this.colneTrans.rotationEuler = new Laya.Vector3(0, this.colneTrans.rotationEuler.y, 0);
    		var addSpeed = 0.02;
    		var tq = new Laya.Quaternion(0, 0, 0, 1);
    		Laya.Quaternion.slerp(this.thisTrans.rotation, this.colneTrans.rotation, addSpeed, tq);

    		this.thisTrans.rotation = tq;

    		this.thisTrans.translate(new Laya.Vector3(0, 0, addSpeed));

    		if (Laya.Vector3.distance(this.thisTrans.position, this.targetTrans.position) < 1) {
    			console.log("上车==========");
    			GameManager$2.playerTrans.owner.addChild(this.owner);
    			this.thisTrans.position = this.targetTrans.position;
    			this.thisTrans.rotation = this.targetTrans.rotation;
    			this.state = "shangche";
    			if (this.shangcheDir == 1) {
    				this.thisAnimator.play("shangche");
    			}
    			else {
    				this.thisAnimator.play("shangche2");
    			}
    			GameManager$2.PlaySound("kaimen");
    			if (this.shangcheDir == 1) {
    				//上车镜头
    				GameManager$2.CameraMove.isShangChe = true;
    				GameManager$2.CameraMove.isMouseDown = false;
    				GameManager$2.CameraMove.ChengKeShangChe = 1;
    				if (GameManager$2.CameraMove.cheNeiShiJiao) {
    					GameManager$2.curPlayer.ChangeShiJiao();
    				}
    			}
    			else {
    				//上车镜头
    				GameManager$2.CameraMove.isShangChe = true;
    				GameManager$2.CameraMove.isMouseDown = false;
    				GameManager$2.CameraMove.ChengKeShangChe = 2;
    				if (GameManager$2.CameraMove.cheNeiShiJiao) {
    					GameManager$2.curPlayer.ChangeShiJiao();
    				}
    			}

    			Laya.timer.once(3000, this, function () {
    				GameManager$2.CameraMove.ChengKeShangChe = 0;
    				this.model_people.active = false;
    				Laya.timer.once(2000, this, function () {
    					//this.owner.active = false;
    					this.state = "chengche";
    					GameManager$2.curPlayer.WaitShangChe(false);
    					GameManager$2.CameraMove.isShangChe = false;
    					GameManager$2.curPlayer.nextGuide();
    					if (GameManager$2.selectModel == 3) {
    						UIManager.ShowZhuangJiTipUI("Tip01");
    						this.guideIndex = parseInt(this.posIndex) + 1;
    					}
    					GameManager$2.chengke.unshift(this);
    					GameManager$2.curPlayer.resetShijian();
    					GameManager$2.curPlayer.Youhua();

    				});

    			});
    		}
    	}
    }

    class PlayerControlBase extends Laya.Script3D {

    	constructor() {
    		super();
    		this.carState = "";
    		this.carDirState = "";
    		this.moveSpeed = 0;
    		this.yingqingSoundTime = 0;
    		this.rotateAngle = 0;
    		this.dangDir = 1; //档方向
    		this.waitShangChe = false;
    		this.carYouLiang = 100; //汽车油量
    		this.ChaoPiaoNum = 0;//当局钞票数量
    		this.curZaiKeNum = 0; //当前载客数量
    		this.autoXiuZhengTime = 0;
    	}
    	initData(carid) {
    		var data = GameManager$2.chekuConfig[carid];
    		this.maxMoveSpeed = data.maxspeed;         //最大速度
    		this.maxDaoCheSpeed = data.reversemax;     //倒车最大速度
    		this.less = data.less;                    //油耗
    		this.speedup = data.speedup;              //加速
    		this.brake = data.brake;                  //减速
    		this.rotate = data.rotateAngle;           //转弯速度
    		this.free = data.free;                    //滑行减速
    		this.reverse = data.reverse;              //倒车加速
    		this.cost = data.cost;                    //加油消耗系数
    		this.chengkeID = 1;                             //乘客id
    		this.targetPos = null;                   //当前目标位置
    		let daohang = PlayerData.GetUserData("daohang");
    		console.log("model:" + GameManager$2.selectModel + " guan:" + GameManager$2.curSelectGuanQia);
    		if (GameManager$2.selectModel != 2 && GameManager$2.curSelectGuanQia < 11) {
    			this.openDaohang = true;
    		}
    		else
    			this.openDaohang = daohang > 0 && GameManager$2.selectModel != 2;


    		this.mainid = -1;
    		this.shunfengid = -1;
    	}
    	onEnable() {
    		var youLiang = PlayerData.GetUserData("youLiang");
    		var carid = PlayerData.GetUserData("selectCar");
    		this.initData(carid);
    		if (PlayerData.shiyongCarId > 0) {
    			PlayerData.shiyongCarId2 = PlayerData.shiyongCarId;
    			carid = PlayerData.shiyongCarId;
    			PlayerData.shiyongCarId = 0;
    		}
    		else {
    			PlayerData.shiyongCarId2 = 0;
    		}
    		this.carYouLiang = youLiang[carid];

    		this.CreateCar(carid);

    		this.CreateArrow();
    		this.UpdateHongLvDeng();
    		this.CreateGuide();
    		if (PlayerData.gamePingZhi == 1 || PlayerData.gamePingZhi == 2) {
    			this.CreateXingRen();
    			this.CreateNpcCar();
    		}

    		GameManager$2.gameState = "run";

    		this.time = 0;
    		this.ResetMission();
    		this.nodePos = -1;

    		if (GameManager$2.selectModel == 2) {//自由模式
    			this.zongshijian = -1; //GameManager.RandomInt(120, 180);
    		} else { //工作模式
    			var config = GameManager$2.guanqia3Config[GameManager$2.curSelectGuanQia];
    			this.zongshijian = config.time;
    		}
    		GameManager$2.gameStartTime = this.zongshijian;
    		this.shijian = this.zongshijian;
    		GameManager$2.xinqing = 100;
    		this.lucheng = 0;
    		this.CreateChengKe();
    		this.HideJiayouzhan();
    		this.isAuto = false;
    		this.isStart = false;
    	}
    	SetAuto1() {
    		this.isAuto = false;
    	}
    	SetAuto() {
    		if (this.isAuto || this.carState == "" || false == this.isStart)
    			return;
    		GameManager$2.show = false;
    		this.rotateAngle = 0;
    		this.isAuto = true;
    		// this.playerTrans.lookAt(this.targetPos, new Laya.Vector3(0, 1, 0));
    		// this.playerTrans.rotate(new Laya.Vector3(0, 180, 0), false, false);
    		// this.playerTrans.rotationEuler = new Laya.Vector3(0, this.playerTrans.rotationEuler.y, 0);

    	}
    	HideJiayouzhan() {

    	}
    	CreateGuide() {
    		// if (GameManager.selectModel == 4)
    		//     return;
    		//创建目的地标识
    		var Prefab = GameManager$2.models.getChildByName("Money");
    		//蓝色路标
    		this.guideObj = Laya.Sprite3D.instantiate(Prefab, GameManager$2.curScene);
    		this.guideObj.active = false;
    		//乘客上车标识
    		this.guideShangCheObj = Laya.Sprite3D.instantiate(GameManager$2.models.getChildByName("shangche"), GameManager$2.curScene);
    		this.guideShangCheObj.active = false;

    	}

    	//type 1:蓝色 2：上下车
    	SetGuidePos(type, pos) {
    		this.guideObj.active = type == 1;
    		this.guideShangCheObj.active == type == 2 && GameManager$2.selectModel != 2;
    		if (type == 1) {
    			this.guideObj.transform.position = pos;

    		}
    		else {

    			this.guideShangCheObj.transform.position = pos;
    		}
    	}

    	CreateCar(id) {
    		var huocheName = "Car_" + id;
    		var targetTrans = GameManager$2.curScene.getChildByName("PlayerPos").transform;
    		if (GameManager$2.selectModel == 3) { //任务
    			targetTrans = GameManager$2.curScene.getChildByName("Guanqia").getChildByName("PlayerPos").getChildByName("" + GameManager$2.curSelectGuanQia).transform;
    		}
    		else if (GameManager$2.selectModel == 4) //加油关
    		{
    			// GameManager.RandomInt(0, ChengKe.numChildren - 1);
    			let jiayouNode = GameManager$2.curScene.getChildByName("Guanqia").getChildByName("Chengke").getChildByName("jiayou");
    			this.randJiayou = GameManager$2.RandomInt(1, jiayouNode.numChildren);
    			targetTrans = jiayouNode.getChildByName("" + this.randJiayou).transform;
    		}
    		var carPrefab = GameManager$2.models.getChildByName(huocheName);
    		var clone = Laya.Sprite3D.instantiate(carPrefab, GameManager$2.curScene, true, new Laya.Vector3(0, 0, 0));
    		clone.transform.position = targetTrans.position;
    		clone.transform.rotation = targetTrans.rotation;
    		clone.addComponent(PlayerCollision);
    		this.playerTrans = clone.transform;
    		GameManager$2.playerTrans = clone.transform;
    		this.playerRigidbody = clone.getComponent(Laya.Rigidbody3D);
    		this.playerAnimator = clone.getComponent(Laya.Animator);

    		this.cheNeiObj = clone.getChildByName("Car_inside");
    		this.cheBodyObj = clone.getChildByName("Body");

    		this.fangXiangPanTrans = this.cheNeiObj.getChildByName("FXP").transform;
    		this.cheNeiObj.active = false;

    		this.playerRigidbody.mass = 1500;


    		this.wheelTrans01 = clone.getChildByName("Wheel_1").transform;
    		this.wheelTrans02 = clone.getChildByName("Wheel_2").transform;
    		this.wheelTrans03 = clone.getChildByName("Wheel_3").transform;
    		this.wheelTrans04 = clone.getChildByName("Wheel_4").transform;

    		this.wheelTrans05 = clone.getChildByName("Wheel_1").getChildByName("Wheel").transform;
    		this.wheelTrans06 = clone.getChildByName("Wheel_2").getChildByName("Wheel").transform;

    		this.ShangChePos01 = clone.getChildByName("ShangChePos01").transform;
    		this.ShangChePos02 = clone.getChildByName("ShangChePos02").transform;
    		this.carTargetCamera = clone.getChildByName("renderTargetCamera");

    		this.carShaCheDeng = clone.getChildByName("TX_shachedeng");
    		this.carShaCheDeng.active = false;

    		GameManager$2.PlaySound("yinqingfadong_1");

    	}
    	InitPath() {
    		//   GameManager.path
    	}
    	ResetMission() {
    		//初始化主线/顺风车 列表

    		GameManager$2.curSelectGuanQia_main = 1;
    		GameManager$2.curSelectGuanQia_shunfeng = 1;
    		GameManager$2.shunfengNum = 0;
    		GameManager$2.chengke = [];
    		GameManager$2.path = [];
    		GameManager$2.mission = [];
    		if (2 == GameManager$2.selectModel)
    			return;


    		let root = GameManager$2.curScene.getChildByName("Guanqia").getChildByName("Chengke").getChildByName("" + GameManager$2.curSelectGuanQia);
    		for (let i = 1; i < 10; i++) {//主线剧情

    			let ChengKe = root.getChildByName("p" + i);
    			if (null == ChengKe)
    				break;
    			GameManager$2.mission.push({ type: 1, id: i });
    			for (let j = 1; j < 10; j++) {
    				let shunfeng = root.getChildByName("d" + i + "-" + j);
    				if (null == shunfeng)
    					break;
    				GameManager$2.mission.push({ type: 2, id: j, main: i });
    			}
    		}
    		GameManager$2.mission.shift();
    	}

    	checkGuide() {
    		if (GameManager$2.path.length == 0)
    			return;
    		if (GameManager$2.path[0].pathList.length < this.guideIdx)
    			return;
    		if (GameManager$2.path[0].pathList[this.guideIdx - 1] == null) {
    			let a = 0;
    		}
    		let pos = GameManager$2.path[0].pathList[this.guideIdx - 1].pos;
    		let pos2 = GameManager$2.playerTrans.position;
    		if (GameManager$2.selectModel == 4) {
    			if (Laya.Vector3.distance(pos, GameManager$2.playerTrans.position) < 1) {
    				let cur = GameManager$2.path[0];
    				this.nodePos = GameManager$2.path[0].pathList[this.guideIdx - 1].idx;
    				if (this.guideIdx == GameManager$2.path[0].pathList.length) {    //到达终点
    					if (this.moveSpeed <= 500) {
    						if (GameManager$2.selectModel == 4) {
    							GameManager$2.curPlayer.WaitShangChe(true);
    							return;
    						}

    						if (GameManager$2.selectModel == 2) {
    							GameManager$2.songdaShiJian = this.shijian;
    						}
    						GameManager$2.curPlayer.SetAuto();
    						let chengke = GameManager$2.chengke.shift();
    						chengke.OnArrive();
    						GameManager$2.path.shift();
    						this.hideGuide();
    						if (GameManager$2.path.length > 0) {
    							this.SetGuideDefault();
    						}
    						else {
    							this.guideIdx = -1;
    						}

    					}
    				}
    				else if (this.guideIdx - 1 == GameManager$2.path[0].node) {  //到达接客点
    					if (this.moveSpeed <= 500) {
    						this.hideGuide();
    					}
    				}
    				else if (this.guideIdx - 1 != GameManager$2.path[0].node) {  //到达路径点
    					this.hideGuide();
    					this.nextGuide();
    				}

    			} else if (GameManager$2.path[0].pathList.length > this.guideIdx && this.guideIdx != GameManager$2.path[0].pathList.length && (this.guideIdx - 1) != GameManager$2.path[0].node) {
    				let pos2 = GameManager$2.path[0].pathList[this.guideIdx].pos;
    				let playerpos = GameManager$2.playerTrans.position;
    				if (Laya.Vector3.distance(pos2, GameManager$2.playerTrans.position) < Laya.Vector3.distance(pos, pos2)) {
    					this.hideGuide();
    					this.nextGuide();
    				}
    			}
    		} else {
    			let dis = Laya.Vector3.distance(pos, GameManager$2.playerTrans.position);
    			if (dis < 6) {
    				let cur = GameManager$2.path[0];
    				this.nodePos = GameManager$2.path[0].pathList[this.guideIdx - 1].idx;
    				if (this.guideIdx == GameManager$2.path[0].pathList.length) {    //到达终点

    					if (dis == 0) {
    						this.SetAuto();
    					}
    					else {
    						if (GameManager$2.selectModel == 4) {
    							GameManager$2.curPlayer.WaitShangChe(true);
    							return;
    						}

    						if (GameManager$2.selectModel == 2) {
    							GameManager$2.songdaShiJian = this.shijian;
    						}
    						let chengke = GameManager$2.chengke.shift();
    						chengke.OnArrive();

    						GameManager$2.path.shift();
    						this.hideGuide();
    						if (GameManager$2.path.length > 0) {
    							this.SetGuideDefault();
    						}
    						else {
    							this.guideIdx = -1;
    						}
    					}

    				} else if (this.guideIdx - 1 == GameManager$2.path[0].node) {  //到达接客点
    					if (this.moveSpeed <= 500) {
    						this.hideGuide();
    					}
    				}
    				else if (this.guideIdx - 1 != GameManager$2.path[0].node) {  //到达路径点
    					this.hideGuide();
    					this.nextGuide();
    				}





    			}
    			else if (GameManager$2.path[0].pathList.length > this.guideIdx && this.guideIdx != GameManager$2.path[0].pathList.length && (this.guideIdx - 1) != GameManager$2.path[0].node) {
    				let pos2 = GameManager$2.path[0].pathList[this.guideIdx].pos;
    				let playerpos = GameManager$2.playerTrans.position;
    				if (Laya.Vector3.distance(pos2, GameManager$2.playerTrans.position) < Laya.Vector3.distance(pos, pos2)) {
    					this.hideGuide();
    					this.nextGuide();
    				}
    			}
    		}

    	}
    	hideGuide() {
    		this.guideObj.active = false;
    		this.guideShangCheObj.active = false;
    	}
    	nextGuide() {
    		if (this.openDaohang) {
    			this.guideIdx++;
    		}
    		else {
    			this.guideIdx = GameManager$2.path[0].pathList.length;
    		}
    		//乘客上车后调用，继续指路
    		this.ShowGuide();
    	}



    	ShowGuide() {
    		if (GameManager$2.path.length == 0 || GameManager$2.path[0].pathList.length < this.guideIdx) {
    			this.targetPos = null;
    			return;
    		}

    		let path = GameManager$2.path[0];
    		if (path.node == this.guideIdx - 1 || this.guideIdx == GameManager$2.path[0].pathList.length) {
    			this.guideShangCheObj.transform.position = path.pathList[this.guideIdx - 1].pos;
    			this.guideShangCheObj.active = GameManager$2.selectModel != 2 || this.guideIdx == GameManager$2.path[0].pathList.length;
    		}
    		else {
    			this.guideObj.transform.position = path.pathList[this.guideIdx - 1].pos;
    			this.guideObj.active = true;
    		}
    		this.targetPos = path.pathList[this.guideIdx - 1].pos;

    	}
    	SetGuideDefault() {
    		if (this.openDaohang) {
    			this.guideIdx = 1;
    		}
    		else {
    			let path = GameManager$2.path[0];
    			if (path.node == -1) {//如果已经接了客人 ，设置为终点
    				this.guideIdx = path.pathList.length;
    			}
    			else {//如果还没接客，那就去接客
    				this.guideIdx = path.node + 1;
    			}

    		}
    	}
    	CreateArrow() {
    		var Prefab = GameManager$2.models.getChildByName("Arrow");
    		var clone = Laya.Sprite3D.instantiate(Prefab, GameManager$2.curScene);
    		this.arrowTrans = clone.transform;
    		//this.arrowTrans.owner.active = this.openDaohang || GameManager.selectModel == 2;
    	}
    	CreateNpcCar() {
    		var AICarObj = GameManager$2.curScene.getChildByName("AICar");
    		for (var i = 0; i < AICarObj.numChildren; i++) {
    			var obj = AICarObj.getChildAt(i);
    			let tarobj = obj.getChildByName("1").transform;
    			var carPrefab = GameManager$2.models.getChildByName("AI_Car_" + GameManager$2.RandomInt(1, 7));
    			var clone = Laya.Sprite3D.instantiate(carPrefab, GameManager$2.curScene);
    			clone.transform.position = tarobj.position;
    			clone.transform.rotation = tarobj.rotation;
    			var AICarMoveScript = clone.addComponent(AICarMove);
    			AICarMoveScript.Init(obj);
    		}
    	}
    	//行人
    	CreateXingRen() {
    		var AIrenObj = GameManager$2.curScene.getChildByName("AINpc");
    		for (var i = 0; i < AIrenObj.numChildren; i++) {
    			var obj = AIrenObj.getChildAt(i);
    			let tarobj = obj.getChildByName("1").transform;
    			var carPrefab = GameManager$2.models.getChildByName("Npc_" + GameManager$2.RandomInt(1, 7));
    			var clone = Laya.Sprite3D.instantiate(carPrefab, GameManager$2.curScene);
    			clone.transform.position = tarobj.position;
    			clone.transform.rotation = tarobj.rotation;
    			var AICarMoveScript = clone.addComponent(AIXingRen);
    			AICarMoveScript.Init(obj);
    		}
    	}
    	CreateChengKe() {
    		if (GameManager$2.selectModel == 2) {
    			this.CreateChengKe_2();
    		}
    		else if (GameManager$2.selectModel == 3) {
    			this.CreateChengKe_3(1, 1, 1);
    		}
    		else {
    			this.CreateChengKe_4();
    		}
    	}
    	//自由模式
    	CreateChengKe_2() {
    		GameManager$2.xinqing = 100;
    		this.hideGuide();
    		var ChengKe = GameManager$2.curScene.getChildByName("ChengKe");
    		var index = GameManager$2.RandomInt(0, ChengKe.numChildren - 1);
    		let tarobj = ChengKe.getChildAt(index);
    		var posindex = "" + index;
    		console.log("random:" + posindex);
    		GameManager$2.InsertChengke_free(tarobj);
    		let chushengPos = tarobj.getChildAt(0).transform;
    		GameManager$2.curSelectGuanQia = GameManager$2.RandomInt(1, 40);
    		var carPrefab = GameManager$2.models.getChildByName("guanqia_" + GameManager$2.curSelectGuanQia + "_1");
    		var clone = Laya.Sprite3D.instantiate(carPrefab, GameManager$2.curScene);
    		let path = GameManager$2.path;
    		clone.transform.position = chushengPos.position;
    		clone.transform.rotation = chushengPos.rotation;
    		this.AIChengKeScript = clone.addComponent(AIChengKe);
    		this.AIChengKeScript.Init(this.chengkeID++, 1, -1);
    		this.chengkeTrans = clone.transform;
    		//        this.guideIdx = 1;
    		this.SetGuideDefault();
    		this.ShowGuide();
    		this.mainid = 1;
    		this.shunfengid = -1;
    	}
    	//任务模式
    	CreateChengKe_3(type, mainid, shunfengid) {
    		this.hideGuide();
    		let ChengKe = GameManager$2.curScene.getChildByName("Guanqia").getChildByName("Chengke").getChildByName("" + GameManager$2.curSelectGuanQia);

    		let ChengKeNode = null;
    		if (type == 1) {
    			GameManager$2.InsertChengke(ChengKe, "p" + mainid, this.nodePos);
    			ChengKeNode = ChengKe.getChildByName("p" + mainid);
    		}
    		else {
    			GameManager$2.InsertChengke(ChengKe, "d" + mainid + "-" + shunfengid, this.nodePos);
    			ChengKeNode = ChengKe.getChildByName("d" + mainid + "-" + shunfengid);
    		}
    		let chushengPos = ChengKeNode.transform;
    		//接客点
    		let startIndex = ChengKeNode.getChildAt(0).name;
    		//送客点
    		let targetIndex = ChengKeNode.getChildAt(1).name;
    		let tarobj = ChengKe.transform;

    		var carPrefab = null;
    		if (type == 1) {
    			carPrefab = GameManager$2.models.getChildByName("guanqia_" + GameManager$2.curSelectGuanQia + "_" + mainid);
    			this.mainid = mainid;
    			this.shunfengid = -1;
    		}
    		else {
    			carPrefab = GameManager$2.models.getChildByName("guanqia_s_" + GameManager$2.curSelectGuanQia + "_" + mainid + "_" + shunfengid);
    			this.mainid = mainid;
    			this.shunfengid = shunfengid;
    		}
    		var clone = Laya.Sprite3D.instantiate(carPrefab, GameManager$2.curScene);
    		clone.transform.position = chushengPos.position;
    		clone.transform.rotation = chushengPos.rotation;
    		this.AIChengKeScript = clone.addComponent(AIChengKe);
    		this.AIChengKeScript.Init(this.chengkeID++, this.mainid, this.shunfengid);
    		this.chengkeTrans = clone.transform;
    		//        this.guideIdx = 1;
    		this.SetGuideDefault();
    		this.ShowGuide();
    	}
    	SetCurChengke() {
    		if (GameManager$2.chengke.length > 0) {
    			this.AIChengKeScript = GameManager$2.chengke[0];
    			this.mainid = this.AIChengKeScript.mainid;
    			this.shunfengid = this.AIChengKeScript.shunfengid;
    		}
    	}
    	CreateChengKe_4() {
    		console.log("加油关createchengke");
    		let root = GameManager$2.curScene.getChildByName("Guanqia").getChildByName("Chengke").getChildByName("jiayou").getChildByName("" + this.randJiayou);
    		GameManager$2.InsertJiayou(root);
    		this.SetGuideDefault();
    		this.ShowGuide();
    	}

    	//红绿灯
    	UpdateHongLvDeng() {
    		var honglvdeng = GameManager$2.curScene.getChildByName("honglvdeng");
    		for (var i = 0; i < honglvdeng.numChildren; i++) {
    			honglvdeng.getChildAt(i).addComponent(HongLvDeng);
    		}
    	}
    	onDisable() {
    	}
    	//呼叫乘客
    	HuJiaoChengKe() {
    		if (this.chengkeTrans) {
    			this.chengkeTrans.owner.destroy();
    			this.chengkeTrans = null;
    		}
    		this.CreateChengKe();
    	}
    	//加油
    	AddQiYou() {
    		this.carYouLiang = 100;
    	}
    	XiuZhengChe() {
    		GameManager$2.playerTrans.position = new Laya.Vector3(GameManager$2.playerTrans.position.x, GameManager$2.playerTrans.position.y + 3, GameManager$2.playerTrans.position.z);
    		GameManager$2.playerTrans.rotationEuler = new Laya.Vector3(0, 0, 0);
    		GameManager$2.CameraMove.autoRotateTimer = 20;
    	}
    	ChangeYingXiang() {
    		if (GameManager$2.CameraMove.cheNeiShiJiao == true && this.dangDir == -1) {
    			if (this.renderTargetCamera == null) {
    				this.renderTargetCamera = this.carTargetCamera.addChild(new Laya.Camera(0, 0.01, 20));
    				this.renderTargetCamera.transform.localPosition = new Laya.Vector3(0, 0, 0);
    				this.renderTargetCamera.transform.localRotationEuler = new Laya.Vector3(-30, 180, 0);
    				this.renderTargetCamera.renderTarget = new Laya.RenderTexture(128, 128);
    				this.renderTargetCamera.renderingOrder = -1;
    				this.renderTargetCamera.clearFlag = Laya.BaseCamera.CLEARFLAG_SKY;
    			}

    		}
    		else {
    			if (this.renderTargetCamera) {
    				this.renderTargetCamera.destroy();
    				this.renderTargetCamera = null;
    			}

    		}
    	}
    	ChangeCar() {
    		UIManager.gameUI.initTuijian();
    		var youLiang = PlayerData.GetUserData("youLiang");
    		var carid = PlayerData.GetUserData("selectCar");
    		this.carYouLiang = youLiang[carid];
    		var data = GameManager$2.chekuConfig[carid];
    		this.maxMoveSpeed = data.maxspeed;         //最大速度
    		this.maxDaoCheSpeed = data.reversemax;     //倒车最大速度
    		this.less = data.less;                    //油耗
    		this.speedup = data.speedup;              //加速
    		this.brake = data.brake;                  //减速
    		this.rotate = data.rotateAngle;           //转弯速度
    		this.free = data.free;                    //滑行减速
    		this.reverse = data.reverse;              //倒车加速
    		this.cost = data.cost;                    //加油消耗系数

    		var huocheName = "Car_" + carid;

    		var carPrefab = GameManager$2.models.getChildByName(huocheName);
    		var clone = Laya.Sprite3D.instantiate(carPrefab, GameManager$2.curScene, true, new Laya.Vector3(0, 0, 0));
    		clone.transform.position = this.playerTrans.position;
    		clone.transform.rotation = this.playerTrans.rotation;
    		clone.addComponent(PlayerCollision);
    		this.playerTrans.owner.active = false;

    		this.playerTrans = clone.transform;
    		GameManager$2.playerTrans = clone.transform;
    		this.playerRigidbody = clone.getComponent(Laya.Rigidbody3D);
    		this.playerAnimator = clone.getComponent(Laya.Animator);

    		this.cheNeiObj = clone.getChildByName("Car_inside");
    		this.cheBodyObj = clone.getChildByName("Body");

    		this.fangXiangPanTrans = this.cheNeiObj.getChildByName("FXP").transform;

    		this.cheNeiObj.active = false;

    		this.playerRigidbody.mass = 1500;

    		this.wheelTrans01 = clone.getChildByName("Wheel_1").transform;
    		this.wheelTrans02 = clone.getChildByName("Wheel_2").transform;
    		this.wheelTrans03 = clone.getChildByName("Wheel_3").transform;
    		this.wheelTrans04 = clone.getChildByName("Wheel_4").transform;

    		this.wheelTrans05 = clone.getChildByName("Wheel_1").getChildByName("Wheel").transform;
    		this.wheelTrans06 = clone.getChildByName("Wheel_2").getChildByName("Wheel").transform;

    		this.ShangChePos01 = clone.getChildByName("ShangChePos01").transform;
    		this.ShangChePos02 = clone.getChildByName("ShangChePos02").transform;

    		this.carTargetCamera = clone.getChildByName("renderTargetCamera");

    		this.carShaCheDeng = clone.getChildByName("TX_shachedeng");
    		this.carShaCheDeng.active = false;
    	}
    	HuanDang() {
    		if (Math.abs(this.moveSpeed) <= 0.01 || this.waitShangChe == true) {
    			if (this.dangDir == 1) {
    				this.dangDir = -1;
    			}
    			else {
    				this.dangDir = 1;
    			}
    			UIManager.gameUI.HuanDangAni(this.dangDir);
    			this.ChangeYingXiang();
    		}
    		else {
    			UIManager.ShowGameImgTipUI("8");
    		}
    		GameManager$2.PlaySound("huandang");
    	}
    	ChangeDingSu() {
    		if (this.carState == "dingsu") {
    			this.carState = "stopjiayou";
    		}
    		else if (this.carState == "jiayou" || this.carState == "stopjiayou") {
    			this.carState = "dingsu";
    		}
    	}
    	ChangeShiJiao() {
    		GameManager$2.CameraMove.ChangeShiJiao();
    		this.ChangeYingXiang();

    		if (GameManager$2.CameraMove.cheNeiShiJiao == true) {
    			this.cheNeiObj.active = true;
    			this.cheBodyObj.active = false;
    		}
    		else {
    			this.cheNeiObj.active = false;
    			this.cheBodyObj.active = true;
    		}

    	}
    	JiaYou() {
    		if (UIManager.showMeiYouUI) {
    			return;
    		}
    		this.carState = "jiayou";
    		this.isStart = true;
    	}
    	//消耗油
    	LessYouLiang() {
    		if (GameManager$2.selectModel == 4)
    			return;
    		this.carYouLiang -= this.less;//* 50;//0.005 
    		if (this.carYouLiang <= 0) {
    			this.carYouLiang = 0;
    			if (UIManager.showMeiYouUI == null) {
    				UIManager.InsertUIList("meiyou");
    				GameManager$2.PlaySound("yinqingmeiyou");
    			}
    		}
    	}
    	StopJiaYou() {
    		if (UIManager.showMeiYouUI) {
    			this.carState = "shache";
    		}
    		else {
    			this.carState = "stopjiayou";
    		}
    	}
    	ShaChe() {
    		this.carState = "shache";
    		this.carShaCheDeng.active = true;
    		if (this.moveSpeed >= 10) {
    			GameManager$2.PlaySound("shache");
    		}
    	}
    	StopShaChe() {
    		this.carShaCheDeng.active = false;
    		this.carState = "stopjiayou";
    	}
    	ZhuanXiang(dir) {
    		this.carDirState = dir;
    	}
    	StopZhuanXiang() {
    		this.carDirState = "stop";
    	}
    	WaitShangChe(v) {
    		this.waitShangChe = v;
    		if (false == v) {
    			this.isAuto = false;
    		}
    	}
    	lessmovespeed(a) {
    		this.moveSpeed = a;
    	}
    	Clamp(v, min, max) {
    		if (v < min) {
    			v = min;
    		}
    		if (v > max) {
    			v = max;
    		}
    		return v;
    	}
    	//碰撞 弹开
    	CollisionHuiTan(fangxiang) {
    		if (this.isHuiTan) {
    			return;
    		}

    		this.isHuiTan = true;
    		var forward = new Laya.Vector3(0, 0, 0);
    		GameManager$2.playerTrans.getForward(forward);
    		var speed = 400 * this.moveSpeed;
    		// forward = fangxiang ;
    		this.playerRigidbody.applyImpulse(new Laya.Vector3(forward.x * speed, 0, forward.z * speed));
    		Laya.timer.frameOnce(30, this, function () {
    			this.isHuiTan = false;
    		});
    		this.moveSpeed = 0;
    	}
    	Stop() {
    		this.carState = "stopjiayou";
    		this.moveSpeed = 0;
    		this.onUpdate();
    		//        this.playerRigidbody.linearVelocity = new Laya.Vector3(0, 0, 0);
    	}
    	onUpdate() {
    		if ("pause" == GameManager$2.gameState) {
    			return;
    		}
    		this.UpdateArrow();
    		var ex = GameManager$2.playerTrans.rotationEuler.x;
    		var ez = GameManager$2.playerTrans.rotationEuler.z;
    		var ey = this.arrowTrans.rotationEuler.y;
    		var ny = GameManager$2.playerTrans.rotationEuler.y;
    		if (Math.abs(ex) > 70 || Math.abs(ez) > 70) {
    			if (this.autoXiuZhengTime <= 0) {
    				this.autoXiuZhengTime = 10;
    			}
    			this.autoXiuZhengTime -= 0.1;
    			if (this.autoXiuZhengTime <= 0) {
    				this.XiuZhengChe();
    			}
    			return;
    		}
    		if (Math.abs(ny - ey) > 130 && Math.abs(ny - ey) < 200 && GameManager$2.path.length > 0) {
    			this.hidearrow();
    			GameManager$2.show = true;
    		} else {
    			this.showarrow();
    			GameManager$2.show = false;
    		}
    		if (this.isHuiTan) {
    			return;
    		}
    		var shijiMoveSpeed = Math.sqrt(Math.pow(this.playerRigidbody.linearVelocity.z, 2) + Math.pow(this.playerRigidbody.linearVelocity.x, 2));
    		var lvy = this.playerRigidbody.linearVelocity.y;

    		if (this.waitShangChe == true) {
    			this.carState = "shache";
    		}
    		var a = this.moveSpeed * (0 - this.rotateAngle) * 0.006;
    		a = this.Clamp(a, -1, 1);
    		this.playerRigidbody.angularVelocity = new Laya.Vector3(0, a, 0);
    		var f = new Laya.Vector3(0, 0, 0);
    		this.wheelTrans01.getForward(f);
    		if (GameManager$2.gameState == "over") {
    			this.carState = "shache";
    		}

    		if (this.isAuto) {
    			let dis = Laya.Vector3.distance(this.targetPos, this.playerTrans.position);
    			if (dis < 3) {//stop
    				this.carState = "shache";
    				this.moveSpeed = 0;
    			} else if (dis < 10) {//减速
    				this.moveSpeed += this.speedup[0] + (0 - this.moveSpeed) * this.brake[1];
    			} else if (dis < 30) {//缓慢减速
    				this.moveSpeed += this.speedup[0] + (0 - this.moveSpeed) * this.brake[2];
    			}
    			this.playerRigidbody.linearVelocity = new Laya.Vector3(-f.x * this.moveSpeed, lvy, -f.z * this.moveSpeed);
    		} else {
    			switch (this.carState) {
    				case "jiayou":
    					GameManager$2.CameraMove.autoRotate = true;
    					if (this.dangDir == 1) {
    						if (shijiMoveSpeed >= 0 && shijiMoveSpeed <= 30) {
    							this.moveSpeed += (this.speedup[0] * this.dangDir);
    						}
    						if (shijiMoveSpeed >= 30 && shijiMoveSpeed <= 40) {
    							this.moveSpeed += (this.speedup[1] * this.dangDir);
    						}
    						if (shijiMoveSpeed >= 40 && shijiMoveSpeed <= 50) {
    							this.moveSpeed += (this.speedup[2] * this.dangDir);
    						}
    						if (shijiMoveSpeed >= 50 && shijiMoveSpeed <= 60) {
    							this.moveSpeed += (this.speedup[3] * this.dangDir);
    						}
    						if (shijiMoveSpeed >= 60 && shijiMoveSpeed <= 70) {
    							this.moveSpeed += (this.speedup[4] * this.dangDir);
    						}
    						if (shijiMoveSpeed >= 70 && shijiMoveSpeed <= 80) {
    							this.moveSpeed += (this.speedup[5] * this.dangDir);
    						}
    						else {
    							this.moveSpeed += (this.speedup[6] * this.dangDir);
    						}
    						if (this.moveSpeed >= this.maxMoveSpeed) {
    							this.moveSpeed = this.maxMoveSpeed;
    						}
    					}
    					else {
    						this.moveSpeed += (this.reverse * this.dangDir);
    						if (this.moveSpeed <= this.maxDaoCheSpeed) {
    							this.moveSpeed = this.maxDaoCheSpeed;
    						}

    					}
    					this.playerRigidbody.linearVelocity = new Laya.Vector3(-f.x * this.moveSpeed, lvy, -f.z * this.moveSpeed);
    					this.LessYouLiang();

    					if (this.yinqingSound == null) {
    						this.yingqingSoundTime = 100;
    						this.yinqingSound = GameManager$2.PlaySound("yinqing_1", 0);
    					}

    					break;
    				case "stopjiayou":
    					if (this.yinqingSound != null) {
    						this.yinqingSound.stop();
    						this.yinqingSound = null;
    					}
    					if (shijiMoveSpeed <= 1) {
    						this.moveSpeed = 0;
    						GameManager$2.CameraMove.autoRotate = false;
    						//     console.log("<=1==================");
    					}
    					else {
    						GameManager$2.CameraMove.autoRotate = true;
    						//   console.log("else==================");
    					}
    					this.moveSpeed += (0 - this.moveSpeed) * this.free;
    					this.playerRigidbody.linearVelocity = new Laya.Vector3(-f.x * this.moveSpeed, lvy, -f.z * this.moveSpeed);

    					break;
    				case "dingsu":
    					GameManager$2.CameraMove.autoRotate = true;
    					this.playerRigidbody.linearVelocity = new Laya.Vector3(-f.x * this.moveSpeed, lvy, -f.z * this.moveSpeed);
    					this.LessYouLiang();
    					break;
    				case "shache":
    					GameManager$2.CameraMove.autoRotate = false;

    					if (this.moveSpeed < 10) {
    						this.moveSpeed += (0 - this.moveSpeed) * this.brake[0];
    					}
    					else if (this.moveSpeed < 30) {
    						this.moveSpeed += (0 - this.moveSpeed) * this.brake[1];
    					}
    					else {
    						this.moveSpeed += (0 - this.moveSpeed) * this.brake[2];
    					}
    					this.playerRigidbody.linearVelocity = new Laya.Vector3(-f.x * this.moveSpeed, lvy, -f.z * this.moveSpeed);
    					if (this.yinqingSound != null) {
    						this.yinqingSound.stop();
    						this.yinqingSound = null;
    					}
    					break;
    			}
    		}


    		if (UIManager.gameUI && UIManager.gameUI.rocker != null && this.isAuto == false) {
    			var aaa = UIManager.gameUI.rocker.knob.x;
    			if (this.moveSpeed > 30) {
    				//var lv = this.moveSpeed-10;
    				this.rotateAngle = -(aaa - 150) * this.rotate[1];
    			} else if (this.moveSpeed > 50) {
    				this.rotateAngle = -(aaa - 150) * this.rotate[2];
    			}
    			else {
    				var aaa = UIManager.gameUI.rocker.knob.x;
    				this.rotateAngle = -(aaa - 150) * this.rotate[0];
    			}
    		}

    		this.fangXiangPanTrans.localRotationEuler = new Laya.Vector3(this.fangXiangPanTrans.localRotationEuler.x, 0, -this.rotateAngle);
    		this.UpdateWheel();
    		if (UIManager.gameUI) {
    			UIManager.gameUI.UpdateSudu(shijiMoveSpeed);
    			UIManager.gameUI.UpdateDingSu(this.carState);
    			UIManager.gameUI.UpdateYouLiang(this.carYouLiang);
    		}
    		this.checkGuide();
    		this.UpdateTimer();
    		this.UpdateLucheng();
    		if (UIManager.gameUI) {
    			let show = GameManager$2.selectModel == 3;
    			if (GameManager$2.selectModel == 2) {
    				show = GameManager$2.chengke.length > 0;
    			}
    			UIManager.gameUI.UpdateXinQing(show, this.lucheng, this.shijian);
    		}
    	}
    	resetShijian() {
    		if (GameManager$2.selectModel != 2)
    			return;
    		this.zongshijian = GameManager$2.RandomInt(120, 180);
    		GameManager$2.gameStartTime = this.zongshijian;
    		this.shijian = this.zongshijian;
    		GameManager$2.zongShiJian = this.zongshijian;
    		this.lucheng = 0;
    	}

    	hidearrow() {
    		this.arrowTrans.owner.active = false;
    	}
    	showarrow() {
    		this.arrowTrans.owner.active = true;
    	}
    	//优化路线
    	Youhua() {
    		if (GameManager$2.selectModel != 3)
    			return;
    		if (GameManager$2.path.length <= 1)
    			return;
    		if (GameManager$2.chengke.length <= 1) {
    			console.error("乘客数量错误");
    			return;
    		}
    		let curnode = GameManager$2.path[0].node;
    		let path1 = GameManager$2.path[0];
    		let path2 = GameManager$2.path[1];
    		let node1 = path1.pathList[path1.pathList.length - 1].idx;
    		let node2 = path2.pathList[path2.pathList.length - 1].idx;
    		let curIdx = path1.pathList[curnode].idx;

    		if (Math.abs(node1 - curIdx) < Math.abs(node2 - curIdx))
    			return;
    		let root = GameManager$2.curScene.getChildByName("Guanqia").getChildByName("Chengke").getChildByName("" + GameManager$2.curSelectGuanQia);
    		let new1 = GameManager$2.GetPath(curIdx, node2);
    		let new2 = GameManager$2.GetPath(node2, node1);
    		GameManager$2.path.shift();
    		GameManager$2.path.shift();
    		let p1 = [];
    		let p2 = [];
    		for (let i = 0; i < new1.length; i++) {
    			let node = root.getChildByName("" + new1[i]);
    			p1.push({ idx: new1[i], pos: node.transform.position });
    		}


    		for (let i = 0; i < new2.length; i++) {
    			let node = root.getChildByName("" + new2[i]);
    			p2.push({ idx: new2[i], pos: node.transform.position });
    		}
    		GameManager$2.path.unshift({ pathList: p2, node: -1 });
    		GameManager$2.path.unshift({ pathList: p1, node: -1 });

    		let chengke1 = GameManager$2.chengke.shift();
    		let chengke2 = GameManager$2.chengke.shift();
    		GameManager$2.chengke.unshift(chengke1);
    		GameManager$2.chengke.unshift(chengke2);
    		this.AIChengKeScript = chengke2;
    		this.mainid = this.AIChengKeScript.mainid;
    		this.shunfengid = this.AIChengKeScript.shunfengid;
    		this.SetGuideDefault();
    		this.nextGuide();
    	}
    	UpdateTimer() {
    		if (GameManager$2.selectModel == 3) {
    			this.shijian -= 0.015;
    		}
    		else if (GameManager$2.selectModel == 2) {//自由模式，计算送单时间
    			this.shijian -= 0.015;
    		}
    	}
    	UpdateLucheng() {
    		if (this._lastPos == null) {
    			this._lastPos = GameManager$2.playerTrans.position.clone();
    		}

    		if (1 > Laya.Vector3.distance(this._lastPos, GameManager$2.playerTrans.position)) {
    			return;
    		}
    		this.lucheng += 1;
    		this._lastPos = GameManager$2.playerTrans.position.clone();

    	}
    	UpdateXinqing() {

    	}

    	UpdateWheel() {
    		var speed = this.moveSpeed * 0.01;
    		this.wheelTrans05.rotate(new Laya.Vector3(speed, 0, 0));
    		this.wheelTrans06.rotate(new Laya.Vector3(speed, 0, 0));
    		this.wheelTrans03.rotate(new Laya.Vector3(speed, 0, 0));
    		this.wheelTrans04.rotate(new Laya.Vector3(speed, 0, 0));

    		this.wheelTrans01.localRotationEulerY = this.rotateAngle;
    		this.wheelTrans02.localRotationEulerY = this.rotateAngle;
    	}
    	UpdateArrow() {
    		if (this.arrowTrans)
    			this.arrowTrans.position = GameManager$2.playerTrans.position;
    		this.arrowTrans.lookAt(this.targetPos, new Laya.Vector3(0, 1, 0));
    		this.arrowTrans.rotate(new Laya.Vector3(0, 180, 0), false, false);
    		this.arrowTrans.rotationEuler = new Laya.Vector3(0, this.arrowTrans.rotationEuler.y, 0);
    		if (UIManager.gameUI) {
    			UIManager.gameUI.UpdateMinMap(GameManager$2.playerTrans.position, this.targetPos);
    		}
    	}
    	Daohang() {
    		this.openDaohang = true;
    		this.arrowTrans.owner.active = true;
    		if (GameManager$2.path.length == 0)
    			return;
    		let path = GameManager$2.path[0];
    		if (this.guideIdx - 1 == path.node) {  //接客途中，导航初始点为起点
    			this.guideIdx = 1;
    		}
    		else if (this.guideIdx == path.pathList.length) { //送客途中，导航起始点为接客点
    			this.guideIdx = path.node + 2;
    		}
    		UIManager.gameUI.UpdateDaohang();
    		this.ShowGuide();
    	}

    }

    class PlayerControl extends PlayerControlBase {

    	constructor() {
    		super();
    		this.carState = "";
    		this.carDirState = "";
    		this.moveSpeed = 0;
    		this.maxMoveSpeed = 40;
    		this.yingqingSoundTime = 0;
    		this.maxDaoCheSpeed = -7;
    		this.rotateAngle = 0;
    		this.dangDir = 1; //档方向
    		this.waitShangChe = false;
    		this.carYouLiang = 100; //汽车油量
    		this.ChaoPiaoNum = 0;//当局钞票数量
    		this.curZaiKeNum = 0; //当前载客数量

    		this.autoXiuZhengTime = 0;
    	}

    	onEnable() {
    		var carid = PlayerData.GetUserData("selectCar");
    		if (PlayerData.shiyongCarId > 0) {
    			PlayerData.shiyongCarId2 = PlayerData.shiyongCarId;
    			carid = PlayerData.shiyongCarId;
    			PlayerData.shiyongCarId = 0;
    		}
    		else {
    			PlayerData.shiyongCarId2 = 0;
    		}
    		this.CreateCar(carid);
    		this.CreateNpcCar();
    		this.CreateChengKe();
    		this.CreateArrow();
    		this.UpdateHongLvDeng();
    		this.CreateXingRen();
    		GameManager$2.gameState = "run";
    	}
    	CreateCar(id) {
    		var huocheName = "Car_" + id;
    		var targetTrans = GameManager$2.curScene.getChildByName("PlayerPos").transform;
    		if (GameManager$2.selectModel == 3) {
    			targetTrans = GameManager$2.curScene.getChildByName("Guanqia").getChildByName("PlayerPos").getChildByName("" + GameManager$2.curSelectGuanQia).transform;
    		}
    		var carPrefab = GameManager$2.models.getChildByName(huocheName);
    		var clone = Laya.Sprite3D.instantiate(carPrefab, GameManager$2.curScene, true, new Laya.Vector3(0, 0, 0));
    		clone.transform.position = targetTrans.position;
    		clone.transform.rotation = targetTrans.rotation;
    		clone.addComponent(PlayerCollision);
    		this.playerTrans = clone.transform;
    		GameManager$2.playerTrans = clone.transform;
    		this.playerRigidbody = clone.getComponent(Laya.Rigidbody3D);
    		this.playerAnimator = clone.getComponent(Laya.Animator);

    		this.cheNeiObj = clone.getChildByName("Car_inside");
    		this.cheBodyObj = clone.getChildByName("Body");

    		this.fangXiangPanTrans = this.cheNeiObj.getChildByName("FXP").transform;
    		this.carTargetMat = this.cheNeiObj.getChildByName("YinXiang").meshRenderer.material;
    		this.carTargetObj = this.cheNeiObj.getChildByName("YinXiang");
    		this.carTargetObj.active = false;
    		this.cheNeiObj.active = false;

    		this.playerRigidbody.mass = 1500;
    		// this.playerRigidbody.restitution = 10000 ;
    		this.wheelTrans01 = clone.getChildByName("Wheel_1").transform;
    		this.wheelTrans02 = clone.getChildByName("Wheel_2").transform;
    		this.wheelTrans03 = clone.getChildByName("Wheel_3").transform;
    		this.wheelTrans04 = clone.getChildByName("Wheel_4").transform;

    		this.wheelTrans05 = clone.getChildByName("Wheel_1").getChildByName("Wheel").transform;
    		this.wheelTrans06 = clone.getChildByName("Wheel_2").getChildByName("Wheel").transform;

    		this.ShangChePos01 = clone.getChildByName("ShangChePos01").transform;
    		this.ShangChePos02 = clone.getChildByName("ShangChePos02").transform;

    		// this.carZhiZhen01 = clone.getChildByName("Pointer_1").transform ;
    		// this.carZhiZhen02 = clone.getChildByName("Pointer_2").transform ;
    		this.carTargetCamera = clone.getChildByName("renderTargetCamera");

    		this.carShaCheDeng = clone.getChildByName("TX_shachedeng");
    		this.carShaCheDeng.active = false;

    		GameManager$2.PlaySound("yinqingfadong_1");
    	}
    	CreateArrow() {
    		var Prefab = GameManager$2.models.getChildByName("Arrow");
    		var clone = Laya.Sprite3D.instantiate(Prefab, GameManager$2.curScene);
    		this.arrowTrans = clone.transform;
    	}
    	CreateNpcCar() {
    		var AICarObj = GameManager$2.curScene.getChildByName("AICar");
    		for (var i = 0; i < AICarObj.numChildren; i++) {
    			var obj = AICarObj.getChildAt(i);
    			let tarobj = obj.getChildByName("1").transform;
    			var carPrefab = GameManager$2.models.getChildByName("AI_Car_" + GameManager$2.RandomInt(1, 7));
    			var clone = Laya.Sprite3D.instantiate(carPrefab, GameManager$2.curScene);
    			clone.transform.position = tarobj.position;
    			clone.transform.rotation = tarobj.rotation;
    			var AICarMoveScript = clone.addComponent(AICarMove);
    			AICarMoveScript.Init(obj);
    		}
    	}
    	//行人
    	CreateXingRen() {
    		var AIrenObj = GameManager$2.curScene.getChildByName("AINpc");
    		for (var i = 0; i < AIrenObj.numChildren; i++) {
    			var obj = AIrenObj.getChildAt(i);
    			let tarobj = obj.getChildByName("1").transform;
    			var carPrefab = GameManager$2.models.getChildByName("Npc_" + GameManager$2.RandomInt(1, 5));
    			var clone = Laya.Sprite3D.instantiate(carPrefab, GameManager$2.curScene);
    			clone.transform.position = tarobj.position;
    			clone.transform.rotation = tarobj.rotation;
    			var AICarMoveScript = clone.addComponent(AIXingRen);
    			AICarMoveScript.Init(obj);
    		}
    	}
    	CreateChengKe() {
    		if (GameManager$2.selectModel == 2 || GameManager$2.selectModel == 3) {
    			var ChengKe = GameManager$2.curScene.getChildByName("ChengKe");
    			var index = GameManager$2.RandomInt(0, ChengKe.numChildren - 1);
    			let tarobj = ChengKe.getChildAt(index).transform;
    			var posindex = "" + index;
    			let chushengPos = ChengKe.getChildAt(index).transform;

    			if (GameManager$2.selectModel == 3) {
    				ChengKe = GameManager$2.curScene.getChildByName("Guanqia").getChildByName("Chengke").getChildByName("" + GameManager$2.curSelectGuanQia);
    				posindex = ChengKe.getChildByName("p").getChildAt(0).name;
    				chushengPos = ChengKe.getChildByName("p").transform;
    				tarobj = ChengKe.transform;
    			}
    			else {
    				GameManager$2.curSelectGuanQia = GameManager$2.RandomInt(1, 10);
    			}
    			var carPrefab = GameManager$2.models.getChildByName("guanqia_" + GameManager$2.curSelectGuanQia);
    			var clone = Laya.Sprite3D.instantiate(carPrefab, GameManager$2.curScene);
    			clone.transform.position = chushengPos.position;
    			clone.transform.rotation = chushengPos.rotation;
    			this.AIChengKeScript = clone.addComponent(AIChengKe);
    			this.AIChengKeScript.Init(tarobj.owner, posindex);

    			this.chengkeTrans = clone.transform;
    		}

    	}
    	//红绿灯
    	UpdateHongLvDeng() {
    		var honglvdeng = GameManager$2.curScene.getChildByName("honglvdeng");
    		for (var i = 0; i < honglvdeng.numChildren; i++) {
    			honglvdeng.getChildAt(i).addComponent(HongLvDeng);
    		}
    	}
    	onDisable() {
    	}
    	//呼叫乘客
    	HuJiaoChengKe() {
    		if (this.chengkeTrans) {
    			this.chengkeTrans.owner.destroy();
    			this.chengkeTrans = null;
    		}
    		this.CreateChengKe();
    	}
    	//加油
    	AddQiYou() {
    		this.carYouLiang = 100;
    	}
    	XiuZhengChe() {
    		GameManager$2.playerTrans.position = new Laya.Vector3(GameManager$2.playerTrans.position.x, GameManager$2.playerTrans.position.y + 3, GameManager$2.playerTrans.position.z);
    		GameManager$2.playerTrans.rotationEuler = new Laya.Vector3(0, 0, 0);
    	}
    	ChangeYingXiang() {
    		if (GameManager$2.CameraMove.cheNeiShiJiao == true && this.dangDir == -1) {
    			if (this.renderTargetCamera == null) {
    				this.renderTargetCamera = this.carTargetCamera.addChild(new Laya.Camera(0, 0.01, 20));
    				this.renderTargetCamera.transform.localPosition = new Laya.Vector3(0, 0, 0);
    				this.renderTargetCamera.transform.localRotationEuler = new Laya.Vector3(-30, 180, 0);
    				this.renderTargetCamera.renderTarget = new Laya.RenderTexture(128, 128);
    				this.renderTargetCamera.renderingOrder = -1;
    				this.renderTargetCamera.clearFlag = Laya.BaseCamera.CLEARFLAG_SKY;
    				this.carTargetMat.albedoTexture = this.renderTargetCamera.renderTarget;
    				this.carTargetObj.active = true;
    			}

    		}
    		else {
    			if (this.renderTargetCamera) {
    				this.renderTargetCamera.destroy();
    				this.renderTargetCamera = null;
    				this.carTargetObj.active = false;
    			}

    		}
    	}
    	HuanDang() {
    		if (Math.abs(this.moveSpeed) <= 0) {
    			if (this.dangDir == 1) {
    				this.dangDir = -1;
    			}
    			else {
    				this.dangDir = 1;
    			}
    			UIManager.gameUI.HuanDangAni(this.dangDir);
    			this.ChangeYingXiang();
    		}
    		GameManager$2.PlaySound("huandang");
    	}
    	ChangeDingSu() {
    		if (this.carState == "dingsu") {
    			this.carState = "stopjiayou";
    		}
    		else if (this.carState == "jiayou" || this.carState == "stopjiayou") {
    			this.carState = "dingsu";
    		}
    	}
    	ChangeShiJiao() {
    		GameManager$2.CameraMove.ChangeShiJiao();
    		this.ChangeYingXiang();

    		if (GameManager$2.CameraMove.cheNeiShiJiao == true) {
    			this.cheNeiObj.active = true;
    			this.cheBodyObj.active = false;
    		}
    		else {
    			this.cheNeiObj.active = false;
    			this.cheBodyObj.active = true;
    		}

    	}
    	JiaYou() {
    		this.carState = "jiayou";
    	}
    	//消耗油
    	LessYouLiang() {
    		this.carYouLiang -= 0.005;
    		if (this.carYouLiang <= 0) {
    			this.carYouLiang = 0;
    			if (UIManager.showMeiYouUI == null) {
    				UIManager.ShowUIPanel("meiyou", false);
    				UIManager.showMeiYouUI = true;
    				this.carState = "shache";
    				GameManager$2.PlaySound("yinqingmeiyou");
    			}
    		}
    	}
    	StopJiaYou() {

    		this.carState = UIManager.showMeiYouUI ? "shache" : "stopjiayou";
    	}
    	ShaChe() {
    		this.carState = "shache";
    		this.carShaCheDeng.active = true;
    		if (this.moveSpeed >= 10) {
    			GameManager$2.PlaySound("shache");
    		}
    	}
    	StopShaChe() {
    		this.carShaCheDeng.active = false;
    		this.carState = "stopjiayou";
    	}
    	ZhuanXiang(dir) {
    		this.carDirState = dir;
    	}
    	StopZhuanXiang() {
    		this.carDirState = "stop";
    	}
    	WaitShangChe(v) {
    		this.waitShangChe = v;
    	}
    	Clamp(v, min, max) {
    		if (v < min) {
    			v = min;
    		}
    		if (v > max) {
    			v = max;
    		}
    		return v;
    	}
    	//碰撞 弹开
    	CollisionHuiTan(fangxiang) {
    		if (this.isHuiTan) {
    			return;
    		}

    		this.isHuiTan = true;
    		var forward = new Laya.Vector3(0, 0, 0);
    		GameManager$2.playerTrans.getForward(forward);
    		var speed = 400 * this.moveSpeed;
    		// forward = fangxiang ;
    		this.playerRigidbody.applyImpulse(new Laya.Vector3(forward.x * speed, 0, forward.z * speed));
    		Laya.timer.frameOnce(30, this, function () {
    			this.isHuiTan = false;
    		});
    		this.moveSpeed = 0;
    	}
    	onUpdate() {
    		// console.log("111111111111111111111111111111111111111111111111")
    		var ex = GameManager$2.playerTrans.rotationEuler.x;
    		var ez = GameManager$2.playerTrans.rotationEuler.z;
    		if (Math.abs(ex) > 70 || Math.abs(ez) > 70) {
    			if (this.autoXiuZhengTime <= 0) {
    				this.autoXiuZhengTime = 10;
    			}
    			this.autoXiuZhengTime -= 0.1;
    			if (this.autoXiuZhengTime <= 0) {
    				this.XiuZhengChe();
    			}
    			return;
    		}
    		if (this.isHuiTan) {
    			return;
    		}
    		var shijiMoveSpeed = Math.abs(this.playerRigidbody.linearVelocity.z) + Math.abs(this.playerRigidbody.linearVelocity.x);
    		var lvy = this.playerRigidbody.linearVelocity.y;
    		if (this.waitShangChe == true) {
    			console.log("刹车？ ");
    			this.carState = "shache";
    		}
    		var a = this.moveSpeed * (0 - this.rotateAngle) * 0.006;
    		a = this.Clamp(a, -1, 1);
    		this.playerRigidbody.angularVelocity = new Laya.Vector3(0, a, 0);
    		var f = new Laya.Vector3(0, 0, 0);
    		this.wheelTrans01.getForward(f);
    		switch (this.carState) {
    			case "jiayou":
    				console.log("paopaopao ");
    				GameManager$2.CameraMove.autoRotate = true;
    				if (this.dangDir == 1) {
    					if (shijiMoveSpeed >= 0 && shijiMoveSpeed <= 30) {
    						this.moveSpeed += (0.053 * this.dangDir);
    					}
    					if (shijiMoveSpeed >= 30 && shijiMoveSpeed <= 40) {
    						this.moveSpeed += (0.043 * this.dangDir);
    					}
    					if (shijiMoveSpeed >= 40 && shijiMoveSpeed <= 50) {
    						this.moveSpeed += (0.035 * this.dangDir);
    					}
    					if (shijiMoveSpeed >= 50 && shijiMoveSpeed <= 60) {
    						this.moveSpeed += (0.03 * this.dangDir);
    					}
    					if (shijiMoveSpeed >= 60 && shijiMoveSpeed <= 70) {
    						this.moveSpeed += (0.026 * this.dangDir);
    					}
    					if (shijiMoveSpeed >= 70 && shijiMoveSpeed <= 80) {
    						this.moveSpeed += (0.024 * this.dangDir);
    					}
    					else {
    						this.moveSpeed += (0.021 * this.dangDir);
    					}
    					if (this.moveSpeed >= this.maxMoveSpeed) {
    						this.moveSpeed = this.maxMoveSpeed;
    					}
    				}
    				else {
    					this.moveSpeed += (0.018 * this.dangDir);
    					if (this.moveSpeed <= this.maxDaoCheSpeed) {
    						this.moveSpeed = this.maxDaoCheSpeed;
    					}

    				}
    				// this.playerRigidbody.applyForce(new Laya.Vector3(-f.x*15000,0,-f.z*15000))
    				this.playerRigidbody.linearVelocity = new Laya.Vector3(-f.x * this.moveSpeed, lvy, -f.z * this.moveSpeed);
    				this.LessYouLiang();
    				if (this.moveSpeed > 8) {
    					this.yingqingSoundTime += 1;
    					if (this.yingqingSoundTime >= 100) {
    						this.yingqingSoundTime = 0;
    						if (this.yinqingSound != null) {
    							this.yinqingSound.stop();
    							this.yinqingSound = null;
    						}
    						this.yinqingSound = GameManager$2.PlaySound("yinqing_1");
    					}
    				}
    				else {
    					if (this.yinqingSound == null) {
    						this.yingqingSoundTime = 100;
    						this.yinqingSound = GameManager$2.PlaySound("yinqing_2");
    					}
    				}
    				break;
    			case "stopjiayou":

    				if (this.yinqingSound != null) {
    					this.yinqingSound.stop();
    					this.yinqingSound = null;
    				}
    				if (UIManager.showMeiYouUI == true) {
    					return;
    				}
    				if (shijiMoveSpeed <= 1) {
    					this.moveSpeed = 0;
    					GameManager$2.CameraMove.autoRotate = false;

    				}
    				else {
    					GameManager$2.CameraMove.autoRotate = true;
    				}
    				this.moveSpeed += (0 - this.moveSpeed) * 0.004;
    				this.playerRigidbody.linearVelocity = new Laya.Vector3(-f.x * this.moveSpeed, lvy, -f.z * this.moveSpeed);

    				break;
    			case "dingsu":
    				GameManager$2.CameraMove.autoRotate = true;
    				this.playerRigidbody.linearVelocity = new Laya.Vector3(-f.x * this.moveSpeed, lvy, -f.z * this.moveSpeed);
    				break;
    			case "shache":

    				GameManager$2.CameraMove.autoRotate = false;

    				if (this.moveSpeed >= 30) {
    					this.moveSpeed += (0 - this.moveSpeed) * 0.025;
    				}
    				else {
    					if (this.moveSpeed >= 10) {
    						this.moveSpeed += (0 - this.moveSpeed) * 0.035;
    					}
    					else {
    						this.moveSpeed += (0 - this.moveSpeed) * 0.1;
    					}
    				}
    				this.playerRigidbody.linearVelocity = new Laya.Vector3(-f.x * this.moveSpeed, lvy, -f.z * this.moveSpeed);


    				if (this.yinqingSound != null) {
    					this.yinqingSound.stop();
    					this.yinqingSound = null;
    				}

    				break;
    		}
    		switch (this.carDirState) {
    			case "L":

    				if (this.moveSpeed >= 30) {
    					this.rotateAngle += 0.05;
    				}
    				else {
    					this.rotateAngle += 0.3;
    				}
    				if (this.rotateAngle >= 30) {
    					this.rotateAngle = 30;
    				}

    				break;
    			case "R":

    				if (this.moveSpeed >= 30) {
    					this.rotateAngle -= 0.05;
    				}
    				else {
    					this.rotateAngle -= 0.3;
    				}
    				if (this.rotateAngle <= -30) {
    					this.rotateAngle = -30;
    				}
    				break;
    			case "stop":
    				this.rotateAngle += (0 - this.rotateAngle) * 0.2;
    				break;
    		}

    		if (UIManager.gameUI && UIManager.gameUI.rocker != null) {
    			var aaa = UIManager.gameUI.rocker.knob.x;
    			this.rotateAngle = -(aaa - 150) * 0.3;
    		}


    		this.fangXiangPanTrans.localRotationEuler = new Laya.Vector3(this.fangXiangPanTrans.localRotationEuler.x, 0, -this.rotateAngle);
    		this.UpdateWheel();
    		if (UIManager.gameUI) {
    			UIManager.gameUI.UpdateSudu(shijiMoveSpeed);
    			UIManager.gameUI.UpdateDingSu(this.carState);
    			UIManager.gameUI.UpdateYouLiang(this.carYouLiang);
    		}
    	}

    	UpdateWheel() {
    		var speed = this.moveSpeed * 0.01;
    		this.wheelTrans05.rotate(new Laya.Vector3(speed, 0, 0));
    		this.wheelTrans06.rotate(new Laya.Vector3(speed, 0, 0));
    		this.wheelTrans03.rotate(new Laya.Vector3(speed, 0, 0));
    		this.wheelTrans04.rotate(new Laya.Vector3(speed, 0, 0));

    		this.wheelTrans01.localRotationEulerY = this.rotateAngle;
    		this.wheelTrans02.localRotationEulerY = this.rotateAngle;
    	}
    	UpdateArrow(targetPos) {
    		if (this.arrowTrans) {
    			this.arrowTrans.position = GameManager$2.playerTrans.position;
    			this.arrowTrans.lookAt(targetPos, new Laya.Vector3(0, 1, 0));
    			this.arrowTrans.rotate(new Laya.Vector3(0, 180, 0), false, false);
    			this.arrowTrans.rotationEuler = new Laya.Vector3(0, this.arrowTrans.rotationEuler.y, 0);
    		}
    		if (UIManager.gameUI) {
    			UIManager.gameUI.UpdateMinMap(GameManager$2.playerTrans.position, targetPos);
    		}
    	}


    }

    class CameraMove extends Laya.Script3D {

    	constructor() {
    		super();
    		this.yawPitchRoll = new Laya.Vector3();
    		this.tempRotationZ = new Laya.Quaternion();
    		this.rotaionSpeed = 0.0003;
    		this.isMouseDown = false;

    		this.autoRotate = false;
    		this.cheNeiShiJiao = false;




    	}
    	onAwake() {
    		Laya.stage.on(Laya.Event.MOUSE_UP, this, this.mouseUp);
    	}
    	onEnable() {
    		this.yawPitchRoll = new Laya.Vector3(0, 0.3, 0);
    		this.updateRotation();

    		var v = new Laya.Vector3(0, 0, 0);
    		GameManager$2.playerTrans.rotation.getYawPitchRoll(v);
    		var q1 = new Laya.Quaternion(0, 0, 0, 1);
    		Laya.Quaternion.createFromYawPitchRoll(v.x, 0.2, v.z, q1);
    		GameManager$2.cameraTrans.rotation = q1;
    		this.autoRotateTimer = 0;
    	}
    	onDisable() {
    		//关闭监听函数
    		Laya.stage.off(Laya.Event.MOUSE_UP, this, this.mouseUp);
    	}
    	ChangeShiJiao() {
    		if (this.cheNeiShiJiao == false) {
    			this.cheNeiShiJiao = true;
    		}
    		else {
    			this.cheNeiShiJiao = false;
    		}
    	}
    	onUpdate(state) {
    		if (GameManager$2.cameraTrans == null || GameManager$2.playerTrans == null) {
    			return;
    		}
    		var elapsedTime = Laya.timer.delta;
    		if (!isNaN(this.lastMouseX) && !isNaN(this.lastMouseY) && this.isMouseDown) {
    			var offsetX = Laya.stage.mouseX - this.lastMouseX;
    			var offsetY = Laya.stage.mouseY - this.lastMouseY;

    			var yprElem = this.yawPitchRoll;
    			yprElem.x -= offsetX * this.rotaionSpeed * elapsedTime;
    			yprElem.y += offsetY * this.rotaionSpeed * elapsedTime;
    			this.updateRotation();
    		}
    		this.lastMouseX = Laya.stage.mouseX;
    		this.lastMouseY = Laya.stage.mouseY;


    		if (this.cheNeiShiJiao) {
    			var v = new Laya.Vector3(0, 0, 0);
    			GameManager$2.playerTrans.rotation.getYawPitchRoll(v);

    			var q1 = new Laya.Quaternion(0, 0, 0, 1);
    			Laya.Quaternion.createFromYawPitchRoll(v.x, 0.2, v.z, q1);
    			var q = new Laya.Quaternion(0, 0, 0, 1);
    			Laya.Quaternion.slerp(GameManager$2.cameraTrans.rotation, q1, 0.5, q);
    			GameManager$2.cameraTrans.rotation = q;
    		}
    		else if (this.isShangChe) {
    			var v = new Laya.Vector3(0, 0, 0);
    			GameManager$2.playerTrans.rotation.getYawPitchRoll(v);

    			var q1 = new Laya.Quaternion(0, 0, 0, 1);
    			if (this.ChengKeShangChe == 2) {
    				Laya.Quaternion.createFromYawPitchRoll(v.x + (3.14 * 0.5), 0.2, v.z, q1);
    			}
    			if (this.ChengKeShangChe == 1) {
    				Laya.Quaternion.createFromYawPitchRoll(v.x - (3.14 * 0.5), 0.2, v.z, q1);
    			}
    			if (this.ChengKeShangChe == 0) {
    				Laya.Quaternion.createFromYawPitchRoll(v.x, 0.2, v.z, q1);
    			}
    			var q = new Laya.Quaternion(0, 0, 0, 1);
    			Laya.Quaternion.slerp(GameManager$2.cameraTrans.rotation, q1, 0.05, q);

    			GameManager$2.cameraTrans.rotation = q;
    		}
    		else if (this.autoRotate || this.autoRotateTimer > 0) {
    			if (this.autoRotateTimer > 0)
    				this.autoRotateTimer--;
    			var v = new Laya.Vector3(0, 0, 0);
    			GameManager$2.playerTrans.rotation.getYawPitchRoll(v);

    			var q1 = new Laya.Quaternion(0, 0, 0, 1);
    			if (GameManager$2.curPlayer.dangDir == 1) {
    				Laya.Quaternion.createFromYawPitchRoll(v.x, 0.2, v.z, q1);
    			}
    			else {
    				Laya.Quaternion.createFromYawPitchRoll(v.x + 3.14, 0.2, v.z, q1);
    			}
    			var q = new Laya.Quaternion(0, 0, 0, 1);
    			Laya.Quaternion.slerp(GameManager$2.cameraTrans.rotation, q1, 0.1, q);

    			GameManager$2.cameraTrans.rotation = q;
    		}

    		this.updateMove();
    	}
    	mouseDown(e) {
    		if (this.isMouseDown) {
    			return;
    		}
    		if (this.autoRotate) {
    			return;
    		}
    		if (this.cheNeiShiJiao) {
    			return;
    		}
    		if (this.isShangChe) {
    			return;
    		}
    		//获得鼠标的旋转值
    		GameManager$2.cameraTrans.rotation.getYawPitchRoll(this.yawPitchRoll);
    		//获得鼠标的xy值
    		this.lastMouseX = Laya.stage.mouseX;
    		this.lastMouseY = Laya.stage.mouseY;
    		//设置bool值
    		this.isMouseDown = true;
    		this.autoRotate = false;
    	}
    	mouseUp(e) {
    		//设置bool值
    		this.isMouseDown = false;
    	}

    	updateRotation() {
    		this.yawPitchRoll.y = this.ClampAngle(this.yawPitchRoll.y, -0.2, 0.4);
    		Laya.Quaternion.createFromYawPitchRoll(this.yawPitchRoll.x, this.yawPitchRoll.y, this.yawPitchRoll.z, this.tempRotationZ);
    		this.tempRotationZ.cloneTo(GameManager$2.cameraTrans.rotation);
    		GameManager$2.cameraTrans.rotation = GameManager$2.cameraTrans.rotation;
    	}
    	updateMove() {
    		var pv = new Laya.Vector3(0, -1, 5);
    		if (this.cheNeiShiJiao) {
    			var val_h = [-1.05, -1.15, -1.24, -1.1, -1, -1.2, -1, -1, -1, -0.93];
    			var val_z = [0.2, 0, 0, 0.2, 0.05, 0, 0.3, 0.4, 0.1, 0.05];
    			var carid = PlayerData.GetUserData("selectCar");
    			//console.log("------------------:"+carid);
    			pv = new Laya.Vector3(-0.3, val_h[carid - 1], val_z[carid - 1]);
    			// pv = new Laya.Vector3(-0.3, -1, 0.1);
    		}
    		var v = new Laya.Vector3(0, 0, 0);
    		Laya.Vector3.transformQuat(pv, GameManager$2.cameraTrans.rotation, v);
    		Laya.Vector3.subtract(GameManager$2.playerTrans.position, v, v);

    		GameManager$2.cameraTrans.position = v;
    	}

    	ClampAngle(angle, min, max) {
    		if (angle < -360)
    			angle += 360;
    		if (angle > 360)
    			angle -= 360;

    		if (angle < min) {
    			angle = min;
    		}
    		if (angle > max) {
    			angle = max;
    		}
    		return angle;
    	}
    }

    class GameManager$2 {
    	//音效
    	static PlaySound(name, loop = 1) {
    		if (PlayerData.GetUserData("yinliang") == 0) {
    			return;
    		}
    		var sn = "res/ChuZuChe/Sounds/" + name;
    		var sc = Laya.SoundManager.playSound(sn + ".mp3", loop, null);
    		return sc;
    	}

    	static pauseMusic() {
    		Laya.SoundManager.muted = true;
    	}

    	static resumeMusic() {
    		Laya.SoundManager.muted = false;
    	}

    	//背景音
    	static PlayMusic(name) {
    		if (GameManager$2.curMusicName == name) {
    			return;
    		}
    		GameManager$2.curMusicName = name;
    		if (GameManager$2.curMusic) {
    			GameManager$2.curMusic.stop();
    			GameManager$2.curMusic = null;
    		}
    		var sn = "res/ChuZuChe/Sounds/" + name;
    		var sc = Laya.SoundManager.playMusic(sn + ".mp3", 0);

    		GameManager$2.curMusic = sc;
    		if (sc) {
    			sc.volume = PlayerData.GetUserData("yinliang");
    		}

    		return sc;
    	}
    	static ChangeMusicVolume() {
    		var v = PlayerData.GetUserData("yinliang");
    		if (GameManager$2.curMusic != null) {
    			if (v == 0) {
    				GameManager$2.curMusicName = "";
    				GameManager$2.curMusic.stop();
    			}
    			else {
    				GameManager$2.PlayMusic("bj");
    			}
    		}
    	}
    	static SetMusicVolume(v) {
    		if (GameManager$2.curMusic != null) {
    			GameManager$2.curMusic.volume = v;
    		}
    	}
    	//震动
    	static PlayVibrate() {
    		if (PlayerData.GetUserData("zhendong") == 0) {
    			return;
    		}
    		if (GameManager$2.platform == 4) {
    			qg.vibrateShort({
    				success: function (res) { },
    				fail: function (res) { },
    				complete: function (res) { }
    			});
    		}
    		else if (GameManager$2.platform == 1) {
    			wx.vibrateShort();
    		}
    		else if (window.navigator && window.navigator.vibrate) {
    			window.navigator.vibrate(20);
    		}
    	}
    	static RandomInt(min, max) {
    		return Math.round(Math.random() * (max - min) + min);
    	}
    	static RandomFloat(min, max) {
    		return Math.random() * (max - min) + min;
    	}
    	/**获取一年中的第几周 */
    	static getWeekOfYear() {
    		var today = new Date();
    		var firstDay = new Date(today.getFullYear(), 0, 1);
    		var dayOfWeek = firstDay.getDay();
    		var spendDay = 1;
    		if (dayOfWeek != 0) {
    			spendDay = 7 - dayOfWeek + 1;
    		}
    		firstDay = new Date(today.getFullYear(), 0, 1 + spendDay);
    		var d = Math.ceil((today.valueOf() - firstDay.valueOf()) / 86400000);
    		var result = Math.ceil(d / 7);
    		return result + 1;
    	};
    	//js获取当前日期为一年中的第几天
    	static getYearOfday() {
    		var day = Math.ceil((new Date() - new Date(new Date().getFullYear().toString())) / (24 * 60 * 60 * 1000)) + 1;//一个月中的某一天 
    		return day;
    	}
    	//相同时间
    	static isSameDay() {
    		var time = new Date();
    		var date = time.getDate();

    		var today = PlayerData.GetUserData("today");
    		if (date = !today) {
    			PlayerData.SetUserData("today", date);
    			return false;
    		} else {
    			return true;
    		}
    	}
    	//更新车辆试用次数
    	static updateTryCarNum(bool) {
    		//判断试用车辆次数
    		var tryCar = PlayerData.GetUserData("tryCar");
    		var tryCarNum = PlayerData.GetUserData("tryCarNum");
    		var YongYouCar = PlayerData.GetUserData("YongYouCar");
    		var selectCar = PlayerData.GetUserData("selectCar");

    		for (let i = 0; i < 10; i++) {
    			let n = i + 1;
    			if (selectCar == n && tryCar["" + n] == 1) {
    				var num = tryCarNum["" + n];
    				if (num > 0) {
    					if (bool) {
    						tryCarNum["" + n] = num - 1;
    					}

    					PlayerData.SetUserData("tryCarNum", tryCarNum);
    				} else {
    					tryCar["" + n] = 0;
    					YongYouCar["" + n] = 0;
    					//                    PlayerData.SetUserData("selectCar", lastCar);
    					PlayerData.RecoveryLastCar();
    					PlayerData.SetUserData("tryCar", tryCar);
    					tryCarNum["" + n] = 0;
    					PlayerData.SetUserData("tryCarNum", tryCarNum);
    				}
    			}
    		}
    	}

    	//更新试用车辆
    	static updateTryCar() {
    		//拥有的车辆
    		var tryCar = PlayerData.GetUserData("tryCar");
    		var tryCarNum = PlayerData.GetUserData("tryCarNum");
    		var YongYouCar = PlayerData.GetUserData("YongYouCar");
    		var selectCar = PlayerData.GetUserData("selectCar");
    		var lastCar = PlayerData.GetUserData("lastCar");
    		if (YongYouCar[selectCar] == 0) {//试用车到期
    			PlayerData.RecoveryLastCar();
    		}
    	}

    	//更新试用场景
    	static updateTryScene() {
    		var nowTime = (new Date()).getTime() / 1000;//时间秒
    		//拥有
    		var tryScene = PlayerData.GetUserData("tryScene");
    		var trySceneTime = PlayerData.GetUserData("trySceneTime");

    		this.maxNum = 5;
    		for (let i = 1; i < this.maxNum; i++) {
    			let n = i + 1;
    			if (tryScene["" + n] == 1) {
    				var tryTime = trySceneTime["" + n];
    				if (nowTime - tryTime > 24 * 60 * 60) {//
    					trySceneTime["" + n] = 0;
    					tryScene["" + n] = 0;

    				}
    			}
    		}

    		PlayerData.SetUserData("tryScene", tryScene);
    		PlayerData.SetUserData("trySceneTime", trySceneTime);
    	}

    	/**
    	 * int数值 转时间格式
    	 * @param {*} time 
    	 */
    	static TotIimeFormat(time) {
    		var fuhao = "";
    		if (time < 0) {
    			time = -time;
    			fuhao = "-";
    		}
    		var h = Math.floor(time / 3600);
    		var m = Math.floor(time % 3600 / 60);
    		var s = Math.floor(time % 3600 % 60);
    		if (h < 10) h = "0" + h;
    		if (m < 10) m = "0" + m;
    		if (s < 10) s = "0" + s;
    		return fuhao + "" + h + ":" + m + ":" + s;
    	};
    	static onSceneLoaded(data, callback) {
    		if (GameManager$2.curScene != null) {
    			GameManager$2.curScene.destroy();//销毁场景
    			GameManager$2.curScene = null;
    		}
    		var ln = Laya.URL.basePath + "res/ChuZuChe/Scene/Conventional/scene01.ls";

    		Laya.loader.create(ln,
    			Laya.Handler.create(this, function () {
    				GameManager$2.curScene = Laya.loader.getRes(ln);
    				if (GameManager$2.curScene) {
    					Laya.stage.addChildAt(GameManager$2.curScene, 0);
    					GameManager$2.curPlayer = GameManager$2.curScene.getChildByName("PlayerCamera").addComponent(PlayerControl);
    					GameManager$2.mainCamera = GameManager$2.curScene.getChildByName("PlayerCamera").getChildByName("Camera").getChildByName("Camera");
    					GameManager$2.cameraTrans = GameManager$2.curScene.getChildByName("PlayerCamera").transform;
    					GameManager$2.CameraMove = GameManager$2.curScene.getChildByName("PlayerCamera").addComponent(CameraMove);

    					//加载UI
    					if (UIManager.gameUI != null) {
    						UIManager.gameUI.destroy();
    						UIManager.gameUI = null;
    					}
    					UIManager.ShowUIPanel("Game");
    					if (callback) {
    						callback();
    					}
    					if (data && data.nextGQ == true) {
    						UIManager.mainUI.GameRunInit();
    					}

    				}
    				else {
    					GameManager$2.onSceneLoaded(data, callback);
    				}
    			}));
    	}
    	static LoadModels(data, callback) {
    		Laya.loader.create(Laya.URL.basePath + "res/ChuZuChe/Scene/Conventional/Model.lh", Laya.Handler.create(this, function () {
    			console.log("LoadModelscreate========");
    			GameManager$2.models = Laya.loader.getRes(Laya.URL.basePath + "res/ChuZuChe/Scene/Conventional/Model.lh");
    			if (GameManager$2.models) {
    				if (callback) {
    					callback();
    					callback = null;
    				}
    			}
    			else {
    				GameManager$2.LoadModels(data, callback);
    			}
    		}));
    	}
    	static LoadAllScene(data, callback) {
    		if (GameManager$2.models) {
    			GameManager$2.onSceneLoaded(data, callback);
    			// GameManager.models.destroy();//销毁场景
    			return;
    		}
    		this.LoadModels(data, callback);

    	}
    	static DestroyUnusedResources() {
    		Laya.Resource.destroyUnusedResources();

    	}
    	//改变字体
    	static ChangeFnt(box, text, font = null) {
    		box.getComponent(MyFont).ChangeFont(text, font);
    	}
    	static ChangeFntType(box, font) {
    		box.getComponent(MyFont).ChangeFontType(font);
    	}

    	static ExitGame(nextUI = null) {
    		if (PlayerData.shiyongCarId2 > 0) {
    			PlayerData.shiyongCarId2 = 0;
    		}
    		else {
    			var youLiang = PlayerData.GetUserData("youLiang");
    			var carid = PlayerData.GetUserData("selectCar");
    			youLiang[carid] = GameManager$2.curPlayer.carYouLiang;
    			PlayerData.SetUserData("youLiang", youLiang);
    			PlayerData.SaveData();
    		}

    		if (UIManager.gameUI) {
    			UIManager.gameUI.destroy();
    			UIManager.gameUI = null;
    		}
    		if (GameManager$2.curScene) {
    			GameManager$2.curScene.destroy();
    			GameManager$2.curScene = null;
    		}
    		if (nextUI == null)
    			UIManager.ShowUIPanel("Main", true);
    		else
    			UIManager.ShowUIPanel(nextUI);
    		GameManager$2.gameState = "run";
    	}
    	static Jiayou() {
    		var youLiang = PlayerData.GetUserData("youLiang");
    		var carid = PlayerData.GetUserData("selectCar");
    		youLiang[carid] = 100;
    		PlayerData.SetUserData("youLiang", youLiang);
    	}
    	static PauseGame(b) {
    		if (b && GameManager$2.gameState == "pause")
    			return;
    		if (b) {
    			GameManager$2.lastState = GameManager$2.gameState;
    			GameManager$2.curPlayer.Stop();
    			GameManager$2.gameState = "pause";
    		}
    		else {
    			GameManager$2.gameState = GameManager$2.lastState;
    		}
    	}


    	static CheckMission(type) {
    		if (GameManager$2.selectModel != 3)
    			return;
    		if (GameManager$2.mission.length == 0)
    			return;
    		if (GameManager$2.mission[0].type != type)
    			return;
    		if (type == 2) {//顺风车
    			Laya.timer.once(100, this, function () {
    				UIManager.InsertUIList("jieke");
    			});
    		}
    	}
    	static OnTakeShunfeng(b) {
    		let data = GameManager$2.mission.shift();
    		if (b) {
    			GameManager$2.curPlayer.CreateChengKe_3(2, data.main, data.id);
    			GameManager$2.shunfengNum++;
    		}
    	}

    	static GetPath(from, to) {
    		if (from == to)
    			return [];
    		let path = [];
    		path.push(from);
    		while (from != to) {
    			from = from + (to > from ? 1 : -1);
    			path.push(from);
    		}
    		return path;
    	}

    	static InsertJiayou(root) {

    		let n = root.numChildren;

    		let path = [];
    		for (let i = 1; i <= n; i++) {
    			let p = root.getChildByName("" + i);
    			path.push({ idx: i, pos: p.transform.position });
    		}
    		GameManager$2.path.unshift({ pathList: path, node: -1 });
    	}
    	static InsertChengke_free(root) {
    		let from = root.getChildAt(0).transform.position;
    		let to = root.getChildAt(1).transform.position;
    		let tPath = [{ idx: 0, pos: from }, { idx: 1, pos: to }];
    		GameManager$2.path.unshift({ pathList: tPath, node: 0 });
    	}

    	static InsertChengke(root, name, now = 1) {
    		if (now <= 0)
    			now = 1;
    		let ChengKe = root.getChildByName(name);
    		let from = ChengKe.getChildAt(0).name;
    		let to = ChengKe.getChildAt(1).name;
    		let tPath = [];

    		let t1 = GameManager$2.GetPath(parseInt(now), parseInt(from));
    		if (t1.length > 0) {
    			t1.pop();
    		}

    		let t2 = GameManager$2.GetPath(parseInt(from), parseInt(to));
    		tPath = t1.concat(t2);
    		// }
    		let ret = [];
    		let _node = -1;
    		for (let i = 0; i < tPath.length; i++) {
    			let node = root.getChildByName("" + tPath[i]);
    			if (node == null) {
    				let a = 0;
    			}
    			ret.push({ idx: tPath[i], pos: node.transform.position });
    			if (tPath[i] == from) {
    				_node = i;
    			}
    		}

    		if (GameManager$2.path.length > 0) {//修改路径点
    			let dstIdx = GameManager$2.path.shift().pathList.pop().idx;
    			let path = GameManager$2.GetPath(tPath.pop(), dstIdx);
    			let _last = [];
    			for (let i = 0; i < path.length; i++) {
    				let node = root.getChildByName("" + path[i]);
    				if (node == null) {
    					let a = 0;
    				}
    				_last.push({ idx: path[i], pos: node.transform.position });
    			}
    			GameManager$2.path.unshift({ pathList: _last, node: -1 });
    		}
    		GameManager$2.path.unshift({ pathList: ret, node: _node });
    	}
    	static CheckOver() {
    		if (GameManager$2.selectModel == 2) {//自由模式，继续接单
    			UIManager.ShowUIPanel("jiesuan", false);
    		}
    		else if (GameManager$2.selectModel == 3) {//任务模式逻辑
    			if (GameManager$2.path.length > 0) { //还有乘客继续走========
    				console.log("还有乘客，继续跑");
    				if (GameManager$2.curSelectGuanQia < 7) {
    					GameManager$2.curPlayer.curZaiKeNum += 1;
    				}

    				GameManager$2.curPlayer.hideGuide();
    				GameManager$2.curPlayer.ShowGuide();
    				GameManager$2.curPlayer.SetCurChengke();
    				return;
    			}
    			if (GameManager$2.mission.length > 0) {//继续主线
    				UIManager.ShowUIPanel("juqing2", false);
    				let id = GameManager$2.mission[0].id;
    				GameManager$2.curPlayer.CreateChengKe_3(1, id, -1);
    				GameManager$2.mission.shift();
    			}
    			else {//结算
    				UIManager.ShowUIPanel("chenggong", true);
    			}
    		}
    	}
    	static Reload() {
    		UIManager.ShowUIPanel("Loading");
    		if (UIManager.gameUI) {
    			UIManager.gameUI.destroy();
    		}
    		if (GameManager$2.curScene) {
    			GameManager$2.curScene.destroy();
    			GameManager$2.curScene = null;
    		}
    	}
    	static Fail() {
    		UIManager.ShowUIPanel("shibai");
    		GameManager$2.gameState = "over";
    	}
    	static getFormatTime(s) {
    		let n = s % 60;
    		if (n >= 10)
    			return Math.floor(s / 60) + ":" + s % 60;
    		else
    			return Math.floor(s / 60) + ":0" + s % 60;
    	}
    	static getPlaterData() {
    		let self = this;
    		let item = Laya.LocalStorage.getItem("CunShuju_ChuZuChe");
    		if (item == undefined || item == null || item.length == 0 || item == "") {
    			GameManager$2.isNewUser = true;
    			console.log("新用户");
    			Laya.LocalStorage.setItem("CunShuju_ChuZuChe", "oldUser");

    		} else {
    			GameManager$2.isNewUser = false;
    			console.log("老用户");
    		}



    		var dayData = Laya.LocalStorage.getItem("mainday_ChuZuChe");
    		if (dayData && dayData.length > 0) {
    			GameManager$2.dayData = JSON.parse(dayData);
    		} else {
    			Laya.LocalStorage.setItem(JSON.stringify(GameManager$2.dayData));
    		}
    		GameManager$2.day = new Date().getDate();
    		if (GameManager$2.dayData.mainday_ChuZuChe != GameManager$2.day && GameManager$2.dayData.isTwoDay) {
    			GameManager$2.dayData.isTwoDay = false;
    			GameManager$2.dayData.mainday_ChuZuChe = GameManager$2.day + 1;
    			Laya.LocalStorage.setItem("mainday_ChuZuChe", JSON.stringify(GameManager$2.dayData));
    		}
    		console.log("G：" + GameManager$2.dayData.mainday_ChuZuChe + "mainday_ChuZuChe" + GameManager$2.day);
    	}
    	static ShowVideo(successCallback = null, errCallback = null, cancelCallback = null) {
    		console.log("看视频");
    		if (Laya.Browser.onQGMiniGame || Laya.Browser.onVVMiniGame || Laya.Browser.onMiniGame) {
    			GameManager_Collection.showVideo(successCallback, errCallback, cancelCallback);
    		} else {
    			if (successCallback) {
    				successCallback();
    			}
    		}
    	}

    }

    GameManager$2.renwu_king = 0;
    GameManager$2.isNewUser = true;
    GameManager$2.day = 0;

    GameManager$2.xingxing = [0, 0, 0];
    GameManager$2.show = false;
    GameManager$2.curScene = null;
    GameManager$2.curPlayer = null;
    GameManager$2.playerTrans = null;
    GameManager$2.curEnemyManager = null;
    GameManager$2.models = null;
    GameManager$2.gameState = "";
    GameManager$2.lastState = "";
    GameManager$2.mainCamera = null;
    GameManager$2.cameraTrans = null;
    GameManager$2.gameUI = null;
    GameManager$2.xinqing = 0;
    GameManager$2.gameStartTime = 0;
    GameManager$2.AutoBuy = -1;
    GameManager$2.timeH = 0;
    GameManager$2.timeM = 0;
    GameManager$2.timeS = 0;
    //当前的关卡id
    GameManager$2.curSelectGuanQia = 1;
    //当前的剧情id
    GameManager$2.curSelectGuanQia_main = 1;
    //当前的顺风车id
    GameManager$2.curSelectGuanQia_shunfeng = 1;

    GameManager$2.startGameNum = 0;
    GameManager$2.zongShiJian = 0; // 总时间
    GameManager$2.songdaShiJian = 0; // 送达时间
    GameManager$2.zhuangjiNum = 0;//撞击次数

    GameManager$2.shunfengNum = 0; //顺风车乘客数量
    GameManager$2.selectModel = 1; //模式   2自由 3关卡 4加油
    GameManager$2.mission = [];     //关卡信息  [{type:1,id:1}]
    GameManager$2.chengke = [];     //乘客信息 AI 脚本
    GameManager$2.path = [];        //路径信息  [{path:[{x:1,y:1},{x:1,y:1},{x:1,y:1},{x:1,y:1}],node:3}......] node 接客点  
    GameManager$2.dayData = { //第二天登录给新车
    	mainday_ChuZuChe: 0,

    	isTwoDay: true,
    	isclickyes: false,
    };
    GameManager$2.goGame = false;

    GameManager$2.passTimes = 1;
    GameManager$2.passNow = 1;

    class PlayerData {
    	static GetData() {
    		//   Laya.LocalStorage.clear();
    		var s = Laya.LocalStorage.getItem("userData_ChuZuChe" + PlayerData.saveBanBen);
    		if (s) {
    			PlayerData.user = JSON.parse(s);
    			var day = new Date().getDate();
    			//新的一天
    			if (PlayerData.user.curDay != day) {
    				PlayerData.user.curDay = day;
    				PlayerData.SetUserData("ChouJiangNum_ChuZuChe", 1);
    			}
    		}

    		PlayerData.SetUserData("RunGameNum_ChuZuChe", PlayerData.GetUserData("RunGameNum_ChuZuChe") + 1);

    		Laya.timer.loop(500, this, PlayerData.SaveTick);
    	}
    	static SaveTick() {
    		if (PlayerData._dirty) {
    			PlayerData.Save();
    			PlayerData._dirty = false;
    		}
    	}
    	static Save() {
    		var d = JSON.stringify(PlayerData.user);
    		// console.log("SaveGameData:"+d) ;
    		Laya.LocalStorage.setItem("userData_ChuZuChe" + PlayerData.saveBanBen, d);
    	}
    	static SaveData() {
    		PlayerData._dirty = true;
    	}
    	static GetUserData(key) {
    		if (key == "GuanQia" && PlayerData.isDebug) {
    			return 80;
    		}
    		if (PlayerData.user[key] != null) {
    			return PlayerData.user[key];
    		}
    		return PlayerData.userDV[key];
    	}
    	static SetUserData(key, value) {
    		PlayerData.user[key] = value;
    		PlayerData.SaveData();
    	}
    	static SetLastCar() {
    		let cur = PlayerData.GetUserData("selectCar");
    		let tryCar = PlayerData.GetUserData("tryCar");
    		if (tryCar[cur] == 0) {
    			PlayerData.SetUserData("lastCar", cur);
    		}
    	}
    	static RecoveryLastCar() {
    		let cur = PlayerData.GetUserData("lastCar");
    		PlayerData.SetUserData("selectCar", cur);
    		return cur;
    	}
    	/**增加道具 1钞票 2金币 */
    	static AddProp(type, num) {
    		if (type == 1) {
    			let cur = PlayerData.GetUserData("Gold");
    			let n = 1;
    			PlayerData.SetUserData("Gold", cur + parseInt(num * n));
    			if (UIManager.gameUI) {
    				UIManager.gameUI.initTuijian();
    			}
    			if (UIManager.mainUI) {
    				UIManager.mainUI.UpdateTitle();
    			}
    			UIManager.ShowUIPanel("qiandonghua", false, [cur, parseInt(num * n)]);
    		}
    		else if (type == 2) {
    			console.error("error1");
    			console.error(1 / 0);
    		}
    	}
    	static GetShuangbei() {
    		let t = PlayerData.GetUserData("shuangbei_t");
    		let l = PlayerData.GetUserData("shuangbei_l");
    		if (l > 0) {
    			let curT = (new Date()).getTime() / 1000;
    			if (curT - t < l) {
    				return 2;
    			}
    			else {
    				PlayerData.SetUserData("shuangbei_t", 0);
    				PlayerData.SetUserData("shuangbei_l", 0);
    			}
    		}
    		return 1;
    	}
    	static IsCanLessProp(type, num) {
    		var maxNum = 0;
    		if (type == 1) {
    			maxNum = PlayerData.GetUserData("Gold");
    			if (maxNum >= num) {
    				return true;
    			}
    		}
    		else if (type == 2) {
    			console.error("error2");
    			console.error(1 / 0);
    		}
    		return false;
    	}
    	static LessProp(type, num) {
    		var maxNum = 0;
    		if (type == 1) {
    			maxNum = PlayerData.GetUserData("Gold");
    			if (maxNum >= num) {
    				PlayerData.SetUserData("Gold", parseInt(maxNum - num));
    				if (UIManager.gameUI) {
    					UIManager.gameUI.initTuijian();
    					//                    UIManager.gameUI.AddChaopiao(maxNum, num);
    				}
    				UIManager.ShowUIPanel("qiandonghua", false, [maxNum, -num]);
    			}
    		}
    		else if (type == 2) {
    			console.error("error3");
    			console.error(1 / 0);
    		}
    	}
    	static GetAddValue() {

    	}
    	/**减钞票 */
    	static LessChaoPiao(num) {
    		var maxNum = PlayerData.GetUserData("Gold");
    		maxNum -= num;
    		if (maxNum <= 0) {
    			maxNum = 0;
    		}
    		PlayerData.SetUserData("Gold", maxNum);
    		PlayerData.SaveData();
    	}

    	/**增加经验 */
    	static AddExp(v) {
    		var playerLevel = PlayerData.GetUserData("playerLevel");
    		if (playerLevel >= 30) {
    			return;
    		}
    		var nextExp = GameManager$2.levelInfoConfig[playerLevel].upexp;
    		var playerExp = PlayerData.GetUserData("playerExp");
    		playerExp += v;
    		if (playerExp >= nextExp) {
    			playerExp -= nextExp;
    			playerLevel += 1;
    		}
    		PlayerData.SetUserData("playerLevel", playerLevel);
    		PlayerData.SetUserData("playerExp", playerExp);
    		PlayerData.SaveData();
    	}
    }


    PlayerData.saveBanBen = 50;
    PlayerData.user = {};
    PlayerData.userDV = {};

    PlayerData.shiyongCarId = 0; //试用车ID
    PlayerData.shiyongCarId2 = 0; //试用车ID
    PlayerData.gamePingZhi = 1; //1高 2中 3低
    PlayerData.userDV.daohang = 0;
    PlayerData.userDV.first = 1;
    PlayerData.userDV.firstDaohang = 1;
    PlayerData.userDV.qiandaoDay = 0;
    PlayerData.userDV.qiandao_time = 0;
    PlayerData.userDV.GuanQia = 1; //关卡是否可解锁
    PlayerData.userDV.Gold = 0; //钞票
    PlayerData.userDV.unlockTimes = 3;  //解锁自由模式观看视频次数
    PlayerData.userDV.ziyou = 0;  //是否解锁自由模式
    //PlayerData.userDV.ZuanShi = 100; //金币 初始玩家给100金币
    PlayerData.userDV.zaikeNum = 0; // 载客数量
    PlayerData.userDV.gameTime = 0; // 游戏时间
    PlayerData.userDV.haopingNum = 0; // 好评数量
    PlayerData.userDV.youLiang = { "1": 100, "2": 100, "3": 100, "4": 100, "5": 100, "6": 100, "7": 100, "8": 100, "9": 100, "10": 100 }; // 油量
    PlayerData.userDV.starNum = {};

    PlayerData.userDV.selectCar = 1; //选择的汽车
    PlayerData.userDV.YongYouCar = { "1": 1, "2": 0, "3": 0, "4": 0, "5": 0, "6": 0, "7": 0, "8": 0, "9": 0, "10": 0 }; //{"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1}; // 拥有的汽车 {"1":1,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0}; 

    //试用车辆次数
    PlayerData.userDV.tryCarNum = { "1": 0, "2": 0, "3": 0, "4": 0, "5": 0, "6": 0, "7": 0, "8": 0, "9": 0, "10": 0 };

    //试用车辆
    PlayerData.userDV.tryCar = { "1": 0, "2": 0, "3": 0, "4": 0, "5": 0, "6": 0, "7": 0, "8": 0, "9": 0, "10": 0 };
    //试用车辆开始时间
    PlayerData.userDV.tryCarStartTime = { "1": 0, "2": 0, "3": 0, "4": 0, "5": 0, "6": 0, "7": 0, "8": 0, "9": 0, "10": 0 };

    //场景试用
    PlayerData.userDV.tryScene = { "1": 1, "2": 0, "3": 0, "4": 0, "5": 0 };
    //场景试用开始时间
    PlayerData.userDV.trySceneTime = { "1": 0, "2": 0, "3": 0, "4": 0, "5": 0 };

    //购买金币次数
    PlayerData.userDV.buyGoldNum = 0;
    //天
    PlayerData.userDV.today = 0;

    PlayerData.userDV.yinliang = 1;//
    PlayerData.userDV.zhendong = 1;//
    PlayerData.userDV.gamePingZhi = 3; //1高 2中 3低

    PlayerData.userDV.playerLevel = 1; //等级
    PlayerData.userDV.playerExp = 0;// 经验

    PlayerData.userDV.GuideIndex = 1; //引导
    PlayerData.userDV.lastCar = 1;   //上一辆车
    PlayerData.userDV.shuangbei_t = 0;   //双倍时间戳
    PlayerData.userDV.shuangbei_l = 0;   //双倍时间长度
    PlayerData.userDV.showYSSM = 0;//

    PlayerData.isGuanKa = 0; //banner和互推交替出现
    PlayerData.isSent = true; //oppo添加桌面  默认是true
    PlayerData.isGameing = false;  //判断是否在游戏中内
    PlayerData.isUnlock = false;
    PlayerData.isDebug = false;
    PlayerData.isLoaded = false;
    PlayerData._dirty = false;

    PlayerData.Static = {};
    PlayerData.Static.MaxMission = 80;
    PlayerData.Static.MaxCarNum = 10;
    PlayerData.Static.ShuangBeiTime = 300;   //双倍时长 单位秒
    PlayerData.isIMESuccess = false;  //是否获取到手机设备型号；
    PlayerData.canShowSign = true;
    PlayerData.isIms = null; //设备手机
    PlayerData.isMain = false; // 主界面
    PlayerData.isMaincar = false;
    PlayerData.isXuanZe = false;
    PlayerData.isMainlixian = false;
    PlayerData.isMainsj = false; // 主界面设备
    PlayerData.isBanner1s = true;
    PlayerData.isXinshou = false;
    PlayerData.zpData_ChuZuChe = {
    	CJnum: 10,
    	preData: 0,
    };

    class UIManager {
    	static ShowUIPanel(name, closeOther = true, param = null) {
    		if (name == "chenggong") {
    			GameManager$2.passTimes++;
    		}
    		if (name == "Loading" && GameManager$2.selectModel != 4) {
    			var youLiang = PlayerData.GetUserData("youLiang");
    			var carid = PlayerData.GetUserData("selectCar");
    			if (youLiang[carid] < 40 && GameManager$2.selectModel != 2) {
    				UIManager.ShowUIPanel("jiayou");
    				return;
    			}
    		}

    		Laya.Scene.open("ChuZuChe/UIPanel/" + name + ".scene", closeOther, param);
    	}

    	static ShowAddMoney(v) {
    		//原生
    		console.log("ShowAddMoney");
    		Advertisement.insertAdverV3();

    		var ui1 = Laya.stage.addChild(new qian_ChuZuCheUI());


    		ui1.width = Laya.stage.width;

    		ui1.qianTex.text = "+" + v;

    		Laya.timer.frameOnce(65, this, function () {
    			ui1.destroy();
    		});

    		GameManager$2.PlaySound("cash");
    	}

    	//改变显示的钱格式
    	static GoldFormat(gold) {
    		if (gold >= 1000) {
    			return parseInt(gold / 1000) + "k";// parseInt( gold/1000 )
    		}
    		return gold;
    	}

    	static GoldFormat2(gold) {
    		if (gold >= 1000) {
    			var value = gold / 1000;
    			return value.toFixed(2) + "k";// parseInt( gold/1000 )
    		}
    		return gold;
    	}


    	//游戏提示UI
    	static ShowGameTipUI(v, node) {
    		console.log("ShowGameTipUI");

    		var pos = new Laya.Point(Laya.stage.width * 0.5, 400);
    		if (node) {
    			pos = node.parent.localToGlobal(new Laya.Point(node.x, node.y));
    			var xxx = node.x - node.pivotX + 0.5 * node.displayWidth;

    			pos.x = xxx;
    		}
    		let ui1 = Laya.stage.addChild(new GameTip_ChuZuCheUI());
    		ui1.value.text = v;
    		ui1.x = pos.x;
    		ui1.y = pos.y;
    		Laya.timer.frameOnce(60, this, function () {
    			ui1.destroy();
    		});
    	}
    	static ShowGameImgTipUI(tipId) {
    		console.log("showGameImgTipUI");

    		var pos = new Laya.Point(Laya.stage.width * 0.5, 360);
    		let ui1 = Laya.stage.addChild(new GameTip1_ChuZuCheUI());
    		ui1.tipImg.skin = "ChuZuChe/UIRes/tsz_" + tipId + ".png";
    		ui1.x = pos.x;
    		ui1.y = pos.y;
    		Laya.timer.frameOnce(60, this, function () {
    			ui1.destroy();
    		});
    	}
    	//撞击提示
    	static ShowZhuangJiTipUI(tip) {
    		console.log("ShowZhuangJiTipUI");

    		let mainid = GameManager$2.curPlayer.mainid;
    		let shunfengid = GameManager$2.curPlayer.shunfengid;
    		var pos = new Laya.Point(0, 0);
    		let ui1 = Laya.stage.addChild(new tishi5_ChuZuCheUI());
    		ui1.width = Laya.stage.width;

    		ui1[tip].visible = true;
    		let id = GameManager$2.curSelectGuanQia + "-" + mainid;
    		if (shunfengid > 0) {
    			id = "S-" + GameManager$2.curSelectGuanQia + "-" + mainid + "-" + shunfengid;
    		}
    		var config = GameManager$2.juqingConfig[id];
    		if (config == null) {
    			let a = 0;
    		}
    		ui1["iconImg"].skin = "ChuZuChe/UIRes/" + config.touxiang + ".png";

    		Laya.timer.frameOnce(120, this, function () {
    			ui1.destroy();
    			if (tip == "Tip01") {
    				GameManager$2.CheckMission(2); //检查顺风车
    			}
    		});
    	}

    	static UpdateGameGuide() {
    		if (UIManager.guideInfo.genSuiPlayer == true) {
    			UIManager.guideUI.ShouBox01.visible = true;
    			UIManager.guideUI.ShouBox02.visible = true;
    			for (var i = 0; i < 2; i++) {
    				var outPos = new Laya.Vector3(0, 0, 0);
    				var ap = GameManager$2.curPlayer.huocheScript[i].thisTrans.position;
    				GameManager$2.mainCamera.viewport.project(ap, GameManager$2.mainCamera.projectionViewMatrix, outPos);
    				UIManager.guideUI["ShouBox0" + (i + 1)].x = outPos.x / Laya.stage.clientScaleX;
    				UIManager.guideUI["ShouBox0" + (i + 1)].y = outPos.y / Laya.stage.clientScaleY - 40;
    			}
    		}
    		else if (UIManager.guideInfo.showShou01 == true) {
    			UIManager.guideUI.ShouBox01.visible = true;

    			var outPos = new Laya.Vector3(0, 0, 0);
    			var ap = UIManager.guideInfo.xunLuDian;
    			GameManager$2.mainCamera.viewport.project(ap, GameManager$2.mainCamera.projectionViewMatrix, outPos);

    			UIManager.guideUI.ShouBox01.x = outPos.x / Laya.stage.clientScaleX;
    			UIManager.guideUI.ShouBox01.y = outPos.y / Laya.stage.clientScaleY - 40;
    		}
    		else {
    			UIManager.guideUI.ShouBox01.visible = false;
    			UIManager.guideUI.ShouBox02.visible = false;
    		}
    		if (UIManager.guideInfo.tip != "Tip1") {
    			UIManager.guideUI.Tip01.visible = false;
    		}
    		UIManager.guideUI.TipTex.text = UIManager.GuideTip[UIManager.guideInfo.tip];
    	}
    	static GetNextUI() {
    		if (UIManager.uiList.length == 0)
    			return null;
    		return UIManager.uiList[0];
    	}
    	static Close(obj, next = null) {
    		obj.destroy();
    		UIManager.uiList.shift();
    		let bShow = false;
    		if (next != null) {
    			bShow = UIManager.InsertUIList(next, false);
    		}
    		let ui = UIManager.GetNextUI();
    		if (ui && bShow == false) {
    			UIManager.ShowUIPanel(ui, false);
    		}
    		else {
    			GameManager$2.PauseGame(false);
    		}
    	}
    	//屏幕适配
    	static FixUI(ui) {
    		if (Laya.stage.width < ui.width) {
    			ui.scaleX = Laya.stage.width / ui.width;
    		}
    	}
    	static InsertUIList(ui, isBack = true) {

    		for (let i = 0; i < UIManager.uiList.length; i++) {
    			if (ui == UIManager.uiList[i])
    				return;
    		}


    		GameManager$2.PauseGame(true);
    		if (isBack)
    			UIManager.uiList.push(ui);
    		else
    			UIManager.uiList.unshift(ui);
    		if (UIManager.uiList.length == 1) {
    			UIManager.ShowUIPanel(ui, false);
    			return true;
    		}
    		return false;
    	}
    }

    UIManager.mainUI = null;
    UIManager.gameUI = null;
    UIManager.uiList = [];
    UIManager.GuideTip = {
    	"Tip100": "", "Tip101": "再次点击火车启动", "Tip1": "", "Tip2": "前方汽车出没，点击停止确保安全通过。", "Tip3": "到达车站火车会自动停止接送乘客。",
    	"Tip4": "点击换路标志确保进入正确道路。", "Tip5": "前方接客火车出没，玩家可选择火车进行避让。", "Tip6": "不同颜色乘客需送到对应颜色车站。"
    };

    class PanelBangZhu extends Laya.Scene {

    	constructor() {
    		super();
    	}

    	onEnable() {
    		this.width = Laya.stage.width;
    		this.height = Laya.stage.height;

    		this.UpdateTitle();
    		this.onUpdate();
    		Laya.timer.frameLoop(1, this, this.onUpdate);
    		this.car.on(Laya.Event.MOUSE_DOWN, this, function () {
    			UIManager.ShowUIPanel("YongjiuCar", false);
    		});
    		if (GameManager$2.dayData.mainday_ChuZuChe <= GameManager$2.day) {
    			this.car.visible = false;
    		}
    		this.backBtn.on(Laya.Event.CLICK, this, function () {
    			this.destroy();
    		});
    	}

    	onDisable() {

    	}
    	onUpdate() {
    		if (this.car.visible) {
    			var h = new Date().getHours();
    			var m = new Date().getMinutes();
    			var s = new Date().getSeconds();
    			GameManager$2.timeH = 24 - h;
    			GameManager$2.timeH = GameManager$2.timeH < 10 ? ('0' + GameManager$2.timeH) : GameManager$2.timeH;
    			GameManager$2.timeM = 60 - m;
    			GameManager$2.timeM = GameManager$2.timeM < 10 ? ('0' + GameManager$2.timeM) : GameManager$2.timeM;

    			GameManager$2.timeS = 60 - s;

    			GameManager$2.timeS = GameManager$2.timeS < 10 ? ('0' + GameManager$2.timeS) : GameManager$2.timeS;
    			this.time.text = GameManager$2.timeH + ":" + GameManager$2.timeM + ":" + GameManager$2.timeS;
    		}
    	}
    	UpdateTitle() {
    		this.levelValue.text = PlayerData.GetUserData("playerLevel");
    		var nextExp = GameManager$2.levelInfoConfig[PlayerData.GetUserData("playerLevel")].upexp;
    		var playerExp = PlayerData.GetUserData("playerExp");
    		this.levelBar.value = playerExp / nextExp;

    		this.chaopiaoText.text = UIManager.GoldFormat2(PlayerData.GetUserData("Gold"));
    	}
    }

    class CheKuCameraMove extends Laya.Script3D {

    	constructor() {
    		super();
    		this.yawPitchRoll = new Laya.Vector3();
    		this.tempRotationZ = new Laya.Quaternion();
    		this.rotaionSpeed = 0.0003;
    		this.isMouseDown = false;
    	}
    	onAwake() {
    		Laya.stage.on(Laya.Event.MOUSE_DOWN, this, this.mouseDown);
    		Laya.stage.on(Laya.Event.MOUSE_UP, this, this.mouseUp);
    	}
    	onEnable() {
    		this.thisTrans = this.owner.transform;
    		this.yawPitchRoll = new Laya.Vector3(0, 0.3, 0);
    		this.updateRotation();
    	}
    	onDisable() {
    		//关闭监听函数
    		Laya.stage.off(Laya.Event.MOUSE_DOWN, this, this.mouseDown);
    		Laya.stage.off(Laya.Event.MOUSE_UP, this, this.mouseUp);
    	}
    	onUpdate(state) {
    		var elapsedTime = Laya.timer.delta;
    		if (!isNaN(this.lastMouseX) && !isNaN(this.lastMouseY) && this.isMouseDown) {
    			var offsetX = Laya.stage.mouseX - this.lastMouseX;
    			var offsetY = Laya.stage.mouseY - this.lastMouseY;

    			var yprElem = this.yawPitchRoll;
    			yprElem.x -= offsetX * this.rotaionSpeed * elapsedTime;
    			yprElem.y += offsetY * this.rotaionSpeed * elapsedTime;
    			this.updateRotation();
    		}
    		this.lastMouseX = Laya.stage.mouseX;
    		this.lastMouseY = Laya.stage.mouseY;
    		this.updateMove();
    	}
    	mouseDown(e) {
    		if (this.isMouseDown) {
    			return;
    		}
    		//获得鼠标的旋转值
    		this.thisTrans.rotation.getYawPitchRoll(this.yawPitchRoll);
    		//获得鼠标的xy值
    		this.lastMouseX = Laya.stage.mouseX;
    		this.lastMouseY = Laya.stage.mouseY;
    		//设置bool值
    		this.isMouseDown = true;
    	}
    	mouseUp(e) {
    		//设置bool值
    		this.isMouseDown = false;
    	}

    	updateRotation() {
    		this.yawPitchRoll.y = 0.2;
    		Laya.Quaternion.createFromYawPitchRoll(this.yawPitchRoll.x, this.yawPitchRoll.y, this.yawPitchRoll.z, this.tempRotationZ);
    		this.tempRotationZ.cloneTo(this.thisTrans.rotation);
    		this.thisTrans.rotation = this.thisTrans.rotation;
    	}
    	updateMove() {
    		var pv = new Laya.Vector3(0, -0.2, 5);
    		var v = new Laya.Vector3(0, 0, 0);
    		Laya.Vector3.transformQuat(pv, this.thisTrans.rotation, v);
    		Laya.Vector3.subtract(new Laya.Vector3(0, 0, 0), v, v);

    		this.thisTrans.position = v;
    	}

    	ClampAngle(angle, min, max) {
    		if (angle < -360)
    			angle += 360;
    		if (angle > 360)
    			angle -= 360;

    		if (angle < min) {
    			angle = min;
    		}
    		if (angle > max) {
    			angle = max;
    		}
    		return angle;
    	}
    }

    class PanelCheKu extends Laya.Scene {

    	constructor() {
    		super();
    	}

    	onEnable() {
    		this.width = Laya.stage.width;
    		this.height = Laya.stage.height;

    		// this.LoadScene();
    		this.Init();
    		this.UpdateTitle();
    		this.onUpdate();
    		Laya.timer.frameLoop(1, this, this.onUpdate);
    		this.car.on(Laya.Event.MOUSE_DOWN, this, function () {
    			UIManager.ShowUIPanel("YongjiuCar", false);
    		});
    		if (GameManager$2.dayData.mainday_ChuZuChe <= GameManager$2.day) {
    			this.car.visible = false;
    		}
    		if (GameManager$2.AutoBuy > 0) {
    			this.selectCar = GameManager$2.AutoBuy;
    		}
    		this.ChangeCar();

    		if (GameManager$2.AutoBuy > 0) {
    			this.onClickChaopiaoBuy();
    			GameManager$2.AutoBuy = -1;
    		}

    		GameManager$2.PlayMusic("cheku");
    	}
    	Init() {
    		GameManager$2.updateTryCarNum(false);
    		this.maxCarNum = 10;
    		this.selectCar = PlayerData.GetUserData("selectCar");
    		let fromMain = GameManager$2.AutoBuy <= 0;
    		this.kuang.on(Laya.Event.CLICK, this, function () {//jj
    			if (PanelCheKu.isClickkuang == false) {
    				PanelCheKu.isClickkuang = true;

    				this.gou.visible = false;

    			} else {
    				PanelCheKu.isClickkuang = false;

    				this.gou.visible = true;
    			}
    		});
    		this.backBtn.on(Laya.Event.CLICK, this, function () {
    			this.destroy();
    			if (fromMain)
    				UIManager.ShowUIPanel("Main");
    			else {
    				GameManager$2.PlayMusic("game_1");
    				GameManager$2.curPlayer.ChangeCar();
    			}
    		});
    		this.LBtn.on(Laya.Event.CLICK, this, function () {
    			this.selectCar -= 1;
    			if (this.selectCar <= 1) {
    				this.selectCar = 1;
    			}
    			this.ChangeCar();
    		});
    		this.RBtn.on(Laya.Event.CLICK, this, function () {
    			this.selectCar += 1;
    			if (this.selectCar >= this.maxCarNum) {
    				this.selectCar = this.maxCarNum;
    			}
    			this.ChangeCar();
    		});

    		let self = this;
    		this.shiyongBuy.on(Laya.Event.CLICK, this, function () {
    			var config = GameManager$2.chekuConfig[this.selectCar];
    			if (PlayerData.IsCanLessProp(1, config.cpjg)) {
    				PlayerData.LessProp(1, config.cpjg);
    				var YongYouCar = PlayerData.GetUserData("YongYouCar");
    				YongYouCar[this.selectCar] = 1;

    				var tryCar = PlayerData.GetUserData("tryCar");
    				if (tryCar[this.selectCar] == 1) { //试用
    					tryCar[this.selectCar] = 0;
    					PlayerData.SetUserData("tryCar", tryCar);
    				}
    				PlayerData.SetUserData("YongYouCar", YongYouCar);
    				PlayerData.SetUserData("selectCar", this.selectCar);


    				self.UpdateTitle();
    				self.ChangeCar();
    				let t = [];
    				for (let i = 1; i <= 9; i++) {
    					t.push(this["tuisongche" + i]);
    				}
    				for (let i = 1; i <= 9; i++) {
    					t[i - 1].visible = i == this.selectCar - 1;
    				}
    				//                self["tuisongche5"].visible = true;
    				self.gxjsAni.play(0, false);
    				self.fanli = parseInt(config.cpjg * 0.1);
    				self.label_fanli.text = "" + this.fanli;
    				this.fangqi.visible = false;
    				this.fangqi.visible = true;
    			}
    			else {
    				UIManager.ShowGameImgTipUI("11");
    			}
    		});
    		this.chaopiaoBuy.on(Laya.Event.CLICK, this, this.onClickChaopiaoBuy);
    		this.xuanzeBtn.on(Laya.Event.CLICK, this, function () {
    			PlayerData.SetLastCar();
    			PlayerData.SetUserData("selectCar", this.selectCar);
    			PlayerData.SaveData();
    			this.ChangeCar();
    		});


    		//试用车辆
    		this.lijiesuo.on(Laya.Event.CLICK, this, function () {
    			var YongYouCar = PlayerData.GetUserData("YongYouCar");
    			YongYouCar[this.selectCar] = 1;
    			PlayerData.SetUserData("YongYouCar", YongYouCar);
    			//试用
    			var tryCar = PlayerData.GetUserData("tryCar");
    			tryCar[this.selectCar] = 1;
    			PlayerData.SetLastCar();
    			PlayerData.SetUserData("tryCar", tryCar);
    			//试用车时间
    			var tryCarStartTime = PlayerData.GetUserData("tryCarStartTime");
    			tryCarStartTime[this.selectCar] = (new Date()).getTime() / 1000;//时间秒
    			PlayerData.SetUserData("tryCarStartTime", tryCarStartTime);
    			PlayerData.SaveData();
    			this.UpdateTitle();
    			this.ChangeCar();

    		});

    		//看广告解锁车辆
    		this.AdButton.on(Laya.Event.CLICK, this, function () {
    			var YongYouCar = PlayerData.GetUserData("YongYouCar");
    			YongYouCar[this.selectCar] = 1;
    			PlayerData.SetUserData("YongYouCar", YongYouCar);
    			PlayerData.SaveData();
    			this.UpdateTitle();
    			this.ChangeCar();
    		});

    		this.fangqi.on(Laya.Event.CLICK, this, function () {
    			this.fangqiAni.play(0, false);
    		});
    		this.jjlingqu.on(Laya.Event.CLICK, this, function () {
    			if (PanelCheKu.isClickkuang) {
    				this.fangqiAni.play(0, false);
    			} else {
    				this.qianAni.play(0, false);
    				PlayerData.AddProp(1, this.fanli);
    				this.UpdateTitle();
    			}



    		});
    		this.lingqu.on(Laya.Event.CLICK, this, function () {
    			let self = this;
    			this.qianAni.play(0, false);
    			PlayerData.AddProp(1, this.fanli);
    			this.UpdateTitle();
    		});
    		this.getcpBtn.on(Laya.Event.CLICK, this, function () {
    			GameManager$2.ShowVideo(function () {
    				PlayerData.AddProp(1, 5000);
    				this.UpdateTitle();
    				this.tishi.visible = false;
    				this.bg1.visible = false;
    			}.bind(this));
    		});
    		this.cpfq.on(Laya.Event.CLICK, this, function () {
    			this.tishi.visible = false;
    			this.bg1.visible = false;
    		});
    	}
    	onClickChaopiaoBuy() {
    		let self = this;
    		var config = GameManager$2.chekuConfig[this.selectCar];
    		if (PlayerData.IsCanLessProp(1, config.cpjg)) {
    			PlayerData.LessProp(1, config.cpjg);
    			var YongYouCar = PlayerData.GetUserData("YongYouCar");
    			YongYouCar[this.selectCar] = 1;
    			PlayerData.SetUserData("YongYouCar", YongYouCar);
    			PlayerData.SetUserData("selectCar", this.selectCar);
    			var tryCar = PlayerData.GetUserData("tryCar");
    			var tryCarNum = PlayerData.GetUserData("tryCarNum");
    			if (tryCar[this.selectCar] == 1) {
    				tryCar[this.selectCar] = 0;
    				PlayerData.SetUserData("tryCar", tryCar);
    			}
    			if (tryCarNum[this.selectCar] > 0) {
    				tryCarNum[this.selectCar] = 0;
    				PlayerData.SetUserData("tryCarNum", tryCarNum);
    			}


    			self.UpdateTitle();
    			self.ChangeCar();
    			let t = [];
    			for (let i = 1; i <= 9; i++) {
    				t.push(this["tuisongche" + i]);
    			}
    			for (let i = 1; i <= 9; i++) {
    				t[i - 1].visible = i == this.selectCar - 1;
    			}
    			self.gxjsAni.play(0, false);
    			self.fanli = parseInt(config.cpjg * 0.1);
    			self.label_fanli.text = "" + this.fanli;
    			this.fangqi.visible = false;
    			this.fangqi.visible = true;
    		} else {
    			console.log("金币不足");
    			this.tishi.visible = true;
    			this.bg1.visible = true;
    			UIManager.ShowGameImgTipUI("11");
    		}
    	}
    	onDisable() {
    		if (this.scene3d) {
    			this.scene3d.destroy();
    		}
    	}
    	UpdateTitle() {
    		this.levelValue.text = PlayerData.GetUserData("playerLevel");
    		var nextExp = GameManager$2.levelInfoConfig[PlayerData.GetUserData("playerLevel")].upexp;
    		var playerExp = PlayerData.GetUserData("playerExp");
    		this.levelBar.value = playerExp / nextExp;

    		this.chaopiaoText.text = UIManager.GoldFormat2(PlayerData.GetUserData("Gold"));

    	}
    	ChangeCar() {
    		for (let i = 1; i <= 10; i++) {
    			this["checheche" + i].visible = false;
    		}
    		this["checheche" + this.selectCar].visible = true;
    		this.LBtn.visible = true;
    		this.RBtn.visible = true;
    		if (this.selectCar <= 1) {
    			this.LBtn.visible = false;
    		}
    		if (this.selectCar >= this.maxCarNum) {
    			this.RBtn.visible = false;
    		}
    		var config = GameManager$2.chekuConfig[this.selectCar];
    		this.glTex.text = config.gl;
    		this.zjTex.text = config.zj;
    		this.qilTex.text = config.qyl;
    		this.zlTex.text = config.zl;
    		var YongYouCar = PlayerData.GetUserData("YongYouCar");



    		this.jinbiBuyBtn.visible = false;
    		this.chaopiaoBuy.visible = false;
    		this.xuanzeBtn.visible = false;
    		this.shiyongBuy.visible = false;
    		this.anniusy.visible = false;
    		this.anniujs.visible = false;


    		if (this.selectCar == PlayerData.GetUserData("selectCar")) {
    			this.choose.visible = true;
    		} else {
    			this.choose.visible = false;
    		}

    		//试用车辆
    		var tryCar = PlayerData.GetUserData("tryCar");
    		var tryCarNum = PlayerData.GetUserData("tryCarNum");
    		if (tryCar[this.selectCar] == 1) { //试用
    			this.freeTimesImg.visible = true;
    			var num = tryCarNum[this.selectCar];
    			this.times.text = num + "/3";

    		} else { //非试用
    			this.freeTimesImg.visible = false;

    		}

    		this.shiyongBuy.visible = tryCar[this.selectCar] == 1;

    		if (YongYouCar[this.selectCar] == 1) {
    			this.status.skin = "ChuZuChe/UIRes/tobechosen.png";
    			this.xuanzeBtn.visible = true;
    			if (PlayerData.GetUserData("selectCar") == this.selectCar) {
    				this.xuanzeBtn.visible = false;
    				this.status.skin = "ChuZuChe/UIRes/chosen.png";
    			}
    			if (tryCar[this.selectCar] == 1) { //试用
    				console.log("试用？？？" + UIManager.GoldFormat(config.cpjg));
    				this.shiyongBuy.getChildByName("num").text = UIManager.GoldFormat(config.cpjg);

    			}
    		}
    		else {

    			this.status.skin = "ChuZuChe/UIRes/nothave.png";

    			if (config.unlockType == 1) {//看视频解锁

    				this.jinbiBuyBtn.visible = false;
    				this.chaopiaoBuy.visible = false;
    				this.anniusy.visible = false;
    				this.anniujs.visible = true;
    			} else {//金币解锁
    				this.anniujs.visible = false;
    				this.jinbiBuyBtn.visible = true;
    				this.chaopiaoBuy.visible = true;
    				this.anniusy.visible = true;
    				this.jinbiBuyBtn.getChildByName("num").text = UIManager.GoldFormat(config.jbjg);
    				this.chaopiaoBuy.getChildByName("num").text = UIManager.GoldFormat(config.cpjg);

    			}
    		}

    	}
    	LoadScene() {
    		Laya.loader.create(Laya.URL.basePath + "res/ChuZuChe/Scene/Conventional/Garage.ls",
    			Laya.Handler.create(this, function () {
    				this.scene3d = Laya.loader.getRes(Laya.URL.basePath + "res/ChuZuChe/Scene/Conventional/Garage.ls");
    				this.addChildAt(this.scene3d, 0);
    				if (this.scene3d) {
    					this.scene3d.getChildByName("PlayerCamera").addComponent(CheKuCameraMove);
    					this.ChangeCar();
    				}
    				else {
    					this.LoadScene();
    				}
    			}));
    	}
    	onUpdate() {

    		if (this.car.visible) {
    			var h = new Date().getHours();
    			var m = new Date().getMinutes();
    			var s = new Date().getSeconds();
    			GameManager$2.timeH = 24 - h;
    			GameManager$2.timeH = GameManager$2.timeH < 10 ? ('0' + GameManager$2.timeH) : GameManager$2.timeH;
    			GameManager$2.timeM = 60 - m;
    			GameManager$2.timeM = GameManager$2.timeM < 10 ? ('0' + GameManager$2.timeM) : GameManager$2.timeM;

    			GameManager$2.timeS = 60 - s;

    			GameManager$2.timeS = GameManager$2.timeS < 10 ? ('0' + GameManager$2.timeS) : GameManager$2.timeS;
    			this.time.text = GameManager$2.timeH + ":" + GameManager$2.timeM + ":" + GameManager$2.timeS;
    		}
    	}
    }


    PanelCheKu.isClickkuang = false;

    class sureVideo extends sureVideoUI {

    	constructor(callback) {
    		super();
    		this.callback = callback;
    	}

    	onEnable() {
    		console.log("sureVideo");

    		this.width = Laya.stage.width;
    		this.height = Laya.stage.height;

    		this.videoBtn.on(Laya.Event.CLICK, this, function () {
    			GameManager_Collection.showVideo(function () {
    				GameManager$2.passNow = GameManager$2.passTimes;
    				if (this.callback) {
    					this.callback();
    					this.callback = null;
    				}
    				this.destroy();
    			}.bind(this));
    		}.bind(this));

    		this.fangqi.on(Laya.Event.CLICK, this, function () {
    			this.destroy();
    		}.bind(this));
    	}

    	onDisable() {
    	}
    }

    class PanleGuanQiaOver extends Laya.Scene {

    	constructor() {
    		super();
    	}

    	onEnable() {
    		this.width = Laya.stage.width;
    		this.height = Laya.stage.height;
    		console.log("结算界面gameing" + PlayerData.isGameing);
    		this.Init();
    		this.onUpdate();
    		Laya.timer.frameLoop(1, this, this.onUpdate);
    		this.car.on(Laya.Event.MOUSE_DOWN, this, function () {
    			UIManager.ShowUIPanel("YongjiuCar", false);
    		});
    		if (GameManager$2.dayData.mainday_ChuZuChe <= GameManager$2.day) {
    			this.car.visible = false;
    		}

    		this.shareBtn.visible = false;

    		this.backBtn.on(Laya.Event.CLICK, this, function () {
    			this.destroy();

    			UIManager.ShowUIPanel("xuanzeguanqia");

    			if (UIManager.gameUI) {
    				UIManager.gameUI.destroy();
    			}
    			if (GameManager$2.curScene) {
    				GameManager$2.curScene.destroy();
    				GameManager$2.curScene = null;
    			}

    		});
    		this.chongwanBtn.on(Laya.Event.CLICK, this, function () {
    			this.destroy();
    			GameManager$2.passTimes--;
    			var youLiang = PlayerData.GetUserData("youLiang");
    			var carid = PlayerData.GetUserData("selectCar");
    			if (youLiang[carid] < 40) {
    				UIManager.ShowUIPanel("jiayou");
    			} else {
    				UIManager.ShowUIPanel("Loading");
    			}
    		});
    		if (this.LingQuBtn) {
    			//关闭双倍领取按钮
    			this.LingQuBtn.on(Laya.Event.CLICK, this, function () {
    				GameManager$2.ShowVideo(function () {
    					PlayerData.AddProp(1, this.zongShouRu * 2);

    					PlayerData.SaveData();
    					UIManager.ShowAddMoney(this.zongShouRu * 2);

    					Laya.timer.once(1500, this, function () {
    						GameManager$2.curSelectGuanQia += 1;
    						this.destroy();
    						UIManager.ShowUIPanel("Loading");

    						if (UIManager.gameUI) {
    							UIManager.gameUI.destroy();
    						}
    						if (GameManager$2.curScene) {
    							GameManager$2.curScene.destroy();
    							GameManager$2.curScene = null;
    						}
    					});
    				}.bind(this));
    			});
    		}
    		this.lingqu.on(Laya.Event.CLICK, this, function () {
    			let self = this;
    			PlayerData.AddProp(1, self.zongShouRu * 5);

    			PlayerData.SaveData();
    			UIManager.ShowAddMoney(self.zongShouRu * 5);
    			Laya.timer.once(1500, this, function () {
    				GameManager$2.curSelectGuanQia += 1;
    				self.destroy();
    				UIManager.ShowUIPanel("Loading");

    				if (UIManager.gameUI) {
    					UIManager.gameUI.destroy();
    				}
    				if (GameManager$2.curScene) {
    					GameManager$2.curScene.destroy();
    					GameManager$2.curScene = null;
    				}
    			});
    		});
    		this.fangqi.on(Laya.Event.CLICK, this, function () {
    			this.jiangli.visible = false;
    			this.bg1.visible = false;
    		});
    		if (this.shareBtn) {
    			let self = this;
    			this.shareBtn.on(Laya.Event.CLICK, this, function () {

    			});
    		}

    		this.nextBtn.on(Laya.Event.CLICK, this, function () {
    			console.log("GameManager.passTimes:" + GameManager$2.passTimes);
    			if (GameManager$2.passTimes % 3 == 1 && GameManager$2.passNow != GameManager$2.passTimes) {
    				this.addChild(new sureVideo(function () {
    					this.next();
    				}.bind(this)));
    			} else {
    				this.next();
    			}
    		});

    		Laya.timer.frameOnce(75, this, function () {
    			GameManager$2.PlaySound("dingdanwancheng");
    		});
    	}

    	next() {
    		GameManager$2.curSelectGuanQia += 1;

    		//推送，每4关
    		if (GameManager$2.curSelectGuanQia % 4 == 1) {
    			this.destroy();
    			var YongYouCar = PlayerData.GetUserData("YongYouCar");
    			this.maxCarNum = 10;
    			let ln = null;
    			for (let i = 0; i < this.maxCarNum; i++) {
    				ln = i + 1;
    				console.log("ln?" + ln);
    				if (YongYouCar["" + ln] != 1) {
    					console.log("lnnnnnnnnnnnnnnnnn");
    					UIManager.ShowUIPanel("tuijian2", false);
    					break;
    				}
    				else {   //lnnnnnnnnnnnn
    					if (YongYouCar["" + 10] == 1 && ln == 10) {
    						console.log("全都解锁完了第10个 ------------------");
    						this.destroy();
    						if (GameManager$2.curSelectGuanQia > PlayerData.Static.MaxMission) {
    							GameManager$2.curSelectGuanQia = PlayerData.Static.MaxMission;
    							UIManager.ShowUIPanel("tishi6");
    						}
    						else {
    							var youLiang = PlayerData.GetUserData("youLiang");
    							var carid = PlayerData.GetUserData("selectCar");
    							if (youLiang[carid] < 40) {
    								UIManager.ShowUIPanel("jiayou");
    							} else
    								UIManager.ShowUIPanel("Loading");
    						}

    					}
    				}


    			}



    		} else {
    			this.destroy();
    			if (GameManager$2.curSelectGuanQia > PlayerData.Static.MaxMission) {
    				GameManager$2.curSelectGuanQia = PlayerData.Static.MaxMission;
    				UIManager.ShowUIPanel("tishi6");
    			}
    			else {
    				var youLiang = PlayerData.GetUserData("youLiang");
    				var carid = PlayerData.GetUserData("selectCar");
    				if (youLiang[carid] < 40) {
    					UIManager.ShowUIPanel("jiayou");
    				} else
    					UIManager.ShowUIPanel("Loading");
    			}

    		}

    		if (UIManager.gameUI) {
    			UIManager.gameUI.destroy();
    		}
    		if (GameManager$2.curScene) {
    			GameManager$2.curScene.destroy();
    			GameManager$2.curScene = null;
    		}
    	}

    	onDisable() {
    	}
    	Init() {
    		var config = GameManager$2.guanqia3Config[GameManager$2.curSelectGuanQia];
    		this.goldTex.text = UIManager.GoldFormat2(PlayerData.GetUserData("Gold"));
    		var starNum = 0;
    		this.shouru1 = config.shouru;
    		this.xiaofei = 0;
    		this.shunfeng = GameManager$2.shunfengNum * config.shufeng;


    		var carid = PlayerData.GetUserData("selectCar");
    		if (PlayerData.shiyongCarId2 > 0) {
    			carid = PlayerData.shiyongCarId2;
    			PlayerData.shiyongCarId2 = 0;
    		}
    		else {
    			var youLiang = PlayerData.GetUserData("youLiang");
    			var carid = PlayerData.GetUserData("selectCar");
    			youLiang[carid] = GameManager$2.curPlayer.carYouLiang;
    			PlayerData.SetUserData("youLiang", youLiang);
    		}
    		var carConfig = GameManager$2.chekuConfig[carid];

    		this.beilv.text = "(" + carConfig.bonus + "倍)";
    		this.che.skin = "ChuZuChe/UIRes/cheB" + carid + ".png";

    		var value = 0;
    		for (let i = 0; i < 3; i++) {
    			value += GameManager$2.xingxing[i];
    		}
    		//value = 3-value;
    		// console.log("-----------------------value:"+value);
    		if (value == 2)//GameManager.zhuangjiNum
    		{
    			starNum = 1;
    			this.hui1.visible = false;
    			this.xiaofei = 0;//(this.shouru1 + this.shunfeng) *0;
    			UIManager.ShowZhuangJiTipUI("Tip08");
    		}
    		else if (value == 1)//GameManager.zhuangjiNum
    		{
    			starNum = 2;
    			this.hui1.visible = false;
    			this.hui2.visible = false;
    			this.xiaofei = (this.shouru1 + this.shunfeng) * 0.5;
    			UIManager.ShowZhuangJiTipUI("Tip09");
    		}
    		else {
    			starNum = 3;
    			this.hui1.visible = false;
    			this.hui2.visible = false;
    			this.hui3.visible = false;
    			this.xiaofei = this.shouru1 + this.shunfeng;
    			UIManager.ShowZhuangJiTipUI("Tip10");
    		}


    		for (var i = 1; i <= 3; i++) {
    			if (i == starNum) {
    				this["title_" + i].visible = true;
    			}
    			else {
    				this["title_" + i].visible = false;
    			}
    		}
    		for (let i = 1; i <= 3; i++) {
    			if (i <= starNum) {
    				Laya.timer.frameOnce(i * 30 + 105, this, function () {
    					GameManager$2.PlaySound("xingxing");
    				});
    			}
    		}
    		this.lab_shunfengche.visible = this.shunfeng > 0;
    		if (this.lab_shunfengche.visible) {
    			this.lab_shunfengche.text = "(顺风车+" + this.shunfeng + ")";
    		}
    		let n = PlayerData.GetShuangbei();
    		this.shouru1 *= n;
    		this.xiaofei *= n;
    		this.shunfeng *= n;
    		this.zongShouRu = this.shouru1 + this.xiaofei + this.shunfeng;
    		this.carJiaCheng = parseInt((this.zongShouRu) * carConfig.bonus);
    		this.zongShouRu += this.carJiaCheng;

    		this.tex01.text = "" + (this.shouru1 + this.shunfeng);
    		this.tex02.text = this.xiaofei;
    		this.tex03.text = this.zongShouRu;



    		this.jiacheng.text = this.carJiaCheng;


    		var GuanQia = PlayerData.GetUserData("GuanQia");
    		if (GuanQia < GameManager$2.curSelectGuanQia + 1) {
    			GuanQia = GameManager$2.curSelectGuanQia + 1;
    		}
    		if (GuanQia >= PlayerData.Static.MaxMission) {
    			GuanQia = PlayerData.Static.MaxMission;
    		}
    		PlayerData.SetUserData("GuanQia", GuanQia);
    		var Star = PlayerData.GetUserData("starNum");
    		if (Star[GameManager$2.curSelectGuanQia]) {
    			if (Star[GameManager$2.curSelectGuanQia] < starNum) {
    				Star[GameManager$2.curSelectGuanQia] = starNum;
    			}
    		}
    		else {
    			Star[GameManager$2.curSelectGuanQia] = starNum;
    		}

    		PlayerData.SetUserData("starNum", Star);


    		this.shijian = GameManager$2.zongShiJian - GameManager$2.songdaShiJian;
    		if (this.shijian > 0) {
    			PlayerData.SetUserData("gameTime", PlayerData.GetUserData("gameTime") + this.shijian);
    		}
    		if (starNum >= 3) {
    			PlayerData.SetUserData("haopingNum", PlayerData.GetUserData("haopingNum") + 1);
    		}
    		PlayerData.SetUserData("zaikeNum", PlayerData.GetUserData("zaikeNum") + 1);

    		PlayerData.SaveData();
    		Laya.timer.frameOnce(200, this, function () {
    			PlayerData.AddProp(1, this.zongShouRu);
    			this.goldTex.text = UIManager.GoldFormat2(PlayerData.GetUserData("Gold"));
    		});
    		GameManager$2.updateTryCar();
    	}
    	onUpdate() {
    		if (this.car.visible) {
    			var h = new Date().getHours();
    			var m = new Date().getMinutes();
    			var s = new Date().getSeconds();
    			GameManager$2.timeH = 24 - h;
    			GameManager$2.timeH = GameManager$2.timeH < 10 ? ('0' + GameManager$2.timeH) : GameManager$2.timeH;
    			GameManager$2.timeM = 60 - m;
    			GameManager$2.timeM = GameManager$2.timeM < 10 ? ('0' + GameManager$2.timeM) : GameManager$2.timeM;

    			GameManager$2.timeS = 60 - s;

    			GameManager$2.timeS = GameManager$2.timeS < 10 ? ('0' + GameManager$2.timeS) : GameManager$2.timeS;
    			this.time.text = GameManager$2.timeH + ":" + GameManager$2.timeM + ":" + GameManager$2.timeS;
    		}
    	}
    }

    class PanelDaoHang extends Laya.Scene {

    	constructor() {
    		super();
    	}

    	onEnable() {
    		this.width = Laya.stage.width;
    		this.height = Laya.stage.height;

    		let self = this;
    		this.shiyongBtn.on(Laya.Event.CLICK, this, function () {
    			UIManager.Close(this);
    		});
    	}

    	onDisable() {
    	}
    }

    class PanelDaoHang1 extends Laya.Scene {

    	constructor() {
    		super();
    	}

    	onEnable() {
    		this.width = Laya.stage.width;
    		this.height = Laya.stage.height;
    		let self = this;
    		console.log("是这里吗？？导航");
    		self.fqBtn.visible = true;
    		self.fqBtn.visible = true;
    		this.kuang.on(Laya.Event.CLICK, this, function () {//jj
    			if (PanelDaoHang1.isClickkuang == false) {
    				PanelDaoHang1.isClickkuang = true;
    				self.jjkaishiBtn.visible = false;
    				self.jjguanbiBtn.visible = true;


    				this.gou.visible = false;

    			} else {
    				PanelDaoHang1.isClickkuang = false;
    				self.jjkaishiBtn.visible = true;
    				self.jjguanbiBtn.visible = false;
    				this.gou.visible = true;
    			}
    		});

    		this.jjkaishiBtn.on(Laya.Event.CLICK, this, function () {
    			PlayerData.SetUserData("daohang", 4);
    			UIManager.Close(self);
    			GameManager$2.curPlayer.Daohang();
    		});
    		this.jjguanbiBtn.on(Laya.Event.CLICK, this, function () {
    			if (PlayerData.GetUserData("firstDaohang") == 1) {
    				UIManager.Close(this, "jiaocheng3");
    				PlayerData.SetUserData("firstDaohang", 0);
    			}
    			else {
    				UIManager.Close(this);
    			}


    		});

    		this.kaishiBtn.on(Laya.Event.CLICK, this, function () {
    			PlayerData.SetUserData("daohang", 4);
    			UIManager.Close(self);
    			GameManager$2.curPlayer.Daohang();
    		});
    		this.fqBtn.on(Laya.Event.CLICK, this, function () {
    			if (PlayerData.GetUserData("firstDaohang") == 1) {
    				UIManager.Close(this, "jiaocheng3");
    				PlayerData.SetUserData("firstDaohang", 0);
    			}
    			else {
    				UIManager.Close(this);
    			}


    		});
    	}
    	onDisable() {
    	}
    }
    PanelDaoHang1.isClickkuang = false;

    class PanelXuanGuan extends Laya.Scene {

    	constructor() {
    		super();
    	}

    	onEnable() {
    		this.width = Laya.stage.width;
    		this.height = Laya.stage.height;

    		this.onUpdate();

    		Laya.timer.frameLoop(1, this, this.onUpdate);
    		var gamedata_ChuZuChe = Laya.LocalStorage.getItem("gamedata_ChuZuChe");
    		if (gamedata_ChuZuChe && gamedata_ChuZuChe.length > 0) {
    			PanelXuanGuan.gamedata_ChuZuChe = JSON.parse(gamedata_ChuZuChe);
    		} else {
    			Laya.LocalStorage.setItem(JSON.stringify(PanelXuanGuan.gamedata_ChuZuChe));
    		}
    		var day = new Date().getDate();

    		//新的一天
    		if (PanelXuanGuan.gamedata_ChuZuChe.gameDay != day) {

    			PanelXuanGuan.gamedata_ChuZuChe.gameDay = day;
    			PanelXuanGuan.gamedata_ChuZuChe.gamenum = 1;
    			Laya.LocalStorage.setItem("gamedata_ChuZuChe", JSON.stringify(PanelXuanGuan.gamedata_ChuZuChe));
    		}
    		this.car.on(Laya.Event.MOUSE_DOWN, this, function () {
    			UIManager.ShowUIPanel("YongjiuCar", false);
    		});
    		if (GameManager$2.dayData.mainday_ChuZuChe <= GameManager$2.day) {
    			this.car.visible = false;
    		}
    		this.Init();
    		this.UpdateTitle();

    		GameManager$2.updateTryScene();

    		this.maxNum = 5;
    		var tryScene = PlayerData.GetUserData("tryScene");

    		for (let i = 1; i < this.maxNum; i++) {
    			let n = i + 1;
    			if (tryScene["" + n] == 1) {
    				if (n == 2) {
    					this.suoding2.visible = false;
    					this.jiesuoBtn2.visible = false;
    					this["time2"].visible = true;

    				} else if (n == 3) {
    					this.suoding3.visible = false;
    					this.jiesuoBtn3.visible = false;
    					this["time3"].visible = true;
    				} else if (n == 4) {
    					this.suoding4.visible = false;
    					this.jiesuoBtn4.visible = false;
    					this["time4"].visible = true;
    				} else if (n == 5) {
    					this.suoding5.visible = false;
    					this.jiesuoBtn5.visible = false;
    					this["time5"].visible = true;
    				}
    			} else {
    				var name = "time" + n;
    				this[name].visible = false;
    			}
    		}
    		this["time1"].visible = false;

    		this.backBtn.on(Laya.Event.CLICK, this, function () {
    			this.destroy();
    			UIManager.ShowUIPanel("Main");
    		});

    		this.selectBtn.on(Laya.Event.CLICK, this, function () {
    			this.destroy();

    			UIManager.ShowUIPanel("Loading");
    		});

    		this.selectBtn2.on(Laya.Event.CLICK, this, function () {
    			this.destroy();
    			UIManager.ShowUIPanel("Loading");
    		});

    		this.selectBtn3.on(Laya.Event.CLICK, this, function () {
    			this.destroy();
    			UIManager.ShowUIPanel("Loading");
    		});
    		this.selectBtn4.on(Laya.Event.CLICK, this, function () {
    			this.destroy();
    			UIManager.ShowUIPanel("Loading");
    		});
    		this.selectBtn5.on(Laya.Event.CLICK, this, function () {
    			this.destroy();
    			UIManager.ShowUIPanel("Loading");
    		});

    		let self = this;
    		this.jiesuoBtn2.on(Laya.Event.CLICK, this, function () {
    			GameManager$2.ShowVideo(function () {
    				console.log("===============jiesuoBtn2==========");
    				self["time2"].visible = true;

    				var tryScene = PlayerData.GetUserData("tryScene");
    				var trySceneTime = PlayerData.GetUserData("trySceneTime");
    				tryScene["2"] = 1;
    				trySceneTime["2"] = (new Date()).getTime() / 1000;//时间秒

    				PlayerData.SetUserData("tryScene", tryScene);
    				PlayerData.SetUserData("trySceneTime", trySceneTime);
    				PlayerData.SaveData();

    				self.suoding2.visible = false;
    				self.jiesuoBtn2.visible = false;
    			}.bind(this));
    		});
    		this.jiesuoBtn3.on(Laya.Event.CLICK, this, function () {
    			GameManager$2.ShowVideo(function () {
    				console.log("===============jiesuoBtn3==========");
    				self["time3"].visible = true;
    				var tryScene = PlayerData.GetUserData("tryScene");
    				var trySceneTime = PlayerData.GetUserData("trySceneTime");
    				tryScene["3"] = 1;
    				trySceneTime["3"] = (new Date()).getTime() / 1000;//时间秒

    				PlayerData.SetUserData("tryScene", tryScene);
    				PlayerData.SetUserData("trySceneTime", trySceneTime);
    				PlayerData.SaveData();

    				self.suoding3.visible = false;
    				self.jiesuoBtn3.visible = false;
    			}.bind(this));
    		});
    		this.jiesuoBtn4.on(Laya.Event.CLICK, this, function () {
    			GameManager$2.ShowVideo(function () {
    				console.log("===============jiesuoBtn4==========");
    				self["time4"].visible = true;

    				var tryScene = PlayerData.GetUserData("tryScene");
    				var trySceneTime = PlayerData.GetUserData("trySceneTime");
    				tryScene["4"] = 1;
    				trySceneTime["4"] = (new Date()).getTime() / 1000;//时间秒

    				PlayerData.SetUserData("tryScene", tryScene);
    				PlayerData.SetUserData("trySceneTime", trySceneTime);
    				PlayerData.SaveData();

    				self.suoding4.visible = false;
    				self.jiesuoBtn4.visible = false;
    			}.bind(this));
    		});
    		this.jiesuoBtn5.on(Laya.Event.CLICK, this, function () {
    			GameManager$2.ShowVideo(function () {
    				console.log("===============jiesuoBtn5==========");

    				self["time5"].visible = true;

    				var tryScene = PlayerData.GetUserData("tryScene");
    				var trySceneTime = PlayerData.GetUserData("trySceneTime");
    				tryScene["5"] = 1;
    				trySceneTime["5"] = (new Date()).getTime() / 1000;//时间秒

    				PlayerData.SetUserData("tryScene", tryScene);
    				PlayerData.SetUserData("trySceneTime", trySceneTime);
    				PlayerData.SaveData();

    				self.suoding5.visible = false;
    				self.jiesuoBtn5.visible = false;
    			}.bind(this));
    		});

    		this.left.on(Laya.Event.CLICK, this, function () {
    			console.log("===============left==========");
    			var v = parseInt(this.Panel01.hScrollBar.value / 785) - 1;

    			Laya.Tween.to(this.Panel01.hScrollBar, { value: v * 785 }, 200);
    		});

    		this.right.on(Laya.Event.CLICK, this, function () {
    			console.log("===============right==========");
    			var v = parseInt(this.Panel01.hScrollBar.value / 785) + 1;
    			Laya.Tween.to(this.Panel01.hScrollBar, { value: v * 785 }, 200);
    		});

    		this.Panel01.hScrollBar.on("change", this, function () {
    			// console.log(this.Panel01.hScrollBar.value);
    		});

    		//更新时间
    		Laya.timer.loop(1000, this, function () {
    			var nowTime = (new Date()).getTime() / 1000;//时间秒
    			//拥有
    			var tryScene = PlayerData.GetUserData("tryScene");
    			var trySceneTime = PlayerData.GetUserData("trySceneTime");

    			this.maxNum = 5;
    			for (let i = 1; i < this.maxNum; i++) {
    				let n = i + 1;
    				if (tryScene["" + n] == 1) {
    					var tryTime = trySceneTime["" + n];

    					var name = "time" + n;
    					var subTime = (nowTime - tryTime);
    					this[name].text = GameManager$2.TotIimeFormat(24 * 60 * 60 - subTime);
    					if (nowTime - tryTime > 24 * 60 * 60) {//
    						trySceneTime["" + n] = 0;
    						tryScene["" + n] = 0;
    						this[name].visible = false;
    						name = "suoding" + n;
    						this[name].visible = true;
    						name = "jiesuoBtn" + n;
    						this[name].visible = true;
    					}
    				}
    			}

    		});
    	}

    	onDisable() {

    	}

    	Init() {
    		this.Panel01.hScrollBarSkin = 'ChuZuChe/comp/hscroll.png';
    		this.Panel01.elasticEnabled = true;
    		this.Panel01.hScrollBar.hide = true;
    	}

    	TuiSongXinChe() {
    		//&& PanelXuanGuan.gamedata_ChuZuChe.gamenum== 1
    		//  if (GameManager.selectModel == 2) { //jjjjj车辆试用
    		console.log("试用？？？？？");

    		var YongYouCar = PlayerData.GetUserData("YongYouCar");
    		this.maxCarNum = 1;
    		let ln = null;
    		for (let i = 11; i > this.maxCarNum; i--) {
    			ln = i - 1;
    			console.log("ln?" + ln);
    			if (YongYouCar["" + ln] != 1) {
    				PanelXuanGuan.gamedata_ChuZuChe.gamenum = 0;
    				Laya.LocalStorage.setItem("gamedata_ChuZuChe", JSON.stringify(PanelXuanGuan.gamedata_ChuZuChe));
    				UIManager.ShowUIPanel("tuijian2", false);

    				break;
    			}
    		}
    		//    }   
    	}
    	UpdateTitle() {
    		this.levelValue.text = PlayerData.GetUserData("playerLevel");
    		var nextExp = GameManager$2.levelInfoConfig[PlayerData.GetUserData("playerLevel")].upexp;
    		var playerExp = PlayerData.GetUserData("playerExp");
    		this.levelBar.value = playerExp / nextExp;

    		this.chaopiaoText.text = PlayerData.GetUserData("Gold");
    	}
    	onUpdate() {
    		if (this.car.visible) {
    			var h = new Date().getHours();
    			var m = new Date().getMinutes();
    			var s = new Date().getSeconds();
    			GameManager$2.timeH = 24 - h;
    			GameManager$2.timeH = GameManager$2.timeH < 10 ? ('0' + GameManager$2.timeH) : GameManager$2.timeH;
    			GameManager$2.timeM = 60 - m;
    			GameManager$2.timeM = GameManager$2.timeM < 10 ? ('0' + GameManager$2.timeM) : GameManager$2.timeM;

    			GameManager$2.timeS = 60 - s;

    			GameManager$2.timeS = GameManager$2.timeS < 10 ? ('0' + GameManager$2.timeS) : GameManager$2.timeS;
    			this.time.text = GameManager$2.timeH + ":" + GameManager$2.timeM + ":" + GameManager$2.timeS;
    		}
    	}
    }
    PanelXuanGuan.gamedata_ChuZuChe = {
    	gamenum: 1,
    	gameDay: 0,
    };

    class PanelFrist extends Laya.Scene {

    	constructor() {
    		super();
    		this.curValue = 0;
    		this.loadValue = 0;
    	}

    	onEnable() {
    		if (GameManager_Collection.GameConfig) {
    			if (GameManager_Collection.gq) {
    				this.logo.skin = GameManager_Collection.GameConfig.gamesLogo[GameManager_Collection.GameID];
    			} else {
    				this.logo.skin = "Collection/AllGameScene/logo.png";
    			}
    		}

    		this.width = Laya.stage.width;
    		this.height = Laya.stage.height;

    		this.LoadConfig();

    		this.loadValue = 0;

    		this.bg.skin = "ChuZuChe/Frist/bj0" + GameManager$2.RandomInt(1, 2) + ".jpg";

    		this.onUpdate();
    		Laya.timer.frameLoop(1, this, this.onUpdate);

    		GameManager$2.getPlaterData();
    	}

    	onDisable() {
    		Laya.timer.clearAll(this);
    	}

    	onUpdate() {
    		this.curValue += 0.01;
    		if (this.curValue > this.loadValue) {
    			this.curValue = this.loadValue;
    		}
    		if (this.curValue >= 1) {
    			Laya.timer.clear(this, this.onUpdate);
    			this.curValue = 1;
    			this.ToMainScene();
    		}

    		let tempNum = parseInt(this.curValue * 100);
    		this.jinduNum.text = tempNum + "%";
    		this.levelBar.value = this.curValue;
    	}

    	LoadConfig() {
    		this.loadLabel.text = "开始加载配置文件...";
    		var config = [
    			"res/ChuZuChe/JsonDatas/dj.json",//0
    			"res/ChuZuChe/JsonDatas/ck.json",//0
    			"res/ChuZuChe/JsonDatas/dt.json",//0
    			"res/ChuZuChe/JsonDatas/guanqia.json",
    			"res/ChuZuChe/JsonDatas/juqing.json",
    			"res/ChuZuChe/JsonDatas/renwu.json",
    			"res/ChuZuChe/JsonDatas/system.json",
    		];

    		let self = this;
    		self.startLoadConfigTime = Date.parse(new Date());
    		Laya.loader.load(config, Laya.Handler.create(this, function () {
    			self.endLoadConfigTime = Date.parse(new Date());
    			console.log("loadconfig耗时:" + (self.endLoadConfigTime - self.startLoadConfigTime));
    			GameManager$2.levelInfoConfig = Laya.loader.getRes(config[0]); //
    			GameManager$2.chekuConfig = Laya.loader.getRes(config[1]); //
    			GameManager$2.guanqiaConfig = Laya.loader.getRes(config[2]); //
    			GameManager$2.guanqia3Config = Laya.loader.getRes(config[3]); //
    			GameManager$2.juqingConfig = Laya.loader.getRes(config[4]); //
    			//任务
    			GameManager$2.renwuConfig = Laya.loader.getRes(config[5]); //
    			GameManager$2.systemConfig = Laya.loader.getRes(config[6]);
    			console.log("GameManager.chekuConfig[carid]" + GameManager$2.chekuConfig["1"].gl);
    			console.log("GameManager.systemConfig" + GameManager$2.systemConfig.Test);
    			PlayerData.GetData();
    			this.loadValue = 1;
    		}));
    	}

    	ToMainScene() {
    		this.loadValue = 0.9;
    		this.loadLabel.text = "开始加载模型...";
    		console.log("当前路径Models" + Laya.URL.basePath);
    		UIManager.ShowUIPanel("Main");
    		GameManager$2.LoadModels(null, function () {
    			this.loadLabel.text = "正在加载关键组件...";
    			this.loadValue = 1;
    			this.loadLabel.text = "正在进入主场景...";
    			PlayerData.isLoaded = true;
    		}.bind(this));
    	}
    }

    class RockerView extends Rocker_ChuZuCheUI {

    	constructor() {
    		super();

    	}

    	onEnable() {
    		console.log("RockerView");

    		/***当前多点触摸id****/
    		this.curTouchId = 0;
    		/***手指（鼠标）是否按下****/
    		this.isDown = false;
    		/***摇杆的角度****/
    		this.angle = -1;
    		/***摇杆的弧度****/
    		this.radians = -1;
    		//鼠标按下事件监听
    		this.on(Laya.Event.MOUSE_DOWN, this, this.onMouseDown);
    		//鼠标抬起事件监听
    		Laya.stage.on(Laya.Event.MOUSE_UP, this, this.onMouseUp);
    		//鼠标是否移除屏幕事件监听
    		Laya.stage.on(Laya.Event.MOUSE_OUT, this, this.onMouseUp);
    		//控制器中心点位置初始化
    		this.originPiont = new Laya.Point(this.width / 2, this.height / 2);
    		//默认为控制器不显示
    		this.visible = true;
    		this.pos(100, Laya.stage.height - 200);
    		this.knob.pos(this.width / 2, this.height / 2);
    		Laya.stage.on(Laya.Event.KEY_DOWN, this, this.onKeyDown);
    		Laya.stage.on(Laya.Event.KEY_UP, this, this.onKeyUp);
    		this._left = false;
    		this._right = false;
    	}
    	onKeyDown(e) {
    		switch (e["keyCode"]) {
    			case 37:
    				if (this._left)
    					return;
    				this.knob.pos(this.knob.x - 70, this.height / 2);
    				this._left = true;
    				break;
    			case 38:
    				break;
    			case 39:
    				if (this._right)
    					return;
    				this.knob.pos(this.knob.x + 70, this.height / 2);
    				this._right = true;
    				break;
    			case 40:
    				break;
    		}
    	}
    	onKeyUp(e) {
    		switch (e["keyCode"]) {
    			case 37:
    				this.knob.pos(this.knob.x + 70, this.height / 2);
    				this._left = false;
    				break;
    			case 38:
    				break;
    			case 39:
    				this.knob.pos(this.knob.x - 70, this.height / 2);
    				this._right = false;
    				break;
    			case 40:
    				break;
    		}
    	}
    	onDisable() {
    		// UIManager.gameUI.bj.off(Laya.Event.MOUSE_DOWN,this,this.onMouseDown);
    		Laya.stage.off(Laya.Event.MOUSE_UP, this, this.onMouseUp);
    		Laya.stage.off(Laya.Event.MOUSE_OUT, this, this.onMouseUp);
    	}
    	/*鼠标按下事件回调*/
    	onMouseDown(e) {

    		//记录当前按下id
    		this.curTouchId = e.touchId;
    		//已按下
    		this.isDown = true;
    		//更新摇杆到屏幕按下位置
    		//  this.pos(Laya.stage.mouseX - (this.width / 2),Laya.stage.mouseY - (this.height / 2));
    		//初始化摇杆控制点位置
    		this.knob.pos(this.width / 2, this.height / 2);
    		//按下后显示摇杆
    		this.visible = true;
    		//摇杆移动控制事件监听
    		Laya.stage.on(Laya.Event.MOUSE_MOVE, this, this.onMove);
    	}
    	/*鼠标抬起事件回调*/
    	onMouseUp(e) {
    		// console.log('mouse up');
    		//如果不是上次的点击id，返回（避免多点抬起，以第一次按下id为准）
    		if (e.touchId != this.curTouchId) return;
    		this.isDown = false;
    		this.visible = true;
    		this.knob.pos(this.width / 2, this.height / 2);
    		//移除摇杆移动事件监听
    		Laya.stage.off(Laya.Event.MOUSE_MOVE, this, this.onMove);
    		//修改摇杆角度与弧度为-1（代表无角度）
    		this.radians = this.angle = -1;


    	}
    	/*鼠标移动事件回调*/
    	onMove(e) {
    		// console.log('mouse move');
    		//如果不是上次的点击id，返回（避免多点抬起，以第一次按下id为准）
    		if (e.touchId != this.curTouchId) return;
    		//将移动时的鼠标屏幕坐标转化为摇杆局部坐标
    		var locationPos = this.globalToLocal(new Laya.Point(Laya.stage.mouseX, Laya.stage.mouseY), false);
    		//更新摇杆控制点位置
    		this.knob.pos(locationPos.x, this.height / 2);
    		//更新控制点与摇杆中心点位置距离
    		this.deltaX = locationPos.x - this.originPiont.x;
    		this.deltaY = locationPos.y - this.originPiont.y;
    		//计算控制点在摇杆中的角度
    		var dx = this.deltaX * this.deltaX;
    		var dy = this.deltaY * this.deltaY;
    		this.angle = Math.atan2(this.deltaX, this.deltaY) * 180 / Math.PI;
    		if (this.angle < 0) this.angle += 360;
    		//对角度取整
    		this.angle = Math.round(this.angle);
    		//计算控制点在摇杆中的弧度
    		this.radians = Math.PI / 180 * this.angle;
    		//强制控制点与中心距离不超过80像素
    		if (dx + dy >= 80 * 80) {
    			//控制点在半径为80像素的位置（根据弧度变化）
    			var x = Math.floor(Math.sin(this.radians) * 80 + this.originPiont.x);
    			var y = Math.floor(Math.cos(this.radians) * 80 + this.originPiont.y);
    			this.knob.pos(x, this.height / 2);
    		}
    		else {
    			//不超过80像素取原坐标
    			this.knob.pos(locationPos.x, this.height / 2);
    		}
    	}
    }

    class PanelGame extends Laya.Scene {

    	constructor() {
    		super();
    	}

    	onEnable() {
    		GameManager_Collection.showBackBtn();
    		this.width = Laya.stage.width;
    		this.height = Laya.stage.height;

    		this.onUpdate();
    		Laya.timer.frameLoop(1, this, this.onUpdate);
    		this.biaobiaob.x = 869;
    		this.biaobiaob.y = 164;

    		this.btn_lock.x = 1030;

    		console.log("当前关卡" + GameManager$2.curSelectGuanQia);
    		UIManager.uiList = [];
    		let self = this;
    		PlayerData.isGameing = true;  //游戏界面
    		console.log("游戏中gameing" + PlayerData.isGameing);

    		Laya.timer.loop(30 * 1000, this, this.is30sBanner);
    		Laya.timer.loop(500, this, function () {
    			if (!GameManager$2.show) {
    				this.fanhui.visible = false;
    				this.turnround.visible = false;
    			} else {
    				self.fanhuiAni.play(0, false);
    				this.fanhui.visible = true;
    				this.turnround.visible = true;
    			}

    		});

    		UIManager.gameUI = this;
    		GameManager$2.renwu_king = 0;
    		this.Init();
    		this.car.on(Laya.Event.MOUSE_DOWN, this, function () {
    			UIManager.ShowUIPanel("YongjiuCar", false);
    		});
    		if (GameManager$2.dayData.mainday_ChuZuChe <= GameManager$2.day) {
    			this.car.visible = false;
    		}
    		this.bj.on(Laya.Event.MOUSE_DOWN, this, function () {
    			GameManager$2.CameraMove.mouseDown();
    		});

    		this.JiaYouBtn.on(Laya.Event.MOUSE_DOWN, this, function () {
    			GameManager$2.curPlayer.JiaYou();
    		});
    		this.JiaYouBtn.on(Laya.Event.MOUSE_UP, this, function () {
    			GameManager$2.curPlayer.StopJiaYou();
    		});
    		this.JiaYouBtn.on(Laya.Event.MOUSE_OUT, this, function () {
    			GameManager$2.curPlayer.StopJiaYou();
    		});

    		this.ShaCheBtn.on(Laya.Event.MOUSE_DOWN, this, function () {
    			GameManager$2.curPlayer.ShaChe();
    		});
    		this.ShaCheBtn.on(Laya.Event.MOUSE_UP, this, function () {
    			GameManager$2.curPlayer.StopShaChe();
    		});
    		this.ShaCheBtn.on(Laya.Event.MOUSE_OUT, this, function () {
    			GameManager$2.curPlayer.StopShaChe();
    		});

    		this.ZhuanLBtn.on(Laya.Event.MOUSE_DOWN, this, function () {
    			GameManager$2.curPlayer.ZhuanXiang("L");
    		});
    		this.ZhuanLBtn.on(Laya.Event.MOUSE_UP, this, function () {
    			GameManager$2.curPlayer.StopZhuanXiang();
    		});
    		this.ZhuanLBtn.on(Laya.Event.MOUSE_OUT, this, function () {
    			GameManager$2.curPlayer.StopZhuanXiang();
    		});

    		this.ZhuanRBtn.on(Laya.Event.MOUSE_DOWN, this, function () {
    			GameManager$2.curPlayer.ZhuanXiang("R");
    		});
    		this.ZhuanRBtn.on(Laya.Event.MOUSE_UP, this, function () {
    			GameManager$2.curPlayer.StopZhuanXiang();
    		});
    		this.ZhuanRBtn.on(Laya.Event.MOUSE_OUT, this, function () {
    			GameManager$2.curPlayer.StopZhuanXiang();
    		});


    		this.dangBtn.on(Laya.Event.MOUSE_DOWN, this, function () {
    			GameManager$2.curPlayer.HuanDang();
    		});
    		this.DingSuBtn.on(Laya.Event.CLICK, this, function () {
    			GameManager$2.curPlayer.ChangeDingSu();
    		});
    		this.shiJiaoBtn.on(Laya.Event.CLICK, this, function () {
    			if (GameManager$2.CameraMove.isShangChe == true) {
    				return;
    			}
    			GameManager$2.curPlayer.ChangeShiJiao();
    		});
    		this.pauseBtn.on(Laya.Event.CLICK, this, function () {  ///梁楠 ================
    			UIManager.InsertUIList("Pause");
    		});
    		this.labaBtn.on(Laya.Event.CLICK, this, function () {
    			GameManager$2.PlaySound("mingdi");
    		});
    		this.kefuBtn.on(Laya.Event.CLICK, this, function () {
    			UIManager.InsertUIList("jiedan");

    		});
    		this.redBtn.on(Laya.Event.CLICK, this, function () {
    			PlayerData.SetUserData("daohang", 4);
    			GameManager$2.curPlayer.Daohang();
    		});
    		this.btn_lock.on(Laya.Event.CLICK, this, function () {
    			console.log("on click lock");
    			if (this.jiesuo2.visible) {
    				UIManager.ShowUIPanel("tuijian6", false);
    			}
    			else {
    				let t = PlayerData.GetUserData("shuangbei_t");
    				let l = PlayerData.GetUserData("shuangbei_l");
    				if (t == 0) {
    					t = (new Date()).getTime() / 1000;
    					l = PlayerData.Static.ShuangBeiTime;
    				}
    				else {
    					l += PlayerData.Static.ShuangBeiTime;
    				}

    				PlayerData.SetUserData("shuangbei_t", t);
    				PlayerData.SetUserData("shuangbei_l", l);
    			}
    		});
    		GameManager$2.xingxing = [0, 0, 0];
    		this.rocker = this.addChild(new RockerView());



    		this.UpdateDaohang();


    		this.initTuijian();

    		let t = PlayerData.GetUserData("shuangbei_t");
    		let l = PlayerData.GetUserData("shuangbei_l");

    		let s = l - ((new Date()).getTime() / 1000 - t);

    		this.cxleble.visible = s > 0;
    		this.jiasu.visible = !this.cxleble.visible;
    		this.jiasuunck.visible = !this.cxleble.visible;

    		if (s > 0) {
    			this.cxleble.text = GameManager$2.getFormatTime(parseInt(s));
    		}
    		Laya.timer.loop(1000, this, this.tick);


    		console.log("当前的【【【【【【【【【【" + GameManager$2.selectModel);
    		//推送 首次推导航 其余 双数推车辆单数推导航

    		if (PlayerData.GetUserData("first") == 1 && GameManager$2.selectModel == 3) {
    			UIManager.InsertUIList("daohang");
    			//}

    			PlayerData.SetUserData("first", 2);
    		}
    		else if (GameManager$2.selectModel == 3) {

    			if (GameManager$2.curSelectGuanQia % 2 == 0) {
    				if (this.btn_lock.visible) {
    					UIManager.InsertUIList("tuijian6");
    				}
    			}
    			else if (GameManager$2.curSelectGuanQia > 10) {
    				let daohang = PlayerData.GetUserData("daohang");
    				if (daohang == 0)
    					UIManager.InsertUIList("daohang1");
    			}
    		}

    	}


    	is30sBanner() {
    		console.log("30sssssssssss");
    	}


    	tick() {
    		let t = PlayerData.GetUserData("shuangbei_t");
    		let l = PlayerData.GetUserData("shuangbei_l");

    		if (t == 0 || l == 0) {
    			if (this.cxleble.visible)
    				this.cxleble.visible = false;
    			if (!this.jiasu.visible)
    				this.jiasu.visible = true;
    			this.jiasuunck.visible = true;
    			return;
    		}
    		else {
    			this.jiasu.visible = false;
    			this.jiasuunck.visible = false;
    			this.cxleble.visible = true;
    		}

    		let s = l - ((new Date()).getTime() / 1000 - t);

    		s = s > 0 ? s : 0;

    		this.cxleble.text = GameManager$2.getFormatTime(parseInt(s));
    		if (s <= 0) {
    			PlayerData.SetUserData("shuangbei_t", 0);
    			PlayerData.SetUserData("shuangbei_l", 0);
    			this.jiasu.visible = true;
    			this.jiasuunck.visible = true;
    			this.cxleble.visible = false;
    		}
    	}
    	onDisable() {
    		if (PlayerData.shiyongCarId2 > 0) {
    			PlayerData.shiyongCarId2 = 0;
    		}
    		else {
    			var youLiang = PlayerData.GetUserData("youLiang");
    			var carid = PlayerData.GetUserData("selectCar");
    			youLiang[carid] = GameManager$2.curPlayer.carYouLiang;
    			PlayerData.SetUserData("youLiang", youLiang);
    			PlayerData.SaveData();
    		}

    		if (UIManager.gameUI) {
    			UIManager.gameUI.destroy();
    			UIManager.gameUI = null;
    		}
    		if (GameManager$2.curScene) {
    			GameManager$2.curScene.destroy();
    			GameManager$2.curScene = null;
    		}

    		PlayerData.isGameing = false;
    		Laya.timer.clear(this, this.is30sBanner);
    		console.log("当前gameing" + PlayerData.isGameing);
    		Laya.timer.clearAll(this);
    	}
    	HuiZhengFangXiang() {
    		Laya.Tween.to(this.CarDirBtn, { x: 88 }, 200);
    	}
    	UpdateDaohang() {
    		if ((GameManager$2.selectModel == 2) || (GameManager$2.selectModel == 3 && GameManager$2.curSelectGuanQia < 11)) {
    			this.redBtn.visible = false;
    			this.blueBtn.visible = false;
    			this.biaobiaob.visible = false;
    			return;
    		}
    		let daohang = PlayerData.GetUserData("daohang");
    		this.redBtn.visible = daohang == 0 && GameManager$2.curSelectGuanQia >= 11;
    		this.blueBtn.visible = daohang > 0 && GameManager$2.curSelectGuanQia >= 11;
    		this.biaobiaob.visible = this.redBtn.visible || this.blueBtn.visible;
    		if (this.biaobiaob.visible) {
    			if (daohang > 0) {
    				this.time_daohang.text = "" + daohang;
    				daohang--;
    				PlayerData.SetUserData("daohang", daohang);
    				this.ani10.play(0, true);
    			}
    		}
    	}
    	Init() {
    		GameManager$2.PlayMusic("game_1");
    		this.UpdateXinQing(false);
    		if (GameManager$2.selectModel == 3) {
    			this.kefuBtn.visible = false;
    		} else {
    			this.task.visible = false;
    		}
    		this.ShowGuide();

    		this.renwuConfig = GameManager$2.renwuConfig["" + GameManager$2.curSelectGuanQia];
    		if (this.renwuConfig.king != 0) {

    			GameManager$2.renwu_king = this.renwuConfig.king;
    			var task1 = this.renwuConfig.task1;
    			if (task1) {
    				this.renwu1.text = task1.content;
    				if (task1.type == 2) {
    					this.renwu1_sc.visible = true;
    					this.renwu1_fa.visible = false;
    				} else {
    					this.renwu1_sc.visible = true;
    					this.renwu1_fa.visible = false;
    				}
    			}

    			this.renwu2.text = "";
    			this.renwu2_sc.visible = false;
    			this.renwu2_fa.visible = false;

    			this.renwu3.text = "";
    			this.renwu3_sc.visible = false;
    			this.renwu3_fa.visible = false;
    			if (GameManager$2.selectModel == 3) {
    				if (GameManager$2.renwu_king == 1) {
    					this.jjrwAni.play(0, false);
    				} else {
    					this.tsrwAni.play(0, false);
    				}
    			}


    		} else {
    			var task1 = this.renwuConfig.task1;
    			if (task1) {
    				this.renwu1.text = task1.content;
    				if (task1.type == 2) {
    					this.renwu1_sc.visible = true;
    					this.renwu1_fa.visible = false;
    				} else {
    					this.renwu1_sc.visible = true;
    					this.renwu1_fa.visible = false;
    				}
    			}

    			var task2 = this.renwuConfig.task2;
    			if (task2) {
    				this.renwu2.text = task2.content;
    				if (task2.type == 2) {
    					this.renwu2_sc.visible = true;
    					this.renwu2_fa.visible = false;
    				} else {
    					this.renwu2_sc.visible = true;
    					this.renwu2_fa.visible = false;
    				}
    			}

    			var task3 = this.renwuConfig.task3;
    			if (task3) {
    				this.renwu3.text = task3.content;

    				if (task3.type == 2) {
    					this.renwu3_sc.visible = true;
    					this.renwu3_fa.visible = false;
    				} else {
    					this.renwu3_sc.visible = true;
    					this.renwu3_fa.visible = false;
    				}
    			}
    		}
    	}
    	ShowGuide() {
    		if (PlayerData.GetUserData("GuideIndex") == 2) {
    			PlayerData.SetUserData("GuideIndex", 3);
    			PlayerData.SaveData();
    			UIManager.ShowUIPanel("jiaocheng", false, {
    				"guideIndex": 1, "callback": function (code) {
    					console.log("callback jiaocheng" + code);
    					if (code == 2) {

    					}
    				}
    			});
    		}
    	}
    	HuanDangAni(dir) {
    		if (dir == 1) {
    			this.dangwei2Ani.play(0, false);
    		}
    		else {
    			this.dangwei1Ani.play(0, false);
    		}
    	}
    	UpdateDingSu(v) {
    		if (v == "dingsu") {
    			this.DingSuBtn.skin = "ChuZuChe/UIRes/yxz_dingsu.png";
    		}
    		else {
    			this.DingSuBtn.skin = "ChuZuChe/UIRes/yxz_dingsu2.png";
    		}
    	}

    	//发生碰撞
    	showRenWu1() {
    		//撞击

    		this.checkTask(1, 0);
    	}

    	//时间超时
    	showRenWu2(time) {

    		if (this.renwuConfig) {
    			var subTime = GameManager$2.gameStartTime - time;
    			this.checkTask(2, subTime);
    		}
    	}

    	//闯红灯
    	showRenWu3() {
    		this.checkTask(3, 0);
    	}


    	//任务检测
    	checkTask(type, value) {

    		for (let i = 1; i <= 3; i++) {
    			var _task = this.renwuConfig["task" + i];

    			if (_task) {

    				if (GameManager$2.xingxing[0] == 1 && GameManager$2.xingxing[1] == 1 && GameManager$2.xingxing[2] == 1) {
    					console.log("当前数组都是1了任务全部失败");
    					console.log("星星：" + GameManager$2.xingxing);
    					if (GameManager$2.gameState != "over") {
    						GameManager$2.Fail();
    					}
    				}
    				else if (GameManager$2.xingxing[0] == 0 && GameManager$2.xingxing[1] == 0 && GameManager$2.xingxing[2] == 0) {

    				}

    				if (_task.type == type && i == 1) {

    					if (type == 2) {//时间
    						if (value > _task.value) {

    							if (GameManager$2.xingxing[0] != 1) {
    								GameManager$2.xingxing[0] = 1;
    								this.updateSkin(i, type);
    								this.playAni(i);
    								console.log("任务king=======" + GameManager$2.renwu_king);
    								if (GameManager$2.renwu_king != 0) {//直接失败

    									if (GameManager$2.gameState != "over") {
    										GameManager$2.Fail();
    									}
    								}

    							}
    						}
    					} else {
    						console.log("任务else：" + GameManager$2.xingxing);
    						if (GameManager$2.xingxing[0] != 1) {
    							GameManager$2.xingxing[0] = 1;
    							this.updateSkin(i, type);
    							this.playAni(i);

    							if (GameManager$2.renwu_king != 0) {//直接失败
    								if (GameManager$2.gameState != "over") {
    									GameManager$2.Fail();
    								}
    							}
    						}
    					}


    				} else if (_task.type == type && i == 2) {
    					if (type == 2) {//时间
    						if (value > _task.value) {
    							if (GameManager$2.xingxing[1] != 1) {
    								GameManager$2.xingxing[1] = 1;
    								this.updateSkin(i, type);
    								this.playAni(i);
    							}
    						}
    					} else {
    						if (GameManager$2.xingxing[1] != 1) {
    							GameManager$2.xingxing[1] = 1;
    							this.updateSkin(i, type);
    							this.playAni(i);
    						}


    					}
    				} else if (_task.type == type && i == 3) {

    					if (type == 2) {//时间
    						if (value > _task.value) {
    							if (GameManager$2.xingxing[2] != 1) {
    								GameManager$2.xingxing[2] = 1;
    								this.updateSkin(i, type);
    								this.playAni(i);
    							}
    						}
    					} else {
    						if (GameManager$2.xingxing[2] != 1) {
    							GameManager$2.xingxing[2] = 1;
    							this.updateSkin(i, type);

    							this.playAni(i);
    						}
    					}
    				}
    			}

    		}

    	}

    	playAni(i) {
    		if (i == 1) {
    			this.huiAni.play(0, false);
    		} else if (i == 2) {
    			this.hui2Ani.play(0, false);
    		} else if (i == 3) {
    			this.hui3Ani.play(0, false);
    		}
    	}

    	updateSkin(n, type) {

    		if (n == 1) {
    			if (type == 2) {

    				this.renwu1_sc.visible = false;
    				this.renwu1_fa.visible = true;
    			} else {
    				this.renwu1_sc.visible = false;
    				this.renwu1_fa.visible = true;
    			}
    		} else if (n == 2) {
    			if (type == 2) {
    				this.renwu2_sc.visible = false;
    				this.renwu2_fa.visible = true;
    			} else {
    				this.renwu2_sc.visible = false;
    				this.renwu2_fa.visible = true;
    			}
    		} else if (n == 3) {
    			if (type == 2) {
    				this.renwu3_sc.visible = false;
    				this.renwu3_fa.visible = true;
    			} else {
    				this.renwu3_sc.visible = false;
    				this.renwu3_fa.visible = true;
    			}
    		}
    	}


    	UpdateSudu(v) {
    		var curv = (v).toFixed(0);
    		this.glTex.text = curv * 3;
    		let rotation = curv * 5 / 240 * 180 + 4;
    		this.zhizhengImg.rotation = rotation > 180 ? 180 : rotation;
    	}
    	UpdateMinMap(pos, target) {
    		// console.log("pos:	" + pos.x + "	" + pos.z);
    		this.minMapImg.x = pos.x / 1700 * 256 + 71;
    		this.minMapImg.y = pos.z / 1700 * 256 + 71;

    		this.minMapImg.getChildByName("ZhiShi").graphics.clear();
    		// this.minMapImg.getChildByName("ZhiShi").graphics.drawLine(0, 0, -pos.x / 850 * 128 + 128, -pos.z / 850 * 128 + 128, "#ff0000", 5);
    		if (target) {
    			this.minMapImg.getChildByName("ZhiShi").graphics.drawLine(-pos.x / 850 * 128 + 128, -pos.z / 850 * 128 + 128,
    				-target.x / 850 * 128 + 128, -target.z / 850 * 128 + 128, "#ff0000", 5);
    		}
    	}
    	UpdateYouLiang(v) {
    		this.youImg.mask.graphics.clear();
    		this.youImg.mask.graphics.drawRect(0, -1, 25, v / 100 * 71, "#ff0000");
    	}
    	UpdateXinQing(show, lucheng, shijian) {
    		// this.time = shijian;
    		let v = GameManager$2.xinqing;
    		this.showRenWu2(shijian);
    		this.xinqingPanel.visible = show && GameManager$2.chengke.length > 0;
    		this.xinqingPanel.getChildByName("valueTex").text = v;
    		this.xinqingPanel.getChildByName("icon01").visible = false;
    		this.xinqingPanel.getChildByName("icon02").visible = false;
    		this.xinqingPanel.getChildByName("icon03").visible = false;
    		if (v < 3) {
    			this.xinqingPanel.getChildByName("icon03").visible = true;
    		}
    		else if (v < 7) {
    			this.xinqingPanel.getChildByName("icon02").visible = true;
    		}
    		else {
    			this.xinqingPanel.getChildByName("icon01").visible = true;
    		}

    		var xqv = v;
    		if (xqv <= 0) {
    			xqv = 0;
    		}
    		this.xinqingPanel.getChildByName("bar").mask.graphics.clear();
    		this.xinqingPanel.getChildByName("bar").mask.graphics.drawRect(0, -1, xqv / 100 * 76, 8, "#ff0000");
    		if (show) {
    			this.jishiTex.text = GameManager$2.TotIimeFormat(shijian);
    			this.luchengTex.text = parseInt(lucheng) + "m";
    			if (shijian < 0) {
    				this.jishiTex.color = "#ff0000";
    			}
    			else {
    				this.jishiTex.color = "#ffffc1";
    			}
    		}
    		else {
    			this.jishiTex.text = "--:--";
    			this.luchengTex.text = "----";
    		}
    	}
    	initTuijian() {
    		let YongYouCar = PlayerData.GetUserData("YongYouCar");
    		let tryCar = PlayerData.GetUserData("tryCar");
    		let max = 10;
    		let cur = max;
    		this.nextCar = -1;

    		for (; cur > 0; cur--) {
    			if (YongYouCar[cur] == 1 && tryCar[cur] == 0) {
    				break;
    			}
    		}
    		cur++;
    		this.btn_lock.visible = cur <= max;
    		if (this.btn_lock.visible == false)
    			return;
    		this.nextCar = cur;
    		this.cheti.skin = "ChuZuChe/UIRes/hbche" + (cur - 1) + ".png";
    		var config = GameManager$2.chekuConfig[cur];
    		let chaopiao = PlayerData.GetUserData("Gold");
    		let need = config.cpjg;
    		this.jiesuo1.visible = need > chaopiao;
    		this.jiesuo2.visible = need <= chaopiao;
    		this.lab_lock.visible = need > chaopiao;
    		if (this.lab_lock.visible) {
    			this.lab_lock.text = parseInt(chaopiao / need * 100) + "%";
    		}

    	}
    	onUpdate() {
    		if (this.car.visible) {
    			var h = new Date().getHours();
    			var m = new Date().getMinutes();
    			var s = new Date().getSeconds();
    			GameManager$2.timeH = 24 - h;
    			GameManager$2.timeH = GameManager$2.timeH < 10 ? ('0' + GameManager$2.timeH) : GameManager$2.timeH;
    			GameManager$2.timeM = 60 - m;
    			GameManager$2.timeM = GameManager$2.timeM < 10 ? ('0' + GameManager$2.timeM) : GameManager$2.timeM;

    			GameManager$2.timeS = 60 - s;

    			GameManager$2.timeS = GameManager$2.timeS < 10 ? ('0' + GameManager$2.timeS) : GameManager$2.timeS;
    			this.time.text = GameManager$2.timeH + ":" + GameManager$2.timeM + ":" + GameManager$2.timeS;
    		}
    	}
    }

    class PanelGuide extends Laya.Scene {

    	constructor() {
    		super();
    	}
    	onEnable() {
    		this.width = Laya.stage.width;
    		this.height = Laya.stage.height;

    		console.log("11111111111xinshou");
    		PlayerData.isXinshou = true;
    	}
    	onOpened(data) {

    		this.index = data.guideIndex;
    		this.preIndex = this.index;
    		this.callback = data.callback;
    		if (this.index == 11) {
    			this.skinBtn.visible = false;
    		}
    		this.skinBtn.on(Laya.Event.CLICK, this, function () {
    			this.destroy();
    			if (this.callback != null) {
    				this.callback(-1);
    				this.callback = null;
    			}
    		});
    		this.bj.on(Laya.Event.CLICK, this, function () {
    			if (this.callback != null) {
    				this.callback(this.index);
    			}
    			this.index += 1;

    			console.log("jjjjjjjjjjjjjjthis.index" + this.index);
    			this.UpdateGuide();
    		});

    		this.UpdateGuide();
    	}
    	onDisable() {

    	}

    	UpdateGuide() {
    		if (this["guide" + this.preIndex]) {
    			this["guide" + this.preIndex].visible = false;
    		}
    		if (this["guide" + this.index]) {
    			this["guide" + this.index].visible = true;
    			if (this["guideAni" + this.index]) {
    				this["guideAni" + this.index].play(0, false);
    			}
    		}
    		else {
    			this.destroy();
    			if (this.callback != null) {
    				this.callback = null;
    			}
    		}

    	}
    }

    class PanelJiaocheng3 extends Laya.Scene {

    	constructor() {
    		super();
    	}

    	onEnable() {
    		this.width = Laya.stage.width;
    		this.height = Laya.stage.height;
    		this.tanchuAni.play(0, true);
    		this.once(Laya.Event.CLICK, this, function () {
    			this.tanchuAni.stop();
    			this.tanchuAni.visible = false;
    			this.tanchu2Ani.play(0, true);
    			this.once(Laya.Event.CLICK, this, function () {
    				UIManager.Close(this);
    			});
    		});
    	}

    	onDisable() {

    	}
    }

    class PanelJieDan extends Laya.Scene {

    	constructor() {
    		super();
    	}

    	onEnable() {
    		this.width = Laya.stage.width;
    		this.height = Laya.stage.height;
    		this.closeBtn.on(Laya.Event.CLICK, this, function () {
    			UIManager.Close(this);
    			// this.destroy() ;
    		});
    		this.OkBtn.on(Laya.Event.CLICK, this, function () {
    			if (GameManager$2.curPlayer.AIChengKeScript && GameManager$2.curPlayer.AIChengKeScript.state == "chengche") {
    				UIManager.ShowGameTipUI("请先完成当前订单");
    			}
    			else if (GameManager$2.curPlayer.waitShangChe == true) {
    				UIManager.ShowGameTipUI("请先完成当前订单");
    			}
    			else {
    				UIManager.Close(this);
    				// this.destroy() ;
    				GameManager$2.curPlayer.HuJiaoChengKe();
    			}

    		});
    	}

    	onDisable() {
    	}
    }

    class PanelJiayou extends Laya.Scene {

    	constructor() {
    		super();
    	}

    	onEnable() {
    		this.width = Laya.stage.width;
    		this.height = Laya.stage.height;
    		let self = this;

    		self.kuang.on(Laya.Event.CLICK, this, function () {//jj
    			if (PanelJiayou.isClickkuang == false) {
    				PanelJiayou.isClickkuang = true;

    				this.gou.visible = false;

    			} else {
    				PanelJiayou.isClickkuang = false;

    				this.gou.visible = true;
    			}
    		});

    		self.jjjyBtn.on(Laya.Event.CLICK, this, function () {//jj
    			if (PanelJiayou.isClickkuang) {
    				self.destroy();
    				GameManager$2.selectModel = 4;
    				UIManager.ShowUIPanel("Loading");
    			} else {
    				self.youtongAni.play(0, false);
    				self.youtongAni.once(Laya.Event.COMPLETE, self, function () {
    					GameManager$2.Jiayou();
    					self.destroy();
    					UIManager.ShowUIPanel("Loading");
    				});
    			}

    		});


    		self.adBtn.on(Laya.Event.CLICK, this, function () {
    			self.youtongAni.play(0, false);
    			self.youtongAni.once(Laya.Event.COMPLETE, self, function () {
    				GameManager$2.Jiayou();
    				self.destroy();
    				UIManager.ShowUIPanel("Loading");
    			});
    		});
    		self.adBtn2.on(Laya.Event.CLICK, this, function () {//jj
    			self.youtongAni.play(0, false);
    			self.youtongAni.once(Laya.Event.COMPLETE, self, function () {
    				GameManager$2.Jiayou();
    				self.destroy();
    				UIManager.ShowUIPanel("Loading");
    			});
    		});

    		self.jyBtn.once(Laya.Event.CLICK, this, function () {
    			self.destroy();
    			GameManager$2.selectModel = 4;
    			UIManager.ShowUIPanel("Loading");
    		});
    	}

    	onDisable() {
    	}
    }
    PanelJiayou.isClickkuang = false;

    class PanelJiayou2 extends Laya.Scene {

    	constructor() {
    		super();
    	}

    	onEnable() {
    		this.width = Laya.stage.width;
    		this.height = Laya.stage.height;
    		this.chongBtn.on(Laya.Event.CLICK, this, function () {
    			this.destroy();
    			GameManager$2.selectModel = 3;
    			UIManager.ShowUIPanel("xuanzeguanqia");
    		});

    		this.xiaBtn.on(Laya.Event.CLICK, this, function () {
    			this.destroy();
    			GameManager$2.selectModel = 3;
    			UIManager.ShowUIPanel("Loading");
    		});
    	}

    	onDisable() {
    	}
    }

    class PanelJieke extends Laya.Scene {

    	constructor() {
    		super();
    	}

    	onEnable() {// 顺风车接单 =======
    		this.width = Laya.stage.width;
    		this.height = Laya.stage.height;
    		GameManager$2.PauseGame(true);
    		this.jieBtn.on(Laya.Event.CLICK, this, function () {
    			console.log("顺风车接单");

    			UIManager.Close(this);
    			GameManager$2.OnTakeShunfeng(true);
    		});
    		this.fangBtn.on(Laya.Event.CLICK, this, function () {
    			console.log("放弃顺风车接单");
    			UIManager.Close(this);
    			GameManager$2.OnTakeShunfeng(false);
    		});
    	}

    	onDisable() {
    	}
    }

    class PanelJieSuan extends Laya.Scene {

    	constructor() {
    		super();
    	}

    	onEnable() {
    		this.width = Laya.stage.width;
    		this.height = Laya.stage.height;
    		this.onUpdate();
    		Laya.timer.frameLoop(1, this, this.onUpdate);
    		this.car.on(Laya.Event.MOUSE_DOWN, this, function () {
    			UIManager.ShowUIPanel("YongjiuCar", false);
    		});
    		if (GameManager$2.dayData.mainday_ChuZuChe <= GameManager$2.day) {
    			this.car.visible = false;
    		}
    		this.bonusList = [1, 1.2, 1.5, 1.8, 2, 2.2, 2.5, 2.8, 3];
    		this.Init();
    		let self = this;

    		self.fq.visible = true;


    		this.kuang.on(Laya.Event.CLICK, this, function () {//jj
    			if (PanelJieSuan.isClickkuang == false) {
    				PanelJieSuan.isClickkuang = true;

    				this.gou.visible = false;

    			} else {
    				PanelJieSuan.isClickkuang = false;
    				this.gou.visible = true;
    			}
    		});
    		this.lingqu.on(Laya.Event.CLICK, this, function () {
    			self.destroy();
    			var shouru = (self.feiyong + self.jiangli + self.xiaofei + self.carJiaCheng) * 5;
    			PlayerData.AddProp(1, shouru);

    			PlayerData.SaveData();
    			GameManager$2.curPlayer.CreateChengKe();
    		});
    		this.fangqi.on(Laya.Event.CLICK, this, function () {
    			this.jiangli.visible = false;
    			this.bg1.visible = false;
    		});
    		//===================单倍领取掉放弃的方法  双倍掉qdBtn
    		this.jjqdBtn.on(Laya.Event.CLICK, this, function () {
    			if (PanelJieSuan.isClickkuang) {
    				var shouru = (this.feiyong + this.jiangli + this.xiaofei + this.carJiaCheng);
    				PlayerData.AddProp(1, shouru);
    				PlayerData.SaveData();
    				this.destroy();
    				GameManager$2.curPlayer.CreateChengKe();
    			} else {
    				self.destroy();
    				var shouru = (self.feiyong + self.jiangli + self.xiaofei + self.carJiaCheng) * 2;
    				PlayerData.AddProp(1, shouru);
    				PlayerData.SaveData();
    				GameManager$2.curPlayer.CreateChengKe();
    			}


    		});



    		this.qdBtn.on(Laya.Event.CLICK, this, function () {
    			self.destroy();
    			var shouru = (self.feiyong + self.jiangli + self.xiaofei + self.carJiaCheng) * 2;
    			PlayerData.AddProp(1, shouru);
    			PlayerData.SaveData();
    			GameManager$2.curPlayer.CreateChengKe();

    		});

    		this.fq.on(Laya.Event.CLICK, this, function () {
    			var shouru = (this.feiyong + this.jiangli + this.xiaofei + this.carJiaCheng);
    			PlayerData.AddProp(1, shouru);
    			PlayerData.SaveData();
    			this.destroy();
    			GameManager$2.curPlayer.CreateChengKe();
    		});
    		this.luping.on(Laya.Event.CLICK, this, function () {

    		});
    		GameManager$2.PlaySound("ziyoujiesuan");
    	}

    	onDisable() {

    	}

    	GetMultiple() {
    		let n = GameManager$2.curPlayer.curZaiKeNum >= this.bonusList.length ? this.bonusList.length - 1 : GameManager$2.curPlayer.curZaiKeNum;
    		return this.bonusList[n];
    	}
    	Init() {
    		var carid = PlayerData.GetUserData("selectCar");
    		if (PlayerData.shiyongCarId2 > 0) {
    			carid = PlayerData.shiyongCarId2;
    			PlayerData.shiyongCarId2 = 0;
    		}
    		else {
    			var youLiang = PlayerData.GetUserData("youLiang");
    			var carid = PlayerData.GetUserData("selectCar");
    			youLiang[carid] = GameManager$2.curPlayer.carYouLiang;
    			PlayerData.SetUserData("youLiang", youLiang);
    		}



    		var carConfig = GameManager$2.chekuConfig[carid];

    		this.beilv.text = "(" + carConfig.bonus + "倍)";
    		this.che.skin = "ChuZuChe/UIRes/cheB" + carid + ".png";



    		this.jinyan = 100;
    		this.feiyong = GameManager$2.RandomInt(500, 600) * this.GetMultiple();
    		this.shijian = GameManager$2.zongShiJian - GameManager$2.songdaShiJian;

    		this.xiaofei = parseInt(GameManager$2.xinqing * 5) * this.GetMultiple();
    		if (GameManager$2.songdaShiJian > 0) {
    			this.jiangli = 500;
    		}
    		else {
    			this.jiangli = 0;
    		}
    		this.jiangli *= this.GetMultiple();

    		let n = PlayerData.GetShuangbei();
    		this.jiangli *= n;
    		this.feiyong *= n;
    		this.xiaofei *= n;
    		//汽车加成
    		this.carJiaCheng = parseInt((this.xiaofei + this.jiangli + this.feiyong) * carConfig.bonus);

    		this.jyTex.text = this.jinyan + "EXP";
    		this.hdfyTex.text = this.feiyong;
    		this.hfsjTex.text = GameManager$2.TotIimeFormat(this.shijian);
    		this.jlTex.text = this.jiangli;
    		this.ckxfTex.text = this.xiaofei;
    		this.jiacheng.text = this.carJiaCheng;
    		for (var i = 1; i <= 5; i++) {
    			if (i > parseInt(GameManager$2.xinqing / 20)) {
    				this["xingxing" + i].visible = false;
    			}
    			else {
    				this["xingxing" + i].visible = true;
    			}
    		}
    		if (GameManager$2.xinqing >= 80) {
    			PlayerData.SetUserData("haopingNum", PlayerData.GetUserData("haopingNum") + 1);
    		}
    		PlayerData.SetUserData("gameTime", PlayerData.GetUserData("gameTime") + this.shijian);
    		PlayerData.AddExp(this.jinyan);
    		//PlayerData.AddProp(1,this.feiyong+this.jiangli+this.xiaofei+this.carJiaCheng) ;
    		PlayerData.SetUserData("zaikeNum", PlayerData.GetUserData("zaikeNum") + 1);
    		PlayerData.SaveData();

    		GameManager$2.curPlayer.ChaoPiaoNum += (this.feiyong + this.jiangli + this.xiaofei + this.carJiaCheng);
    		GameManager$2.curPlayer.curZaiKeNum += 1;
    	}
    	onUpdate() {
    		if (this.car.visible) {
    			var h = new Date().getHours();
    			var m = new Date().getMinutes();
    			var s = new Date().getSeconds();
    			GameManager$2.timeH = 24 - h;
    			GameManager$2.timeH = GameManager$2.timeH < 10 ? ('0' + GameManager$2.timeH) : GameManager$2.timeH;
    			GameManager$2.timeM = 60 - m;
    			GameManager$2.timeM = GameManager$2.timeM < 10 ? ('0' + GameManager$2.timeM) : GameManager$2.timeM;

    			GameManager$2.timeS = 60 - s;

    			GameManager$2.timeS = GameManager$2.timeS < 10 ? ('0' + GameManager$2.timeS) : GameManager$2.timeS;
    			this.time.text = GameManager$2.timeH + ":" + GameManager$2.timeM + ":" + GameManager$2.timeS;
    		}
    	}
    }
    PanelJieSuan.isClickkuang = false;

    class PanelJuQing extends Laya.Scene {

    	constructor() {
    		super();
    	}

    	onEnable() {
    		GameManager$2.goGame = false;
    		this.width = Laya.stage.width;
    		this.height = Laya.stage.height;
    		let id = GameManager$2.curSelectGuanQia + "-1";
    		let data = GameManager$2.juqingConfig;
    		var config = data[id];
    		this.desTex.text = config.juqing;
    		this.iconImg.skin = "ChuZuChe/UIRes/" + config.touxiang + ".png";

    		this.qdBtn.on(Laya.Event.CLICK, this, function () {
    			GameManager$2.goGame = true;
    			if (PlayerData.GetUserData("GuideIndex") == 2) {
    				PlayerData.SetUserData("GuideIndex", 3);
    				PlayerData.SaveData();
    				UIManager.ShowUIPanel("jiaocheng", false, {
    					"guideIndex": 1, "callback": function (code) {
    						if (code == 2) {
    							this.destroy();
    							UIManager.loadUI.loadFinish();
    						}
    					}.bind(this)
    				});
    			} else {
    				this.destroy();
    				UIManager.loadUI.loadFinish();
    			}
    		});
    	}

    	onDisable() {
    		if (!GameManager$2.goGame) {
    			if (UIManager.gameUI) {
    				UIManager.gameUI.destroy();
    				UIManager.gameUI = null;
    			}
    			if (GameManager$2.curScene) {
    				GameManager$2.curScene.destroy();
    				GameManager$2.curScene = null;
    			}
    			UIManager.ShowUIPanel("Main", true);
    			GameManager$2.gameState = "run";
    			Laya.timer.clearAll(this);
    		}
    	}
    }

    class PanelJuQing2 extends Laya.Scene {

    	constructor() {
    		super();
    	}

    	onEnable() {
    		this.width = Laya.stage.width;
    		this.height = Laya.stage.height;
    		console.log("open juqing2");
    		GameManager$2.PauseGame(true);
    		GameManager$2.curSelectGuanQia_main++;
    		let id = GameManager$2.curSelectGuanQia + "-" + GameManager$2.curSelectGuanQia_main;

    		let data = GameManager$2.juqingConfig;

    		var config = data[id];
    		this.desTex.text = config.juqing;
    		this.iconImg.skin = "ChuZuChe/UIRes/" + config.touxiang + ".png";
    		this.qdBtn.on(Laya.Event.CLICK, this, function () {
    			this.destroy();
    			GameManager$2.PauseGame(false);
    		});
    	}

    	onDisable() {
    	}
    }

    class LixianSy extends Laya.Scene {

    	constructor() {
    		super();

    	}

    	onEnable() {
    		this.width = Laya.stage.width;
    		this.height = Laya.stage.height;

    		this.fangqi.visible = true;

    		this.now_day = GameManager$2.getYearOfday();// new Date().getDate();//一个月中的某一天

    		var qiandaoDay = PlayerData.GetUserData("qiandaoDay");

    		var qiandao_time = PlayerData.GetUserData("qiandao_time");//
    		this.lingqu.on(Laya.Event.CLICK, this, function () {
    			GameManager$2.ShowVideo(function () {
    				PlayerData.AddProp(1, 1000);
    				this.destroy();
    				if (PlayerData.isMainlixian == false) {
    					PlayerData.isMainlixian = true;
    					UIManager.ShowUIPanel("Main");
    				}
    			}.bind(this));
    		});
    		this.fangqi.on(Laya.Event.CLICK, this, function () {
    			this.destroy();
    			if (PlayerData.isMainlixian == false) {
    				PlayerData.isMainlixian = true;
    				UIManager.ShowUIPanel("Main");
    			}
    		});
    	}

    	onDisable() {
    	}
    }

    class PanelLoading extends Laya.Scene {

    	constructor() {
    		super();
    	}

    	onEnable() {
    		GameManager_Collection.hideBackBtn();

    		this.width = Laya.stage.width;
    		this.height = Laya.stage.height;

    		UIManager.loadUI = this;
    		this.loadValue = 0;
    		this.curValue = 0;
    		this.onUpdate();
    		Laya.timer.frameLoop(1, this, this.onUpdate);

    		this.guanQiaTex.text = "第" + GameManager$2.curSelectGuanQia + "关";
    		if (GameManager$2.selectModel != 3) {
    			this.moshiImg.visible = false;
    			this.guanQiaTex.visible = false;
    		}
    		this.jiu.visible = GameManager$2.selectModel != 4;
    		this.xin.visible = GameManager$2.selectModel == 4;

    		this.stat = 0;
    	}

    	onUpdate() {
    		this.curValue += 0.003;
    		if (this.stat == 0 && this.curValue > 0.5) {
    			this.curValue = 0.5;
    		} else if (this.stat == 1 && this.curValue > 0.98) {
    			this.curValue = 0.98;
    		}
    		this.levelBar.mask.graphics.clear();
    		this.levelBar.mask.graphics.drawPie(38, 38, 50, this.curValue * 360 - 90, 270, "#ff0000");
    		this.jinduTex.text = (this.curValue * 100).toFixed(0) + "%";
    		if (this.stat == 0 && PlayerData.isLoaded) {
    			console.log("onSceneLoaded");
    			this.onSceneLoaded();
    			this.stat = 1;
    		}
    	}
    	onSceneLoaded() {
    		if (GameManager$2.curScene != null) {
    			GameManager$2.curScene.destroy();//销毁场景
    			GameManager$2.curScene = null;
    		}
    		var ln = Laya.URL.basePath + "res/ChuZuChe/Scene/Conventional/scene04.ls";
    		Laya.loader.create(ln,
    			Laya.Handler.create(this, function () {
    				console.log("onSceneLoaded22222222");
    				GameManager$2.curScene = Laya.loader.getRes(ln);
    				if (GameManager$2.curScene) {
    					if (UIManager.loadUI) {
    						Laya.stage.addChildAt(GameManager$2.curScene, 0);
    						if (GameManager$2.selectModel == 3) {
    							UIManager.ShowUIPanel("juqing");
    						}
    						else {
    							this.loadFinish();
    						}
    					}
    				} else {
    					this.onSceneLoaded();
    				}
    			}), Laya.Handler.create(this, function (p) {

    			}));
    	}

    	loadFinish() {
    		GameManager$2.zhuangjiNum = 0;
    		var gamePingZhi = PlayerData.GetUserData("gamePingZhi");
    		if (gamePingZhi == 1) {
    			PlayerData.gamePingZhi = 1;
    		}
    		else {
    			PlayerData.gamePingZhi = 3;
    		}
    		GameManager$2.updateTryCarNum(GameManager$2.selectModel != 4);

    		GameManager$2.curPlayer = GameManager$2.curScene.getChildByName("PlayerCamera").addComponent(PlayerControlBase);
    		GameManager$2.mainCamera = GameManager$2.curScene.getChildByName("PlayerCamera").getChildByName("Camera").getChildByName("Camera");
    		GameManager$2.cameraTrans = GameManager$2.curScene.getChildByName("PlayerCamera").transform;
    		GameManager$2.CameraMove = GameManager$2.curScene.getChildByName("PlayerCamera").addComponent(CameraMove);
    		GameManager$2.CameraAnimator = GameManager$2.curScene.getChildByName("PlayerCamera").getChildByName("Camera").getComponent(Laya.Animator);

    		if (UIManager.gameUI != null) {
    			UIManager.gameUI.destroy();
    			UIManager.gameUI = null;
    		}
    		UIManager.ShowUIPanel("Game");
    	}

    	onDisable() {
    		Laya.timer.clearAll(this);
    	}
    }

    class PanelMain extends Laya.Scene {
    	constructor() {
    		super();
    	}
    	onEnable() {
    		GameManager_Collection.showBackBtn();
    		this.width = Laya.stage.width;
    		this.height = Laya.stage.height;

    		console.log("PlayerData.IsCanLessProp(1, 100)" + PlayerData.IsCanLessProp(1, 100));

    		this.onUpdate();
    		Laya.timer.frameLoop(1, this, this.onUpdate);
    		let self = this;
    		this.name = "PanelMain";
    		this.showJinBi();
    		this.UpdateTitle();
    		GameManager$2.updateTryScene();
    		console.log("他来咯来咯=========" + PlayerData.GetUserData("GuanQia"));
    		this.ziyousuo.visible = PlayerData.GetUserData("ziyou") == 0;

    		self.tubiao.visible = false;

    		this.szBtn.on(Laya.Event.CLICK, this, function () {
    			UIManager.ShowUIPanel("Shezhi", false);
    		});


    		this.ziyousuo.on(Laya.Event.CLICK, this, function () {
    			UIManager.ShowUIPanel("ziyoumoshi", false);

    		});


    		this.qiandaoBtn.on(Laya.Event.CLICK, this, function () {
    			UIManager.ShowUIPanel("qiandao", false);
    		});

    		this.gengduoGame.on(Laya.Event.CLICK, this, function () {

    		});



    		this.chekuBtn.on(Laya.Event.CLICK, this, function () {

    			this.destroy();
    			UIManager.ShowUIPanel("cheku");
    			GameManager$2.PlaySound("ui_anjiansheng");
    		});
    		this.gongzuoBtn.on(Laya.Event.CLICK, this, function () {
    			this.destroy();
    			UIManager.ShowUIPanel("dituxuanze");
    			GameManager$2.selectModel = 2;
    			GameManager$2.PlaySound("ui_anjiansheng");
    		});
    		this.ziyouBtn.on(Laya.Event.CLICK, this, function () {
    			this.destroy();
    			console.log("1111111111111工作模式");
    			UIManager.ShowUIPanel("xuanzeguanqia");
    			GameManager$2.selectModel = 3;
    			GameManager$2.PlaySound("ui_anjiansheng");
    		});
    		this.bzBtn.on(Laya.Event.CLICK, this, function () {
    			UIManager.ShowUIPanel("bangzhu", false);
    		});
    		this.zhiyeBtn.on(Laya.Event.CLICK, this, function () {
    			UIManager.ShowUIPanel("Shengya", false);
    			GameManager$2.PlaySound("ui_anjiansheng");

    		});
    		this.zpbtn.on(Laya.Event.CLICK, this, function () {
    			UIManager.ShowUIPanel("ZhuanPan");
    		});
    		this.xingzuoBtn.on(Laya.Event.CLICK, this, function () {
    			UIManager.ShowUIPanel("XingZuo");
    		});
    		this.car.on(Laya.Event.MOUSE_DOWN, this, function () {
    			UIManager.ShowUIPanel("YongjiuCar", false);
    		});

    		if (GameManager$2.dayData.mainday_ChuZuChe <= GameManager$2.day) {
    			this.car.visible = false;
    		}
    		//免费金币
    		this.freeGoldBtn.on(Laya.Event.CLICK, this, function () {

    			let self = this;
    			var goldNum = [1000, 1250, 1500, 1750, 2000];
    			var buyGoldNum = PlayerData.GetUserData("buyGoldNum");
    			var _gold = goldNum[buyGoldNum] * PlayerData.GetShuangbei();
    			PlayerData.AddProp(1, _gold);
    			self.UpdateTitle();
    			if (buyGoldNum < 4) {
    				buyGoldNum++;
    			}
    			PlayerData.SetUserData("buyGoldNum", buyGoldNum);
    			PlayerData.SaveData();
    			self.showJinBi();
    		});


    		if (false == this.ShowGuide()) {
    			if (PlayerData.isMaincar == false) {//jj  其他渠道TD上报进入主界面人数
    				if (GameManager$2.dayData.mainday_ChuZuChe > GameManager$2.day) {
    					UIManager.ShowUIPanel("YongjiuCar");
    				}
    			}
    			let now_day = GameManager$2.getYearOfday();// new Date().getDate();//一个月中的某一天
    			var qiandao_time = PlayerData.GetUserData("qiandao_time");//

    			if (now_day != qiandao_time && PlayerData.canShowSign) {
    				PlayerData.canShowSign = false;
    				UIManager.ShowUIPanel("qiandao");
    			}

    			if (PlayerData.isMainlixian == false) {
    				if (!GameManager$2.isNewUser) {
    					UIManager.ShowUIPanel("Lixiansy");
    				}
    			}
    		}

    		if (PlayerData.isMain == false) {//jj  其他渠道TD上报进入主界面人数
    			PlayerData.isMain = true;
    			console.log("mainday_ChuZuChe:::::" + GameManager$2.dayData.mainday_ChuZuChe);
    			if (GameManager$2.dayData.mainday_ChuZuChe == GameManager$2.day && (GameManager$2.dayData.isclickyes == false)) {

    				UIManager.ShowUIPanel("YongjiuCar");


    			}
    		}

    		GameManager$2.PlayMusic("bj");
    		UIManager.mainUI = this;

    	}
    	onUpdate() {

    		if (this.car.visible) {
    			var h = new Date().getHours();
    			var m = new Date().getMinutes();
    			var s = new Date().getSeconds();
    			GameManager$2.timeH = 24 - h;
    			GameManager$2.timeH = GameManager$2.timeH < 10 ? ('0' + GameManager$2.timeH) : GameManager$2.timeH;
    			GameManager$2.timeM = 60 - m;
    			GameManager$2.timeM = GameManager$2.timeM < 10 ? ('0' + GameManager$2.timeM) : GameManager$2.timeM;

    			GameManager$2.timeS = 60 - s;

    			GameManager$2.timeS = GameManager$2.timeS < 10 ? ('0' + GameManager$2.timeS) : GameManager$2.timeS;
    			this.time.text = GameManager$2.timeH + ":" + GameManager$2.timeM + ":" + GameManager$2.timeS;
    		}
    	}
    	onDisable() {
    		UIManager.mainUI = null;
    		//  PlayerData.isMaincar = true;
    		Laya.timer.clearAll(this);
    	}
    	ZiyouUNLOCK20() {
    		let self = this;
    		console.log("可以解锁自由模式啦~~~·");
    		UIManager.ShowGameTipUI("恭喜你，自由模式解锁啦！！！");
    		Laya.timer.once(1000, this, function () {
    			self.ziyousuo.visible = false;
    		});
    		PlayerData.SetUserData("ziyou", 1);
    		// this.ziyou20Unlock.visible=true;
    		// Laya.timer.once(3000,this,function(){
    		//     self.ziyou20Unlock.visible=false;
    		// })
    		Laya.LocalStorage.setItem("UNLOCK20", 1);
    		this.UpdateTitle();

    	}
    	showJinBi() {
    		let self = this;
    		if (!GameManager$2.isSameDay()) {
    			PlayerData.SetUserData("buyGoldNum", 0);
    		}
    		var buyGoldNum = PlayerData.GetUserData("buyGoldNum");
    		if (buyGoldNum == 0) {

    			self.jin100.visible = true;
    			self.jin125.visible = false;
    			self.jin150.visible = false;
    			self.jin175.visible = false;
    			self.jin200.visible = false;

    		} else if (buyGoldNum == 1) {

    			self.jin100.visible = false;
    			self.jin125.visible = true;
    			self.jin150.visible = false;
    			self.jin175.visible = false;
    			self.jin200.visible = false;

    		} else if (buyGoldNum == 2) {

    			self.jin100.visible = false;
    			self.jin125.visible = false;
    			self.jin150.visible = true;
    			self.jin175.visible = false;
    			self.jin200.visible = false;

    		} else if (buyGoldNum == 3) {

    			self.jin100.visible = false;
    			self.jin125.visible = false;
    			self.jin150.visible = false;
    			self.jin175.visible = true;
    			self.jin200.visible = false;

    		} else if (buyGoldNum == 4) {

    			self.jin100.visible = false;
    			self.jin125.visible = false;
    			self.jin150.visible = false;
    			self.jin175.visible = false;
    			self.jin200.visible = true;

    		}
    	}
    	//显示引导
    	ShowGuide() {
    		if (PlayerData.GetUserData("GuideIndex") == 1) {
    			PlayerData.SetUserData("GuideIndex", 2);
    			PlayerData.SaveData();
    			UIManager.ShowUIPanel("jiaocheng", false, {
    				"guideIndex": 11, "callback": function (code) {
    					if (code == 12) {
    						this.destroy();
    						UIManager.ShowUIPanel("xuanzeguanqia");
    						GameManager$2.selectModel = 3;
    					}
    				}
    			});
    			return true;
    		}
    		return false;
    	}
    	UpdateTitle() {
    		this.levelValue.text = PlayerData.GetUserData("playerLevel");

    		var nextExp = GameManager$2.levelInfoConfig[PlayerData.GetUserData("playerLevel")].upexp;
    		var playerExp = PlayerData.GetUserData("playerExp");
    		this.levelBar.value = playerExp / nextExp;

    		this.chaopiaoText.text = UIManager.GoldFormat2(PlayerData.GetUserData("Gold"));
    	}

    }

    class PanelMeiYouTip extends Laya.Scene {

    	constructor() {
    		super();
    	}

    	onEnable() {
    		this.width = Laya.stage.width;
    		this.height = Laya.stage.height;
    		this.Init();
    		var speed = GameManager$2.curPlayer.moveSpeed;
    		// GameManager.curPlayer.moveSpeed = 0;
    		// GameManager.gameState = "pause";
    		GameManager$2.PauseGame(true);
    		this.name = "PanelMeiYouTip";
    		let self = this;
    		this.my.visible = GameManager$2.selectModel == 2;
    		this.jb.visible = GameManager$2.selectModel == 3;
    		let gold = PlayerData.GetUserData("Gold");
    		if (PlayerData.IsCanLessProp(1, 100) && true) {
    			self.jiayouBtn.visible = true;
    			self.huoquBtn.visible = false;
    		} else {
    			self.jiayouBtn.visible = false;
    			self.huoquBtn.visible = GameManager$2.selectModel == 2;
    		}
    		self.videojiayou.visible = GameManager$2.selectModel == 3;

    		self.guanbiBtn.visible = true;
    		this.guanbiBtn.on(Laya.Event.CLICK, this, function () {
    			if (GameManager$2.selectModel == 2) {

    			} else if (GameManager$2.selectModel == 3) {
    				GameManager$2.ExitGame();
    			}
    			UIManager.showMeiYouUI = null;
    			UIManager.Close(this);
    		});
    		this.jiayouBtn.on(Laya.Event.CLICK, this, this.onClickJiayou);
    		this.huoquBtn.on(Laya.Event.CLICK, this, this.onClickJiayou);

    		this.videojiayou.on(Laya.Event.CLICK, this, function () {
    			let self1 = this;
    			self.youtongAni.play(0, false);
    			self.youtongAni.once(Laya.Event.COMPLETE, self, function () {
    				UIManager.showMeiYouUI = null;
    				GameManager$2.curPlayer.AddQiYou();
    				GameManager$2.Jiayou();
    				PlayerData.SaveData();
    				UIManager.Close(self);
    				if (GameManager$2.selectModel == 3)
    					GameManager$2.Reload();
    			});
    		});
    	}
    	onClickJiayou() {
    		let self = this;
    		if (PlayerData.IsCanLessProp(1, 100) && true) {  //关闭钞票加油
    			UIManager.showMeiYouUI = null;
    			PlayerData.LessProp(1, 100);


    			self.youtongAni.play(0, false);
    			self.youtongAni.once(Laya.Event.COMPLETE, self, function () {
    				UIManager.showMeiYouUI = null;
    				GameManager$2.curPlayer.AddQiYou();
    				GameManager$2.Jiayou();
    				PlayerData.SaveData();
    				UIManager.Close(self);
    				if (GameManager$2.selectModel == 3)
    					GameManager$2.Reload();
    			});
    		}
    		else {//金币不足提示
    			self.youtongAni.play(0, false);
    			self.youtongAni.once(Laya.Event.COMPLETE, self, function () {
    				UIManager.showMeiYouUI = null;
    				GameManager$2.curPlayer.AddQiYou();
    				GameManager$2.Jiayou();
    				PlayerData.SaveData();
    				UIManager.Close(self);
    				if (GameManager$2.selectModel == 3)
    					GameManager$2.Reload();
    			});
    		}
    	}
    	onDisable() {
    	}

    	Init() {

    	}
    }

    class PanelPause extends Laya.Scene {

    	constructor() {
    		super();
    	}

    	onEnable() {
    		this.width = Laya.stage.width;
    		this.height = Laya.stage.height;

    		GameManager$2.curPlayer.ShaChe();
    		GameManager$2.gameState = "pause";
    		this.onUpdate();
    		Laya.timer.frameLoop(1, this, this.onUpdate);
    		this.Init();
    		this.car.on(Laya.Event.MOUSE_DOWN, this, function () {
    			UIManager.ShowUIPanel("YongjiuCar", false);
    		});
    		if (GameManager$2.dayData.mainday_ChuZuChe <= GameManager$2.day) {
    			this.car.visible = false;
    		}
    		this.jixuBtn.on(Laya.Event.CLICK, this, function () {
    			UIManager.Close(this);
    		});
    		this.quiteBtn.on(Laya.Event.CLICK, this, function () {
    			this.destroy();
    			GameManager$2.ExitGame();
    		});

    		this.huizhengBtn.on(Laya.Event.CLICK, this, function () {
    			UIManager.Close(this);
    			GameManager$2.curPlayer.XiuZhengChe();

    		});

    		this.jiedanBtn.on(Laya.Event.CLICK, this, function () {
    			UIManager.Close(this, "jiedan");
    		});

    		if (GameManager$2.selectModel == 3) {
    			this.jiedanBtn.visible = false;
    		}
    		GameManager$2.PlaySound("ziyoujiesuan");
    	}

    	onDisable() {
    	}
    	Init() {
    		this.dqsrTex.text = UIManager.GoldFormat2(GameManager$2.curPlayer.ChaoPiaoNum);
    		this.qbTex.text = UIManager.GoldFormat2(PlayerData.GetUserData("Gold"));
    		this.cgzkTex.text = GameManager$2.curPlayer.curZaiKeNum;
    		this.jyzTex.text = GameManager$2.curPlayer.curZaiKeNum * 100;


    	}
    	onUpdate() {
    		if (this.car.visible) {
    			var h = new Date().getHours();
    			var m = new Date().getMinutes();
    			var s = new Date().getSeconds();
    			GameManager$2.timeH = 24 - h;
    			GameManager$2.timeH = GameManager$2.timeH < 10 ? ('0' + GameManager$2.timeH) : GameManager$2.timeH;
    			GameManager$2.timeM = 60 - m;
    			GameManager$2.timeM = GameManager$2.timeM < 10 ? ('0' + GameManager$2.timeM) : GameManager$2.timeM;

    			GameManager$2.timeS = 60 - s;

    			GameManager$2.timeS = GameManager$2.timeS < 10 ? ('0' + GameManager$2.timeS) : GameManager$2.timeS;
    			this.time.text = GameManager$2.timeH + ":" + GameManager$2.timeM + ":" + GameManager$2.timeS;
    		}
    	}
    }

    class PanelQiandao extends Laya.Scene {

    	constructor() {
    		super();
    		/** @prop {name:intType, tips:"整数类型示例", type:Int, default:1000}*/
    		let intType = 1000;
    		/** @prop {name:numType, tips:"数字类型示例", type:Number, default:1000}*/
    		let numType = 1000;
    		/** @prop {name:strType, tips:"字符串类型示例", type:String, default:"hello laya"}*/
    		let strType = "hello laya";
    		/** @prop {name:boolType, tips:"布尔类型示例", type:Bool, default:true}*/
    		let boolType = true;
    		// 更多参数说明请访问: https://ldc2.layabox.com/doc/?nav=zh-as-2-4-0
    	}

    	onEnable() {
    		this.width = Laya.stage.width;
    		this.height = Laya.stage.height;
    		console.log("qiandao");
    		this.fangqi.x = 950;
    		this.now_day = GameManager$2.getYearOfday();// new Date().getDate();//一个月中的某一天

    		var qiandaoDay = PlayerData.GetUserData("qiandaoDay");

    		var qiandao_time = PlayerData.GetUserData("qiandao_time");//

    		this.fangqi.visible = true;
    		if (this.now_day == qiandao_time) {//判断今天是否已经签到

    			//普通领取

    			this.qiandaoButton.visible = false;
    			this.putongQiandap.visible = false;
    			//已签到标签
    			this.yiqiandaoBtn.visible = true;
    		} else {//未签到状态


    			//普通领取
    			this.qiandaoButton.visible = true;
    			this.putongQiandap.visible = true;

    			//已签到标签
    			this.yiqiandaoBtn.visible = false;
    			//   this.fangqi2.visible = false;

    			qiandaoDay = qiandaoDay % 7;
    			PlayerData.SetUserData("qiandaoDay", qiandaoDay);
    		}

    		var day = qiandaoDay + 1;
    		for (var i = 0; i < 7; i++) {
    			var index = i + 1;
    			var name = "hui" + index;
    			var duigou = this[name];
    			if (index >= day) {
    				duigou.visible = false;
    			} else {
    				duigou.visible = true;
    			}
    		}

    		//签到按钮
    		this.qiandaoButton.on(Laya.Event.CLICK, this, function () {
    			GameManager$2.ShowVideo(function () {
    				this.shuangbeiqiandao();
    			}.bind(this));
    		}.bind(this));
    		this.jjqiandaoBtn.on(Laya.Event.CLICK, this, function () {
    			if (PanelQiandao.isClickkuang) {
    				this.qiandao();
    			} else {
    				this.shuangbeiqiandao();
    			}


    		});
    		//放弃
    		this.fangqi.once(Laya.Event.CLICK, this, function () {
    			this.destroy();
    			if (UIManager.mainUI == null) {   //别的渠道记得改。 ----
    				console.log("isnull");
    				UIManager.ShowUIPanel("Main");
    			}
    			else {
    				UIManager.ShowUIPanel("Main");
    			}
    		});
    		this.putongQiandap.once(Laya.Event.CLICK, this, function () {
    			this.qiandao();
    		});

    		// this.fangqi2.on(Laya.Event.CLICK, this, function () {
    		//     this.destroy();
    		// });
    		this.yiqiandaoBtn.on(Laya.Event.CLICK, this, function () {
    			this.yiqdAni.play(0, false);
    		});

    		//===============jjjjjjjjj     复选框勾选点击事件  PanelQiandao.isClickkuang
    		this.kuang.on(Laya.Event.CLICK, this, function () {//jj

    			if (PanelQiandao.isClickkuang == false) {
    				PanelQiandao.isClickkuang = true;

    				this.jjgou.visible = false;

    			} else {
    				PanelQiandao.isClickkuang = false;
    				this.jjgou.visible = true;
    			}
    		});
    		//===============jjjjjjjjjj    签到按钮点击事件  是勾选调取双倍  去掉勾选调取普通
    	}

    	//签到
    	qiandao() {
    		if (PanelQiandao.isShowQianDao) {
    			return;
    		}
    		else {
    			var qiandaoDay = PlayerData.GetUserData("qiandaoDay");
    			PlayerData.SetUserData("qiandao_time", this.now_day);

    			qiandaoDay = qiandaoDay + 1;// 
    			if (qiandaoDay == 1) {
    				this["hui1"].visible = true;
    				this.gou1Ani.play(0, false);

    			} else if (qiandaoDay == 2) {
    				this["hui2"].visible = true;
    				this.gou2Ani.play(0, false);
    			} else if (qiandaoDay == 3) {
    				this["hui3"].visible = true;
    				this.gou3Ani.play(0, false);
    			} else if (qiandaoDay == 4) {
    				this["hui4"].visible = true;
    				this.gou4Ani.play(0, false);
    			} else if (qiandaoDay == 5) {
    				this["hui5"].visible = true;
    				this.gou5Ani.play(0, false);
    			} else if (qiandaoDay == 6) {
    				this["hui6"].visible = true;
    				this.gou6Ani.play(0, false);
    			} else if (qiandaoDay == 7) {
    				this["hui7"].visible = true;
    				this.gou7Ani.play(0, false);
    			}

    			var _gold = [1000, 1250, 1500, 1750, 2000, 2250, 3000];
    			this.qiandaoButton.visible = false;
    			this.putongQiandap.visible = false;
    			this.jjqiandaoBtn.visible = false;
    			this.jjgou.visible = false;
    			this.kuang.visible = false;
    			this.yiqiandaoBtn.visible = true;
    			PlayerData.SetUserData("qiandaoDay", qiandaoDay);
    			PlayerData.SaveData();

    			var parent = this.parent;
    			var PanelMain = parent.getChildByName("PanelMain");
    			PlayerData.AddProp(1, _gold[qiandaoDay - 1] * PlayerData.GetShuangbei());
    		}

    	}
    	//签到
    	shuangbeiqiandao() {
    		let self = this;
    		var qiandaoDay = PlayerData.GetUserData("qiandaoDay");
    		PlayerData.SetUserData("qiandao_time", self.now_day);
    		qiandaoDay = qiandaoDay + 1;// 
    		if (qiandaoDay == 1) {
    			self["hui1"].visible = true;
    			self.gou1Ani.play(0, false);

    		} else if (qiandaoDay == 2) {
    			self["hui2"].visible = true;
    			self.gou2Ani.play(0, false);
    		} else if (qiandaoDay == 3) {
    			self["hui3"].visible = true;
    			self.gou3Ani.play(0, false);
    		} else if (qiandaoDay == 4) {
    			self["hui4"].visible = true;
    			self.gou4Ani.play(0, false);
    		} else if (qiandaoDay == 5) {
    			self["hui5"].visible = true;
    			self.gou5Ani.play(0, false);
    		} else if (qiandaoDay == 6) {
    			self["hui6"].visible = true;
    			self.gou6Ani.play(0, false);
    		} else if (qiandaoDay == 7) {
    			self["hui7"].visible = true;
    			self.gou7Ani.play(0, false);
    		}
    		var _gold = [2000, 2500, 3000, 3500, 4000, 4500, 6000];
    		PlayerData.AddProp(1, _gold[qiandaoDay - 1] * PlayerData.GetShuangbei());
    		self.qiandaoButton.visible = false;
    		self.putongQiandap.visible = false;
    		self.jjqiandaoBtn.visible = false;
    		self.jjgou.visible = false;
    		self.kuang.visible = false;
    		self.yiqiandaoBtn.visible = true;
    		PlayerData.SetUserData("qiandaoDay", qiandaoDay);
    		PlayerData.SaveData();
    		PanelQiandao.isShowQianDao = true;
    		var parent = self.parent;
    		var PanelMain = parent.getChildByName("PanelMain");
    		PanelQiandao.chaopiao = _gold[qiandaoDay - 1];
    	}

    	onDisable() {

    	}
    }
    PanelQiandao.isShowQianDao = false;
    PanelQiandao.isClickkuang = false;

    class PanelQianDonghua extends Laya.Scene {

    	constructor() {
    		super();
    	}
    	onOpened(data) {
    		let cur = data[0];
    		let val = data[1];
    		if (val == 0)
    			return;
    		this.shang.visible = val > 0;
    		this.xia.visible = val < 0;
    		this.qianAni.play(0, false);
    		this.lab_cur.text = "" + UIManager.GoldFormat2(val);
    		this.qianAni.once(Laya.Event.COMPLETE, this, function () {
    			this.destroy();
    		});
    	}
    	onEnable() {
    		this.width = Laya.stage.width;
    		this.height = Laya.stage.height;
    	}

    	onDisable() {

    	}
    }

    class GoldText extends Laya.Scene {


    	onEnable() {
    		this.qianTex.text = "+100000";
    	}

    	onDisable() {
    	}
    }

    class Shareqidong extends Laya.Scene {

    	constructor() {
    		super();

    	}

    	onEnable() {
    		this.width = Laya.stage.width;
    		this.height = Laya.stage.height;

    		this.fangqi.visible = true;
    		this.lingqu.on(Laya.Event.CLICK, this, function () {
    			let self = this;
    		});
    		this.fangqi.on(Laya.Event.CLICK, this, function () {
    			this.destroy();
    		});
    	}

    	onDisable() {
    	}
    }

    //加油站加油
    class PanelJiaYouTip extends Laya.Scene {

    	constructor() {
    		super();
    	}

    	onEnable() {
    		this.width = Laya.stage.width;
    		this.height = Laya.stage.height;

    		let self = this;
    		self.guanbiBtn.visible = true;



    		this.name = "PanelJiaYouTip";
    		this.Init();
    		this.guanbiBtn.once(Laya.Event.CLICK, this, function () {
    			this.destroy();
    			if (GameManager$2.selectModel == 4) {
    				GameManager$2.ExitGame();
    				UIManager.ShowUIPanel("Main");
    			}

    		});

    		this.jiayouBtn.once(Laya.Event.CLICK, this, function () {
    			let self = this;
    			PlayerData.LessProp(1, this.qianNum);
    			self.youtongAni.play(0, false);
    			self.guanbiBtn.disabled = true;
    			self.youtongAni.once(Laya.Event.COMPLETE, self, function () {
    				self.destroy();
    				GameManager$2.curPlayer.AddQiYou();
    				PlayerData.SaveData();
    				if (GameManager$2.selectModel == 4) {
    					GameManager$2.selectModel = 3;
    					GameManager$2.ExitGame();
    					UIManager.ShowUIPanel("jiayou2");
    				}
    			});
    		});
    		this.jiayouBtn2.on(Laya.Event.CLICK, this, function () {
    			let self = this;
    			self.youtongAni.play(0, false);
    			self.youtongAni.once(Laya.Event.COMPLETE, self, function () {
    				self.destroy();
    				PlayerData.LessProp(1, this.qianNum);
    				GameManager$2.curPlayer.AddQiYou();
    				PlayerData.SaveData();
    				if (GameManager$2.selectModel == 4) {
    					GameManager$2.selectModel = 3;
    					GameManager$2.ExitGame();
    					UIManager.ShowUIPanel("jiayou2");
    				}
    			});

    		});
    	}

    	onDisable() {
    	}
    	Init() {
    		//        消耗油量*10*汽车油耗系数
    		let carid = PlayerData.GetUserData("selectCar");
    		let data = GameManager$2.chekuConfig[carid];
    		this.qianNum = parseInt((100 - GameManager$2.curPlayer.carYouLiang) * 10 * data.cost);

    		let b = PlayerData.IsCanLessProp(1, this.qianNum);
    		this.jiayouBtn2.visible = !b;
    		this.jiayouBtn.visible = b;
    		this.qianTex.text = this.qianNum;
    		this.qbTex.text = UIManager.GoldFormat2(PlayerData.GetUserData("Gold"));
    	}

    	updataqbTex() {
    		this.qbTex.text = UIManager.GoldFormat2(PlayerData.GetUserData("Gold"));
    	}
    }

    class PanelShengYa extends Laya.Scene {

    	constructor() {
    		super();
    	}

    	onEnable() {
    		this.width = Laya.stage.width;
    		this.height = Laya.stage.height;

    		this.UpdateTitle();
    		this.onUpdate();
    		Laya.timer.frameLoop(1, this, this.onUpdate);
    		this.car.on(Laya.Event.MOUSE_DOWN, this, function () {
    			UIManager.ShowUIPanel("YongjiuCar", false);
    		});
    		if (GameManager$2.dayData.mainday_ChuZuChe <= GameManager$2.day) {
    			this.car.visible = false;
    		}
    		this.backBtn.on(Laya.Event.CLICK, this, function () {
    			this.destroy();
    		});

    		this.shijianTex.text = (PlayerData.GetUserData("gameTime") / 3600).toFixed(1) + "h";
    		this.renshuTex.text = PlayerData.GetUserData("zaikeNum");
    		this.haopingTex.text = PlayerData.GetUserData("haopingNum");
    		this.dengjiTex.text = PlayerData.GetUserData("playerLevel");
    		this.chenghaoTex.skin = "ChuZuChe/UIRes/" + GameManager$2.levelInfoConfig[PlayerData.GetUserData("playerLevel")].chenghao + ".png";
    	}

    	onDisable() {
    	}

    	UpdateTitle() {
    		this.levelValue.text = PlayerData.GetUserData("playerLevel");
    		var nextExp = GameManager$2.levelInfoConfig[PlayerData.GetUserData("playerLevel")].upexp;
    		var playerExp = PlayerData.GetUserData("playerExp");
    		this.levelBar.value = playerExp / nextExp;

    		this.chaopiaoText.text = UIManager.GoldFormat2(PlayerData.GetUserData("Gold")); //PlayerData.GetUserData("Gold") ;
    	}
    	onUpdate() {
    		if (this.car.visible) {
    			var h = new Date().getHours();
    			var m = new Date().getMinutes();
    			var s = new Date().getSeconds();
    			GameManager$2.timeH = 24 - h;
    			GameManager$2.timeH = GameManager$2.timeH < 10 ? ('0' + GameManager$2.timeH) : GameManager$2.timeH;
    			GameManager$2.timeM = 60 - m;
    			GameManager$2.timeM = GameManager$2.timeM < 10 ? ('0' + GameManager$2.timeM) : GameManager$2.timeM;

    			GameManager$2.timeS = 60 - s;

    			GameManager$2.timeS = GameManager$2.timeS < 10 ? ('0' + GameManager$2.timeS) : GameManager$2.timeS;
    			this.time.text = GameManager$2.timeH + ":" + GameManager$2.timeM + ":" + GameManager$2.timeS;
    		}
    	}
    }

    class PanelSetting extends Laya.Scene {
    	constructor() {
    		super();
    	}

    	onEnable() {
    		this.width = Laya.stage.width;
    		this.height = Laya.stage.height;

    		this.onUpdate();
    		Laya.timer.frameLoop(1, this, this.onUpdate);
    		this.UpdateTitle();
    		this.ChangeShengYin();
    		this.ChangePinZhi();
    		this.car.on(Laya.Event.MOUSE_DOWN, this, function () {
    			UIManager.ShowUIPanel("YongjiuCar", false);
    		});
    		if (GameManager$2.dayData.mainday_ChuZuChe <= GameManager$2.day) {
    			this.car.visible = false;
    		}
    		this.sy.on(Laya.Event.CLICK, this, function () {
    			var yinliang = PlayerData.GetUserData("yinliang");
    			if (yinliang >= 1) {
    				yinliang = 0;
    			}
    			else {
    				yinliang = 1;
    			}
    			PlayerData.SetUserData("yinliang", yinliang);
    			PlayerData.SaveData();
    			this.ChangeShengYin();
    			GameManager$2.ChangeMusicVolume();
    		});
    		this.txzl.on(Laya.Event.CLICK, this, function () {
    			var gamePingZhi = PlayerData.GetUserData("gamePingZhi");
    			if (gamePingZhi == 1) {
    				gamePingZhi = 3;
    			}
    			else {
    				gamePingZhi = 1;
    			}
    			PlayerData.SetUserData("gamePingZhi", gamePingZhi);
    			PlayerData.SaveData();
    			this.ChangePinZhi();
    		});

    		this.backBtn.on(Laya.Event.CLICK, this, function () {
    			this.destroy();
    		});
    	}

    	onDisable() {
    	}
    	UpdateTitle() {
    		this.levelValue.text = PlayerData.GetUserData("playerLevel");
    		var nextExp = GameManager$2.levelInfoConfig[PlayerData.GetUserData("playerLevel")].upexp;
    		var playerExp = PlayerData.GetUserData("playerExp");
    		this.levelBar.value = playerExp / nextExp;

    		this.chaopiaoText.text = UIManager.GoldFormat2(PlayerData.GetUserData("Gold"));
    	}
    	ChangeShengYin() {
    		var yinliang = PlayerData.GetUserData("yinliang");
    		this.sy.getChildByName("on").visible = false;
    		this.sy.getChildByName("off").visible = false;
    		if (yinliang >= 1) {
    			this.sy.getChildByName("on").visible = true;
    		}
    		else {
    			this.sy.getChildByName("off").visible = true;
    		}
    	}
    	ChangePinZhi() {
    		var gamePingZhi = PlayerData.GetUserData("gamePingZhi");
    		this.txzl.getChildByName("on").visible = false;
    		this.txzl.getChildByName("off").visible = false;
    		if (gamePingZhi == 1) {
    			this.txzl.getChildByName("on").visible = true;
    		}
    		else {
    			this.txzl.getChildByName("off").visible = true;
    		}
    	}
    	onUpdate() {
    		if (this.car.visible) {
    			var h = new Date().getHours();
    			var m = new Date().getMinutes();
    			var s = new Date().getSeconds();
    			GameManager$2.timeH = 24 - h;
    			GameManager$2.timeH = GameManager$2.timeH < 10 ? ('0' + GameManager$2.timeH) : GameManager$2.timeH;
    			GameManager$2.timeM = 60 - m;
    			GameManager$2.timeM = GameManager$2.timeM < 10 ? ('0' + GameManager$2.timeM) : GameManager$2.timeM;

    			GameManager$2.timeS = 60 - s;

    			GameManager$2.timeS = GameManager$2.timeS < 10 ? ('0' + GameManager$2.timeS) : GameManager$2.timeS;
    			this.time.text = GameManager$2.timeH + ":" + GameManager$2.timeM + ":" + GameManager$2.timeS;
    		}
    	}
    }

    class PanelShiBai extends Laya.Scene {

    	constructor() {
    		super();
    	}

    	onEnable() {
    		this.width = Laya.stage.width;
    		this.height = Laya.stage.height;
    		let self = this;
    		console.log("当前失败：" + GameManager$2.selectModel);

    		self.backBtn.visible = true;


    		this.kuang.on(Laya.Event.CLICK, this, function () {//jj

    			if (PanelShiBai.isClickkuang == false) {
    				PanelShiBai.isClickkuang = true;
    				self.jjguanbiBtn.visible = true;
    				self.jjshiyongBtn.visible = false;
    				self.gou.visible = false;

    			} else {
    				PanelShiBai.isClickkuang = false;

    				self.jjshiyongBtn.visible = true;
    				self.jjguanbiBtn.visible = false;

    				self.gou.visible = true;
    			}
    		});


    		let YongYouCar = PlayerData.GetUserData("YongYouCar");
    		let tryCar = PlayerData.GetUserData("tryCar");
    		let max = 10;
    		let cur = max;
    		this.nextCar = -1;

    		for (; cur > 0; cur--) {
    			if (YongYouCar[cur] == 1 && tryCar[cur] == 0) {
    				break;
    			}
    		}
    		cur++;
    		if (cur > max)
    			cur = max;
    		this.tuisongCarId = cur;
    		this.che.skin = "ChuZuChe/UIRes/hbche" + (cur - 1) + ".png";

    		//=====================jj   PanelShiBai.isClickkuang 复选框点击事件
    		//===========================jjj使用按钮  勾选走使用   不勾选改变按钮状态走放弃
    		this.jjshiyongBtn.on(Laya.Event.CLICK, this, function () {
    			var selectCar = PlayerData.GetUserData("selectCar");
    			YongYouCar[this.tuisongCarId] = 1;

    			PlayerData.SetLastCar();

    			PlayerData.SetUserData("YongYouCar", YongYouCar);
    			PlayerData.SetUserData("selectCar", this.tuisongCarId);

    			//试用车辆
    			var tryCar = PlayerData.GetUserData("tryCar");
    			tryCar[this.tuisongCarId] = 1;
    			PlayerData.SetUserData("tryCar", tryCar);

    			var tryCarNum = PlayerData.GetUserData("tryCarNum");
    			tryCarNum[this.tuisongCarId] = 3;//试用次数


    			PlayerData.SetUserData("tryCarNum", tryCarNum);


    			PlayerData.SaveData();


    			UIManager.ShowUIPanel("Loading");
    			this.destroy();
    		});
    		this.jjguanbiBtn.on(Laya.Event.CLICK, this, function () {
    			this.destroy();
    			GameManager$2.ExitGame();
    		});
    		this.shiyongBtn.on(Laya.Event.CLICK, this, function () {
    			var selectCar = PlayerData.GetUserData("selectCar");
    			YongYouCar[this.tuisongCarId] = 1;

    			PlayerData.SetLastCar();

    			PlayerData.SetUserData("YongYouCar", YongYouCar);
    			PlayerData.SetUserData("selectCar", this.tuisongCarId);

    			//试用车辆
    			var tryCar = PlayerData.GetUserData("tryCar");
    			tryCar[this.tuisongCarId] = 1;
    			PlayerData.SetUserData("tryCar", tryCar);

    			var tryCarNum = PlayerData.GetUserData("tryCarNum");
    			tryCarNum[this.tuisongCarId] = 3;//试用次数


    			PlayerData.SetUserData("tryCarNum", tryCarNum);


    			PlayerData.SaveData();


    			UIManager.ShowUIPanel("Loading");
    			this.destroy();
    		});
    		this.backBtn.on(Laya.Event.CLICK, this, function () {
    			this.destroy();
    			GameManager$2.ExitGame();
    		});
    		Laya.timer.frameOnce(40, this, function () {
    			GameManager$2.PlaySound("dingdanshibai");
    		});
    		this.ChangeShiYong();
    	}

    	onDisable() {
    	}

    	ChangeShiYong() {
    		if (PlayerData.shiyongCarId2 > 0) {
    			PlayerData.shiyongCarId2 = 0;
    		}
    		else {
    			var youLiang = PlayerData.GetUserData("youLiang");
    			var carid = PlayerData.GetUserData("selectCar");
    			youLiang[carid] = GameManager$2.curPlayer.carYouLiang;
    			PlayerData.SetUserData("youLiang", youLiang);
    			PlayerData.SaveData();
    		}
    	}
    }
    PanelShiBai.isClickkuang = false;

    class PanelAllGuanQia extends Laya.Scene {

    	constructor() {
    		super();
    	}

    	onEnable() {
    		this.width = Laya.stage.width;
    		this.height = Laya.stage.height;

    		this.Init();
    		console.log("关卡：" + GameManager$2.curSelectGuanQia);
    		this.xuanguan.on(Laya.Event.CLICK, this, function () {
    			PlayerData.SaveData();
    			this.destroy();

    			UIManager.ShowUIPanel("xuanzeguanqia");

    			if (UIManager.gameUI) {
    				UIManager.gameUI.destroy();
    			}
    			if (GameManager$2.curScene) {
    				GameManager$2.curScene.destroy();
    				GameManager$2.curScene = null;
    			}

    		});
    		this.chongwan.on(Laya.Event.CLICK, this, function () {
    			this.destroy();
    			GameManager$2.curSelectGuanQia = 60;
    			UIManager.ShowUIPanel("Loading");
    		});
    	}

    	onDisable() {
    	}
    	Init() {
    		console.log("关卡：" + GameManager$2.curSelectGuanQia);
    		GameManager$2.curSelectGuanQia = 60;
    		var config = GameManager$2.guanqia3Config[GameManager$2.curSelectGuanQia];


    		var carid = PlayerData.GetUserData("selectCar");
    		if (PlayerData.shiyongCarId2 > 0) {
    			carid = PlayerData.shiyongCarId2;
    			PlayerData.shiyongCarId2 = 0;
    		}
    		else {
    			var youLiang = PlayerData.GetUserData("youLiang");
    			var carid = PlayerData.GetUserData("selectCar");
    			youLiang[carid] = GameManager$2.curPlayer.carYouLiang;
    			PlayerData.SetUserData("youLiang", youLiang);
    		}
    		var carConfig = GameManager$2.chekuConfig[carid];

    		PlayerData.SetUserData("GuanQia", 60);




    	}
    }

    class PanelTuiJian2 extends Laya.Scene {

    	constructor() {
    		super();
    	}

    	onEnable() {
    		this.width = Laya.stage.width;
    		this.height = Laya.stage.height;
    		// var gold = PlayerData.GetUserData("Gold") ;
    		// this.goldTex.text = gold;
    		//推送车辆
    		let self = this;
    		console.log("在执行吗？？？？？？？？");

    		self.fangqi.visible = true;

    		this.kuang.on(Laya.Event.CLICK, this, function () {//jj

    			if (PanelTuiJian2.isClickkuang == false) {

    				self.goushaibinimalegebazi.visible = false;

    				self.jjguanbiBtn.visible = true;
    				self.jjlingqu2.visible = false;
    				PanelTuiJian2.isClickkuang = true;

    			} else {
    				PanelTuiJian2.isClickkuang = false;
    				self.jjlingqu2.visible = true;
    				self.jjguanbiBtn.visible = false;
    				self.goushaibinimalegebazi.visible = true;

    			}

    		});

    		var YongYouCar = PlayerData.GetUserData("YongYouCar");
    		this.maxCarNum = 1;


    		for (let i = 11; i > this.maxCarNum; i--) {
    			let n = i - 1;
    			if (YongYouCar["" + n] != 1) {
    				this.tuisongCarId = n;
    				console.log("YongYouCar" + YongYouCar["" + n]);
    				var name = "tuisongche" + (n - 1);
    				console.log("1111111111name:" + name);
    				this[name].visible = true;
    				console.log("this[name].visible:" + this[name].visible);
    				break;
    			}
    		}

    		this.lingqu.on(Laya.Event.CLICK, this, function () {
    			let self = this;
    			console.log("this.tuisongCarId" + this.tuisongCarId);
    			if (UIManager.gameUI) {
    				UIManager.gameUI.destroy();
    			}
    			if (GameManager$2.curScene) {
    				GameManager$2.curScene.destroy();
    				GameManager$2.curScene = null;
    			}
    			var selectCar = PlayerData.GetUserData("selectCar");
    			//var YongYouCar = PlayerData.GetUserData("YongYouCar") ;
    			YongYouCar[this.tuisongCarId] = 1;
    			PlayerData.SetUserData("YongYouCar", YongYouCar);
    			PlayerData.SetLastCar();
    			PlayerData.SetUserData("selectCar", this.tuisongCarId);




    			//试用车辆
    			var tryCar = PlayerData.GetUserData("tryCar");
    			tryCar[this.tuisongCarId] = 1;


    			PlayerData.SetUserData("tryCar", tryCar);

    			var tryCarNum = PlayerData.GetUserData("tryCarNum");
    			tryCarNum[this.tuisongCarId] = 3;//试用次数3
    			PlayerData.SetUserData("tryCarNum", tryCarNum);

    			PlayerData.SaveData();
    			self.destroy();
    			if (GameManager$2.curSelectGuanQia >= PlayerData.Static.MaxMission)//上限60关 如果61应载入 敬请期待页面  如果以后变为120关 则=121时载入
    			{

    				UIManager.ShowUIPanel("tishi6");
    			}
    			else {

    				UIManager.ShowUIPanel("Loading");
    			}
    		});
    		this.jjlingqu2.on(Laya.Event.CLICK, this, function () {

    			let self = this;
    			if (UIManager.gameUI) {
    				UIManager.gameUI.destroy();
    			}
    			if (GameManager$2.curScene) {
    				GameManager$2.curScene.destroy();
    				GameManager$2.curScene = null;
    			}
    			var selectCar = PlayerData.GetUserData("selectCar");
    			//var YongYouCar = PlayerData.GetUserData("YongYouCar") ;
    			YongYouCar[this.tuisongCarId] = 1;
    			PlayerData.SetUserData("YongYouCar", YongYouCar);
    			PlayerData.SetLastCar();
    			PlayerData.SetUserData("selectCar", this.tuisongCarId);



    			//试用车辆
    			var tryCar = PlayerData.GetUserData("tryCar");
    			tryCar[this.tuisongCarId] = 1;
    			PlayerData.SetUserData("tryCar", tryCar);

    			var tryCarNum = PlayerData.GetUserData("tryCarNum");
    			tryCarNum[this.tuisongCarId] = 3;//试用次数
    			PlayerData.SetUserData("tryCarNum", tryCarNum);

    			PlayerData.SaveData();
    			self.destroy();
    			if (GameManager$2.curSelectGuanQia >= PlayerData.Static.MaxMission)//上限60关 如果61应载入 敬请期待页面  如果以后变为120关 则=121时载入
    			{

    				UIManager.ShowUIPanel("tishi6");
    			}
    			else {

    				UIManager.ShowUIPanel("Loading");
    			}
    		});
    		this.jjguanbiBtn.on(Laya.Event.CLICK, this, function () {
    			this.destroy();
    			if (GameManager$2.curSelectGuanQia >= PlayerData.Static.MaxMission)//上限60关 如果61应载入 敬请期待页面  如果以后变为120关 则=121时载入
    			{
    				UIManager.ShowUIPanel("tishi6");
    			}
    			else {
    				UIManager.ShowUIPanel("Loading");
    			};//xuanzeguanqia

    			if (UIManager.gameUI) {
    				UIManager.gameUI.destroy();
    			}
    			if (GameManager$2.curScene) {
    				GameManager$2.curScene.destroy();
    				GameManager$2.curScene = null;
    			}
    		});
    		this.lingqu.on(Laya.Event.CLICK, this, function () {
    			let self = this;
    			if (UIManager.gameUI) {
    				UIManager.gameUI.destroy();
    			}
    			if (GameManager$2.curScene) {
    				GameManager$2.curScene.destroy();
    				GameManager$2.curScene = null;
    			}
    			var selectCar = PlayerData.GetUserData("selectCar");
    			//var YongYouCar = PlayerData.GetUserData("YongYouCar") ;
    			YongYouCar[this.tuisongCarId] = 1;
    			PlayerData.SetUserData("YongYouCar", YongYouCar);
    			PlayerData.SetLastCar();
    			PlayerData.SetUserData("selectCar", this.tuisongCarId);



    			//试用车辆
    			var tryCar = PlayerData.GetUserData("tryCar");
    			tryCar[this.tuisongCarId] = 1;
    			PlayerData.SetUserData("tryCar", tryCar);

    			var tryCarNum = PlayerData.GetUserData("tryCarNum");
    			tryCarNum[this.tuisongCarId] = 3;//试用次数
    			PlayerData.SetUserData("tryCarNum", tryCarNum);

    			PlayerData.SaveData();
    			self.destroy();
    			if (GameManager$2.curSelectGuanQia >= PlayerData.Static.MaxMission)//上限60关 如果61应载入 敬请期待页面  如果以后变为120关 则=121时载入
    			{

    				UIManager.ShowUIPanel("tishi6");
    			}
    			else {

    				UIManager.ShowUIPanel("Loading");
    			}
    		});




    		this.fangqi.on(Laya.Event.CLICK, this, function () {
    			this.destroy();
    			if (GameManager$2.curSelectGuanQia >= PlayerData.Static.MaxMission)//上限60关 如果61应载入 敬请期待页面  如果以后变为120关 则=121时载入
    			{
    				UIManager.ShowUIPanel("tishi6");
    			}
    			else {
    				UIManager.ShowUIPanel("Loading");
    			};//xuanzeguanqia

    			if (UIManager.gameUI) {
    				UIManager.gameUI.destroy();
    			}
    			if (GameManager$2.curScene) {
    				GameManager$2.curScene.destroy();
    				GameManager$2.curScene = null;
    			}
    		});
    	}
    }
    PanelTuiJian2.isClickkuang = false;

    class PanelTuiJian4 extends Laya.Scene {

    	constructor() {
    		super();
    	}

    	onEnable() {
    		this.width = Laya.stage.width;
    		this.height = Laya.stage.height;
    		// var gold = PlayerData.GetUserData("Gold") ;
    		// this.goldTex.text = gold;
    		//推送车辆
    		let self = this;
    		self.fangqi.visible = true;

    		var YongYouCar = PlayerData.GetUserData("YongYouCar");
    		this.maxCarNum = 9;

    		// this.tuisongCarId = GameManager.RandomInt(1,9) ;
    		for (let i = 0; i < this.maxCarNum; i++) {
    			let n = i + 1;
    			if (YongYouCar["" + n] != 1) {
    				this.tuisongCarId = n;

    				var name = "tuisongche" + n;
    				this[name].visible = true;
    				break;
    			}
    		}

    		for (let i = 0; i < this.maxCarNum; i++) {
    			let n = i + 1;
    			//console.log("---------------------n:"+n);
    			if (this.tuisongCarId == n) {
    				var name = "tuisongche" + (n - 1);
    				this[name].visible = true;
    			} else {
    				var name = "tuisongche" + (n - 1);
    				if (this[name]) {
    					this[name].visible = false;
    				}

    			}
    		}

    		//console.log("-----------------this.tuisongCarId:"+this.tuisongCarId);

    		this.title.skin = "ChuZuChe/UIRes/title" + (this.tuisongCarId - 1) + ".png";

    		this.lingqu.on(Laya.Event.CLICK, this, function () {
    			let self = this;
    			self.destroy();
    		});



    		this.fangqi.on(Laya.Event.CLICK, this, function () {
    			this.destroy();
    			if (GameManager$2.curSelectGuanQia >= PlayerData.Static.MaxMission)//上限60关 如果61应载入 敬请期待页面  如果以后变为120关 则=121时载入
    			{
    				UIManager.ShowUIPanel("tishi6");
    			}
    			else {
    				UIManager.ShowUIPanel("Loading");
    			};//xuanzeguanqia

    			if (UIManager.gameUI) {
    				UIManager.gameUI.destroy();
    			}
    			if (GameManager$2.curScene) {
    				GameManager$2.curScene.destroy();
    				GameManager$2.curScene = null;
    			}
    		});
    	}
    }

    class JiesuanTuisong extends Laya.Scene {


    	constructor() {
    		super();
    	}
    	onEnable() {
    		this.width = Laya.stage.width;
    		this.height = Laya.stage.height;

    		let self = this;
    		self.fangqi.visible = true;

    		this.sharebtn.on(Laya.Event.CLICK, this, function () {
    			console.log("1111111111111111111点击分享");
    		});
    		this.fangqi.on(Laya.Event.CLICK, this, function () {
    			this.destroy();
    			if (GameManager$2.selectModel == 3) {
    				UIManager.ShowUIPanel("chenggong", true);
    			} else {
    				UIManager.ShowUIPanel("jiesuan", false);
    			}
    		});
    	}

    	onDisable() {
    	}


    }

    class PanelTuiJian6 extends Laya.Scene {

    	constructor() {
    		super();
    	}

    	onEnable() {
    		this.width = Laya.stage.width;
    		this.height = Laya.stage.height;

    		var TuiJianData = Laya.LocalStorage.getItem("tjData_ChuZuChe");
    		if (TuiJianData && TuiJianData.length > 0) {
    			PanelTuiJian6.tjData_ChuZuChe = JSON.parse(TuiJianData);
    		} else {
    			Laya.LocalStorage.setItem(JSON.stringify(PanelTuiJian6.tjData_ChuZuChe));
    		}

    		this.guanbiBtn.visible = true;
    		Laya.timer.loop(1000, this, this.tick);
    		let self = this;
    		GameManager$2.PauseGame(true);
    		let carid = UIManager.gameUI.nextCar;
    		this["tuisongche" + (carid - 1)].visible = true;

    		console.log("PanelTuiJian6.tjData_ChuZuChe.Tjnum" + PanelTuiJian6.tjData_ChuZuChe.Tjnum);


    		var config = GameManager$2.chekuConfig[carid];
    		let chaopiao = PlayerData.GetUserData("Gold");
    		let need = config.cpjg;
    		this.dizuoguang.visible = need <= chaopiao;
    		let v = chaopiao >= need ? 1 : chaopiao / need;
    		this.levelBar.value = v;
    		this.img.x = this.levelBar.width * v;
    		this.jindu.text = parseInt(v * 100) + "%";
    		this.need_gold.text = "" + (need > chaopiao ? need - chaopiao : 0);
    		this.julijiesuo.visible = v < 1;
    		this.kejiesuo.visible = v == 1;



    		this.cheti.skin = "ChuZuChe/UIRes/hbche" + (carid - 1) + ".png";
    		this.jiesuo1.visible = need > chaopiao;
    		this.jiesuo2.visible = need <= chaopiao;
    		this.lab.visible = need > chaopiao;

    		let t = PlayerData.GetUserData("shuangbei_t");
    		let l = PlayerData.GetUserData("shuangbei_l");

    		if (this.lab.visible) {
    			this.lab.text = parseInt(chaopiao / need * 100) + "%";
    		}
    		this.tanchuAni.play(0, false);
    		this.tanchuAni.once(Laya.Event.COMPLETE, this, function () {
    			this.jiesuoBtn.once(Laya.Event.CLICK, this, function () {
    				UIManager.Close(this);
    				GameManager$2.AutoBuy = UIManager.gameUI.nextCar;

    				UIManager.ShowUIPanel("cheku", false);

    				//GameManager.ExitGame("cheku");
    			});
    			this.guanbiBtn.once(Laya.Event.CLICK, this, this.close);
    			this.jiasuBtn.once(Laya.Event.CLICK, this, this.close);// {
    			this.shuangbei.on(Laya.Event.CLICK, this, function () {//jjjjjj
    				if (PanelTuiJian6.isClickkuang == false) {
    					console.log("zhuangtai " + PanelTuiJian6.isClickkuang);
    					PanelTuiJian6.isClickkuang = true;
    					console.log("zhuangtai3: " + PanelTuiJian6.isClickkuang);
    					self.gou.visible = false;
    					self.jjguanbi2Btn.visible = true;//=======开
    					self.jjspeedBtn.visible = false;//=======开
    				} else {
    					console.log("zhuangtai22 " + PanelTuiJian6.isClickkuang);


    					self.gou.visible = true;
    					self.jjguanbi2Btn.visible = false;//=======开
    					self.jjspeedBtn.visible = true;//=======开
    					PanelTuiJian6.isClickkuang = false;
    				}
    			});
    			this.jjguanbi2Btn.once(Laya.Event.CLICK, this, this.close); //jjjjj
    			this.jjspeedBtn.on(Laya.Event.CLICK, this, function () {//jjjjjj
    				if (t == 0) {
    					t = (new Date()).getTime() / 1000;
    				}
    				l += PlayerData.Static.ShuangBeiTime;
    				PlayerData.SetUserData("shuangbei_t", t);
    				PlayerData.SetUserData("shuangbei_l", l);
    				UIManager.Close(self);
    			});

    			this.speedBtn.on(Laya.Event.CLICK, this, function () {
    				if (PanelTuiJian6.tjData_ChuZuChe.Tjnum == 1) {
    					if (t == 0) {
    						t = (new Date()).getTime() / 1000;
    					}
    					l += PlayerData.Static.ShuangBeiTime;
    					PlayerData.SetUserData("shuangbei_t", t);
    					PlayerData.SetUserData("shuangbei_l", l);
    					UIManager.Close(self);
    				} else {
    					if (t == 0) {
    						t = (new Date()).getTime() / 1000;
    					}
    					l += PlayerData.Static.ShuangBeiTime;
    					PlayerData.SetUserData("shuangbei_t", t);
    					PlayerData.SetUserData("shuangbei_l", l);
    					UIManager.Close(self);
    				}

    			});
    		});

    		console.log("1111111111111111sanmu");
    		this.jiasuBtn.visible = need > chaopiao && l > 0;
    		this.speedBtn.visible = need > chaopiao && l <= 0;
    		this.jiesuoBtn.visible = need <= chaopiao;



    		this.cxleble.visible = t > 0;
    		this.sp.visible = !this.cxleble.visible;
    		if (this.cxleble.visible) {
    			let s = l - ((new Date()).getTime() / 1000 - t);

    			s = s > 0 ? s : 0;
    			this.cxleble.text = GameManager$2.getFormatTime(parseInt(s));
    			if (s <= 0) {
    				PlayerData.SetUserData("shuangbei_t", 0);
    				PlayerData.SetUserData("shuangbei_l", 0);
    				this.sp.visible = true;
    				this.cxleble.visible = false;
    			}
    			else {
    				this.sp.visible = false;
    				this.cxleble.visible = true;
    			}
    		}
    	}
    	close() {
    		this.jiesuoAni.play(0, false);

    		this.jiesuoAni.once(Laya.Event.COMPLETE, this, function () {
    			UIManager.Close(this);
    		});
    	}
    	tick() {
    		if (this.cxleble.visible == false) {
    			return;
    		}
    		let t = PlayerData.GetUserData("shuangbei_t");
    		let l = PlayerData.GetUserData("shuangbei_l");

    		let s = l - ((new Date()).getTime() / 1000 - t);

    		s = s > 0 ? s : 0;

    		this.cxleble.text = GameManager$2.getFormatTime(parseInt(s));

    		if (s <= 0) {
    			PlayerData.SetUserData("shuangbei_t", 0);
    			PlayerData.SetUserData("shuangbei_l", 0);


    			this.sp.visible = true;
    			this.cxleble.visible = false;
    			this.speedBtn.visible = true;
    			this.jiasuBtn.visible = false;
    			this.jiesuoBtn.visible = false;
    		}
    	}
    }
    PanelTuiJian6.isClickkuang = false;
    PanelTuiJian6.tjData_ChuZuChe = {
    	Tjnum: 1,

    };

    class Config {


    	static getLotteryID() {
    		let num = Math.floor(Math.random() * 100);
    		console.log("============================num" + num);
    		if (num < Config.probData[0]) {
    			console.log("======================0");
    			return 0;
    		} else if (num < Config.probData[0] + Config.probData[1]) {
    			console.log("======================1");
    			return 1;
    		} else if (num < Config.probData[0] + Config.probData[1] + Config.probData[2]) {
    			console.log("======================2");
    			return 2;
    		} else if (num < Config.probData[0] + Config.probData[1] + Config.probData[2] + Config.probData[3]) {
    			console.log("===================3");
    			return 3;
    		} else if (num < Config.probData[0] + Config.probData[1] + Config.probData[2] + Config.probData[3] + Config.probData[4]) {
    			console.log("============================4");
    			return 4;
    		} else if (num < Config.probData[0] + Config.probData[1] + Config.probData[2] + Config.probData[3] + Config.probData[4] + Config.probData[5]) {
    			console.log("=========================5");
    			return 5;
    		}
    	}
    	static getid() {
    		let num = Math.floor(Math.random() * 100);
    		console.log("============================num" + num);
    		if (num < Config.probData[0]) {
    			console.log("======================0");
    			return 0;
    		} else {
    			console.log("======================1");
    			return 1;
    		}

    	}
    	static XzId() {
    		let num = Math.floor(Math.random() * 100);
    		console.log("============================num" + num);
    		if (num < Config.probDataXZ[0]) {
    			console.log("======================0");
    			return 0;
    		} else if (num < Config.probDataXZ[0] + Config.probDataXZ[1]) {
    			console.log("======================1");
    			return 1;
    		} else if (num < Config.probDataXZ[0] + Config.probDataXZ[1] + Config.probDataXZ[2]) {
    			console.log("======================2");
    			return 2;
    		} else if (num < Config.probDataXZ[0] + Config.probDataXZ[1] + Config.probDataXZ[2] + Config.probDataXZ[3]) {
    			console.log("===================3");
    			return 3;
    		} else if (num < Config.probDataXZ[0] + Config.probDataXZ[1] + Config.probDataXZ[2] + Config.probDataXZ[3] + Config.probDataXZ[4]) {
    			console.log("============================4");
    			return 4;
    		} else if (num < Config.probDataXZ[0] + Config.probDataXZ[1] + Config.probDataXZ[2] + Config.probDataXZ[3] + Config.probDataXZ[4] + Config.probDataXZ[5]) {
    			console.log("=========================5");
    			return 5;
    		}
    		else if (num < Config.probDataXZ[0] + Config.probDataXZ[1] + Config.probDataXZ[2] + Config.probDataXZ[3] + Config.probDataXZ[4] + Config.probDataXZ[5] + Config.probDataXZ[6]) {
    			console.log("=========================5");
    			return 6;
    		}
    	}
    	static setSignNum() {
    		Config.data.signNum++;
    	}
    }

    Config.data = {
    	signNum: 0,
    };
    Config.probData = [15, 12, 39, 5, 20, 9];//转盘抽奖
    Config.probData1 = [50, 50];//转盘首次
    Config.gearInfo = ['500钞票', '700钞票', '100钞票', '试用新车', '300钞票', '加油'];//转盘
    Config.gearInfo1 = ['500钞票', '700钞票'];//转盘首次
    Config.probDataXZ = [20, 12, 31, 5, 15, 8, 9];//星座抽奖
    Config.gearInfoXZ = ['500钞票', '奖励翻倍', '100钞票', '试用高级新车', '2000钞票', '加油', "试用低级新车"];//星座奖品

    class xingzuo extends Laya.Scene {

    	constructor() {
    		super();

    	}

    	onEnable() {
    		GameManager_Collection.hideBackBtn();
    		this.width = Laya.stage.width;
    		this.height = Laya.stage.height;

    		var xzData_ChuZuChe = Laya.LocalStorage.getItem("xzData_ChuZuChe");
    		if (xzData_ChuZuChe && xzData_ChuZuChe.length > 0) {
    			xingzuo.xzData_ChuZuChe = JSON.parse(xzData_ChuZuChe);
    		} else {
    			Laya.LocalStorage.setItem(JSON.stringify(xingzuo.xzData_ChuZuChe));
    		}
    		var day = new Date().getDate();

    		//新的一天
    		if (xingzuo.xzData_ChuZuChe.xzDay != day) {

    			xingzuo.xzData_ChuZuChe.xzDay = day;
    			for (let i = 0; i < xingzuo.xzData_ChuZuChe.shouhuHs.length; i++) {
    				xingzuo.xzData_ChuZuChe.shouhuHs[i] = 0;//灰色按钮隐藏
    			}
    			xingzuo.xzData_ChuZuChe.chaopiao500 = 0,
    				xingzuo.xzData_ChuZuChe.chaopiao2000 = 0,
    				xingzuo.xzData_ChuZuChe.chaopiao100 = 0,
    				Laya.LocalStorage.setItem("xzData_ChuZuChe", JSON.stringify(xingzuo.xzData_ChuZuChe));
    		}

    		this.close.on(Laya.Event.CLICK, this, function () {
    			this.destroy();
    			UIManager.ShowUIPanel("Main");
    		});

    		this.ygsh.on(Laya.Event.CLICK, this, function () {
    			GameManager$2.ShowVideo(function () {
    				this.showDaoju();
    				xingzuo.xzData_ChuZuChe.shouhuHs[0] = 1;//灰色按钮显示
    				Laya.LocalStorage.setItem("xzData_ChuZuChe", JSON.stringify(xingzuo.xzData_ChuZuChe));
    				var name = "hui" + (0);
    				this[name].visible = true;
    			}.bind(this));
    		});
    		this.kysh.on(Laya.Event.CLICK, this, function () {
    			GameManager$2.ShowVideo(function () {
    				this.showDaoju();
    				xingzuo.xzData_ChuZuChe.shouhuHs[1] = 1;//灰色按钮显示
    				Laya.LocalStorage.setItem("xzData_ChuZuChe", JSON.stringify(xingzuo.xzData_ChuZuChe));
    				var name = "hui" + (1);
    				this[name].visible = true;
    			}.bind(this));
    		}); //
    		this.yhsh.on(Laya.Event.CLICK, this, function () {
    			GameManager$2.ShowVideo(function () {
    				this.showDaoju();
    				xingzuo.xzData_ChuZuChe.shouhuHs[2] = 1;//灰色按钮显示
    				Laya.LocalStorage.setItem("xzData_ChuZuChe", JSON.stringify(xingzuo.xzData_ChuZuChe));
    				var name = "hui" + (2);
    				this[name].visible = true;
    			}.bind(this));
    		});
    		this.tqsh.on(Laya.Event.CLICK, this, function () {
    			GameManager$2.ShowVideo(function () {
    				this.showDaoju();
    				xingzuo.xzData_ChuZuChe.shouhuHs[3] = 1;//灰色按钮显示
    				Laya.LocalStorage.setItem("xzData_ChuZuChe", JSON.stringify(xingzuo.xzData_ChuZuChe));
    				var name = "hui" + (3);
    				this[name].visible = true;
    			}.bind(this));
    		});
    		this.tjish.on(Laya.Event.CLICK, this, function () {
    			GameManager$2.ShowVideo(function () {
    				this.showDaoju();
    				xingzuo.xzData_ChuZuChe.shouhuHs[4] = 1;//灰色按钮显示
    				Laya.LocalStorage.setItem("xzData_ChuZuChe", JSON.stringify(xingzuo.xzData_ChuZuChe));
    				var name = "hui" + (4);
    				this[name].visible = true;
    			}.bind(this));
    		});
    		this.txsh.on(Laya.Event.CLICK, this, function () {
    			GameManager$2.ShowVideo(function () {
    				this.showDaoju();
    				xingzuo.xzData_ChuZuChe.shouhuHs[5] = 1;//灰色按钮显示
    				Laya.LocalStorage.setItem("xzData_ChuZuChe", JSON.stringify(xingzuo.xzData_ChuZuChe));
    				var name = "hui" + (5);
    				this[name].visible = true;
    			}.bind(this));
    		});
    		this.TianShush.on(Laya.Event.CLICK, this, function () {
    			GameManager$2.ShowVideo(function () {
    				this.showDaoju();
    				xingzuo.xzData_ChuZuChe.shouhuHs[6] = 1;//灰色按钮显示
    				Laya.LocalStorage.setItem("xzData_ChuZuChe", JSON.stringify(xingzuo.xzData_ChuZuChe));
    				var name = "hui" + (6);
    				this[name].visible = true;
    			}.bind(this));
    		});
    		this.lingqu.on(Laya.Event.CLICK, this, function () {
    			this.lingquBtn();
    		});
    		for (let i = 0; i < xingzuo.xzData_ChuZuChe.shouhuHs.length; i++) {//设置灰色按钮状态

    			if (xingzuo.xzData_ChuZuChe.shouhuHs[i] == 0) {

    				var name = "hui" + (i);
    				this[name].visible = false;

    			} else {
    				var name = "hui" + (i);
    				this[name].visible = true;
    			}

    		}
    	}
    	showDaoju() {
    		console.log("11111111111" + GameManager$2.isNewUser);
    		xingzuo.targetID = Config.XzId();
    		if (GameManager$2.isNewUser) {
    			if (!xingzuo.xzData_ChuZuChe.isClick) {
    				console.log("222");
    				xingzuo.xzData_ChuZuChe.isClick = true;
    				Laya.LocalStorage.setItem("xzData_ChuZuChe", JSON.stringify(xingzuo.xzData_ChuZuChe));
    				this.huode.visible = true;
    				this.bg1.visible = true;
    				this.wupin6.visible = true;
    				xingzuo.targetID = 6;
    			} else {
    				this.huode.visible = true;
    				this.bg1.visible = true;
    				var name = "wupin" + (xingzuo.targetID);
    				this[name].visible = true;
    			}
    		} else {
    			this.huode.visible = true;
    			this.bg1.visible = true;
    			var name = "wupin" + (xingzuo.targetID);
    			this[name].visible = true;
    		}

    	}
    	lingquBtn() {
    		switch (xingzuo.targetID) {//['500钞票', '奖励翻倍', '100钞票', '试用高级新车', '200钞票', '加油',"试用低级新车"];
    			case 0://
    				PlayerData.AddProp(1, 500);
    				xingzuo.xzData_ChuZuChe.chaopiao500++;
    				Laya.LocalStorage.setItem("xzData_ChuZuChe", JSON.stringify(xingzuo.xzData_ChuZuChe));
    				console.log("500");
    				break;
    			case 1:
    				console.log("奖励翻倍");
    				let jinbin = (xingzuo.xzData_ChuZuChe.chaopiao2000 * 2000) + (xingzuo.xzData_ChuZuChe.chaopiao500 * 500) + (xingzuo.xzData_ChuZuChe.chaopiao100 * 100);

    				console.log("xingzuo.xzData_ChuZuChe.chaopiao2000*2000::::::" + (xingzuo.xzData_ChuZuChe.chaopiao2000 * 2000) + "xingzuo.xzData_ChuZuChe.chaopiao500*500::::" + (xingzuo.xzData_ChuZuChe.chaopiao500 * 500) + "xingzuo.xzData_ChuZuChe.chaopiao100*100::::::" + (xingzuo.xzData_ChuZuChe.chaopiao100 * 100));
    				if (jinbin != 0) {
    					PlayerData.AddProp(1, jinbin);
    				} else {
    					UIManager.ShowGameTipUI("今日还没有获得奖励哦");
    				}

    				break;
    			case 2:
    				PlayerData.AddProp(1, 100);
    				xingzuo.xzData_ChuZuChe.chaopiao100++;
    				Laya.LocalStorage.setItem("xzData_ChuZuChe", JSON.stringify(xingzuo.xzData_ChuZuChe));
    				console.log("100钞票");
    				break;
    			case 3:
    				console.log("试用高级新车");
    				var YongYouCar = PlayerData.GetUserData("YongYouCar");
    				if (YongYouCar["" + 10] == 1) {
    					UIManager.ShowGameTipUI("已有车辆折成700钞票");
    					console.log("有车了====给金币");
    					PlayerData.AddProp(1, 700);
    				}
    				else {
    					var selectCar = PlayerData.GetUserData("selectCar");
    					YongYouCar[10] = 1;
    					PlayerData.SetUserData("YongYouCar", YongYouCar);
    					PlayerData.SetLastCar();
    					PlayerData.SetUserData("selectCar", 10);
    					var tryCar = PlayerData.GetUserData("tryCar");
    					tryCar[10] = 1;
    					PlayerData.SetUserData("tryCar", tryCar);
    					var tryCarNum = PlayerData.GetUserData("tryCarNum");
    					tryCarNum[10] = 3;//试用次数
    					PlayerData.SetUserData("tryCarNum", tryCarNum);
    					PlayerData.SaveData();
    				}
    				break;
    			case 4:
    				console.log("2000钞票");
    				PlayerData.AddProp(1, 2000);
    				xingzuo.xzData_ChuZuChe.chaopiao2000++;
    				Laya.LocalStorage.setItem("xzData_ChuZuChe", JSON.stringify(xingzuo.xzData_ChuZuChe));
    				break;
    			case 5:
    				console.log("加油");
    				GameManager$2.Jiayou();
    				//this.youtongAni.play(0, false);
    				break;
    			case 6:
    				console.log("试用低级新车");
    				var YongYouCar = PlayerData.GetUserData("YongYouCar");
    				if (YongYouCar["" + 2] == 1) {
    					UIManager.ShowGameTipUI("已有车辆折成2000钞票");
    					console.log("有车了====给金币");
    					PlayerData.AddProp(1, 2000);
    				}
    				else {
    					var selectCar = PlayerData.GetUserData("selectCar");
    					YongYouCar[2] = 1;
    					PlayerData.SetUserData("YongYouCar", YongYouCar);
    					PlayerData.SetLastCar();
    					PlayerData.SetUserData("selectCar", 2);
    					var tryCar = PlayerData.GetUserData("tryCar");
    					tryCar[2] = 1;
    					PlayerData.SetUserData("tryCar", tryCar);
    					var tryCarNum = PlayerData.GetUserData("tryCarNum");
    					tryCarNum[2] = 3;//试用次数
    					PlayerData.SetUserData("tryCarNum", tryCarNum);
    					PlayerData.SaveData();
    				}
    				break;

    		}
    		this.huode.visible = false;
    		this.bg1.visible = false;
    		var name = "wupin" + (xingzuo.targetID);
    		this[name].visible = false;
    	}
    	onDisable() {
    		Laya.timer.clearAll(this);
    		GameManager_Collection.showBackBtn();
    	}
    }

    xingzuo.targetID = 7;
    xingzuo.xzData_ChuZuChe = {
    	isClick: false,////新玩家是否点击过看视频   点击过后再次点击则随机发道具
    	xzDay: 0,
    	shouhuHs: [0, 0, 0, 0, 0, 0, 0],//守护按钮灰色状态  0为隐藏 1为显示
    	chaopiao500: 0,
    	chaopiao2000: 0,
    	chaopiao100: 0,
    };

    class PanelGuanQia extends Laya.Scene {

    	constructor() {
    		super();
    	}

    	onEnable() {
    		this.width = Laya.stage.width;
    		this.height = Laya.stage.height;

    		this.Init();
    		this.onUpdate();

    		console.log("来选择关卡？？？？");
    		PlayerData.isXuanZe = true;
    		Laya.timer.frameLoop(1, this, this.onUpdate);
    		this.car.on(Laya.Event.MOUSE_DOWN, this, function () {
    			UIManager.ShowUIPanel("YongjiuCar", false);
    		});
    		if (GameManager$2.dayData.mainday_ChuZuChe <= GameManager$2.day) {
    			this.car.visible = false;
    		}
    		this.backBtn.on(Laya.Event.CLICK, this, function () {
    			this.destroy();
    			UIManager.ShowUIPanel("Main");
    		});
    		this.left.on(Laya.Event.CLICK, this, function () {
    			var v = parseInt(this.Panel01.hScrollBar.value / 1200) - 1;

    			Laya.Tween.to(this.Panel01.hScrollBar, { value: v * 1260 }, 200);
    		});
    		this.right.on(Laya.Event.CLICK, this, function () {
    			var v = parseInt(this.Panel01.hScrollBar.value / 1200) + 1;
    			Laya.Tween.to(this.Panel01.hScrollBar, { value: v * 1260 }, 200);

    		});
    		//        
    		var Star = PlayerData.GetUserData("starNum");
    		let self = this;
    		for (let i = 1; i <= PlayerData.Static.MaxMission; i++) {
    			if (i <= PlayerData.GetUserData("GuanQia")) {
    				this["guan" + i].getChildByName("weijs").visible = false;
    				let xuanzelist = parseInt(i / 10); //ln
    				console.log("xuanze:" + xuanzelist);
    				var v = parseInt(this.Panel01.hScrollBar.value / 1200) + xuanzelist;
    				Laya.Tween.to(this.Panel01.hScrollBar, { value: v * 1260 }, 200);
    			}
    			else {

    				this["guan" + i].getChildByName("weijs").visible = true;
    			}
    			for (var j = 1; j <= 3; j++) {
    				if (j <= Star[i]) {
    					//console.log("----------------i:"+i);
    					this["star" + i].getChildByName("num" + j).visible = false;
    				}
    			}


    			//选择关卡
    			this["guan" + i].on(Laya.Event.CLICK, this, function () {
    				var youLiang = PlayerData.GetUserData("youLiang");
    				var carid = PlayerData.GetUserData("selectCar");
    				if (i <= PlayerData.GetUserData("GuanQia")) {
    					console.log("GameManager.passTimes:" + GameManager$2.passTimes);
    					if (GameManager$2.passTimes % 3 == 1 && GameManager$2.passTimes != GameManager$2.passNow) {
    						this.addChild(new sureVideo(function () {
    							this.destroy();
    							GameManager$2.curSelectGuanQia = i;
    							if (youLiang[carid] < 40) {
    								UIManager.ShowUIPanel("jiayou");
    							} else {
    								UIManager.ShowUIPanel("Loading");
    							}
    						}.bind(this)));
    					} else {
    						this.destroy();
    						GameManager$2.curSelectGuanQia = i;
    						if (youLiang[carid] < 40) {
    							UIManager.ShowUIPanel("jiayou");
    						} else {
    							UIManager.ShowUIPanel("Loading");
    						}
    					}
    				} else {
    					this.ani2.play(0, false);
    				}
    			});
    		}

    		this.Panel01.hScrollBar.on("change", this, function () {
    			this.UpdateDian();
    		});
    		this.UpdateDian();

    	}

    	onDisable() {
    		PlayerData.isXuanZe = false;
    	}

    	Init() {
    		this.Panel01.hScrollBarSkin = 'ChuZuChe/comp/hscroll.png';
    		this.Panel01.elasticEnabled = true;
    		this.Panel01.hScrollBar.hide = true;
    	}
    	UpdateDian() {
    		var v = parseInt(this.Panel01.hScrollBar.value / 1200);
    		for (var i = 1; i <= 8; i++) {
    			if (i == v + 1) {
    				this["d" + i].visible = true;
    			}
    			else {
    				this["d" + i].visible = false;
    			}
    		}
    	}
    	onUpdate() {
    		if (this.car.visible) {
    			var h = new Date().getHours();
    			var m = new Date().getMinutes();
    			var s = new Date().getSeconds();
    			GameManager$2.timeH = 24 - h;
    			GameManager$2.timeH = GameManager$2.timeH < 10 ? ('0' + GameManager$2.timeH) : GameManager$2.timeH;
    			GameManager$2.timeM = 60 - m;
    			GameManager$2.timeM = GameManager$2.timeM < 10 ? ('0' + GameManager$2.timeM) : GameManager$2.timeM;

    			GameManager$2.timeS = 60 - s;

    			GameManager$2.timeS = GameManager$2.timeS < 10 ? ('0' + GameManager$2.timeS) : GameManager$2.timeS;
    			this.time.text = GameManager$2.timeH + ":" + GameManager$2.timeM + ":" + GameManager$2.timeS;
    		}
    	}
    }

    class YongjiuCar extends Laya.Scene {



    	onEnable() {
    		this.width = Laya.stage.width;
    		this.height = Laya.stage.height;

    		if (GameManager$2.dayData.mainday_ChuZuChe == GameManager$2.day && (GameManager$2.dayData.isTwoDay == false)) {
    			this.OKbtn.skin = "ChuZuChe/UIRes/huode_liqu12.png";
    			this.title.skin = "ChuZuChe/xinzeng/tc_dtt3.png";
    		}
    		this.OKbtn.on(Laya.Event.CLICK, this, function () {

    			let now_day = GameManager$2.getYearOfday();// new Date().getDate();//一个月中的某一天
    			var qiandao_time = PlayerData.GetUserData("qiandao_time");//


    			if (GameManager$2.dayData.mainday_ChuZuChe == GameManager$2.day && (GameManager$2.dayData.isTwoDay == false)) {
    				this.destroy();
    				GameManager$2.dayData.isclickyes = true;
    				Laya.LocalStorage.setItem("mainday_ChuZuChe", JSON.stringify(GameManager$2.dayData));
    				var YongYouCar = PlayerData.GetUserData("YongYouCar");
    				YongYouCar[5] = 1;
    				PlayerData.SetUserData("YongYouCar", YongYouCar);
    				PlayerData.SetUserData("selectCar", 5);
    				var tryCar = PlayerData.GetUserData("tryCar");
    				var tryCarNum = PlayerData.GetUserData("tryCarNum");
    				if (tryCar[5] == 1) {
    					tryCar[5] = 0;
    					PlayerData.SetUserData("tryCar", tryCar);
    				}
    				if (tryCarNum[5] > 0) {
    					tryCarNum[5] = 0;
    					PlayerData.SetUserData("tryCarNum", tryCarNum);
    				}
    				if (PlayerData.isMaincar == false) {
    					PlayerData.isMaincar = true;
    					UIManager.ShowUIPanel("Main");
    				}
    			} else {
    				console.log("来else" + PlayerData.isMaincar + "" + PlayerData.isXuanZe);
    				this.destroy();
    				if (PlayerData.isMaincar == false && PlayerData.isGameing == false && PlayerData.isXuanZe == false) {
    					PlayerData.isMaincar = true;
    					UIManager.ShowUIPanel("Main");
    				}
    				else {
    					this.destroy();
    				}
    			}


    		});
    		this.huode.on(Laya.Event.CLICK, this, function () {

    			this.destroy();



    			UIManager.ShowUIPanel("Main");


    		});
    	}

    	onDisable() {
    	}
    }

    class ZhuanPan extends Laya.Scene {
    	onEnable() {
    		GameManager_Collection.hideBackBtn();
    		this.width = Laya.stage.width;
    		this.height = Laya.stage.height;

    		this.car.on(Laya.Event.MOUSE_DOWN, this, function () {
    			UIManager.ShowUIPanel("YongjiuCar", false);
    		});
    		if (GameManager$2.dayData.mainday_ChuZuChe <= GameManager$2.day) {
    			this.car.visible = false;
    		}
    		var ZhuanPanData = Laya.LocalStorage.getItem("zpData_ChuZuChe");
    		if (ZhuanPanData && ZhuanPanData.length > 0) {
    			PlayerData.zpData_ChuZuChe = JSON.parse(ZhuanPanData);
    		} else {
    			Laya.LocalStorage.setItem(JSON.stringify(PlayerData.zpData_ChuZuChe));
    		}
    		var day = new Date().getDate();

    		//新的一天
    		if (PlayerData.zpData_ChuZuChe.preData != day) {
    			PlayerData.zpData_ChuZuChe.preData = day;
    			PlayerData.zpData_ChuZuChe.CJnum = 10;
    			Laya.LocalStorage.setItem("zpData_ChuZuChe", JSON.stringify(PlayerData.zpData_ChuZuChe));
    		}


    		if (PlayerData.zpData_ChuZuChe.CJnum != 10) {
    			this.sptb.visible = true;
    		}
    		//===============================================转盘开始
    		this.bj.rotation = ZhuanPan.defaultAngle;
    		console.log("ZhuanPan.zpData_ChuZuChe.CJnum" + PlayerData.zpData_ChuZuChe.CJnum);
    		this.CStext.text = PlayerData.zpData_ChuZuChe.CJnum;
    		this.zhizhen.on(Laya.Event.CLICK, this, function () {
    			if (PlayerData.zpData_ChuZuChe.CJnum == 0) {
    				console.log("今日次数已用完请明日再来!");
    				UIManager.ShowGameTipUI("今日次数已用完请明日再来");
    				return;
    			}

    			if (ZhuanPan.wheelState !== 0) {
    				console.log("请等待抽奖结束!");
    				UIManager.ShowGameTipUI("请等待抽奖结束");
    				return;
    			}

    			if (PlayerData.zpData_ChuZuChe.CJnum == 10) {
    				ZhuanPan.targetID = Config.getid();
    				ZhuanPan.decAngle = 720; // 减速旋转两圈          
    				ZhuanPan.spinTime = 0;
    				ZhuanPan.curSpeed = 0;
    				ZhuanPan.wheelState = 1;
    				PlayerData.zpData_ChuZuChe.CJnum -= 1;
    				Laya.LocalStorage.setItem("zpData_ChuZuChe", JSON.stringify(PlayerData.zpData_ChuZuChe));
    				if (PlayerData.zpData_ChuZuChe.CJnum != 10) {
    					this.sptb.visible = true;
    				}
    				this.CStext.text = PlayerData.zpData_ChuZuChe.CJnum;
    			} else {
    				GameManager$2.ShowVideo(function () {
    					this.sptb.visible = true;
    					ZhuanPan.targetID = Config.getLotteryID();
    					ZhuanPan.decAngle = 720; // 减速旋转两圈          
    					ZhuanPan.spinTime = 0;
    					ZhuanPan.curSpeed = 0;
    					ZhuanPan.wheelState = 1;
    					PlayerData.zpData_ChuZuChe.CJnum -= 1;
    					Laya.LocalStorage.setItem("zpData_ChuZuChe", JSON.stringify(PlayerData.zpData_ChuZuChe));
    					this.CStext.text = PlayerData.zpData_ChuZuChe.CJnum;
    				}.bind(this));
    			}
    		});
    		this.bj.pivot(this.bj.width / 2, this.bj.height / 2);
    		Laya.timer.frameLoop(1, this, this.onUpdate);
    		this.backBtn.on(Laya.Event.CLICK, this, function () {
    			if (ZhuanPan.wheelState !== 0) {
    				console.log("请等待抽奖结束!");
    				UIManager.ShowGameTipUI("请等待抽奖结束");
    				return;
    			}
    			this.destroy();
    			UIManager.ShowUIPanel("Main");
    		});

    		this.close.on(Laya.Event.CLICK, this, function () {
    			let self = this;
    			switch (ZhuanPan.targetID) {//'500钞票', '700钞票', '100钞票', '试用新车', '300钞票', '加油'
    				case 0://
    					PlayerData.AddProp(1, 500);
    					break;
    				case 1:
    					PlayerData.AddProp(1, 700);
    					break;
    				case 2:
    					PlayerData.AddProp(1, 100);
    					break;
    				case 3:
    					var YongYouCar = PlayerData.GetUserData("YongYouCar");
    					if (YongYouCar["" + 10] == 1) {
    						console.log("有车了====给金币");
    						UIManager.ShowGameTipUI("已有车辆折成700钞票");

    						PlayerData.AddProp(1, 700);
    					}
    					else {
    						var selectCar = PlayerData.GetUserData("selectCar");
    						YongYouCar[10] = 1;
    						PlayerData.SetUserData("YongYouCar", YongYouCar);
    						PlayerData.SetLastCar();
    						PlayerData.SetUserData("selectCar", 10);
    						var tryCar = PlayerData.GetUserData("tryCar");
    						tryCar[10] = 1;
    						PlayerData.SetUserData("tryCar", tryCar);
    						var tryCarNum = PlayerData.GetUserData("tryCarNum");
    						tryCarNum[10] = 3;//试用次数
    						PlayerData.SetUserData("tryCarNum", tryCarNum);
    						PlayerData.SaveData();
    					}
    					break;
    				case 4:
    					PlayerData.AddProp(1, 300);
    					break;
    				case 5:
    					GameManager$2.Jiayou();
    					//self.youtongAni.play(0, false);
    					break;
    			}
    			self.huode.visible = false;
    			var name = "wupin" + (ZhuanPan.targetID);
    			self[name].visible = false;
    			self.bg1.visible = false;

    		});
    		this.shuangbei.on(Laya.Event.CLICK, this, function () {//视频双倍
    			let self = this;
    			switch (ZhuanPan.targetID) {//'500钞票', '700钞票', '100钞票', '试用新车', '300钞票', '加油'
    				case 0://
    					PlayerData.AddProp(1, 1000);
    					break;
    				case 1:
    					PlayerData.AddProp(1, 1400);
    					break;
    				case 2:
    					PlayerData.AddProp(1, 200);
    					break;
    				case 3:

    					break;
    				case 4:
    					PlayerData.AddProp(1, 600);
    					break;
    				case 5:

    					//self.youtongAni.play(0, false);
    					break;
    			}
    			self.huode.visible = false;
    			self.bg1.visible = false;
    			var name = "wupin" + (ZhuanPan.targetID);
    			self[name].visible = false;
    		});
    		this.share.on(Laya.Event.CLICK, this, function () {//分享双倍
    			let self = this;
    		});
    	}

    	showRes() {
    		ZhuanPan.wheelState = 0;
    		console.log("获得物品的id=============" + (ZhuanPan.targetID) + " ->" + Config.gearInfo[ZhuanPan.targetID]);
    		this.huode.visible = true;
    		this.bg1.visible = true;
    		var name = "wupin" + (ZhuanPan.targetID);
    		this[name].visible = true;

    		this.close.visible = true;

    		if (ZhuanPan.targetID == 0 || ZhuanPan.targetID == 1 || ZhuanPan.targetID == 2 || ZhuanPan.targetID == 4) {
    			let num = Math.floor(Math.random() * 100);
    			console.log("============================num" + num);
    			if (num < 50) {
    				console.log("视频");
    				this.shuangbei.visible = false;
    				this.share.visible = false;

    			} else {
    				console.log("======================分享");

    				this.shuangbei.visible = false;
    				// this.share.visible=true;
    			}

    		} else {
    			this.shuangbei.visible = false;
    			this.share.visible = false;
    		}

    	}
    	onUpdate(dt) {
    		if (this.car.visible) {
    			var h = new Date().getHours();
    			var m = new Date().getMinutes();
    			var s = new Date().getSeconds();
    			GameManager$2.timeH = 24 - h;
    			GameManager$2.timeH = GameManager$2.timeH < 10 ? ('0' + GameManager$2.timeH) : GameManager$2.timeH;
    			GameManager$2.timeM = 60 - m;
    			GameManager$2.timeM = GameManager$2.timeM < 10 ? ('0' + GameManager$2.timeM) : GameManager$2.timeM;

    			GameManager$2.timeS = 60 - s;

    			GameManager$2.timeS = GameManager$2.timeS < 10 ? ('0' + GameManager$2.timeS) : GameManager$2.timeS;
    			this.time.text = GameManager$2.timeH + ":" + GameManager$2.timeM + ":" + GameManager$2.timeS;
    		}
    		if (ZhuanPan.wheelState === 0) {
    			return;
    		}
    		if (ZhuanPan.wheelState == 1) {
    			// cc.log('....加速,speed:' + this.curSpeed);
    			ZhuanPan.spinTime += dt;
    			this.bj.rotation = this.bj.rotation + ZhuanPan.curSpeed;

    			if (ZhuanPan.curSpeed < ZhuanPan.maxSpeed) {
    				ZhuanPan.curSpeed += ZhuanPan.acc;
    				if (ZhuanPan.curSpeed >= ZhuanPan.maxSpeed) {
    					ZhuanPan.curSpeed = ZhuanPan.maxSpeed;
    				}
    			} else {
    				// this.curSpeed = this.duration;
    				if (ZhuanPan.spinTime < ZhuanPan.duration) {
    					return;
    				}
    				// cc.log('....开始减速');
    				//设置目标角度
    				ZhuanPan.finalAngle = 360 - (ZhuanPan.targetID + 1) * ZhuanPan.gearAngle + ZhuanPan.defaultAngle;
    				ZhuanPan.maxSpeed = ZhuanPan.curSpeed;
    				if (ZhuanPan.springback) {
    					ZhuanPan.finalAngle += ZhuanPan.gearAngle;
    				}
    				this.bj.rotation = ZhuanPan.finalAngle;
    				ZhuanPan.wheelState = 2;
    			}
    		} else if (ZhuanPan.wheelState == 2) {
    			// cc.log('......减速');
    			var curRo = this.bj.rotation; //应该等于finalAngle
    			var hadRo = curRo - ZhuanPan.finalAngle;
    			ZhuanPan.curSpeed = ZhuanPan.maxSpeed * ((ZhuanPan.decAngle - hadRo) / ZhuanPan.decAngle) + 0.2;
    			this.bj.rotation = curRo + ZhuanPan.curSpeed;

    			if ((ZhuanPan.decAngle - hadRo) <= 0) {
    				// cc.log('....停止');               
    				this.bj.rotation = ZhuanPan.finalAngle;
    				if (ZhuanPan.springback) {
    					//倒转一个齿轮
    					// var act = new cc.rotateBy(0.6, -this.gearAngle);
    					var act = cc.rotateBy(1, -this.gearAngle);
    					var seq = cc.sequence(act, cc.callFunc(this.showRes, this));
    					this.bj.runAction(seq);
    				} else {
    					this.showRes();
    				}
    			}
    		}

    	}

    	onDisable() {
    		Laya.timer.clearAll(this);
    		GameManager_Collection.showBackBtn();
    	}
    }

    ZhuanPan.isRun = false;
    ZhuanPan.wheelState = 0;
    ZhuanPan.curSpeed = 0;
    ZhuanPan.spinTime = 0; //减速前旋转时间
    ZhuanPan.gearNum = 6; //转盘格子数
    ZhuanPan.maxSpeed = 15;
    ZhuanPan.defaultAngle = 360 / ZhuanPan.gearNum / 2; //修正默认角度
    ZhuanPan.gearAngle = 360 / ZhuanPan.gearNum; //每个齿轮的角度

    ZhuanPan.finalAngle = 0; //最终结果指定的角度
    ZhuanPan.effectFlag = 0; //用于音效播放
    ZhuanPan.duration = 1;
    ZhuanPan.springback = false;
    ZhuanPan.targetID = 7;
    ZhuanPan.acc = 0.5;

    class PanelJieSuoZiYou extends Laya.Scene {

    	constructor() {
    		super();
    	}

    	onEnable() {
    		this.width = Laya.stage.width;
    		this.height = Laya.stage.height;

    		let cur = PlayerData.GetUserData("unlockTimes");
    		this.times.text = "当前次数(" + cur + "/4)";
    		this.jjtime.text = "当前次数(" + cur + "/4)";

    		this.kuang.on(Laya.Event.CLICK, this, function () {//jj
    			if (PanelJieSuoZiYou.isClickkuang == false) {
    				PanelJieSuoZiYou.isClickkuang = true;
    				this.jjshipin2Btn.visible = false;
    				this.jie2Btn.visible = true;
    				this.gou.visible = false;

    			} else {
    				PanelJieSuoZiYou.isClickkuang = false;
    				this.jjshipin2Btn.visible = true;
    				this.jie2Btn.visible = false;
    				this.gou.visible = true;
    			}
    		});

    		this.jie2Btn.on(Laya.Event.CLICK, this, function () {//jj
    			if (PlayerData.IsCanLessProp(1, 20000)) {
    				PlayerData.LessProp(1, 20000);
    				this.destroy();
    				UIManager.mainUI.ZiyouUNLOCK20();
    			}
    			else {
    				this.cpbzAni.play(0, false);
    			}
    		});
    		let self2 = this;
    		this.jjshipin2Btn.on(Laya.Event.CLICK, this, function () {//jj
    			PlayerData.SetUserData("unlockTimes", PlayerData.GetUserData("unlockTimes") + 1);
    			self2.reset();
    		});
    		this.jieBtn.on(Laya.Event.CLICK, this, function () {
    			if (PlayerData.IsCanLessProp(1, 20000)) {
    				PlayerData.LessProp(1, 20000);
    				this.destroy();
    				UIManager.mainUI.ZiyouUNLOCK20();
    			}
    			else {
    				this.cpbzAni.play(0, false);
    			}
    		});
    		this.guanbiBtn.on(Laya.Event.CLICK, this, function () {
    			this.destroy();
    		});
    		let self = this;
    		this.shipinBtn.on(Laya.Event.CLICK, this, function () {
    			GameManager$2.ShowVideo(function () {
    				PlayerData.SetUserData("unlockTimes", PlayerData.GetUserData("unlockTimes") + 1);
    				this.reset();
    			}.bind(this));
    		});
    		this.guanbiBtn.visible = true;
    	}
    	reset() {
    		this.destroy();
    		UIManager.mainUI.ZiyouUNLOCK20();
    	}

    	onDisable() {
    	}
    }
    PanelJieSuoZiYou.isClickkuang = false;

    class CollectionDownload extends Laya.Scene {

    	constructor() {
    		super();
    		this.updateLoadValue = 0;
    		this.loadValue = 0;
    		this.isLoading = false;
    		this.gameUrl = null;
    		this.ZIPName = null;
    		this.downloadTask = null;
    	}

    	onEnable() {
    		this.width = Laya.stage.width;
    		this.height = Laya.stage.height;

    		this.iconImage.skin = GameManager_Collection.GameConfig.guanka[GameManager_Collection.GameID];
    		if (GameManager_Collection.gq) {
    			this.gameName.text = GameManager_Collection.GameConfig.name[GameManager_Collection.GameID];
    		} else {
    			this.gameName.text = GameManager_Collection.GameName;
    		}
    		this.gameUrl = GameManager_Collection.GameConfig.url[GameManager_Collection.GameID];
    		this.ZIPName = GameManager_Collection.GameConfig.ZIP[GameManager_Collection.GameID];

    		if (Laya.Browser.onQGMiniGame) {
    			this.downloadZIP(function () {
    				this.loadValue = 1;
    				this.isLoading = true;
    			}.bind(this));
    		} else {
    			this.loadValue = 1;
    			this.isLoading = true;
    		}

    		Laya.timer.loop(1, this, this.updateBar);
    	}

    	checkRoot(callback) {
    		try {
    			qg.getFileSystemManager().accessSync(qg.env.USER_DATA_PATH + "/" + GameManager_Collection.FileName + "/quickgame");
    			console.warn("根目录存在：" + qg.env.USER_DATA_PATH + "/" + GameManager_Collection.FileName + "/quickgame");
    			if (callback) {
    				callback();
    			}
    		} catch (e) {
    			console.error("根目录不存在", JSON.stringify(e));
    		}
    	}

    	downloadZIP(callback) {
    		this.checkRoot(function () {
    			let self = this;
    			let fileManager = qg.getFileSystemManager();
    			console.log("系统路径:" + qg.env.USER_DATA_PATH);
    			fileManager.access({
    				path: qg.env.USER_DATA_PATH + "/" + GameManager_Collection.FileName + "/quickgame/" + self.ZIPName + "_downloadFlag/",
    				success: function () {
    					console.log("有版本控制文件 ===" + qg.env.USER_DATA_PATH + "/" + GameManager_Collection.FileName + "/quickgame/" + self.ZIPName + "_downloadFlag");
    					if (callback) {
    						callback();
    					}
    					return;
    				},
    				fail: function (res) {
    					console.log("无版本控制文件 ===" + qg.env.USER_DATA_PATH + "/" + GameManager_Collection.FileName + "/quickgame/" + self.ZIPName + "_downloadFlag");
    					self.loadStr.text = "资源下载中...";
    					var downloadUrl = "https://qygres.17666.mobi/NanJing/CollectionGames/OPPO/AutoTool/" + GameManager_Collection.CDNFileName + "/" + GameManager_Collection.CDNFileVersion + "/" + self.ZIPName + ".zip?t=" + GameManager_Collection.timeStamp;
    					var downloadUrl = "https://qygres.17666.mobi/NanJing/CollectionGames/OPPO/AutoTool/" + "XXHMMNQ" + "/" + "1.0.1" + "/" + "Accident" + ".zip?t=" + "1685006708";
    					console.log("资源下载地址：", downloadUrl);
    					self.downloadTask = qg.downloadFile({
    						url: downloadUrl,
    						success: function (res) { // 下载成功  
    							self.loadValue = 0;
    							self.loadStr.text = "资源下载成功,解压中...";

    							var filePath = res.tempFilePath; // 下载路径  
    							console.log("临时目录：" + qg.env.USER_DATA_PATH);
    							console.log("下载路径：" + filePath);
    							fileManager.unzip({
    								zipFilePath: filePath, // 资源下载后路径
    								targetPath: qg.env.USER_DATA_PATH + "/" + GameManager_Collection.FileName + "/quickgame/", // 解压资源存放路径
    								success: function (res) { // 解压成功
    									self.loadStr.text = "资源解压成功...";
    									fileManager.mkdir({
    										dirPath: qg.env.USER_DATA_PATH + "/" + GameManager_Collection.FileName + "/quickgame/" + self.ZIPName + "_downloadFlag",
    										success() {
    											if (callback) {
    												callback();
    											}
    										},
    										fail(err) {
    											console.log("创建标识错误：", JSON.stringify(err));
    										}
    									});
    								},

    								fail: function (res) { // 解压失败  
    									if (JSON.stringify(res).indexOf("No END header found")) {
    										console.log('下载失败：' + JSON.stringify(res));
    										self.loadStr.text = "下载游戏资源失败， 请重启后重试";
    									} else {
    										console.log('解压失败：' + JSON.stringify(res));
    										self.loadStr.text = "解压失败游戏资源失败， 请重启后重试";
    									}
    								},
    							});
    						},
    						fail: function (res) { // 下载失败  
    							self.loadStr.text = "下载游戏资源失败， 请重启后重试";
    							console.log('下载失败' + JSON.stringify(res));
    						},
    					});
    					self.downloadTask.onProgressUpdate((res) => {
    						self.loadValue = res.value;
    					});
    				}
    			});
    		}.bind(this));
    	}

    	updateBar() {
    		this.updateLoadValue += 0.01;
    		if (this.updateLoadValue > this.loadValue) {
    			this.updateLoadValue = this.loadValue;
    		}
    		this.loadBar.value = this.updateLoadValue;

    		if (this.loadBar.value >= 1 && this.isLoading) {
    			Laya.timer.clear(this, this.updateBar);
    			Laya.Scene.open(this.gameUrl);
    		}
    	}

    	onDisable() {
    		Laya.timer.clearAll(this);
    	}
    }

    class GameData$2 {
    	/**
    	 * 初始化本地数据
    	 * @param successcallback 完成回调
    	 */
    	static InitData(successcallback) {
    		var CollectionGamesData_XXHMMNQ = Laya.LocalStorage.getItem("OPPOCollectionGamesData_" + GameManager_Collection.FileName);
    		if (CollectionGamesData_XXHMMNQ) {
    			console.log("============老用户============");
    			GameData$2.CollectionGamesData_XXHMMNQ = JSON.parse(CollectionGamesData_XXHMMNQ);
    			var day = new Date().getDate();
    			if (GameData$2.GetData("curDay") != day) {
    				console.log("============新的一天============");
    				GameData$2.SetData("curDay", day);
    			}
    		} else {
    			console.log("============新用户============");
    			GameData$2.SaveData();

    			var day = new Date().getDate();
    			GameData$2.SetData("curDay", day);
    		}

    		GameData$2.isPlayedArr = GameData$2.GetData("isPlayed");
    		console.log("GameData.isPlayedArr:", GameData$2.isPlayedArr);

    		var config = ["res/Collection/JSON/config.json"];
    		Laya.loader.load(config, Laya.Handler.create(this, function () {
    			GameManager_Collection.GameConfig = Laya.loader.getRes(config[0]);
    			console.log("======================================================================================================================");
    			console.log(JSON.stringify(GameManager_Collection.GameConfig, null, "\t"));
    			console.log("======================================================================================================================");
    			if (GameManager_Collection.GameConfig) {
    				var isPlayedArr = GameData$2.GetData("isPlayed");
    				if (isPlayedArr.length != GameManager_Collection.GameConfig.guanka.length) {
    					GameData$2.isPlayedArr = [];
    					for (var key in GameManager_Collection.GameConfig.guanka) {
    						GameData$2.isPlayedArr.push(0);
    					}
    					GameData$2.SetData("isPlayed", GameData$2.isPlayedArr);
    				}
    				successcallback();
    			} else {
    				console.error("未找到配置合集JSON,配置地址应该为: res/Collection/JSON/config.json");
    			}
    		}), Laya.Handler.create(this, function (value) {
    			GameData$2.loadValue = value;
    		}), Laya.Loader.JSON);
    	}

    	/**
    	 * 保存数据
    	 */
    	static SaveData() {
    		var CollectionGamesData_XXHMMNQ = JSON.stringify(GameData$2.CollectionGamesData_XXHMMNQ);
    		Laya.LocalStorage.setItem("OPPOCollectionGamesData_" + GameManager_Collection.FileName, CollectionGamesData_XXHMMNQ);
    	}

    	/**
    	 * 获取数据
    	 * @param key 数据名称
    	 * @returns 返回数据
    	 */
    	static GetData(key) {
    		return GameData$2.CollectionGamesData_XXHMMNQ[key];
    	}

    	/**
    	 * 设置数据
    	 * @param key 数据名称
    	 * @param value 数据
    	 */
    	static SetData(key, value) {
    		GameData$2.CollectionGamesData_XXHMMNQ[key] = value;
    		GameData$2.SaveData();
    	}
    }
    GameData$2.isPlayedArr = [];
    GameData$2.loadValue = 0;
    GameData$2.CollectionGamesData_XXHMMNQ = {
    	"yssm": 0,                                                              //隐私声明
    	"curDay": 0,                                                            //日期
    	"sound": 0,                                                             //声音
    	"isPlayed": [],
    };

    class GamesScene extends Laya.Scene {

    	constructor() {
    		super();
    		this.tempValue = 0;
    	}

    	onEnable() {
    		Laya.SoundManager.stopAll();
    		Laya.SoundManager.muted = false;

    		this.width = Laya.stage.width;
    		this.height = Laya.stage.height;

    		this.bg.skin = GameManager_Collection.GameConfig.bg;
    		this.logo.skin = GameManager_Collection.GameConfig.logo;

    		Laya.SoundManager.playSound("Collection/sound/bgm.mp3", 0);

    		Laya.timer.loop(1, this, this.update);

    		GameManager_Collection.gq = LabelUtils.getLabel("gq");
    		this.InitGamesList(GameManager_Collection.gq);

    		//隐私
    		this.ysBtn.on(Laya.Event.CLICK, this, function () {
    			OVHAdsManager.showYSSM();
    		});
    		this.ysBtn.visible = false;
    	}

    	/**
    	 * 初始化游戏列表
    	 */
    	InitGamesList(gq) {
    		Laya.timer.clear(this, this.update);

    		this.GamesList.renderHandler = new Laya.Handler(this, this.updateGamesList);
    		this.GamesList.array = [];

    		let array = [];
    		let index = 1;
    		//关卡
    		for (var key in GameManager_Collection.GameConfig.guanka) {
    			if (index >= 1 && index <= 1) {
    				let obj = {};
    				obj['gameID'] = { text: key };
    				obj['gameBtn'] = { skin: GameManager_Collection.GameConfig.bgPre };
    				obj['gameIcon'] = { skin: GameManager_Collection.GameConfig.guanka[key] };
    				if (!gq) {
    					obj['gameName'] = { text: GameManager_Collection.GameName };
    				} else {
    					obj['gameName'] = { text: GameManager_Collection.GameConfig.name[key] };
    				}
    				obj['gameUrl'] = { text: GameManager_Collection.GameConfig.url[key] };
    				obj['isPlayed'] = { visible: GameData$2.isPlayedArr[key] == 1 ? true : false };
    				array.push(obj);
    				if (!gq) {
    					break;
    				}
    				index++;
    			} else {
    				continue;
    			}
    		}
    		this.GamesList.array = array;

    		this.loadBar.visible = false;

    		var width = array.length * 270 + (array.length - 1) * 20;
    		if (width > this.width - 350) {
    			this.GamesList.hScrollBarSkin = "";
    			this.GamesList.width = this.width - 350;
    		} else {
    			this.GamesList.width = width;
    			this.GamesList.hScrollBarSkin = "";
    		}

    		this.GamesList.visible = true;
    	}

    	/**
    	 * 更新游戏列表添加按钮监听
    	 * @param {*} cell 列表组件
    	 */
    	updateGamesList(cell) {
    		let gameBtn = cell.getChildByName("gameBtn");
    		let gameID = parseInt(cell.getChildByName("gameID").text);

    		gameBtn.offAll();
    		gameBtn.on(Laya.Event.CLICK, this, this.selectGame, [gameID]);
    	}

    	/**
    	 * 选择游戏
    	 * @param {*} gameID 游戏ID
    	 */
    	selectGame(gameID) {
    		//原生
    		console.log("选择游戏");
    		Advertisement.insertAdverV3();

    		var cell = this.GamesList.getItem(gameID);
    		var gameUrl = cell['gameUrl'].text;
    		GameManager_Collection.GameID = gameID;

    		cell['isPlayed'].visible = true;
    		this.GamesList.setItem(gameID, cell);

    		Laya.SoundManager.playSound("Collection/sound/btn.mp3", 1);
    		console.log("======================================================================================================================");
    		console.log("游戏ID:" + gameID);
    		console.log("游戏Url:" + gameUrl);
    		console.log("======================================================================================================================");

    		GameData$2.isPlayedArr[gameID] = 1;
    		GameData$2.SetData("isPlayed", GameData$2.isPlayedArr);


    		Laya.stage.scaleMode = GameManager_Collection.GameConfig.Mode[gameID][0];
    		Laya.stage.screenMode = GameManager_Collection.GameConfig.Mode[gameID][1];

    		if (Laya.Browser.onMiniGame) {
    			var OrientationValue = "landscape";
    			if (Laya.stage.screenMode == "vertical") {
    				OrientationValue = "portrait";
    			}
    			wx.setDeviceOrientation({
    				value: OrientationValue,
    				success: function () {
    					if (Laya.stage.screenMode == "vertical") {
    						// WeChatUtil.InitCustomSingle1(true, true);
    						// WeChatUtil.InitCustomSingle2(true, true);
    						// WeChatUtil.InitCustom53(true);
    					}
    					Laya.SoundManager.stopAll();
    					Laya.Scene.open("Collection/CollectionDownload.scene");
    				},
    				fail: function (res) {
    					console.warn("转换横竖屏失败：" + res);
    				},
    				complete: function () {
    					console.warn("转换横竖屏");
    				}
    			});
    		} else {
    			Laya.timer.once(1, this, function () {
    				Laya.SoundManager.stopAll();
    				Laya.Scene.open("Collection/CollectionDownload.scene");

    				//添加RESIZE事件，当舞台发生改变时触发横竖屏设置
    				Laya.stage.on(Event.RESIZE, Laya.stage, function () {
    					if (Laya.Browser.width > Laya.Browser.height) {
    						fillWidth = Laya.Browser.width;
    						fillHeight = Laya.Browser.height;
    					} else {
    						fillWidth = Laya.Browser.height;
    						fillHeight = Laya.Browser.width;
    					}
    				});
    			}.bind(this));
    		}

    	}

    	update() {
    		if (this.tempValue <= GameData$2.loadValue) {
    			this.tempValue += 0.01;
    			this.loadBar.value = this.tempValue;
    		}
    	}

    	onDisable() {

    	}
    }

    class CollectionLoading extends Laya.Scene {

    	constructor() {
    		super();
    	}

    	onEnable() {
    		this.width = Laya.stage.width;
    		this.height = Laya.stage.height;

    		this.loadValue = 0;
    		this.updateLoadValue = 0;
    		this.isLoading = false;

    		if (Laya.Browser.onQGMiniGame) {
    			OVHAdsManager.Init("res/Collection/JSON/ConstantsJSON.json", function () {
    				this.downloadZIP(function () {
    					setTimeout(() => {
    						this.loadValue = 1;
    						this.isLoading = true;
    					}, 1000);
    				}.bind(this));
    			}.bind(this), this);
    		} else {
    			OVHAdsManager.Init("res/Collection/JSON/ConstantsJSON.json", function () {
    				Laya.timer.clear(this, this.updateRemoveFile);
    				Laya.timer.loop(1, this, this.update);
    				setTimeout(() => {
    					this.loadValue = 1;
    					this.isLoading = true;
    				}, 1000);
    			}.bind(this), this);
    		}
    	}

    	downloadZIP(callback) {
    		let self = this;
    		let fileManager = qg.getFileSystemManager();
    		console.log("系统路径 ===" + qg.env.USER_DATA_PATH);
    		fileManager.access({
    			path: qg.env.USER_DATA_PATH + "/" + GameManager_Collection.FileName + "/quickgame/" + GameManager_Collection.FileName + "/",
    			success: function () {
    				console.log("有版本控制文件 ===" + (qg.env.USER_DATA_PATH + "/" + GameManager_Collection.FileName + "/quickgame/" + GameManager_Collection.FileName));
    				Laya.URL.basePath = qg.env.USER_DATA_PATH + "/" + GameManager_Collection.FileName + "/quickgame/";
    				Laya.timer.loop(1, self, self.update);
    				if (callback) {
    					callback();
    				}
    				return;
    			},
    			fail: function (res) {
    				self.loadStr.text = "正在检查更新，请稍后。。。";
    				Laya.timer.loop(1, self, self.updateRemoveFile);
    				self.cleanAllFiles(qg.env.USER_DATA_PATH + "/", null, function () {
    					Laya.timer.clear(self, self.updateRemoveFile);
    					Laya.timer.loop(1, self, self.update);
    					console.log("无版本控制文件 ===" + (qg.env.USER_DATA_PATH + "/" + GameManager_Collection.FileName + "/quickgame/" + GameManager_Collection.FileName));
    					Laya.LocalStorage.clear();
    					self.loadStr.text = "资源下载中...";
    					self.loadValue = 0.2;
    					var downloadUrl = "https://qygres.17666.mobi/NanJing/CollectionGames/OPPO/AutoTool/" + GameManager_Collection.CDNFileName + "/" + GameManager_Collection.CDNFileVersion + "/quickgame.zip?t=" + GameManager_Collection.timeStamp;
    					var downloadUrl = "https://qygres.17666.mobi/NanJing/CollectionGames/OPPO/AutoTool/" + "XXHMMNQ" + "/" + "1.0.1" + "/quickgame.zip?t=" + "1685006708";
    					console.log("资源下载地址：", downloadUrl);
    					let downloadTask = qg.downloadFile({
    						url: downloadUrl,
    						success: function (res) { // 下载成功  
    							self.loadStr.text = "下载成功,资源解压中...";
    							self.loadValue = 0.4;
    							var filePath = res.tempFilePath; // 下载路径  
    							console.log("临时目录 = " + qg.env.USER_DATA_PATH);
    							console.log("下载路径 = " + filePath);
    							fileManager.unzip({
    								zipFilePath: filePath, // 资源下载后路径
    								targetPath: qg.env.USER_DATA_PATH + "/" + GameManager_Collection.FileName + "/", // 解压资源存放路径
    								success: function (res) { // 解压成功
    									self.loadStr.text = "资源解压成功...";
    									self.loadValue = 0.6;
    									Laya.URL.basePath = qg.env.USER_DATA_PATH + "/" + GameManager_Collection.FileName + "/quickgame/";
    									fileManager.mkdir({
    										dirPath: qg.env.USER_DATA_PATH + "/" + GameManager_Collection.FileName + "/quickgame/" + GameManager_Collection.FileName,
    										success() {
    											if (callback) {
    												callback();
    											}
    										},
    										fail(err) {
    											console.log("创建标识错误：", JSON.stringify(err));
    										}
    									});
    								},

    								fail: function (res) { // 解压失败  
    									self.loadStr.text = "解压失败游戏资源失败， 请重启后重试";
    									console.log('解压失败：' + JSON.stringify(res));
    								},
    							});
    						},
    						fail: function (res) { // 下载失败  
    							self.loadStr.text = "下载游戏资源失败， 请重启后重试";
    							console.log('下载失败' + JSON.stringify(res));
    						},
    					});
    					downloadTask.onProgressUpdate((res) => {
    						self.loadValue = res.value;
    					});
    				}.bind(this));
    			}
    		});
    	}

    	update() {
    		this.updateLoadValue += 0.01;
    		if (this.updateLoadValue > this.loadValue) {
    			this.updateLoadValue = this.loadValue;
    		}
    		this.loadBar.value = this.updateLoadValue;

    		if (this.loadBar.value >= 1 && this.isLoading) {
    			Laya.timer.clear(this, this.update);
    			this.goMain();
    		}
    	}

    	goMain() {
    		this.loadStr.text = "正在加载数据";
    		GameData$2.InitData(function () {
    			console.log();
    			if (GameData$2.GetData("yssm") == 0) {
    				OVHAdsManager.showYSSM(function () {
    					OVHAdsManager.InitConstants();
    					GameData$2.SetData("yssm", 1);
    					Laya.Scene.open("Collection/CollectionGamesScene.scene");
    				}.bind(this), true);
    			} else {
    				OVHAdsManager.InitConstants();
    				setTimeout(() => {
    					Laya.Scene.open("Collection/CollectionGamesScene.scene");
    				}, 1000);
    			}
    		}.bind(this));
    	}

    	cleanAllFiles(path, newAssets, callback) {
    		let self = this;
    		var fs = qg.getFileSystemManager ? qg.getFileSystemManager() : null;
    		if (!fs) {
    			callback();
    			return;
    		}
    		fs.access({
    			path: path,
    			success: function () {
    				console.log("文件夹存在，开始删除文件夹！");
    				fs.readdir({
    					dirPath: path,
    					success: function (res) {
    						var files = res.files;
    						console.log("res.files     " + res.files);
    						(function next(idx) {
    							if (idx < files.length) {
    								var dirPath = path + '/' + files[idx];
    								if (dirPath.indexOf("�") == -1) {
    									var stat = fs.statSync(dirPath, false);
    									if (stat.isDirectory()) {
    										self.cleanAllFiles(dirPath, newAssets, function () {
    											next(idx + 1);
    										});
    									} else {
    										if (newAssets && newAssets.indexOf(dirPath) !== -1) {
    											next(idx + 1);
    											return;
    										}

    										fs.unlink({
    											filePath: dirPath,
    											success: function () {
    												console.log('unlink local file？？？' + dirPath + ' successfully!');
    											},
    											fail: function (res) {
    												console.log("failed to unlink file？？？(' + dirPath + '): ' + res ? res.errMsg : 'unknown error");
    											},
    											complete: function () {
    												next(idx + 1);
    											}
    										});
    									}
    								} else {
    									next(idx + 1);
    								}
    							} else {
    								callback();
    							}
    						})(0);
    					},
    					fail: function (res) {
    						callback();
    					},
    				});
    			},
    			fail: function () {
    				console.log("文件夹不存在，直接调用回调");
    				callback();
    			}
    		});
    	}

    	updateRemoveFile() {
    		if (this.loadBar.value >= 1) {
    			this.loadBar.value = 0;
    		}
    		this.loadBar.value += 0.001;
    	}

    	onDisable() {
    	}
    }

    class GameData$3 {
    	static InitData(successcallback) {
    		var playerData = Laya.LocalStorage.getItem("GJJ_playerData");
    		if (playerData) {
    			console.log("============老用户============");
    			GameData$3.playerData = JSON.parse(playerData);
    			var day = new Date().getDate();
    			if (GameData$3.playerData.curDay != day) {
    				console.log("============新的一天============");
    				GameData$3.playerData.curDay = day;
    			}
    		} else {
    			console.log("============新用户============");
    		}

    		Laya.timer.loop(500, this, GameData$3.AutoSaveData);

    		var config = [
    			"res/GJJ/JSON/car.json",
    			"res/GJJ/JSON/map.json",
    			"res/GJJ/JSON/station.json",
    		];

    		Laya.loader.load(config, Laya.Handler.create(this, function () {
    			GameData$3.JSONCar = Laya.loader.getRes(config[0]);
    			GameData$3.JSONMap = Laya.loader.getRes(config[1]);
    			GameData$3.JSONStation = Laya.loader.getRes(config[2]);
    			GameData$3.AutoSaveData();
    			successcallback();
    		}));
    	}

    	static SaveData() {
    		var playerData = JSON.stringify(GameData$3.playerData);
    		Laya.LocalStorage.setItem("GJJ_playerData", playerData);
    		console.log(playerData);

    		GameData$3.selectCar = GameData$3.GetUserData("selectCar");
    		GameData$3.money = GameData$3.GetUserData("money");
    	}

    	static GetUserData(key) {
    		return GameData$3.playerData[key];
    	}

    	static SetData(key, value) {
    		GameData$3.playerData[key] = value;
    		GameData$3.AutoSave = true;
    	}

    	static AutoSaveData() {
    		if (GameData$3.AutoSave) {
    			GameData$3.SaveData();
    			GameData$3.AutoSave = false;
    		}
    	}
    }
    GameData$3.AutoSave = true;//自动保存标识
    GameData$3.playerData = {
    	"sound": 1,
    	"yssm": 0,              //隐私声明
    	"curDay": 0,            //日期
    	"money": 1000,          //金币
    	"selectCar": 1,
    	"map": [1, 0, 0, 0, 0],
    };

    GameData$3.JSONCar = null;
    GameData$3.JSONMap = null;
    GameData$3.JSONStation = null;
    GameData$3.money = 0;
    GameData$3.selectCar = 1;

    class GameManager$3 {
    	static ChangeMinuteSecondstr(str) {
    		if (str !== "0" && str !== "" && str !== null) {
    			return ((Math.floor(str / 60)).toString().length < 2 ? "0" + (Math.floor(str / 60)).toString() :
    				(Math.floor(str / 60)).toString()) + ":" + ((str % 60).toString().length < 2 ? "0" + (str % 60).toString() : (str % 60).toString());
    		} else {
    			return "00:00";
    		}
    	}

    	static PlaySound(name, loop = 1) {
    		var sn = "res/GJJ/sound/" + name + ".mp3";
    		Laya.loader.load(sn, Laya.Handler.create(this, () => {
    			Laya.SoundManager.playSound(sn, loop);
    			if (GameManager$3.hasPlayedSound.indexOf(sn) == -1) {
    				GameManager$3.hasPlayedSound.push(sn);
    				Laya.SoundManager.playSound(sn, loop);
    			}
    		}));
    	}

    	static StopSound(name) {
    		if (name == null) {
    			Laya.SoundManager.stopAll();
    		}
    		else {
    			var sn = "res/GJJ/sound/" + name + ".mp3";
    			Laya.SoundManager.stopSound(sn);
    		}
    	}

    	static OpenSound() {
    		Laya.SoundManager.muted = false;
    	}

    	static CloseSound() {
    		Laya.SoundManager.muted = true;
    	}
    	static stopStationSound() {
    		if (GameManager$3.stationSoundName == null) {
    			return;
    		}
    		var sn = "res/GJJ/sound/bus/" + GameManager$3.stationSoundName + ".mp3";
    		Laya.SoundManager.stopSound(sn);
    		GameManager$3.stationSoundName = null;
    	}
    	static playStationSound(name, loop = 1) {
    		this.stopStationSound();
    		var sn = "res/GJJ/sound/bus/" + name + ".mp3";
    		GameManager$3.stationSoundName = name;
    		Laya.loader.load(sn, Laya.Handler.create(this, () => {
    			Laya.SoundManager.playSound(sn, loop);
    		}));
    	}
    	static PlayCarSound(name, loop = 1) {
    		var sn = "res/GJJ/sound/" + name + ".mp3";
    		Laya.loader.load(sn, Laya.Handler.create(this, () => {
    			Laya.SoundManager.playSound(sn, loop);
    			// Laya.SoundManager.setSoundVolume(1);
    			if (GameManager$3.hasPlayedSound.indexOf(sn) == -1) {
    				GameManager$3.hasPlayedSound.push(sn);
    				Laya.SoundManager.playSound(sn, loop);
    			}
    		}));
    	}

    	static PlayMusic(name) {
    		Laya.SoundManager.stopAll();
    		var sn = "res/GJJ/sound/" + name + ".wav";
    		Laya.loader.load(sn, Laya.Handler.create(this, () => {
    			Laya.SoundManager.playMusic(sn, 0);
    			if (GameManager$3.hasPlayedSound.indexOf(sn) == -1) {
    				GameManager$3.hasPlayedSound.push(sn);
    				Laya.SoundManager.playMusic(sn, 0);

    			}
    			if (GameData$3.GetUserData("Sound") == 0) {
    				GameManager$3.CloseSound();
    			}
    		}));
    	}
    	static clearData() {
    		GameManager$3.busList = [0, 0, 0, 0, 0, 0, 0, 0];
    		GameManager$3.stationList = [];
    		GameManager$3.childList = [];
    		GameManager$3.stationNum = 0;
    		GameManager$3.stationSoundName = null;
    		GameManager$3.doorFlag = false;
    	}

    	static Random(min, max) {
    		return Math.floor(Math.random() * (max - min)) + min;
    	}
    }
    GameManager$3.hasPlayedSound = [];
    GameManager$3.ResScene = null;
    GameManager$3.Scene = null;
    GameManager$3.Camera = null;
    GameManager$3.CarCamera = null;

    GameManager$3.CarModel = null;
    GameManager$3.MapModel = null;

    GameManager$3.Car = null;
    GameManager$3.CarJS = null;

    GameManager$3.GasStation = null;
    GameManager$3.GasStationJS = null;

    GameManager$3.QDAni = null;
    GameManager$3.ZDAni = null;
    GameManager$3.stationList = [];
    GameManager$3.childList = [];

    GameManager$3.GameScene = null;
    GameManager$3.MapID = 0;

    GameManager$3.FB = false;//卡车前后判定
    GameManager$3.LR = false;//卡车左右判定

    GameManager$3.LevelName = ["shanghai1", "nanjing2", "guangzhou3", "qingdao4", "beijing5"];//地图的名字
    GameManager$3.selectLevel = 0;//选择的地图
    GameManager$3.pause = true;//暂停

    GameManager$3.AICarNum = 0;//npc数量

    GameManager$3.timeStr = 120;//时间
    GameManager$3.isAddOil = false;
    GameManager$3.isFristOil = true;
    GameManager$3.busList = [0, 0, 0, 0, 0, 0, 0, 0];//公交车上的乘客

    GameManager$3.GearSize = [9, 69, 125];
    GameManager$3.Gear = 0;
    GameManager$3.GearSpeed = [0, 1, -1];
    GameManager$3.hsjCamera = null;
    GameManager$3.stationNum = 0;
    GameManager$3.stationSoundName = null;
    GameManager$3.doorFlag = false;

    GameManager$3.PUBLIC = true;
    GameManager$3.isOnTLUI = false;
    GameManager$3.isOnPauseUI = false;

    class cheScene extends Laya.Scene {

    	constructor() {
    		super();
    	}

    	onEnable() {
    		this.width = Laya.stage.width;
    		this.height = Laya.stage.height;
    		this.moneyNum.text = GameData$3.money;

    		this.showTruckUI();

    		this.backBtn.on(Laya.Event.CLICK, this, function () {
    			Laya.Scene.open("GJJ/mainScene_GJJ.scene");
    		});

    		Laya.timer.loop(1, this, this.update);
    	}

    	showTruckUI() {
    		this.truck_list.hScrollBarSkin = "";
    		this.truck_list.renderHandler = new Laya.Handler(this, this.updateTruck);
    		this.truck_list.array = [];

    		let array = [];
    		console.log("truck:", GameData$3.JSONCar);
    		for (var key in GameData$3.JSONCar) {
    			let data = GameData$3.JSONCar[key];
    			let obj = {};
    			obj['truckID'] = { text: key };
    			obj['name'] = { text: data.name };
    			obj['bg'] = { skin: "GJJ/cheScene/" + data.image };

    			obj['accelerateSpeed'] = { width: data.accelerateSpeed * 100 * 5 };
    			obj['maxSpeed'] = { width: data.maxSpeed * 5 };
    			obj['Maxoil'] = { width: data.Maxoil / 100 * 5 };

    			obj['selectBtn'] = { visible: GameData$3.selectCar != key ? true : false };
    			obj['isSelect'] = { visible: GameData$3.selectCar == key ? true : false };
    			array.push(obj);
    		}
    		this.truck_list.array = array;
    	}

    	updateTruck(cell) {
    		let selectBtn = cell.getChildByName("selectBtn");
    		let id = cell.getChildByName("truckID").text;
    		selectBtn.offAll();
    		selectBtn.on(Laya.Event.CLICK, this, this.selectTruck, [id]);
    	}

    	selectTruck(id) {
    		console.log("============选择第" + id + "个选项============");
    		GameData$3.selectCar = id;
    		GameData$3.SetData("selectCar", GameData$3.selectCar);
    		this.showTruckUI();
    	}

    	update() {
    		this.moneyNum.text = GameData$3.money;
    	}

    	onDisable() {
    		Laya.timer.clearAll(this);
    		Laya.timer.scale = 1;
    	}
    }

    class TriggerCollisionScript$1 extends Laya.Script3D {
    	constructor() {
    		super();
    		this.controller = null;
    	}
    	onTriggerEnter(other) {
    		let id = this.checkHitObject(other.owner);
    		if (id != -1) {
    			if (id == 999) {
    				this.controller.playerFlag = true;
    			} else {
    				this.controller.stopFlag = true;
    			}
    		}
    	}

    	onTriggerStay(other) {
    	}

    	onTriggerExit(other) {
    		let id = this.checkHitObject(other.owner);
    		if (id != -1) {
    			if (id == 999) {
    				this.controller.playerFlag = false;
    			} else {
    				this.controller.stopFlag = false;
    			}
    			this.controller.onCollision = false;
    		}
    	}
    	onCollisionEnter(collision) {
    	}
    	onCollisionStay(collision) {
    	}
    	onCollisionExit(collision) {
    	}
    	checkHitObject(obj) {
    		let name = obj.name;
    		if (name.indexOf("car") >= 0) {
    			return 999;
    		}
    		if (name.indexOf("npc_") >= 0) {
    			let id = name.substr(name.lastIndexOf("_") + 1);
    			if (this.controller.carID == id) {
    				return -1;
    			} else {
    				return parseInt(id);
    			}
    		}
    		return -1;
    	}
    }

    class AICar extends Laya.Script3D {

    	constructor() {
    		super();
    		this.carID = 1;
    		this.onCollision = false;
    		this.InitFinish = false;
    		this.nextPoint = 1;
    		this.onGround = false;
    		this.playerFlag = false;
    		this.stopFlag = false;
    		this.accelerateSpeed = 1;
    		this.speed = -0.1;
    		this.carRigidbody = null;
    	}

    	onTriggerEnter(other) {
    		if (other.owner.name == "" + this.nextPoint) {
    			this.nextPoint++;
    			if (this.nextPoint >= this.point.length) {
    				this.nextPoint = 0;
    			}
    			var targePos = this.point[this.nextPoint].transform.position;
    			this.lookAt(new Laya.Vector3(targePos.x, this.owner.transform.position.y, targePos.z));
    		} else {
    			// console.log(other.owner.name);
    			// if (other.owner.name = "cfq") {
    			//     this.onCollision = true;
    			// }
    		}
    	}

    	onTriggerStay(other) {
    	}

    	onTriggerExit(other) {

    	}

    	onCollisionEnter(collision) {
    		if (collision.other.owner.name.indexOf("car") != -1) {
    			// this.onCollision = true;
    		} else {
    			if (!this.onGround) {
    				this.onGround = true;
    				if (this.carRigidbody != null) {
    					this.carRigidbody.isKinematic = true;
    				}
    			}
    		}
    	}

    	onCollisionStay(collision) {
    		if (collision.other.owner.name != "ground") {
    			this.onCollision = true;
    		}
    	}

    	onCollisionExit(collision) {
    		if (collision.other.owner.name.indexOf("car") != -1) {
    			this.onCollision = false;
    		}
    	}

    	onEnable() {
    		this.f_l_rote = this.owner.getChildByName("Wheels_FL_LOD1");
    		this.f_r_rote = this.owner.getChildByName("Wheels_FR_LOD1");
    		this.b_l_rote = this.owner.getChildByName("Wheels_RL_LOD1");
    		this.b_r_rote = this.owner.getChildByName("Wheels_RR_LOD1");

    		this.carRigidbody = this.owner.getComponent(Laya.Rigidbody3D);
    	}

    	Init(point, carID) {
    		this.point = point;
    		this.carID = carID;
    		this.InitFinish = true;
    		this.owner.name = "npc_" + this.carID;
    		this.carjs = this.owner.getChildByName("Cube").addComponent(TriggerCollisionScript$1);
    		this.carjs.controller = this;
    		console.log("AICar 初始化成功");
    	}

    	lookAt(targetPos) {
    		this.owner.transform.lookAt(targetPos, new Laya.Vector3(0, 1, 0));
    	}

    	onUpdate() {
    		if (this.InitFinish && this.onGround && !this.onCollision) {
    			if (!this.playerFlag && !this.stopFlag) {
    				this.owner.transform.translate(new Laya.Vector3(0, 0, this.speed * this.accelerateSpeed));

    				this.f_l_rote.transform.rotate(new Laya.Vector3(this.speed * this.accelerateSpeed, 0, 0));
    				this.f_r_rote.transform.rotate(new Laya.Vector3(this.speed * this.accelerateSpeed, 0, 0));
    				this.b_l_rote.transform.rotate(new Laya.Vector3(this.speed * this.accelerateSpeed, 0, 0));
    				this.b_r_rote.transform.rotate(new Laya.Vector3(this.speed * this.accelerateSpeed, 0, 0));


    				var targePos = this.point[this.nextPoint].transform.position;
    				this.lookAt(new Laya.Vector3(targePos.x, this.owner.transform.position.y, targePos.z));
    			}
    		}
    	}

    	onDisable() {
    	}
    }

    class Car$2 extends Laya.Script3D {

    	constructor() {
    		super();
    		this.accelerateSpeed = 0.1;                           //加速度
    		this.accelerateBackSpeed = 0.05;                      //倒车加速度
    		this.speed = 0;                                       //当前速度
    		this.maxSpeed = 10;                                   //最大速度
    		this.maxBackSpeed = -40;                              //倒车最大速度
    		this.Maxoil = 100;                                    //最大油量
    		this.oil = 100;                                       //油量
    		this.oilSpeed = 0;                                     //油量损耗速率
    		this.AccelerateRotate = 0.3;                          //转弯速率
    		this.MaxAccelerateRotate = 0.15;                      //高速转弯速率
    		this.RotateLimit = 5;                                 //达到高速转弯的速度
    		this.rotateAngle = 0;
    		this.keyDownList = [];
    		this.InitFinish = false;
    		this.isHuiTan = false;
    		this.music = "";
    		this.onGround = false;
    		this.gravity = 1;
    		this.stationFlag = false;
    		this.takeoffFlag = false;
    		this.carAnimator = null;
    		this.stationID = 0;
    	}

    	onTriggerEnter(other) {
    		if (other.owner.name == "finish") {
    			GameManager$3.pause = true;
    			if (GameManager$3.GameScene != null) {
    				this.speed = 0;
    				GameManager$3.GameScene.showSuccessUI();
    			}
    		} else if (other.owner.name == "station") {
    			// if (!GameManager.isAddOil) {
    			//     if (GameManager.GameScene != null) {
    			//         GameManager.pause = true;
    			//         this.speed = 0;
    			//         GameManager.GameScene.jiayouTipUI.visible = true;
    			//         GameManager.StopSound(this.music);
    			//         this.music = "";
    			//     }
    			// }
    		} else {
    			// console.log(other.owner.name);
    			if (other.owner.name == "lg") {
    				if (GameManager$3.QDAni != null) {
    					GameManager$3.QDAni.crossFade("lgAni_up", 0.2);
    				}
    			}
    			if (other.owner.name == "lg_finish") {
    				if (GameManager$3.QDAni != null) {
    					GameManager$3.ZDAni.crossFade("lgAni_up", 0.2);
    				}
    			}
    		}
    		let id = this.checkParent(other);
    		if (id != -1) {
    			if (id > this.stationID) {
    				this.stationFlag = true;
    				this.playArrivalSound(id);
    				GameManager$3.GameScene.tips_img.skin = "GJJ/gameScene/tips3.png";
    				GameManager$3.GameScene.tips_img.visible = true;
    				GameManager$3.GameScene.tips_img.alpha = 1;
    				Laya.Tween.to(GameManager$3.GameScene.tips_img, { alpha: 0 }, 2 * 1000, null, Laya.Handler.create(GameManager$3.GameScene, function () {
    					GameManager$3.GameScene.tips_img.visible = false;
    					GameManager$3.GameScene.tips_img.alpha = 1;
    				}), 5 * 1000, true, true);
    			}
    		}
    	}

    	onTriggerStay(other) {
    		let id = this.checkParent(other);
    		if (id != -1 && this.speed <= 1 && !this.takeoffFlag && GameManager$3.GameScene.doorFlag) {
    			if (id > this.stationID) {
    				this.NPCTakeoff(id);
    				this.takeoffFlag = true;
    				GameManager$3.doorFlag = true;
    			}
    		}
    	}

    	onTriggerExit(other) {
    		if (other.owner.name == "lg") {
    			if (GameManager$3.QDAni != null) {
    				GameManager$3.QDAni.crossFade("lgAni_down", 0.2);
    			}
    		}
    		if (other.owner.name == "lg_finish") {
    			if (GameManager$3.QDAni != null) {
    				GameManager$3.ZDAni.crossFade("lgAni_down", 0.2);
    			}
    		}
    		let id = this.checkParent(other);
    		if (id != -1) {
    			this.stationFlag = false;
    			if (this.takeoffFlag) {
    				this.takeoffFlag = false;
    			} else {
    				console.log("车辆溜站，没有上下客");
    				if (id > this.stationID) {
    					GameManager$3.GameScene.showFailUI(1);
    					return;
    				}
    			}
    			this.checkChild(id);
    		}
    	}

    	onCollisionEnter(collision) {
    		if (collision.other.owner.name == "ground") {
    			this.onGround = true;
    		} else {
    			// this.CollisionHuiTan();
    		}
    	}

    	onCollisionStay(collision) {

    	}

    	onCollisionExit(collision) {
    		if (collision.other.owner.name == "ground") {
    			this.onGround = false;
    			this.gravity = 1;
    		}
    	}

    	onEnable() {
    		this.car = this.owner;
    		this.qian = this.car.getChildByName("tire_q");
    		this.hou = this.car.getChildByName("tire_h");

    		this.listenKeyboard();
    	}

    	Init(carJson) {
    		this.accelerateSpeed = carJson.accelerateSpeed;                             //加速度
    		this.accelerateBackSpeed = carJson.accelerateBackSpeed;                     //倒车加速度
    		this.speed = carJson.speed;                                                 //当前速度
    		this.maxSpeed = carJson.maxSpeed;                                           //最大速度
    		this.maxBackSpeed = carJson.maxBackSpeed;                                   //倒车最大速度
    		this.Maxoil = carJson.Maxoil;                                               //最大油量
    		this.oil = carJson.oil;                                                     //油量
    		this.oilSpeed = carJson.oilSpeed * 0;                                       //油量损耗速率

    		this.accelerateSpeed = carJson.accelerateSpeed;
    		this.maxSpeed = carJson.maxSpeed;
    		this.oil = carJson.oil;

    		this.AccelerateRotate = carJson.AccelerateRotate;
    		this.MaxAccelerateRotate = carJson.MaxAccelerateRotate;
    		this.RotateLimit = carJson.RotateLimit;
    		console.log("初始化汽车完成     ", this.car);


    		this.f_l = this.car.getChildByName("f_l");
    		this.f_r = this.car.getChildByName("f_r");
    		this.f_l_rote = this.car.getChildByName("f_l").getChildByName("f_l");
    		this.f_r_rote = this.car.getChildByName("f_r").getChildByName("f_r");
    		this.b_l_rote = this.car.getChildByName("b_l");
    		this.b_r_rote = this.car.getChildByName("b_r");

    		this.fxp = this.car.getChildByName("nei").getChildByName("fxp");


    		this.carRigidbody = this.car.getComponent(Laya.Rigidbody3D);
    		this.InitFinish = true;
    		this.carAnimator = this.owner.getComponent(Laya.Animator);
    		this.carAnimator.crossFade("close", 0.2);
    	}

    	listenKeyboard() {
    		// console.log("设置键盘监听事件");
    		// //添加键盘按下事件,一直按着某按键则会不断触发
    		// Laya.stage.on(Laya.Event.KEY_DOWN, this, this.onKeyDown);
    		// //添加键盘抬起事件
    		// Laya.stage.on(Laya.Event.KEY_UP, this, this.onKeyUp);
    	}

    	onKeyDown(e) {
    		this.keyDownList[e["keyCode"]] = true;
    	}

    	onKeyUp(e) {
    		delete this.keyDownList[e["keyCode"]];
    	}

    	Keyboard() {
    		if (!this.keyDownList[38] && !this.keyDownList[40] && !this.keyDownList[83] && !this.keyDownList[87] && !GameManager$3.FB) {
    			this.speed -= this.speed * 0.01;
    			if (GameManager$3.Gear == 1) {
    				if (this.speed > -0.001) {
    					this.speed = 0;
    				}
    			} else {
    				if (this.speed < 0.001) {
    					this.speed = 0;
    				}
    			}
    			if (parseInt(Math.abs(GameManager$3.CarJS.speed) * 5) != 0) {
    				if (this.music != "jiangsu") {
    					GameManager$3.StopSound(this.music);
    					this.music = "jiangsu";
    					GameManager$3.PlayCarSound(this.music, 1);
    				}
    			} else {
    				if (!GameManager$3.pause) {
    					if (this.music != "daiji") {
    						GameManager$3.StopSound(this.music);
    						this.music = "daiji";
    						GameManager$3.PlayCarSound(this.music, 0);
    					}
    				}
    			}
    		} else {
    			if (this.keyDownList[38] || this.keyDownList[87]) {
    				this.forward();
    			}
    			if (this.keyDownList[83] || this.keyDownList[40]) {
    				this.back();
    			}
    		}

    		if (!this.keyDownList[37] && !this.keyDownList[39] && !this.keyDownList[65] && !this.keyDownList[68] && !GameManager$3.LR) {
    			this.rotateAngle += (0 - this.rotateAngle) * 0.2;
    		} else {
    			if (this.keyDownList[65] || this.keyDownList[37]) {
    				this.left();
    			}
    			if (this.keyDownList[68] || this.keyDownList[39]) {
    				this.right();
    			}
    		}
    	}

    	onUpdate() {
    		if (this.InitFinish && !GameManager$3.pause) {
    			this.Keyboard();

    			var f = new Laya.Vector3(0, 0, 0);
    			this.f_l.transform.getForward(f);
    			if (this.onGround) {
    				this.linearVelocity = new Laya.Vector3(f.x * this.speed, 0, f.z * this.speed);
    				this.carRigidbody.linearVelocity = this.linearVelocity;
    			} else {
    				this.gravity++;
    				this.linearVelocity = new Laya.Vector3(f.x * this.speed, -this.gravity, f.z * this.speed);
    				this.carRigidbody.linearVelocity = this.linearVelocity;
    			}

    			var a = this.speed * (0 - this.rotateAngle) * 0.005;
    			a = this.Clamp(a, -1, 1);
    			this.carRigidbody.angularVelocity = new Laya.Vector3(0, a, 0);

    			var speed = -this.speed * 0.03;
    			this.f_l_rote.transform.rotate(new Laya.Vector3(speed, 0, 0));
    			this.f_r_rote.transform.rotate(new Laya.Vector3(speed, 0, 0));
    			this.b_l_rote.transform.rotate(new Laya.Vector3(speed, 0, 0));
    			this.b_r_rote.transform.rotate(new Laya.Vector3(speed, 0, 0));

    			this.f_l.transform.localRotationEulerY = this.rotateAngle;
    			this.f_r.transform.localRotationEulerY = this.rotateAngle;

    			this.fxp.transform.localRotationEulerZ = this.rotateAngle;
    			if (this.speed > 1) {
    				if (GameManager$3.GameScene.doorFlag) {
    					console.log("没有关闭车门起步");
    					GameManager$3.GameScene.showFailUI(3);
    				}
    			}
    		} else if (GameManager$3.pause) {
    			// this.speed = 0;
    			// var f = new Laya.Vector3(0, 0, 0);
    			// this.f_l.transform.getForward(f);
    			// if (this.onGround) {
    			//     this.linearVelocity = new Laya.Vector3(f.x * this.speed, 0, f.z * this.speed);
    			//     this.carRigidbody.linearVelocity = this.linearVelocity;
    			// } else {
    			//     this.gravity++;
    			//     this.linearVelocity = new Laya.Vector3(f.x * this.speed, -this.gravity, f.z * this.speed);
    			//     this.carRigidbody.linearVelocity = this.linearVelocity;
    			// }
    			GameManager$3.FB = false;
    			GameManager$3.LR = false;
    		}

    		this.CameraMove();
    	}

    	OilConsumption() {
    		this.oil -= Math.abs(this.speed) * this.oilSpeed;
    		if (this.oil < 0) {
    			this.oil = 0;
    			this.speed = 0;
    			GameManager$3.pause = true;
    			if (GameManager$3.isFristOil) {
    				GameManager$3.isFristOil = false;
    				GameManager$3.GameScene.showFristOilUI();
    			} else {
    				GameManager$3.GameScene.showFailUI();
    			}
    		} else {
    			if (this.music != "jiasu") {
    				GameManager$3.StopSound(this.music);
    				this.music = "jiasu";
    				GameManager$3.PlayCarSound(this.music, 0);
    			}
    		}
    	}

    	AddOil() {
    		this.oil = this.Maxoil;
    		GameManager$3.isAddOil = true;
    	}

    	CollisionHuiTan() {
    		if (this.isHuiTan) {
    			return;
    		}
    		this.isHuiTan = true;
    		Laya.timer.frameOnce(30, this, function () {
    			this.isHuiTan = false;
    		});
    		this.speed = this.speed / 2;
    	}

    	CameraMove() {
    		var fixedDistance = 9 * (0.1 * GameData$3.selectCar + 1);
    		var targetPos = this.car.transform.position;
    		var nowPos = GameManager$3.Camera.transform.position;
    		var dx = targetPos.x - nowPos.x;
    		var dz = targetPos.z - nowPos.z;
    		var actualDistance = Math.sqrt(dx * dx + dz * dz);
    		var xm = targetPos.x - dx * fixedDistance / actualDistance;
    		var zm = targetPos.z - dz * fixedDistance / actualDistance;
    		GameManager$3.Camera.transform.position = new Laya.Vector3(xm, this.car.transform.position.y + 4.5, zm);
    		GameManager$3.Camera.transform.position.y = 0;
    		GameManager$3.Camera.transform.lookAt(this.car.transform.position, new Laya.Vector3(0, 1, 0));
    		GameManager$3.Camera.transform.rotate(new Laya.Vector3(-20, 0, 0), true, false);
    	}


    	forward() {
    		if (GameManager$3.pause) {

    		} else {
    			if (GameManager$3.FB || this.keyDownList[38] || this.keyDownList[40] || this.keyDownList[83] || this.keyDownList[87]) {
    				switch (GameManager$3.Gear) {
    					case 0:
    						if (parseInt(Math.abs(GameManager$3.CarJS.speed) * 5) == 0) {
    							this.speed = 0;
    						}
    						break;
    					case 1:
    						this.speed -= this.accelerateSpeed;
    						if (this.speed <= this.maxBackSpeed) {
    							this.speed = this.maxBackSpeed;
    						}
    						this.OilConsumption();
    						break;
    					case 2:
    						this.speed += this.accelerateSpeed;
    						if (this.speed >= this.maxSpeed) {
    							this.speed = this.maxSpeed;
    						}
    						this.OilConsumption();
    						break;
    				}
    			}
    		}
    	}

    	back() {
    		if (GameManager$3.pause) {

    		} else {
    			if (GameManager$3.FB || this.keyDownList[38] || this.keyDownList[40] || this.keyDownList[83] || this.keyDownList[87]) {
    				this.speed += this.accelerateSpeed * 10 * GameManager$3.GearSpeed[GameManager$3.Gear];
    				switch (GameManager$3.Gear) {
    					case 0:
    						if (parseInt(Math.abs(GameManager$3.CarJS.speed) * 5) == 0) {
    							this.speed = 0;
    						}
    						break;
    					case 1:
    						if (this.speed > 0) {
    							this.speed = 0;
    						}
    						break;
    					case 2:
    						if (this.speed < 0) {
    							this.speed = 0;
    						}
    						break;
    				}
    			}
    		}

    		if (parseInt(Math.abs(GameManager$3.CarJS.speed) * 5) != 0) {
    			GameManager$3.StopSound(this.music);
    			this.music = "shache";
    			GameManager$3.PlayCarSound(this.music, 1);
    		}
    	}

    	left() {
    		if (GameManager$3.LR || this.keyDownList[37] || this.keyDownList[39] || this.keyDownList[65] || this.keyDownList[68]) {
    			if (this.speed >= this.RotateLimit) {
    				this.rotateAngle += this.MaxAccelerateRotate;
    			} else {
    				this.rotateAngle += this.AccelerateRotate;
    			}
    			if (this.rotateAngle >= 30) {
    				this.rotateAngle = 30;
    			}
    		}
    	}

    	right() {
    		if (GameManager$3.LR || this.keyDownList[37] || this.keyDownList[39] || this.keyDownList[65] || this.keyDownList[68]) {
    			if (this.speed >= this.RotateLimit) {
    				this.rotateAngle -= this.MaxAccelerateRotate;
    			} else {
    				this.rotateAngle -= this.AccelerateRotate;
    			}
    			if (this.rotateAngle <= -30) {
    				this.rotateAngle = -30;
    			}
    		}
    	}

    	Clamp(v, min, max) {
    		if (v < min) {
    			v = min;
    		}
    		if (v > max) {
    			v = max;
    		}
    		return v;
    	}

    	localPosition() {
    		return this.car.transform.localPosition;
    	}

    	onDisable() {

    	}
    	checkParent(obj) {
    		let name = obj.owner._parent.name;
    		if (name.indexOf("gjz_sh_") >= 0) {
    			var id = name.substr(name.lastIndexOf("_") + 1);
    			return parseInt(id);
    		}
    		return -1;
    	}
    	takeupNPC(id) {
    		let num = GameManager$3.stationList[id - 1].upNum;
    		GameManager$3.stationNum = num;
    		for (var i = 0; i < num; i++) {
    			GameManager$3.childList[i].childStartWalk();
    		}
    		if (id == 5) {
    			Laya.timer.once(2 * 1000, this, function () {
    				Laya.timer.scale = 0.0001;
    				GameManager$3.GameScene.showSuccessUI();
    			});
    		}
    	}
    	NPCTakeoff(key, num = null) {
    		if (num == null) {
    			num = GameManager$3.stationList[key - 1].downNum;
    		}
    		if (num == 0) {
    			this.takeupNPC(key);
    			return;
    		}
    		let id = GameManager$3.Random(0, 7);
    		if (GameManager$3.busList[id] == 1) {
    			GameManager$3.busList[id] = 0;
    			GameManager$3.Scene.getChildByName("Car_Nei").getChildAt(id).active = false;
    			num--;
    			if (num > 0) {
    				return this.NPCTakeoff(key, num);
    			} else {
    				this.takeupNPC(key);
    				return;
    			}
    		} else {
    			return this.NPCTakeoff(key, num);
    		}
    	}
    	showNPC() {
    		let id = GameManager$3.Random(0, 7);
    		if (GameManager$3.busList[id] == 0) {
    			GameManager$3.busList[id] = 1;
    			GameManager$3.Scene.getChildByName("Car_Nei").getChildAt(id).active = true;
    			return;
    		} else {
    			return this.showNPC();
    		}
    	}
    	checkChild(stationID) {
    		for (var key in GameManager$3.Scene.getChildByName(GameManager$3.LevelName[GameManager$3.selectLevel]).getChildByName("gjz_sh_" + stationID)._children) {
    			if (GameManager$3.Scene.getChildByName(GameManager$3.LevelName[GameManager$3.selectLevel]).getChildByName("gjz_sh_" + stationID)._children[key].name.lastIndexOf("child") != -1) {
    				console.log("任务失败，没有把站台上的乘客接走");
    				GameManager$3.GameScene.showFailUI(2);
    				return;
    			}
    		}
    		this.playLeaveSound(stationID);
    		this.stationID = stationID;
    	}
    	playArrivalSound(id) {
    		let map;
    		let name;
    		switch (GameManager$3.LevelName[GameManager$3.selectLevel]) {
    			case "shanghai1":
    				map = "sh";
    				break;
    			case "nanjing2":
    				map = "nj";
    				break;
    			case "guangzhou3":
    				map = "gz";
    				break;
    			case "qingdao4":
    				map = "qd";
    				break;
    			case "beijing5":
    				map = "bj";
    				break;
    		}
    		name = map + "_" + id + "_1";
    		GameManager$3.playStationSound(name);
    	}
    	playLeaveSound(id) {
    		let map;
    		let name;
    		switch (GameManager$3.LevelName[GameManager$3.selectLevel]) {
    			case "shanghai1":
    				map = "sh";
    				break;
    			case "nanjing2":
    				map = "nj";
    				break;
    			case "guangzhou3":
    				map = "gz";
    				break;
    			case "qingdao4":
    				map = "qd";
    				break;
    			case "beijing5":
    				map = "bj";
    				break;
    		}
    		name = map + "_" + id + "_2";
    		GameManager$3.playStationSound(name);
    		Laya.timer.clear(this, this.playDriveSound);
    		Laya.timer.once(8.5 * 1000, this, this.playDriveSound);
    	}
    	playDriveSound() {
    		GameManager$3.playStationSound("notice_1");
    	}
    }

    class Child extends Laya.Script3D {
    	constructor() {
    		super();
    		this.finishPos;
    		this.childPos;
    		this.walkFlag = false;
    	}
    	onEnable() {
    		this.model = this.owner;
    	}
    	Init(stationID, key) {
    		this.childAnimation = this.model.getComponent(Laya.Animator);
    		this.childAnimation.play("idle");
    		// this.finishPos = GameManager.Scene.getChildByName("gjz_sh_" + stationID).getChildByName("sh_" + stationID + "_pos1").transform.position;
    		this.finishPos = GameManager$3.Car.getChildByName("geton").transform.position;
    		this.childPos = GameManager$3.Scene.getChildByName(GameManager$3.LevelName[GameManager$3.selectLevel]).getChildByName("gjz_sh_" + stationID).getChildByName("sh_" + stationID + "_pos" + key).transform.position;
    	}
    	lookAt(targetPos) {
    		this.owner.transform.lookAt(targetPos, new Laya.Vector3(0, 1, 0));
    		this.owner.transform.rotate(new Laya.Vector3(0, 180, 0), false, false);
    	}
    	onUpdate() {
    		if (this.walkFlag) {
    			this.owner.transform.translate(new Laya.Vector3(0, 0, 0.1));
    			var targePos = this.finishPos;
    			this.lookAt(new Laya.Vector3(targePos.x, this.owner.transform.position.y, targePos.z));
    			var dis = Laya.Vector3.distance(targePos, this.owner.transform.position);
    			if (dis < 1) {
    				this.walkFlag = false;
    				this.childStopWalk();
    			}
    		}
    	}
    	childStartWalk() {
    		Laya.timer.once(GameManager$3.Random(1, 8) * 100, this, function () {
    			var targePos = this.finishPos;
    			this.lookAt(new Laya.Vector3(targePos.x, this.owner.transform.position.y, targePos.z));
    			this.walkFlag = true;
    			this.childAnimation.play("walk");
    		});
    	}
    	childStopWalk() {
    		this.walkFlag = false;
    		GameManager$3.childList.shift();
    		GameManager$3.stationNum--;
    		if (GameManager$3.stationNum == 0) {
    			GameManager$3.doorFlag = false;
    			GameManager$3.GameScene.tips_img.skin = "GJJ/gameScene/tips2.png";
    			GameManager$3.GameScene.tips_img.visible = true;
    			GameManager$3.GameScene.tips_img.alpha = 1;
    			Laya.Tween.to(GameManager$3.GameScene.tips_img, { alpha: 0 }, 2 * 1000, null, Laya.Handler.create(GameManager$3.GameScene, function () {
    				GameManager$3.GameScene.tips_img.visible = false;
    				GameManager$3.GameScene.tips_img.alpha = 1;
    			}), 5 * 1000, true, true);
    		}
    		GameManager$3.CarJS.showNPC();
    		this.owner.destroy();
    	}
    }

    class GS extends Laya.Script3D {

    	constructor() {
    		super();
    		this.normalizedTime1 = 0;
    		this.lastnormalizedTime1 = -1;

    		this.normalizedTime2 = 0;
    		this.lastnormalizedTime2 = -1;

    		this.normalizedTime3 = 0;
    		this.lastnormalizedTime3 = -1;

    		this.CameraAni = null;
    		this.NpcAni = null;
    		this.CarAni = null;

    		this.isAddOil = false;
    		this.isAddOil1 = false;
    		this.isAddOil2 = false;
    		this.isAddOil3 = false;
    	}

    	onEnable() {
    		for (var key = 1; key < 6; key++) {
    			if (key != GameData$3.selectCar) {
    				this.owner.getChildByName("car" + key).active = false;
    			}
    		}
    		this.CameraAni = this.owner.getChildByName("Camera").getComponent(Laya.Animator);
    		this.NpcAni = this.owner.getChildByName("npc5").getComponent(Laya.Animator);
    		this.CarAni = this.owner.getChildByName("car" + GameData$3.selectCar).getComponent(Laya.Animator);
    	}

    	addOil() {
    		this.isAddOil = true;
    	}

    	onUpdate() {
    		if (this.isAddOil) {
    			if (this.CameraAni != null) {
    				this.normalizedTime1 = this.CameraAni.getCurrentAnimatorPlayState().normalizedTime;
    				if (this.lastnormalizedTime1 == this.normalizedTime1) {
    					if (!this.isAddOil1) {
    						this.isAddOil1 = true;
    						console.log("加油站摄像头动画播放完毕");
    					}
    				}
    				this.lastnormalizedTime1 = this.normalizedTime1;
    			}

    			if (this.NpcAni != null) {
    				this.normalizedTime2 = this.NpcAni.getCurrentAnimatorPlayState().normalizedTime;
    				if (this.lastnormalizedTime2 == this.normalizedTime2) {
    					if (!this.isAddOil2) {
    						this.isAddOil2 = true;
    						console.log("加油站NPC车辆动画播放完毕");
    					}
    				}
    				this.lastnormalizedTime2 = this.normalizedTime2;
    			}

    			if (this.CarAni != null) {
    				this.normalizedTime3 = this.CarAni.getCurrentAnimatorPlayState().normalizedTime;
    				if (this.lastnormalizedTime3 == this.normalizedTime3) {
    					if (!this.isAddOil3) {
    						this.isAddOil3 = true;
    						console.log("加油站玩家车辆动画播放完毕");
    					}
    				}
    				this.lastnormalizedTime3 = this.normalizedTime3;
    			}

    			if (this.isAddOil1 && this.isAddOil2 && this.isAddOil3) {
    				this.isAddOil = false;
    				this.isAddOil1 = false;
    				this.isAddOil2 = false;
    				this.isAddOil3 = false;

    				if (GameManager$3.GameScene != null) {
    					// console.log(GameManager.Scene.getChildByName(GameManager.LevelName[GameManager.selectLevel]).getChildByName("point"));
    					GameManager$3.GameScene.createCar(GameManager$3.Scene.getChildByName(GameManager$3.LevelName[GameManager$3.selectLevel]).getChildByName("point").getChildByName("jiayou").transform.position);
    					GameManager$3.Car.transform.lookAt(GameManager$3.Scene.getChildByName(GameManager$3.LevelName[GameManager$3.selectLevel]).getChildByName("point").getChildByName("lookPoint").transform.position, new Laya.Vector3(0, 1, 0));
    					GameManager$3.GasStation.active = false;
    					GameManager$3.GameScene.oilAni.visible = false;
    					GameManager$3.GameScene.controlUI.visible = true;
    					GameManager$3.pause = false;
    				}
    			}
    		}
    	}


    	onDisable() {
    	}
    }

    class gameScene$2 extends Laya.Scene {
    	constructor() {
    		super();
    		this.value = 0;
    		this.normalizedTime = 0;
    		this.lastnormalizedTime = -1;
    		this.CameraAni = null;
    		this.kaichang = true;
    	}

    	onEnable() {
    		GameManager$3.Gear = 0;
    		GameManager$3.timeStr = 120;
    		Laya.timer.scale = 1;
    		// this.timeStr.visible = true;
    		// this.missionUI.visible = true;
    		this.missionUI2.visible = false;
    		this.missionUI3.visible = false;
    		this.kaichangAni.visible = true;
    		this.nextBtnTime = 0;
    		this.reStartBtn1Time = 0;
    		this.sureBtn1Time = 0;
    		this.doorFlag = false;
    		this.kaiguanFlag = false;
    		GameManager$3.isFristOil = true;
    		GameManager$3.pause = true;
    		Laya.timer.scale = 1;
    		this.kaichangAni.getChildByName(GameManager$3.LevelName[GameManager$3.selectLevel]).visible = true;
    		GameManager$3.isAddOil = false;

    		GameManager$3.GameScene = this;
    		GameManager_Collection.showBackBtn();
    		this.width = Laya.stage.width;
    		this.height = Laya.stage.height;
    		Laya.timer.loop(1, this, this.update);
    		for (var key in GameManager$3.LevelName) {
    			GameManager$3.ResScene.getChildByName(GameManager$3.LevelName[key]).active = false;
    		}

    		console.log("选择的地图：" + GameManager$3.selectLevel);
    		GameManager$3.ResScene.getChildByName(GameManager$3.LevelName[GameManager$3.selectLevel]).active = true;
    		GameManager$3.Scene = Laya.stage.addChildAt(GameManager$3.ResScene, 0);
    		// console.log(GameManager.Scene);
    		GameManager$3.hsjCamera = GameManager$3.Scene.getChildByName("Camera_N");
    		GameManager$3.hsjCamera.active = false;
    		GameManager$3.hsjCamera.renderTarget = new Laya.RenderTexture(512, 512);
    		GameManager$3.Camera = GameManager$3.Scene.getChildByName(GameManager$3.LevelName[GameManager$3.selectLevel]).getChildByName("Camera");

    		this.CameraAni = GameManager$3.Scene.getChildByName("kaichang").getComponent(Laya.Animator);
    		// this.createCar(GameManager.Scene.getChildByName(GameManager.LevelName[GameManager.selectLevel]).getChildByName("point").getChildByName("born").transform.position);

    		if (GameData$3.JSONMap[parseInt(GameManager$3.selectLevel) + 1]["GS"]) {
    			GameManager$3.GasStation = GameManager$3.Scene.getChildByName(GameManager$3.LevelName[GameManager$3.selectLevel]).getChildByName("jyz");
    			GameManager$3.GasStation.active = false;
    			GameManager$3.GasStationJS = GameManager$3.GasStation.addComponent(GS);
    		}

    		GameManager$3.Camera.active = false;
    		// GameManager.pause = false;
    		// GameManager.Scene.getChildByName("kaichang").active = false;
    		// GameManager.Camera.active = true;
    		// this.controlUI.visible = true;
    		// Laya.timer.loop(1000, this, function name(params) {
    		//     if (!GameManager.pause) {
    		//         GameManager.timeStr++;
    		//     }
    		// });

    		this.ButtonClick();

    		this.npcPoint = GameManager$3.Scene.getChildByName(GameManager$3.LevelName[GameManager$3.selectLevel]).getChildByName("npc")._children;
    		this.areaPoint = [];
    		for (var key in this.npcPoint) {
    			this.areaPoint[key] = this.npcPoint[key]._children;
    		}
    		for (var key in GameManager$3.Scene.getChildByName("Car_Nei")._children) {
    			GameManager$3.Scene.getChildByName("Car_Nei").getChildAt(key).active = false;
    		}

    		this.CameraAni = GameManager$3.Scene.getChildByName("kaichang").getComponent(Laya.Animator);
    		GameManager$3.QDAni = GameManager$3.Scene.getChildByName(GameManager$3.LevelName[GameManager$3.selectLevel]).getChildByName("cs").getChildByName("lg").getComponent(Laya.Animator);
    		GameManager$3.ZDAni = GameManager$3.Scene.getChildByName(GameManager$3.LevelName[GameManager$3.selectLevel]).getChildByName("zd").getChildByName("lg_finish").getComponent(Laya.Animator);
    	}

    	reStart() {
    		GameManager$3.timeStr = 120;
    		this.timeStr.visible = true;
    		// this.missionUI.visible = true;
    		this.missionUI2.visible = false;
    		this.missionUI3.visible = false;
    		GameManager$3.isFristOil = true;
    		GameManager$3.Gear = 0;

    		if (GameManager$3.Car != null) {
    			GameManager$3.Car.destroy();
    			GameManager$3.Car = null;
    			this.createCar(GameManager$3.Scene.getChildByName(GameManager$3.LevelName[GameManager$3.selectLevel]).getChildByName("point").getChildByName("born").transform.position);
    		}
    	}

    	createMoreAICar(num = 1) {
    		GameManager$3.AICarNum = 0;
    		for (var key in this.areaPoint) {
    			for (var i = 0; i < num; i++) {
    				Laya.timer.once(8000 * i, this, this.createAICar, [key], false);
    			}
    		}
    	}

    	createAICar(key) {
    		var npcCar = Laya.Sprite3D.instantiate(GameManager$3.CarModel.getChildByName("npc" + GameManager$3.Random(1, 6)), GameManager$3.Scene);
    		npcCar.transform.position = this.areaPoint[key][0].transform.position;
    		var npcCarJS = npcCar.addComponent(AICar);
    		npcCarJS.Init(this.areaPoint[key], GameManager$3.AICarNum);
    		GameManager$3.AICarNum++;
    	}

    	createCar(point) {
    		let id = parseInt(GameManager$3.selectLevel) + 1;
    		console.log("id     " + id);
    		GameManager$3.Car = Laya.Sprite3D.instantiate(GameManager$3.CarModel.getChildByName("car" + 1), GameManager$3.Scene);
    		GameManager$3.Car.transform.position = point;
    		GameManager$3.CarJS = GameManager$3.Car.addComponent(Car$2);
    		GameManager$3.CarJS.Init(GameData$3.JSONCar[GameData$3.selectCar]);
    		GameManager$3.CarCamera = GameManager$3.Car.getChildByName("nei").getChildByName("Camera_1");
    		GameManager$3.CarCamera.active = false;
    		var wCamera = GameManager$3.Car.getChildByName("Camera_W");
    		wCamera.active = false;
    		wCamera.renderTarget = new Laya.RenderTexture(512, 512);
    		var mat = new Laya.UnlitMaterial();
    		mat.albedoColor = new Laya.Vector4(1.0, 1.0, 1.0, 1.0);
    		mat.cull = Laya.RenderState.CULL_NONE;
    		GameManager$3.Car.getChildByName("hsj_n").getChildByName("N").meshRenderer.sharedMaterial = mat;
    		GameManager$3.hsjCamera.active = true;
    		GameManager$3.hsjCamera.renderingOrder = -1;
    		// GameManager.Car.getChildByName("hsj_n").getChildByName("N").transform.scale = new Laya.Vector3(GameManager.Car.getChildByName("hsj_n").getChildByName("N").transform.scale.x * -1, GameManager.Car.getChildByName("hsj_n").getChildByName("N").transform.scale.y, GameManager.Car.getChildByName("hsj_n").getChildByName("N").transform.scale.z);
    		//清除标记
    		GameManager$3.hsjCamera.clearFlag = Laya.BaseCamera.CLEARFLAG_SKY;
    		//设置网格精灵的纹理
    		mat.albedoTexture = GameManager$3.hsjCamera.renderTarget;

    		var mat1 = new Laya.UnlitMaterial();
    		mat1.albedoColor = new Laya.Vector4(1.0, 1.0, 1.0, 1.0);
    		mat1.cull = Laya.RenderState.CULL_NONE;
    		// GameManager.Car.getChildByName("hsj_w").getChildByName("W").transform.scale = new Laya.Vector3(GameManager.Car.getChildByName("hsj_w").getChildByName("W").transform.scale.x * -1, GameManager.Car.getChildByName("hsj_w").getChildByName("W").transform.scale.y, GameManager.Car.getChildByName("hsj_w").getChildByName("W").transform.scale.z);
    		GameManager$3.Car.getChildByName("hsj_w").getChildByName("W").meshRenderer.sharedMaterial = mat1;
    		wCamera.active = true;
    		wCamera.renderingOrder = -1;
    		// wCamera.transform.localScale = new Laya.Vector3(-1, 1, 1);
    		//清除标记
    		wCamera.clearFlag = Laya.BaseCamera.CLEARFLAG_SKY;
    		//设置网格精灵的纹理
    		mat1.albedoTexture = wCamera.renderTarget;
    		for (var key in GameData$3.JSONStation) {
    			if (GameData$3.JSONStation[key].map == GameManager$3.LevelName[GameManager$3.selectLevel]) {
    				GameManager$3.stationList[GameManager$3.stationList.length] = GameData$3.JSONStation[key];
    				this.creatChild(GameManager$3.stationList.length, GameData$3.JSONStation[key].upNum);
    			}
    		}
    	}

    	ButtonClick() {
    		this.left.on(Laya.Event.MOUSE_DOWN, this, function () {
    			GameManager$3.LR = true;
    			Laya.timer.loop(1, this, this.BtnLeft);
    		});
    		this.left.on(Laya.Event.MOUSE_UP, this, function () {
    			Laya.timer.clear(this, this.BtnLeft);
    			GameManager$3.LR = false;
    		});

    		this.right.on(Laya.Event.MOUSE_DOWN, this, function () {
    			GameManager$3.LR = true;
    			Laya.timer.loop(1, this, this.BtnRight);
    		});
    		this.right.on(Laya.Event.MOUSE_UP, this, function () {
    			Laya.timer.clear(this, this.BtnRight);
    			GameManager$3.LR = false;
    		});

    		this.forward.on(Laya.Event.MOUSE_DOWN, this, function () {
    			GameManager$3.FB = true;
    			Laya.timer.loop(1, this, this.BtnForward);
    		});
    		this.forward.on(Laya.Event.MOUSE_UP, this, function () {
    			Laya.timer.clear(this, this.BtnForward);
    			GameManager$3.FB = false;
    		});

    		this.back.on(Laya.Event.MOUSE_DOWN, this, function () {
    			GameManager$3.FB = true;
    			Laya.timer.loop(1, this, this.BtnBack);
    		});
    		this.back.on(Laya.Event.MOUSE_UP, this, function () {
    			Laya.timer.clear(this, this.BtnBack);
    			GameManager$3.FB = false;
    		});
    		this.pauseBtn.on(Laya.Event.CLICK, this, function () {
    			this.pauseUI.visible = true;
    			GameManager$3.pause = true;
    			Laya.timer.scale = 0.0001;
    			if (GameManager$3.CarJS != null) {
    				GameManager$3.StopSound(GameManager$3.CarJS.music);
    				GameManager$3.CarJS.music = "";
    			}
    		});
    		this.closePauseBtn.on(Laya.Event.CLICK, this, function () {
    			this.pauseUI.visible = false;
    			GameManager$3.pause = false;
    			Laya.timer.scale = 1;
    		});
    		this.reStartBtn.on(Laya.Event.CLICK, this, function () {
    			Laya.Scene.open("GJJ/mapScene_GJJ.scene", true, true);
    		});
    		this.mainBtn.on(Laya.Event.CLICK, this, function () {
    			Laya.Scene.open("GJJ/mainScene_GJJ.scene");
    		});
    		this.continueBtn.on(Laya.Event.CLICK, this, function () {
    			this.pauseUI.visible = false;
    			GameManager$3.pause = false;
    			Laya.timer.scale = 1;
    		});
    		this.changeCamera.on(Laya.Event.CLICK, this, function () {
    			if (GameManager$3.CarCamera != null) {
    				if (GameManager$3.CarCamera.active) {
    					GameManager$3.CarCamera.active = false;
    					GameManager$3.Camera.active = true;
    				} else {
    					GameManager$3.CarCamera.active = true;
    					GameManager$3.Camera.active = false;
    				}
    			}
    		});

    		this.sureBtn.on(Laya.Event.CLICK, this, function () {
    			if (GameManager$3.GasStationJS != null) {
    				this.controlUI.visible = false;
    				this.jiayouTipUI.visible = false;
    				this.oilAni.visible = true;
    				GameData$3.money = GameData$3.money - 100;
    				GameData$3.SetData("money", GameData$3.money);

    				if (GameManager$3.Car != null) {
    					GameManager$3.Car.destroy();
    					GameManager$3.Car = null;
    				}
    				GameManager$3.GasStation.active = true;
    				GameManager$3.GasStationJS.addOil();
    				if (GameManager$3.CarJS != null) {
    					GameManager$3.CarJS.AddOil();
    				}
    			}
    		});
    		this.cancelBtn.on(Laya.Event.CLICK, this, function () {
    			this.jiayouTipUI.visible = false;
    			GameManager$3.pause = false;
    			Laya.timer.scale = 1;
    		});

    		this.nextBtn.on(Laya.Event.CLICK, this, function () {
    			var map = GameData$3.GetUserData("map");
    			GameManager$3.selectLevel++;
    			if (map[GameManager$3.selectLevel] == 0) {
    				map[GameManager$3.selectLevel] = 1;
    				GameData$3.SetData("map", map);
    			}
    			if (GameManager$3.selectLevel >= 5) {
    				GameManager$3.selectLevel = 4;
    				Laya.Scene.open("GJJ/mapScene_GJJ.scene", true, false);
    			} else {
    				Laya.Scene.open("GJJ/mapScene_GJJ.scene", true, true);
    			}
    		});

    		this.againBtn.on(Laya.Event.CLICK, this, function () {
    			Laya.Scene.open("GJJ/mapScene_GJJ.scene", true, true);
    		});

    		this.mainBtn1.on(Laya.Event.CLICK, this, function () {
    			Laya.Scene.open("GJJ/mainScene_GJJ.scene");
    		});

    		this.reStartBtn1.on(Laya.Event.CLICK, this, function () {
    			GameManager_Collection.showVideo(function () {
    				Laya.Scene.open("GJJ/mapScene_GJJ.scene", true, true);
    			}.bind(this));
    		});

    		this.loudspeaker.on(Laya.Event.CLICK, this, function () {
    			GameManager$3.PlaySound("laba");
    		});

    		this.P.on(Laya.Event.CLICK, this, function () {
    			if (GameManager$3.Gear == 1) {
    				GameManager$3.StopSound("daoche");
    			}
    			GameManager$3.Gear = 0;
    		});

    		this.R.on(Laya.Event.CLICK, this, function () {
    			GameManager$3.PlaySound("daoche", 0);
    			GameManager$3.Gear = 1;
    		});

    		this.D.on(Laya.Event.CLICK, this, function () {
    			if (GameManager$3.Gear == 1) {
    				GameManager$3.StopSound("daoche");
    			}
    			GameManager$3.Gear = 2;
    		});


    		this.sureBtn1.on(Laya.Event.CLICK, this, function () {
    			GameManager_Collection.showVideo(function () {
    				this.fristOil.visible = false;
    				if (GameManager$3.CarJS != null) {
    					GameManager$3.CarJS.oil = GameManager$3.CarJS.Maxoil;
    				}
    				GameManager$3.pause = false;
    				Laya.timer.scale = 1;
    			}.bind(this));
    		});
    		this.closeBtn1.on(Laya.Event.CLICK, this, function () {
    			this.fristOil.visible = false;
    			this.showFailUI();
    		});
    		this.open_btn.on(Laya.Event.CLICK, this, this.carDoor);
    	}

    	BtnLeft() {
    		console.log("left");
    		if (GameManager$3.CarJS != null) {
    			GameManager$3.CarJS.left();
    		}
    	}
    	closePause() {
    		this.pauseUI.visible = false;
    		GameManager$3.pause = false;
    		Laya.timer.scale = 1;
    	}
    	BtnRight() {
    		console.log("right");
    		if (GameManager$3.CarJS != null) {
    			GameManager$3.CarJS.right();
    		}
    	}

    	BtnForward() {
    		console.log("forward");
    		if (GameManager$3.CarJS != null) {
    			GameManager$3.CarJS.forward();
    		}
    	}

    	BtnBack() {
    		console.log("back");
    		if (GameManager$3.CarJS != null) {
    			GameManager$3.CarJS.back();
    		}
    	}

    	update() {
    		this.moneyNum.text = GameData$3.money;

    		if (GameManager$3.CarJS != null) {
    			let num = 310 * Math.abs(GameManager$3.CarJS.speed) / GameManager$3.CarJS.maxSpeed * 0.7;
    			let speedMask = 3.125 * Math.abs(GameManager$3.CarJS.speed * 5);
    			if (num > 155) {
    				num = 155;
    			}
    			if (GameManager$3.CarJS.speed >= 0) {
    				this.speed.mask.graphics.clear();
    				this.speed.mask.graphics.drawPie(71, 71, 76, 115, 115 + speedMask, "#ff0000");//前进速度仪表盘显示
    				this.oil.mask.graphics.clear();
    				this.oil.mask.graphics.drawPie(71, 71, 76, 140, 180 + num, "#ff0000");//转速显示
    			} else {
    				this.speed.mask.graphics.clear();
    				this.speed.mask.graphics.drawPie(71, 71, 76, 115, 115 + speedMask, "#ff0000");//倒退速度仪表盘显示
    				this.oil.mask.graphics.clear();
    				this.oil.mask.graphics.drawPie(71, 71, 76, 140, 180 + num, "#ff0000");//转速显示
    			}

    			this.speedNum.text = parseInt(Math.abs(GameManager$3.CarJS.speed) * 5);
    		}

    		if (this.CameraAni != null) {
    			this.normalizedTime = this.CameraAni.getCurrentAnimatorPlayState().normalizedTime;
    			if (this.lastnormalizedTime >= 0.90) {
    				if (GameManager$3.GameScene != null) {
    					if (this.kaichang) {
    						console.log("开场结束");
    						GameManager$3.pause = false;
    						Laya.timer.scale = 1;
    						this.kaichang = false;
    						Laya.timer.once(1, this, function () {
    							console.log("初始化玩家车辆");
    							this.createCar(GameManager$3.Scene.getChildByName(GameManager$3.LevelName[GameManager$3.selectLevel]).getChildByName("point").getChildByName("born").transform.position);
    							var _outPos = new Laya.Vector3();
    							var layaMonkey3D = GameManager$3.Car.getChildByName("nei").getChildByName("Button");
    							GameManager$3.Scene.getChildByName("kaichang").active = false;
    							GameManager$3.CarCamera.active = true;
    							GameManager$3.CarCamera.viewport.project(layaMonkey3D.transform.position.clone(), GameManager$3.CarCamera.projectionViewMatrix, _outPos);
    							this.open_btn.pos(_outPos.x / Laya.stage.clientScaleX, _outPos.y / Laya.stage.clientScaleY);
    							this.kaichangAni.visible = false;
    							this.controlUI.visible = true;
    						});
    					}
    				}
    			}
    			this.lastnormalizedTime = this.normalizedTime;
    		}
    		this.timeStr.text = GameManager$3.ChangeMinuteSecondstr(GameManager$3.timeStr);

    		if (this.handle.y > GameManager$3.GearSize[GameManager$3.Gear]) {
    			this.handle.y -= 2;
    		} else if (this.handle.y < GameManager$3.GearSize[GameManager$3.Gear]) {
    			this.handle.y += 2;
    		}
    	}

    	showSuccessUI() {
    		GameManager$3.pause = true;
    		Laya.timer.scale = 0.0001;
    		var num = 0;
    		var map = GameData$3.GetUserData("map");
    		console.log("num:", num);
    		if (map[GameManager$3.selectLevel] == 1) {
    			num = parseInt((parseInt(GameManager$3.selectLevel) + 1)) * 1000;
    		} else {
    			num = parseInt((parseInt(GameManager$3.selectLevel) + 1)) * 100;
    		}
    		console.log("num:", num);

    		this.missionUI.visible = false;
    		var map = GameData$3.GetUserData("map");
    		map[GameManager$3.selectLevel] = 1;
    		if (GameManager$3.timeStr >= 0) {
    			// this.missionUI2.visible = true;
    			map[GameManager$3.selectLevel] = 3;
    			num = parseInt(num) + parseInt((parseInt(GameManager$3.selectLevel) + 1)) * 50;
    			this.nice.visible = true;
    		} else {
    			// this.missionUI3.visible = true;
    			map[GameManager$3.selectLevel] = 2;
    			this.nice.visible = true;
    		}
    		GameData$3.SetData("map", map);
    		this.successUI.visible = true;

    		console.log("num:", num);
    		this.rewardNum.text = num;
    		GameData$3.money = GameData$3.money + parseInt(this.rewardNum.text);
    		GameData$3.SetData("money", GameData$3.money);

    		if (GameManager$3.CarJS != null) {
    			GameManager$3.StopSound(GameManager$3.CarJS.music);
    			GameManager$3.CarJS.music = "";
    		}
    	}

    	showFailUI(id) {
    		GameManager$3.pause = true;
    		Laya.timer.scale = 0.0001;
    		this.missionUI.visible = false;
    		// this.missionUI3.visible = true;
    		this.failUI.visible = true;
    		Laya.timer.scale = 0.0001;
    		if (GameManager$3.CarJS != null) {
    			GameManager$3.StopSound(GameManager$3.CarJS.music);
    			GameManager$3.CarJS.music = "";
    		}
    		switch (id) {
    			case 1:
    				this.tip1.visible = true;
    				this.tip2.visible = false;
    				this.tip3.visible = false;
    				break;
    			case 2:
    				this.tip1.visible = false;
    				this.tip2.visible = true;
    				this.tip3.visible = false;
    				break;
    			case 3:
    				this.tip1.visible = false;
    				this.tip2.visible = false;
    				this.tip3.visible = true;
    				break;
    		}
    	}

    	showFristOilUI() {
    		GameManager$3.pause = true;
    		Laya.timer.scale = 0.0001;
    		this.fristOil.visible = true;


    		if (GameManager$3.CarJS != null) {
    			GameManager$3.StopSound(GameManager$3.CarJS.music);
    			GameManager$3.CarJS.music = "";
    		}
    	}

    	creatChild(stationID, num) {
    		for (var key = 1; key <= num; key++) {
    			let id = GameManager$3.Random(1, 8);
    			let name = "child_0" + id;
    			let model = Laya.Sprite3D.instantiate(GameManager$3.CarModel.getChildByName(name), GameManager$3.Scene.getChildByName(GameManager$3.LevelName[GameManager$3.selectLevel]).getChildByName("gjz_sh_" + stationID));
    			let p = GameManager$3.Scene.getChildByName(GameManager$3.LevelName[GameManager$3.selectLevel]).getChildByName("gjz_sh_" + stationID).getChildByName("sh_" + stationID + "_pos" + key).transform.position;
    			model.transform.position = p;
    			model.transform.rotation = GameManager$3.Scene.getChildByName(GameManager$3.LevelName[GameManager$3.selectLevel]).getChildByName("gjz_sh_" + stationID).getChildByName("sh_" + stationID + "_pos" + key).transform.rotation;
    			var child = model.addComponent(Child);
    			let finishPos = "sh_" + stationID + "_pos1";
    			let childPos = "sh_" + stationID + "_pos" + key;
    			child.Init(stationID, key);
    			GameManager$3.childList.push(child);
    		}
    	}
    	carDoor() {
    		if (Math.abs(GameManager$3.CarJS.speed) > 1 || this.kaiguanFlag) {
    			return;
    		}
    		if (!this.doorFlag) {
    			Laya.timer.once(2 * 1000, this, function () {
    				this.doorFlag = true;
    			});
    			this.open_btn.skin = "GJJ/gameScene/closedoor_img.png";
    			GameManager$3.CarJS.carAnimator.crossFade("open", 0.2);
    		} else {
    			if (GameManager$3.doorFlag) {
    				this.tips_img.skin = "GJJ/gameScene/tips1.png";
    				this.tips_img.visible = true;
    				this.tips_img.alpha = 1;
    				Laya.Tween.to(this.tips_img, { alpha: 0 }, 2 * 1000, null, Laya.Handler.create(this, function () {
    					this.tips_img.visible = false;
    					this.tips_img.alpha = 1;
    				}), 1 * 1000, true, true);
    			} else {
    				this.doorFlag = false;
    				this.open_btn.skin = "GJJ/gameScene/opendoor_img.png";
    				GameManager$3.CarJS.carAnimator.crossFade("close", 0.2);
    			}
    		}
    		this.kaiguanFlag = true;
    		Laya.timer.clear(this, this.resetFlag);
    		this.resetFlag();
    	}
    	resetFlag() {
    		Laya.timer.once(3 * 1000, this, function () {
    			this.kaiguanFlag = false;
    		});
    	}

    	onDisable() {
    		Laya.timer.clearAll(this);
    		Laya.timer.scale = 1;
    		GameManager$3.clearData();
    		this.destroy();
    		GameManager$3.Scene.destroy();
    		GameManager$3.GameScene = null;
    	}
    }

    class loading extends Laya.Scene {

    	constructor() {
    		super();
    	}

    	onEnable() {
    		this.width = Laya.stage.width;
    		this.height = Laya.stage.height;
    		if (GameManager_Collection.GameConfig) {
    			if (GameManager_Collection.GameConfig) {
    				if (GameManager_Collection.gq) {
    					this.logo.skin = GameManager_Collection.GameConfig.gamesLogo[GameManager_Collection.GameID];
    				} else {
    					this.logo.skin = "Collection/AllGameScene/logo.png";
    				}
    			}
    		}
    		GameManager_Collection.hideBackBtn();
    		Laya.timer.scale = 1;
    		this.loadValue = 0;
    		this.updateLoadValue = 0;

    		Laya.timer.loop(1, this, this.update);

    		this.loadValue = 1;

    	}

    	update() {
    		this.updateLoadValue += 0.01;
    		if (this.updateLoadValue > this.loadValue) {
    			this.updateLoadValue = this.loadValue;
    		}
    		if (this.updateLoadValue >= 1) {
    			Laya.timer.clear(this, this.update);
    			this.goMain();
    		}

    		this.loadBar.value = this.updateLoadValue;
    	}

    	goMain() {
    		this.loadStr.text = "正在加载数据";
    		GameData$3.InitData(function () {
    			this.next();
    		}.bind(this));
    	}

    	next() {
    		this.loadValue = 1;
    		Laya.Scene.open("GJJ/mainScene_GJJ.scene");
    	}

    	onDisable() {
    		Laya.timer.clearAll(this);
    		Laya.timer.scale = 1;
    	}
    }

    class mainScene$2 extends Laya.Scene {

    	constructor() {
    		super();
    	}

    	onEnable() {
    		this.width = Laya.stage.width;
    		this.height = Laya.stage.height;
    		Laya.timer.scale = 1;
    		if (GameManager_Collection.GameConfig) {
    			if (GameManager_Collection.GameConfig) {
    				if (GameManager_Collection.gq) {
    					this.logo.skin = GameManager_Collection.GameConfig.gamesLogo[GameManager_Collection.GameID];
    				} else {
    					this.logo.skin = "Collection/AllGameScene/logo.png";
    				}
    			}
    		}
    		GameManager_Collection.showBackBtn();
    		GameManager$3.PlayMusic("bgm");
    		this.startBtn.on(Laya.Event.CLICK, this, function () {
    			Laya.Scene.open("GJJ/mapScene_GJJ.scene", true, false);
    		});
    		this.garageBtn.on(Laya.Event.CLICK, this, function () {
    			Laya.Scene.open("GJJ/cheScene_GJJ.scene");
    		});
    		this.settingBtn.on(Laya.Event.CLICK, this, this.onpenSettintUI);
    		this.settingCloseBtn.on(Laya.Event.CLICK, this, this.closeSettintUI);

    		this.openMusicBtn.on(Laya.Event.CLICK, this, function () {
    			GameManager$3.OpenSound();
    		});

    		this.closeMusicBtn.on(Laya.Event.CLICK, this, function () {
    			GameManager$3.CloseSound();
    		});

    		this.ageBtn.on(Laya.Event.CLICK, this, function () {
    			// SDK_apk.showNotice();
    		});

    		this.moneyNum.text = GameData$3.money;
    	}

    	onpenSettintUI() {
    		this.settingUI.visible = true;
    	}

    	closeSettintUI() {
    		this.settingUI.visible = false;
    	}


    	onDisable() {
    		Laya.timer.clearAll(this);
    		Laya.timer.scale = 1;
    	}
    }

    class mapScene extends Laya.Scene {

    	constructor() {
    		super();
    	}

    	onEnable() {
    		this.width = Laya.stage.width;
    		this.height = Laya.stage.height;
    		Laya.timer.scale = 1;
    		this.loadValue = 1;
    		this.updateLoadValue = 0;
    		Laya.timer.scale = 1;
    		this.resource = [
    			"res/GJJ/unity_res/LayaScene_map2/Conventional/map2.ls",
    			"res/GJJ/unity_res/LayaScene_che2/Conventional/che2.lh",
    		];

    		Laya.loader.create(this.resource, Laya.Handler.create(this, this.onPreLoadFinish),
    			Laya.Handler.create(this, function (value) {
    				this.loadValue = value;
    			})
    		);

    		this.startBtn.on(Laya.Event.CLICK, this, function () {
    			this.loading.visible = true;
    			Laya.timer.loop(1, this, this.update);
    			GameManager_Collection.hideBackBtn();
    		});
    		this.backBtn.on(Laya.Event.CLICK, this, function () {
    			Laya.Scene.open("GJJ/mainScene_GJJ.scene");
    		});

    		this.selectBtns = [];
    		this.selectBtns.push(this.shanghai1);
    		this.selectBtns.push(this.nanjing2);
    		this.selectBtns.push(this.guangzhou3);
    		this.selectBtns.push(this.qingdao4);
    		this.selectBtns.push(this.beijing5);

    		var map = GameData$3.GetUserData("map");
    		for (var key in this.selectBtns) {
    			this.selectBtns[key].on(Laya.Event.CLICK, this, this.selectMap, [key]);
    			if (map[key] == 0) {
    				this.selectBtns[key].getChildByName("lock").visible = true;
    			} else if (map[key] == 1) {
    				this.selectBtns[key].getChildByName("unlock").visible = true;
    			} else if (map[key] == 2) {
    				this.selectBtns[key].getChildByName("pass").visible = true;
    			} else if (map[key] == 3) {
    				this.selectBtns[key].getChildByName("nice").visible = true;
    				this.selectBtns[key].getChildByName("pass").visible = true;
    			}
    		}
    	}

    	onOpened(type) {
    		if (type) {
    			this.selectMap(GameManager$3.selectLevel);
    			this.loading.visible = true;
    			Laya.timer.loop(1, this, this.update);
    		} else {
    			this.selectMap(0);
    		}
    	}

    	onPreLoadFinish() {
    		GameManager$3.ResScene = Laya.Loader.getRes("res/GJJ/unity_res/LayaScene_map2/Conventional/map2.ls");
    		GameManager$3.CarModel = Laya.Loader.getRes("res/GJJ/unity_res/LayaScene_che2/Conventional/che2.lh");
    	}

    	selectMap(id) {
    		var map = GameData$3.GetUserData("map");
    		if (map[id] == 0) {
    			GameManager_Collection.showVideo(function () {
    				this.selectBtns[GameManager$3.selectLevel].getChildByName("isSelect").visible = false;
    				GameManager$3.selectLevel = id;
    				this.selectBtns[GameManager$3.selectLevel].getChildByName("isSelect").visible = true;
    				this.selectBtns[GameManager$3.selectLevel].getChildByName("lock").visible = false;
    				this.selectBtns[GameManager$3.selectLevel].getChildByName("unlock").visible = true;
    				var pos = parseInt(id) + 1;
    				this.title.text = GameData$3.JSONMap[pos].title;
    				this.introduce.text = GameData$3.JSONMap[pos]["introduce"];
    				map[id] = 1;
    				GameData$3.SetData("map", map);
    			}.bind(this));
    		} else {
    			this.selectBtns[GameManager$3.selectLevel].getChildByName("isSelect").visible = false;
    			GameManager$3.selectLevel = id;
    			this.selectBtns[GameManager$3.selectLevel].getChildByName("isSelect").visible = true;
    			var pos = parseInt(id) + 1;
    			this.title.text = GameData$3.JSONMap[pos].title;
    			this.introduce.text = GameData$3.JSONMap[pos]["introduce"];
    		}
    	}

    	update() {
    		this.updateLoadValue += 0.01;
    		if (this.updateLoadValue > this.loadValue) {
    			this.updateLoadValue = this.loadValue;
    		}

    		this.loadBar.value = this.updateLoadValue;

    		if (this.loadBar.value >= 1) {
    			Laya.timer.clear(this, this.update);
    			Laya.Scene.open("GJJ/gameScene_GJJ.scene");
    		}
    	}

    	onDisable() {
    		Laya.timer.clearAll(this);
    		Laya.timer.scale = 1;
    	}
    }

    class GameData$4 {
    	static InitData(successcallback) {
    		var Truck = Laya.LocalStorage.getItem("Truck");
    		if (Truck) {
    			console.log("============老用户============");
    			GameData$4.Truck = JSON.parse(Truck);
    			var day = new Date().getDate();
    			if (GameData$4.Truck.curDay != day) {
    				console.log("============新的一天============");
    				GameData$4.Truck.curDay = day;
    			}
    		} else {
    			console.log("============新用户============");
    		}

    		var config = [
    			"res/Truck/JSON/car.json",
    			"res/Truck/JSON/map.json",
    		];

    		Laya.loader.load(config, Laya.Handler.create(this, function () {
    			GameData$4.JSONCar = Laya.loader.getRes(config[0]);
    			GameData$4.JSONMap = Laya.loader.getRes(config[1]);
    			GameData$4.SaveData();
    			successcallback();
    		}));
    	}

    	static SaveData() {
    		var Truck = JSON.stringify(GameData$4.Truck);
    		Laya.LocalStorage.setItem("Truck", Truck);
    		console.log(Truck);

    		GameData$4.selectCar = GameData$4.GetUserData("selectCar");
    		GameData$4.money = GameData$4.GetUserData("money");
    	}

    	static GetUserData(key) {
    		return GameData$4.Truck[key];
    	}

    	static SetData(key, value) {
    		GameData$4.Truck[key] = value;
    		GameData$4.SaveData();
    	}
    }
    GameData$4.AutoSave = true;//自动保存标识
    GameData$4.Truck = {
    	"sound": 1,
    	"yssm": 0,              //隐私声明
    	"curDay": 0,            //日期
    	"money": 1000,          //金币
    	"selectCar": 1,
    	"map": [1, 0, 0, 0, 0],
    	"car": [1, 0, 0, 0, 0],
    };

    GameData$4.JSONCar = null;
    GameData$4.JSONMap = null;
    GameData$4.money = 0;
    GameData$4.selectCar = 1;

    class GameManager$4 {
    	static ChangeMinuteSecondstr(str) {
    		if (str !== "0" && str !== "" && str !== null) {
    			return ((Math.floor(str / 60)).toString().length < 2 ? "0" + (Math.floor(str / 60)).toString() :
    				(Math.floor(str / 60)).toString()) + ":" + ((str % 60).toString().length < 2 ? "0" + (str % 60).toString() : (str % 60).toString());
    		} else {
    			return "00:00";
    		}
    	}

    	static PlaySound(name, loop = 1) {
    		var sn = "res/Truck/sound/" + name + ".wav";
    		Laya.loader.load(sn, Laya.Handler.create(this, () => {
    			Laya.SoundManager.playSound(sn, loop);
    			if (GameManager$4.hasPlayedSound.indexOf(sn) == -1) {
    				GameManager$4.hasPlayedSound.push(sn);
    				Laya.SoundManager.playSound(sn, loop);
    			}
    		}));
    	}

    	static StopSound(name) {
    		if (name == null) {
    			Laya.SoundManager.stopAll();
    		}
    		else {
    			var sn = "res/Truck/sound/" + name + ".wav";
    			Laya.SoundManager.stopSound(sn);
    		}
    	}

    	static OpenSound() {
    		Laya.SoundManager.muted = false;
    	}

    	static CloseSound() {
    		Laya.SoundManager.muted = true;
    	}

    	static PlayCarSound(name, loop = 1) {
    		var sn = "res/Truck/sound/" + name + ".wav";
    		Laya.loader.load(sn, Laya.Handler.create(this, () => {
    			Laya.SoundManager.playSound(sn, loop);
    			// Laya.SoundManager.setSoundVolume(1);
    			if (GameManager$4.hasPlayedSound.indexOf(sn) == -1) {
    				GameManager$4.hasPlayedSound.push(sn);
    				Laya.SoundManager.playSound(sn, loop);
    			}
    		}));
    	}

    	static PlayMusic(name) {
    		Laya.SoundManager.stopAll();
    		var sn = "res/Truck/sound/" + name + ".wav";
    		Laya.loader.load(sn, Laya.Handler.create(this, () => {
    			Laya.SoundManager.playMusic(sn, 0);
    			if (GameManager$4.hasPlayedSound.indexOf(sn) == -1) {
    				GameManager$4.hasPlayedSound.push(sn);
    				Laya.SoundManager.playMusic(sn, 0);

    			}
    			if (GameData$4.GetUserData("Sound") == 0) {
    				GameManager$4.CloseSound();
    			}
    		}));
    	}

    	static Random(min, max) {
    		return Math.floor(Math.random() * (max - min)) + min;
    	}

    	static showVideo(successcallback, failcallback, cancelcallback) {
    		if (Laya.Browser.onMiniGame) {

    		} else {
    			if (successcallback) {
    				successcallback();
    			}
    		}
    	}
    }
    GameManager$4.hasPlayedSound = [];
    GameManager$4.ResScene = null;
    GameManager$4.Scene = null;
    GameManager$4.Camera = null;
    GameManager$4.CarCamera = null;

    GameManager$4.CarModel = null;
    GameManager$4.MapModel = null;

    GameManager$4.Car = null;
    GameManager$4.CarJS = null;

    GameManager$4.GasStation = null;
    GameManager$4.GasStationJS = null;

    GameManager$4.QDAni = null;
    GameManager$4.ZDAni = null;

    GameManager$4.GameScene = null;
    GameManager$4.MapID = 0;

    GameManager$4.FB = false;//卡车前后判定
    GameManager$4.LR = false;//卡车左右判定

    GameManager$4.LevelName = ["shanghai1", "nanjing2", "guangzhou3", "qingdao4", "beijing5"];//地图的名字
    GameManager$4.selectLevel = 0;//选择的地图
    GameManager$4.pause = true;//暂停
    GameManager$4.isOnPauseUI = false;
    GameManager$4.isOnTLUI = false;

    GameManager$4.AICarNum = 0;//npc数量

    GameManager$4.timeStr = 120;//时间
    GameManager$4.isAddOil = false;
    GameManager$4.isFristOil = true;
    GameManager$4.isAddOiled = false;

    GameManager$4.GearSize = [9, 69, 125];
    GameManager$4.Gear = 0;
    GameManager$4.GearSpeed = [0, 1, -1];

    GameManager$4.PUBLIC = true;

    class cheScene$1 extends Laya.Scene {

    	constructor() {
    		super();
    		this.times = 0;
    	}

    	onEnable() {
    		this.width = Laya.stage.width;
    		this.height = Laya.stage.height;
    		this.moneyNum.text = GameData$4.money;

    		this.showTruckUI();

    		this.backBtn.on(Laya.Event.CLICK, this, function () {
    			Laya.Scene.open("Truck/mainScene.scene");
    		});

    		Laya.timer.loop(1, this, this.update);
    	}

    	showTruckUI() {
    		this.truck_list.hScrollBarSkin = "";
    		this.truck_list.renderHandler = new Laya.Handler(this, this.updateTruck);
    		this.truck_list.array = [];

    		let array = [];
    		console.log("truck:", GameData$4.JSONCar);
    		for (var key in GameData$4.JSONCar) {
    			let data = GameData$4.JSONCar[key];
    			let obj = {};
    			obj['truckID'] = { text: key };
    			obj['name'] = { text: data.name };
    			obj['bg'] = { skin: "Truck/cheScene/" + data.image };

    			obj['accelerateSpeed'] = { width: data.accelerateSpeed * 100 * 5 };
    			obj['maxSpeed'] = { width: data.maxSpeed * 5 };
    			obj['Maxoil'] = { width: data.Maxoil / 100 * 5 };

    			obj['selectBtn'] = { visible: GameData$4.selectCar != key ? true : false };
    			obj['selectSPBtn'] = { visible: GameData$4.GetUserData("car")[key - 1] == 0 ? true : false };
    			obj['isSelect'] = { visible: GameData$4.selectCar == key ? true : false };
    			array.push(obj);
    		}
    		this.truck_list.array = array;
    	}

    	updateTruck(cell) {
    		let selectBtn = cell.getChildByName("selectBtn");
    		let selectSPBtn = cell.getChildByName("selectSPBtn");
    		let id = cell.getChildByName("truckID").text;
    		selectBtn.offAll();
    		selectBtn.on(Laya.Event.CLICK, this, this.selectTruck, [id]);

    		selectSPBtn.offAll();
    		selectSPBtn.on(Laya.Event.CLICK, this, this.selectSPBtn, [id]);
    	}

    	selectTruck(id) {
    		console.log("============选择第" + id + "个选项============");
    		GameData$4.selectCar = id;
    		GameData$4.SetData("selectCar", GameData$4.selectCar);
    		this.showTruckUI();
    	}

    	selectSPBtn(id) {
    		GameManager_Collection.showVideo(function () {
    			this.times = 0;
    			var car = GameData$4.GetUserData("car");
    			car[id - 1] = 1;
    			GameData$4.SetData("car", car);
    			this.showTruckUI();
    		}.bind(this));
    	}

    	update() {
    		this.moneyNum.text = GameData$4.money;
    	}

    	onDisable() {
    	}
    }

    class NpcRayBox extends Laya.Script3D {

    	constructor() {
    		super();
    		this.raybox = null;
    		this.name = null;
    		this.isCollision = false;
    		this.triggerName = null;
    	}

    	onTriggerEnter(other) {
    		if (other.owner.name.indexOf("car") != -1 || other.owner.name.indexOf("npc") != -1) {
    			this.isCollision = true;
    			this.triggerName = other.owner.name;
    		}
    	}

    	onTriggerStay(other) {
    		if (other.owner.name.indexOf("car") != -1 || other.owner.name.indexOf("npc") != -1) {
    			this.isCollision = true;
    			this.triggerName = other.owner.name;
    		}
    	}

    	onTriggerExit(other) {
    		if (other.owner.name.indexOf("car") != -1 || other.owner.name.indexOf("npc") != -1) {
    			this.isCollision = false;
    			this.triggerName = null;
    		}
    	}

    	onEnable() {
    		this.raybox = this.owner;
    		this.name = this.owner.name;
    	}

    	onDisable() {
    	}
    }

    class AICar$1 extends Laya.Script3D {

    	constructor() {
    		super();
    		this.name = null;
    		this.carID = 1;
    		this.onCollision = false;
    		this.InitFinish = false;
    		this.nextPoint = 1;
    		this.onGround = false;

    		this.accelerateSpeed = 1;
    		this.speed = -0.1;
    		this.carRigidbody = null;
    		this.gravity = 2;

    		this.rayFJS = null;
    	}

    	onTriggerEnter(other) {
    		if (other.owner.name == "" + this.nextPoint) {
    			this.nextPoint++;
    			if (this.nextPoint >= this.point.length) {
    				this.nextPoint = 0;
    			}
    			var targePos = this.point[this.nextPoint].transform.position;
    			this.lookAt(new Laya.Vector3(targePos.x, this.owner.transform.position.y, targePos.z));
    		}
    		if (other.owner.name == "ground") {
    			console.log("触发地面");
    			this.onGround = true;
    		} else if (other.owner.name.indexOf("npc") != -1 && other.owner.name != this.name) {
    			this.onCollision = true;
    		}
    	}

    	onTriggerStay(other) {
    		if (other.owner.name.indexOf("npc") != -1 && other.owner.name != this.name) {
    			console.log(other.owner.name);
    			this.onCollision = true;
    		}
    	}

    	onTriggerExit(other) {
    		if (other.owner.name.indexOf("npc") != -1 && other.owner.name != this.name) {
    			this.onCollision = false;
    		}
    	}

    	onEnable() {
    		this.name = this.owner.name;
    		this.f_l_rote = this.owner.getChildByName("Wheels_FL_LOD1");
    		this.f_r_rote = this.owner.getChildByName("Wheels_FR_LOD1");
    		this.b_l_rote = this.owner.getChildByName("Wheels_RL_LOD1");
    		this.b_r_rote = this.owner.getChildByName("Wheels_RR_LOD1");

    		this.carRigidbody = this.owner.getComponent(Laya.Rigidbody3D);
    		this.carRigidbody.isKinematic = true;

    		var rayF = this.owner.getChildByName("rayF");
    		this.rayFJS = rayF.addComponent(NpcRayBox);
    	}

    	Init(point, carID) {
    		this.point = point;
    		this.carID = carID;
    		this.InitFinish = true;
    		console.log("AICar 初始化成功");
    	}

    	lookAt(targetPos) {
    		this.owner.transform.lookAt(targetPos, new Laya.Vector3(0, 1, 0));
    	}

    	onUpdate() {
    		if (!this.onGround) {
    			if (!this.onCollision) {
    				this.gravity++;
    				this.owner.transform.translate(new Laya.Vector3(0, -this.gravity * 0.01, 0));
    			}
    		}

    		if (this.InitFinish) {
    			if (this.rayFJS != null) {
    				if (!this.rayFJS.isCollision) {
    					this.owner.transform.translate(new Laya.Vector3(0, 0, this.speed * this.accelerateSpeed));

    					this.f_l_rote.transform.rotate(new Laya.Vector3(this.speed * this.accelerateSpeed, 0, 0));
    					this.f_r_rote.transform.rotate(new Laya.Vector3(this.speed * this.accelerateSpeed, 0, 0));
    					this.b_l_rote.transform.rotate(new Laya.Vector3(this.speed * this.accelerateSpeed, 0, 0));
    					this.b_r_rote.transform.rotate(new Laya.Vector3(this.speed * this.accelerateSpeed, 0, 0));

    					var targePos = this.point[this.nextPoint].transform.position;
    					this.lookAt(new Laya.Vector3(targePos.x, this.owner.transform.position.y, targePos.z));

    				}
    			}
    		}
    	}

    	onDisable() {
    	}
    }

    class RayBox extends Laya.Script3D {

    	constructor() {
    		super();
    		this.raybox = null;
    		this.name = null;
    		this.isCollision = false;
    		this.triggerName = null;
    	}

    	onTriggerEnter(other) {
    		if (other.owner.name != "lg" && other.owner.name != "lg_finish" && other.owner.name != "finish" && other.owner.name != "station" && other.owner.name.indexOf("car") == -1 && other.owner.name != 0 && other.owner.name != 1 && other.owner.name != 2 && other.owner.name != 3) {
    			// console.log(this.name + ":" + other.owner.name);
    			this.triggerName = other.owner.name;
    			this.isCollision = true;
    			if (other.owner.name.indexOf("npc") != -1) {
    				GameManager$4.CarJS.speed = 0;
    			} else {
    				if (!GameManager$4.CarJS.ray3JS.isCollision && !GameManager$4.CarJS.ray4JS.isCollision) {
    					// if (this.name == "ray1" || this.name == "ray2") {
    					GameManager$4.CarJS.speed = 0;
    				}
    			}
    		}
    	}

    	onTriggerStay(other) {
    		if (other.owner.name != "lg" && other.owner.name != "lg_finish" && other.owner.name != "finish" && other.owner.name != "station" && other.owner.name.indexOf("car") == -1 && other.owner.name != 0 && other.owner.name != 1 && other.owner.name != 2 && other.owner.name != 3) {
    			// console.log(this.name + ":" + other.owner.name);
    			this.isCollision = true;
    			this.triggerName = other.owner.name;
    		}

    	}

    	onTriggerExit(other) {
    		if (other.owner.name != "lg" && other.owner.name != "lg_finish" && other.owner.name != "finish" && other.owner.name != "station" && other.owner.name.indexOf("car") == -1 && other.owner.name != 0 && other.owner.name != 1 && other.owner.name != 2 && other.owner.name != 3) {
    			// console.log(this.name + ":" + other.owner.name);
    			this.isCollision = false;
    			this.triggerName = null;
    		}
    	}

    	onEnable() {
    		this.raybox = this.owner;
    		this.name = this.owner.name;
    	}

    	onDisable() {

    	}
    }

    class Car$3 extends Laya.Script3D {

    	constructor() {
    		super();
    		this.name = null;
    		this.accelerateSpeed = 0.1;                           //加速度
    		this.accelerateBackSpeed = 0.05;                      //倒车加速度
    		this.speed = 0;                                       //当前速度
    		this.maxSpeed = 10;                                   //最大速度
    		this.maxBackSpeed = -40;                              //倒车最大速度
    		this.Maxoil = 100;                                    //最大油量
    		this.oil = 100;                                       //油量
    		this.oilSpeed = 1;                                     //油量损耗速率
    		this.AccelerateRotate = 0.3;                          //转弯速率
    		this.MaxAccelerateRotate = 0.5;                       //高速转弯速率
    		this.RotateLimit = 5;                                 //达到高速转弯的速度
    		this.rotateAngle = 0;
    		this.keyDownList = [];
    		this.InitFinish = false;
    		this.isHuiTan = false;
    		this.music = "";
    		this.onGround = false;
    		this.gravity = 1;

    		this.oldPosition = new Laya.Vector3(0, 0, 0);

    		this.ray1JS = null;
    		this.ray2JS = null;
    		this.ray3JS = null;
    		this.ray4JS = null;
    	}

    	onTriggerEnter(other) {
    		// console.log(other.owner.name);

    		switch (other.owner.name) {
    			case "ground":
    				this.onGround = true;
    				break;
    			case "lg":
    				if (GameManager$4.QDAni != null) {
    					GameManager$4.QDAni.crossFade("lgAni_up", 0.2);
    				}
    				break;
    			case "lg_finish":
    				if (GameManager$4.ZDAni != null) {
    					GameManager$4.ZDAni.crossFade("lgAni_up", 0.2);
    				}
    				break;
    			case "finish":
    				GameManager$4.pause = true;
    				if (GameManager$4.GameScene != null) {
    					this.speed = 0;
    					GameManager$4.GameScene.showSuccessUI();
    				}
    				break;
    			case "station":
    				if (!GameManager$4.isAddOiled) {
    					if (GameManager$4.GameScene != null) {
    						GameManager$4.isAddOiled = true;
    						GameManager$4.pause = true;
    						this.speed = 0;
    						GameManager$4.GameScene.jiayouTipUI.visible = true;

    						GameManager$4.StopSound(this.music);
    						this.music = "";
    					}
    				}
    				break;
    		}
    	}

    	onTriggerStay(other) {

    	}

    	onTriggerExit(other) {
    		switch (other.owner.name) {
    			case "ground":
    				this.onGround = false;
    				break;
    			case "lg":
    				if (GameManager$4.QDAni != null) {
    					GameManager$4.QDAni.crossFade("lgAni_down", 0.2);
    				}
    				break;
    			case "lg_finish":
    				if (GameManager$4.ZDAni != null) {
    					GameManager$4.ZDAni.crossFade("lgAni_down", 0.2);
    				}
    				break;
    		}
    	}

    	CollisionHuiTan() {
    		if (this.isHuiTan) {
    			return;
    		}
    		this.isHuiTan = true;
    		Laya.timer.frameOnce(30, this, function () {
    			this.isHuiTan = false;
    		});
    		this.speed = this.speed / 2;
    	}

    	onEnable() {
    		this.car = this.owner;
    		this.name = this.car.name;
    		this.qian = this.car.getChildByName("tire_q");
    		this.hou = this.car.getChildByName("tire_h");

    		this.listenKeyboard();

    		this.createCollisionBox();
    	}

    	createCollisionBox() {
    		var ray1 = this.car.getChildByName("ray1");
    		this.ray1JS = ray1.addComponent(RayBox);

    		var ray2 = this.car.getChildByName("ray2");
    		this.ray2JS = ray2.addComponent(RayBox);

    		var ray3 = this.car.getChildByName("ray3");
    		this.ray3JS = ray3.addComponent(RayBox);

    		var ray4 = this.car.getChildByName("ray4");
    		this.ray4JS = ray4.addComponent(RayBox);
    	}

    	Init(carJson) {
    		this.accelerateSpeed = carJson.accelerateSpeed;                             //加速度
    		this.accelerateBackSpeed = carJson.accelerateBackSpeed;                     //倒车加速度
    		this.speed = carJson.speed * 0.01;                                          //当前速度
    		this.maxSpeed = carJson.maxSpeed;                                           //最大速度
    		this.maxBackSpeed = carJson.maxBackSpeed;                                   //倒车最大速度
    		this.Maxoil = carJson.Maxoil;                                               //最大油量
    		this.oil = carJson.oil;                                                     //油量
    		this.oilSpeed = carJson.oilSpeed;                                           //油量损耗速率

    		this.accelerateSpeed = carJson.accelerateSpeed;
    		this.maxSpeed = carJson.maxSpeed;
    		this.oil = carJson.oil;

    		this.AccelerateRotate = carJson.AccelerateRotate;
    		this.MaxAccelerateRotate = carJson.MaxAccelerateRotate;
    		this.RotateLimit = carJson.RotateLimit;
    		console.log("初始化汽车完成");


    		this.f_l = this.car.getChildByName("f_l");
    		this.f_r = this.car.getChildByName("f_r");
    		this.f_l_rote = this.car.getChildByName("f_l").getChildByName("f_l");
    		this.f_r_rote = this.car.getChildByName("f_r").getChildByName("f_r");
    		this.b_l_rote = this.car.getChildByName("b_l");
    		this.b_r_rote = this.car.getChildByName("b_r");

    		this.fxp = this.car.getChildByName("nei").getChildByName("fxp");


    		this.carRigidbody = this.car.getComponent(Laya.Rigidbody3D);
    		this.carRigidbody.isKinematic = true;
    		this.InitFinish = true;

    		this.oldPosition = new Laya.Vector3(this.car.transform.position.x, this.car.transform.position.y, this.car.transform.position.z);
    	}

    	listenKeyboard() {
    		console.log("设置键盘监听事件");
    		//添加键盘按下事件,一直按着某按键则会不断触发
    		Laya.stage.on(Laya.Event.KEY_DOWN, this, this.onKeyDown);
    		//添加键盘抬起事件
    		Laya.stage.on(Laya.Event.KEY_UP, this, this.onKeyUp);
    	}

    	onKeyDown(e) {
    		this.keyDownList[e["keyCode"]] = true;
    	}

    	onKeyUp(e) {
    		delete this.keyDownList[e["keyCode"]];
    	}

    	Keyboard() {
    		if (!this.keyDownList[38] && !this.keyDownList[40] && !this.keyDownList[83] && !this.keyDownList[87] && !GameManager$4.FB) {
    			this.speed -= this.speed * 0.01;
    			if (GameManager$4.Gear == 1) {
    				if (this.speed > -0.001) {
    					this.speed = 0;
    				}
    			} else {
    				if (this.speed < 0.001) {
    					this.speed = 0;
    				}
    			}
    			if (parseInt(Math.abs(GameManager$4.CarJS.speed) * 5) != 0) {
    				if (this.music != "jiangsu") {
    					GameManager$4.StopSound(this.music);
    					this.music = "jiangsu";
    					GameManager$4.PlayCarSound(this.music, 1);
    				}
    			} else {
    				if (!GameManager$4.pause) {
    					if (this.music != "daiji") {
    						GameManager$4.StopSound(this.music);
    						this.music = "daiji";
    						GameManager$4.PlayCarSound(this.music, 0);
    					}
    				}
    			}
    		} else {
    			if (this.keyDownList[38] || this.keyDownList[87]) {
    				this.forward();
    			}
    			if (this.keyDownList[83] || this.keyDownList[40]) {
    				this.back();
    			}
    		}

    		if (!this.keyDownList[37] && !this.keyDownList[39] && !this.keyDownList[65] && !this.keyDownList[68] && !GameManager$4.LR) {
    			this.rotateAngle += (0 - this.rotateAngle) * 0.2;
    		} else {
    			if (this.keyDownList[65] || this.keyDownList[37]) {
    				this.left();
    			}
    			if (this.keyDownList[68] || this.keyDownList[39]) {
    				this.right();
    			}
    		}
    	}

    	onUpdate() {
    		if (this.InitFinish && !GameManager$4.pause) {
    			this.oldPosition = new Laya.Vector3(this.car.transform.position.x, this.car.transform.position.y, this.car.transform.position.z);
    			this.Keyboard();
    			var f = new Laya.Vector3(0, 0, 0);
    			this.f_l.transform.getForward(f);
    			if (this.onGround) {
    				this.car.transform.translate(new Laya.Vector3(0, 0, -this.speed * 0.05));
    			} else {
    				this.gravity++;
    				this.car.transform.translate(new Laya.Vector3(0, -this.gravity * 0.01, 0));
    			}
    			var a = this.speed * (0 - this.rotateAngle) * 0.005;
    			if (!this.ray3JS.isCollision && !this.ray4JS.isCollision) {
    				this.car.transform.rotate(new Laya.Vector3(0, -a * 0.03, 0));
    			}

    			var speed = -this.speed * 0.03;
    			this.f_l_rote.transform.rotate(new Laya.Vector3(speed, 0, 0));
    			this.f_r_rote.transform.rotate(new Laya.Vector3(speed, 0, 0));
    			this.b_l_rote.transform.rotate(new Laya.Vector3(speed, 0, 0));
    			this.b_r_rote.transform.rotate(new Laya.Vector3(speed, 0, 0));

    			this.f_l.transform.localRotationEulerY = this.rotateAngle;
    			this.f_r.transform.localRotationEulerY = this.rotateAngle;
    			this.fxp.transform.localRotationEulerZ = this.rotateAngle;

    			if (this.ray3JS.isCollision) {
    				if (this.ray3JS.triggerName.indexOf("npc") == -1) {
    					if (parseInt(this.speed) > 0) {
    						this.car.transform.rotate(new Laya.Vector3(0, -0.03, 0));
    					} else if (parseInt(this.speed) < 0) {
    						this.car.transform.rotate(new Laya.Vector3(0, 0.03, 0));
    					}
    				}
    			}
    			if (this.ray4JS.isCollision) {
    				if (this.ray4JS.triggerName.indexOf("npc") == -1) {
    					if (parseInt(this.speed) > 0) {
    						this.car.transform.rotate(new Laya.Vector3(0, 0.03, 0));
    					} else if (parseInt(this.speed) < 0) {
    						this.car.transform.rotate(new Laya.Vector3(0, -0.03, 0));
    					}
    				}
    			}
    		} else if (GameManager$4.pause) {
    			this.speed = 0;
    			var f = new Laya.Vector3(0, 0, 0);
    			this.f_l.transform.getForward(f);
    			if (this.onGround) {
    				this.car.transform.translate(new Laya.Vector3(0, 0, -this.speed * 0.05));
    			} else {
    				this.gravity++;
    				this.car.transform.translate(new Laya.Vector3(0, -this.gravity * 0.01, 0));
    			}
    			GameManager$4.FB = false;
    			GameManager$4.LR = false;
    		}
    		this.CameraMove();
    	}

    	OilConsumption() {
    		this.oil -= Math.abs(this.speed) * this.oilSpeed;
    		if (this.oil < 0) {
    			this.oil = 0;
    			this.speed = 0;
    			GameManager$4.pause = true;
    			if (GameManager$4.isFristOil) {
    				GameManager$4.isFristOil = false;
    				GameManager$4.GameScene.showFristOilUI();
    			} else {
    				GameManager$4.GameScene.showFailUI();
    			}
    		} else {
    			if (this.music != "jiasu") {
    				GameManager$4.StopSound(this.music);
    				this.music = "jiasu";
    				GameManager$4.PlayCarSound(this.music, 0);
    			}
    		}
    	}

    	AddOil() {
    		this.oil = this.Maxoil;
    		GameManager$4.isAddOil = true;
    	}

    	CameraMove() {
    		var fixedDistance = 9 * (0.1 * GameData$4.selectCar + 1);
    		var targetPos = this.car.transform.position;
    		var nowPos = GameManager$4.Camera.transform.position;
    		var dx = targetPos.x - nowPos.x;
    		var dz = targetPos.z - nowPos.z;
    		var actualDistance = Math.sqrt(dx * dx + dz * dz);
    		var xm = targetPos.x - dx * fixedDistance / actualDistance;
    		var zm = targetPos.z - dz * fixedDistance / actualDistance;
    		GameManager$4.Camera.transform.position = new Laya.Vector3(xm, this.car.transform.position.y + 4.5, zm);
    		GameManager$4.Camera.transform.position.y = 0;
    		GameManager$4.Camera.transform.lookAt(this.car.transform.position, new Laya.Vector3(0, 1, 0));
    		GameManager$4.Camera.transform.rotate(new Laya.Vector3(-20, 0, 0), true, false);
    	}


    	forward() {
    		if (GameManager$4.pause) {
    			this.speed = 0;
    		} else {
    			if (GameManager$4.FB || this.keyDownList[38] || this.keyDownList[40] || this.keyDownList[83] || this.keyDownList[87]) {
    				switch (GameManager$4.Gear) {
    					case 0:
    						if (parseInt(Math.abs(GameManager$4.CarJS.speed) * 5) == 0) {
    							this.speed = 0;
    						}
    						break;
    					case 1:
    						if (this.ray2JS.isCollision) {
    							console.log("2不允许加速");
    							return;
    						}
    						this.speed -= this.accelerateSpeed;
    						if (this.speed <= this.maxBackSpeed) {
    							this.speed = this.maxBackSpeed;
    						}
    						this.OilConsumption();
    						break;
    					case 2:
    						if (this.ray1JS.isCollision) {
    							console.log("1不允许加速");
    							return;
    						}
    						this.speed += this.accelerateSpeed;
    						if (this.speed >= this.maxSpeed) {
    							this.speed = this.maxSpeed;
    						}
    						this.OilConsumption();
    						break;
    				}
    			}
    		}
    	}

    	back() {
    		if (GameManager$4.pause) {
    			this.speed = 0;
    		} else {
    			if (GameManager$4.FB || this.keyDownList[38] || this.keyDownList[40] || this.keyDownList[83] || this.keyDownList[87]) {
    				this.speed += this.accelerateSpeed * 10 * GameManager$4.GearSpeed[GameManager$4.Gear];
    				switch (GameManager$4.Gear) {
    					case 0:
    						if (parseInt(Math.abs(GameManager$4.CarJS.speed) * 5) == 0) {
    							this.speed = 0;
    						}
    						break;
    					case 1:
    						if (this.speed > 0) {
    							this.speed = 0;
    						}
    						break;
    					case 2:
    						if (this.speed < 0) {
    							this.speed = 0;
    						}
    						break;
    				}
    			}
    		}

    		if (parseInt(Math.abs(GameManager$4.CarJS.speed) * 5) != 0) {
    			GameManager$4.StopSound(this.music);
    			this.music = "shache";
    			GameManager$4.PlayCarSound(this.music, 1);
    		}
    	}

    	left() {
    		if (this.ray3JS.isCollision) {
    			return;
    		}
    		if (GameManager$4.LR || this.keyDownList[37] || this.keyDownList[39] || this.keyDownList[65] || this.keyDownList[68]) {
    			if (this.speed >= this.RotateLimit) {
    				this.rotateAngle += this.MaxAccelerateRotate;
    			} else {
    				this.rotateAngle += this.AccelerateRotate;
    			}
    			if (this.rotateAngle >= 30) {
    				this.rotateAngle = 30;
    			}
    		}
    	}

    	right() {
    		if (this.ray4JS.isCollision) {
    			return;
    		}
    		if (GameManager$4.LR || this.keyDownList[37] || this.keyDownList[39] || this.keyDownList[65] || this.keyDownList[68]) {
    			if (this.speed >= this.RotateLimit) {
    				this.rotateAngle -= this.MaxAccelerateRotate;
    			} else {
    				this.rotateAngle -= this.AccelerateRotate;
    			}
    			if (this.rotateAngle <= -30) {
    				this.rotateAngle = -30;
    			}
    		}
    	}

    	Clamp(v, min, max) {
    		if (v < min) {
    			v = min;
    		}
    		if (v > max) {
    			v = max;
    		}
    		return v;
    	}

    	localPosition() {
    		return this.car.transform.localPosition;
    	}

    	onDisable() {

    	}
    }

    class GS$1 extends Laya.Script3D {

    	constructor() {
    		super();
    		this.normalizedTime1 = 0;
    		this.lastnormalizedTime1 = -1;

    		this.normalizedTime2 = 0;
    		this.lastnormalizedTime2 = -1;

    		this.normalizedTime3 = 0;
    		this.lastnormalizedTime3 = -1;

    		this.CameraAni = null;
    		this.NpcAni = null;
    		this.CarAni = null;

    		this.isAddOil = false;
    		this.isAddOil1 = false;
    		this.isAddOil2 = false;
    		this.isAddOil3 = false;
    	}

    	onEnable() {
    		for (var key = 1; key < 6; key++) {
    			if (key != GameData$4.selectCar) {
    				this.owner.getChildByName("car" + key).active = false;
    			}
    		}
    		this.CameraAni = this.owner.getChildByName("Camera").getComponent(Laya.Animator);
    		this.NpcAni = this.owner.getChildByName("npc5").getComponent(Laya.Animator);
    		this.CarAni = this.owner.getChildByName("car" + GameData$4.selectCar).getComponent(Laya.Animator);
    	}

    	addOil() {
    		this.isAddOil = true;
    	}

    	onUpdate() {
    		if (this.isAddOil) {
    			if (this.CameraAni != null) {
    				this.normalizedTime1 = this.CameraAni.getCurrentAnimatorPlayState().normalizedTime;
    				if (this.lastnormalizedTime1 == this.normalizedTime1) {
    					if (!this.isAddOil1) {
    						this.isAddOil1 = true;
    						console.log("加油站摄像头动画播放完毕");
    					}
    				}
    				this.lastnormalizedTime1 = this.normalizedTime1;
    			}

    			if (this.NpcAni != null) {
    				this.normalizedTime2 = this.NpcAni.getCurrentAnimatorPlayState().normalizedTime;
    				if (this.lastnormalizedTime2 == this.normalizedTime2) {
    					if (!this.isAddOil2) {
    						this.isAddOil2 = true;
    						console.log("加油站NPC车辆动画播放完毕");
    					}
    				}
    				this.lastnormalizedTime2 = this.normalizedTime2;
    			}

    			if (this.CarAni != null) {
    				this.normalizedTime3 = this.CarAni.getCurrentAnimatorPlayState().normalizedTime;
    				if (this.lastnormalizedTime3 == this.normalizedTime3) {
    					if (!this.isAddOil3) {
    						this.isAddOil3 = true;
    						console.log("加油站玩家车辆动画播放完毕");
    					}
    				}
    				this.lastnormalizedTime3 = this.normalizedTime3;
    			}

    			if (this.isAddOil1 && this.isAddOil2 && this.isAddOil3) {
    				this.isAddOil = false;
    				this.isAddOil1 = false;
    				this.isAddOil2 = false;
    				this.isAddOil3 = false;

    				if (GameManager$4.GameScene != null) {
    					// console.log(GameManager.Scene.getChildByName(GameManager.LevelName[GameManager.selectLevel]).getChildByName("point"));
    					GameManager$4.GameScene.createCar(GameManager$4.Scene.getChildByName(GameManager$4.LevelName[GameManager$4.selectLevel]).getChildByName("point").getChildByName("jiayou").transform.position);
    					GameManager$4.Car.transform.lookAt(GameManager$4.Scene.getChildByName(GameManager$4.LevelName[GameManager$4.selectLevel]).getChildByName("point").getChildByName("lookPoint").transform.position, new Laya.Vector3(0, 1, 0));
    					GameManager$4.GasStation.active = false;
    					GameManager$4.GameScene.oilAni.visible = false;
    					GameManager$4.GameScene.controlUI.visible = true;
    					GameManager$4.pause = false;
    				}
    			}
    		}
    	}


    	onDisable() {
    	}
    }

    class gameScene$3 extends Laya.Scene {
    	constructor() {
    		super();
    		this.value = 0;
    		this.normalizedTime = 0;
    		this.lastnormalizedTime = -1;
    		this.CameraAni = null;
    		this.kaichang = true;

    		this.times = 0;
    	}

    	onEnable() {
    		GameManager_Collection.showBackBtn();
    		GameManager$4.Gear = 0;
    		GameManager$4.timeStr = 120;
    		this.timeStr.visible = true;
    		this.missionUI.visible = true;
    		this.missionUI2.visible = false;
    		this.missionUI3.visible = false;
    		this.kaichangAni.visible = true;
    		GameManager$4.isFristOil = true;
    		GameManager$4.isAddOiled = false;
    		GameManager$4.pause = true;

    		console.log("GameManager.selectLevel:" + GameManager$4.selectLevel);
    		this.kaichangAni.getChildByName(GameManager$4.LevelName[GameManager$4.selectLevel]).visible = true;
    		GameManager$4.isAddOil = false;

    		GameManager$4.GameScene = this;
    		this.width = Laya.stage.width;
    		this.height = Laya.stage.height;
    		Laya.timer.loop(1, this, this.update);

    		for (var key in GameManager$4.LevelName) {
    			GameManager$4.ResScene.getChildByName(GameManager$4.LevelName[key]).active = false;
    		}

    		console.log("选择的地图：" + GameManager$4.LevelName[GameManager$4.selectLevel]);
    		GameManager$4.ResScene.getChildByName(GameManager$4.LevelName[GameManager$4.selectLevel]).active = true;
    		GameManager$4.Scene = Laya.stage.addChildAt(GameManager$4.ResScene, 0);
    		GameManager$4.Camera = GameManager$4.Scene.getChildByName(GameManager$4.LevelName[GameManager$4.selectLevel]).getChildByName("Camera");

    		this.CameraAni = GameManager$4.Scene.getChildByName("kaichang").getComponent(Laya.Animator);
    		// this.createCar(GameManager.Scene.getChildByName(GameManager.LevelName[GameManager.selectLevel]).getChildByName("point").getChildByName("born").transform.position);

    		if (GameData$4.JSONMap[parseInt(GameManager$4.selectLevel) + 1]["GS"]) {
    			GameManager$4.GasStation = GameManager$4.Scene.getChildByName(GameManager$4.LevelName[GameManager$4.selectLevel]).getChildByName("jyz");
    			GameManager$4.GasStation.active = false;
    			GameManager$4.GasStationJS = GameManager$4.GasStation.addComponent(GS$1);
    		}

    		GameManager$4.Camera.active = false;
    		// GameManager.pause = false;
    		// GameManager.Scene.getChildByName("kaichang").active = false;
    		// GameManager.Camera.active = true;
    		// this.controlUI.visible = true;
    		// Laya.timer.loop(1000, this, function name(params) {
    		//     if (!GameManager.pause) {
    		//         GameManager.timeStr++;
    		//     }
    		// });

    		this.ButtonClick();

    		this.npcPoint = GameManager$4.Scene.getChildByName(GameManager$4.LevelName[GameManager$4.selectLevel]).getChildByName("npc")._children;
    		this.areaPoint = [];
    		for (var key in this.npcPoint) {
    			this.areaPoint[key] = this.npcPoint[key]._children;
    		}

    		this.createMoreAICar(3);

    		this.CameraAni = GameManager$4.Scene.getChildByName("kaichang").getComponent(Laya.Animator);
    		GameManager$4.QDAni = GameManager$4.Scene.getChildByName(GameManager$4.LevelName[GameManager$4.selectLevel]).getChildByName("cs").getChildByName("lg").getComponent(Laya.Animator);
    		GameManager$4.ZDAni = GameManager$4.Scene.getChildByName(GameManager$4.LevelName[GameManager$4.selectLevel]).getChildByName("zd").getChildByName("lg_finish").getComponent(Laya.Animator);
    	}

    	reStart() {
    		GameManager$4.timeStr = 120;
    		this.timeStr.visible = true;
    		this.missionUI.visible = true;
    		this.missionUI2.visible = false;
    		this.missionUI3.visible = false;
    		GameManager$4.isFristOil = true;
    		GameManager$4.isAddOiled = false;
    		GameManager$4.Gear = 0;

    		if (GameManager$4.Car != null) {
    			GameManager$4.Car.destroy();
    			GameManager$4.Car = null;
    			this.createCar(GameManager$4.Scene.getChildByName(GameManager$4.LevelName[GameManager$4.selectLevel]).getChildByName("point").getChildByName("born").transform.position);
    		}
    	}

    	createMoreAICar(num = 1) {
    		GameManager$4.AICarNum = 0;
    		for (var key in this.areaPoint) {
    			for (var i = 0; i < num; i++) {
    				Laya.timer.once(8000 * i, this, this.createAICar, [key], false);
    			}
    		}
    	}

    	createAICar(key) {
    		var npcCar = Laya.Sprite3D.instantiate(GameManager$4.CarModel.getChildByName("npc" + GameManager$4.Random(1, 6)), GameManager$4.Scene);
    		npcCar.transform.position = this.areaPoint[key][0].transform.position;
    		var npcCarJS = npcCar.addComponent(AICar$1);
    		npcCarJS.Init(this.areaPoint[key], GameManager$4.AICarNum);
    		GameManager$4.AICarNum++;
    	}

    	createCar(point) {
    		GameManager$4.Car = Laya.Sprite3D.instantiate(GameManager$4.CarModel.getChildByName("car" + GameData$4.selectCar), GameManager$4.Scene);
    		GameManager$4.Car.transform.position = point;
    		GameManager$4.CarJS = GameManager$4.Car.addComponent(Car$3);
    		GameManager$4.CarJS.Init(GameData$4.JSONCar[GameData$4.selectCar]);
    		GameManager$4.CarCamera = GameManager$4.Car.getChildByName("nei").getChildByName("Camera");
    		GameManager$4.CarCamera.active = false;
    	}

    	ButtonClick() {
    		this.left.on(Laya.Event.MOUSE_DOWN, this, function () {
    			GameManager$4.LR = true;
    			Laya.timer.loop(1, this, this.BtnLeft);
    		});
    		this.left.on(Laya.Event.MOUSE_UP, this, function () {
    			Laya.timer.clear(this, this.BtnLeft);
    			GameManager$4.LR = false;
    		});

    		this.right.on(Laya.Event.MOUSE_DOWN, this, function () {
    			GameManager$4.LR = true;
    			Laya.timer.loop(1, this, this.BtnRight);
    		});
    		this.right.on(Laya.Event.MOUSE_UP, this, function () {
    			Laya.timer.clear(this, this.BtnRight);
    			GameManager$4.LR = false;
    		});

    		this.forward.on(Laya.Event.MOUSE_DOWN, this, function () {
    			GameManager$4.FB = true;
    			Laya.timer.loop(1, this, this.BtnForward);
    		});
    		this.forward.on(Laya.Event.MOUSE_UP, this, function () {
    			Laya.timer.clear(this, this.BtnForward);
    			GameManager$4.FB = false;
    		});

    		this.back.on(Laya.Event.MOUSE_DOWN, this, function () {
    			GameManager$4.FB = true;
    			Laya.timer.loop(1, this, this.BtnBack);
    		});
    		this.back.on(Laya.Event.MOUSE_UP, this, function () {
    			Laya.timer.clear(this, this.BtnBack);
    			GameManager$4.FB = false;
    		});

    		this.pauseBtn.on(Laya.Event.CLICK, this, function () {
    			this.pauseUI.visible = true;
    			GameManager$4.isOnPauseUI = true;
    			GameManager$4.pause = true;
    			if (GameManager$4.CarJS != null) {
    				GameManager$4.StopSound(GameManager$4.CarJS.music);
    				GameManager$4.CarJS.music = "";
    			}
    		});
    		this.closePauseBtn.on(Laya.Event.CLICK, this, function () {
    			this.pauseUI.visible = false;
    			GameManager$4.isOnPauseUI = false;
    			GameManager$4.pause = false;
    		});
    		this.reStartBtn.on(Laya.Event.CLICK, this, function () {
    			GameManager$4.isOnPauseUI = false;
    			Laya.Scene.open("Truck/mapScene.scene", true, true);
    		});
    		this.mainBtn.on(Laya.Event.CLICK, this, function () {
    			GameManager$4.isOnPauseUI = false;
    			Laya.Scene.open("Truck/mainScene.scene");
    		});
    		this.continueBtn.on(Laya.Event.CLICK, this, function () {
    			this.pauseUI.visible = false;
    			GameManager$4.isOnPauseUI = false;
    			GameManager$4.pause = false;
    		});
    		this.changeCamera.on(Laya.Event.CLICK, this, function () {
    			if (GameManager$4.CarCamera != null) {
    				if (GameManager$4.CarCamera.active) {
    					GameManager$4.CarCamera.active = false;
    				} else {
    					GameManager$4.CarCamera.active = true;
    				}
    			}
    		});

    		this.sureBtn.on(Laya.Event.CLICK, this, function () {
    			if (GameManager$4.GasStationJS != null) {
    				this.controlUI.visible = false;
    				this.jiayouTipUI.visible = false;
    				this.oilAni.visible = true;
    				GameData$4.money = GameData$4.money - 100;
    				GameData$4.SetData("money", GameData$4.money);

    				if (GameManager$4.Car != null) {
    					GameManager$4.Car.destroy();
    					GameManager$4.Car = null;
    				}
    				GameManager$4.GasStation.active = true;
    				GameManager$4.GasStationJS.addOil();
    				if (GameManager$4.CarJS != null) {
    					GameManager$4.CarJS.AddOil();
    				}
    			}
    		});
    		this.cancelBtn.on(Laya.Event.CLICK, this, function () {
    			this.jiayouTipUI.visible = false;
    			GameManager$4.pause = false;
    		});

    		this.nextBtn.on(Laya.Event.CLICK, this, function () {
    			GameManager$4.selectLevel++;
    			console.log(GameManager$4.selectLevel);
    			if (GameManager$4.selectLevel >= 5) {
    				GameManager$4.selectLevel = 4;
    				Laya.Scene.open("Truck/mapScene.scene", true, false);
    			} else {
    				if (this.sptb.visible) {
    					GameManager_Collection.showVideo(function () {
    						var map = GameData$4.GetUserData("map");
    						map[GameManager$4.selectLevel] = 1;
    						GameData$4.SetData("map", map);
    						console.log(map);
    						Laya.Scene.open("Truck/mapScene.scene", true, true);
    					}.bind(this));
    				} else {
    					Laya.Scene.open("Truck/mapScene.scene", true, true);
    				}
    			}
    		});

    		this.againBtn.on(Laya.Event.CLICK, this, function () {
    			Laya.Scene.open("Truck/mapScene.scene", true, true);
    		});

    		this.mainBtn1.on(Laya.Event.CLICK, this, function () {
    			Laya.Scene.open("Truck/mainScene.scene");
    		});

    		this.reStartBtn1.on(Laya.Event.CLICK, this, function () {
    			Laya.Scene.open("Truck/mapScene.scene", true, true);
    		});

    		this.loudspeaker.on(Laya.Event.CLICK, this, function () {
    			GameManager$4.PlaySound("laba");
    		});

    		this.P.on(Laya.Event.CLICK, this, function () {
    			if (GameManager$4.Gear == 1) {
    				GameManager$4.StopSound("daoche");
    			}
    			GameManager$4.Gear = 0;
    		});

    		this.R.on(Laya.Event.CLICK, this, function () {
    			GameManager$4.PlaySound("daoche", 0);
    			GameManager$4.Gear = 1;
    		});

    		this.D.on(Laya.Event.CLICK, this, function () {
    			if (GameManager$4.Gear == 1) {
    				GameManager$4.StopSound("daoche");
    			}
    			GameManager$4.Gear = 2;
    		});


    		this.sureBtn1.on(Laya.Event.CLICK, this, function () {
    			GameManager_Collection.showVideo(function () {
    				this.times = 0;
    				this.fristOil.visible = false;
    				if (GameManager$4.CarJS != null) {
    					GameManager$4.CarJS.oil = GameManager$4.CarJS.Maxoil;
    				}
    				GameManager$4.pause = false;
    			}.bind(this));
    		});

    		this.closeBtn1.on(Laya.Event.CLICK, this, function () {
    			this.fristOil.visible = false;
    			this.showFailUI();
    		});
    	}

    	BtnLeft() {
    		console.log("left");
    		if (GameManager$4.CarJS != null) {
    			GameManager$4.CarJS.left();
    		}
    	}

    	BtnRight() {
    		console.log("right");
    		if (GameManager$4.CarJS != null) {
    			GameManager$4.CarJS.right();
    		}
    	}

    	BtnForward() {
    		console.log("forward");
    		if (GameManager$4.CarJS != null) {
    			GameManager$4.CarJS.forward();
    		}
    	}

    	BtnBack() {
    		console.log("back");
    		if (GameManager$4.CarJS != null) {
    			GameManager$4.CarJS.back();
    		}
    	}

    	update() {
    		this.moneyNum.text = GameData$4.money;

    		if (GameManager$4.CarJS != null) {
    			if (GameManager$4.CarJS.speed >= 0) {
    				this.speed.mask.graphics.clear();
    				this.speed.mask.graphics.drawPie(71, 71, 76, 115, 115 + ((310 * Math.abs(GameManager$4.CarJS.speed)) / GameManager$4.CarJS.maxSpeed), "#ff0000");//前进速度仪表盘显示
    			} else {
    				this.speed.mask.graphics.clear();
    				this.speed.mask.graphics.drawPie(71, 71, 76, 115, 115 + ((310 * Math.abs(GameManager$4.CarJS.speed)) / Math.abs(GameManager$4.CarJS.maxBackSpeed)), "#ff0000");//倒退速度仪表盘显示
    			}

    			this.speedNum.text = parseInt(Math.abs(GameManager$4.CarJS.speed) * 5);
    			this.oil.mask.graphics.clear();
    			this.oil.mask.graphics.drawPie(68, 68, 75, 180, 180 + ((180 * GameManager$4.CarJS.oil) / GameManager$4.CarJS.Maxoil), "#ff0000");//油量显示
    		}

    		if (this.CameraAni != null) {
    			this.normalizedTime = this.CameraAni.getCurrentAnimatorPlayState().normalizedTime;
    			if (this.lastnormalizedTime == this.normalizedTime) {
    				if (GameManager$4.GameScene != null) {
    					if (this.kaichang) {
    						this.kaichang = false;

    						console.log("开场结束");
    						this.createCar(GameManager$4.Scene.getChildByName(GameManager$4.LevelName[GameManager$4.selectLevel]).getChildByName("point").getChildByName("born").transform.position);
    						if (!GameManager$4.isOnPauseUI && !GameManager$4.isOnTLUI) {
    							GameManager$4.pause = false;
    						}
    						GameManager$4.Scene.getChildByName("kaichang").active = false;
    						GameManager$4.Camera.active = true;
    						this.kaichangAni.visible = false;
    						this.controlUI.visible = true;
    						Laya.timer.loop(1000, this, function name(params) {
    							if (!GameManager$4.pause) {
    								GameManager$4.timeStr--;
    								if (GameManager$4.timeStr < 0) {
    									this.missionUI.visible = false;
    									this.missionUI3.visible = true;
    									this.timeStr.visible = false;
    								}
    							}
    						});
    					}
    				}
    			}
    			this.lastnormalizedTime = this.normalizedTime;
    		}
    		this.timeStr.text = GameManager$4.ChangeMinuteSecondstr(GameManager$4.timeStr);

    		if (this.handle.y > GameManager$4.GearSize[GameManager$4.Gear]) {
    			this.handle.y -= 2;
    		} else if (this.handle.y < GameManager$4.GearSize[GameManager$4.Gear]) {
    			this.handle.y += 2;
    		}
    	}

    	showSuccessUI() {
    		GameManager$4.pause = true;
    		var num = 0;
    		var map = GameData$4.GetUserData("map");
    		console.log("num:", num);
    		if (map[GameManager$4.selectLevel] == 1) {
    			num = parseInt((parseInt(GameManager$4.selectLevel) + 1)) * 1000;
    		} else {
    			num = parseInt((parseInt(GameManager$4.selectLevel) + 1)) * 100;
    		}
    		console.log("num:", num);

    		this.missionUI.visible = false;
    		// var map = GameData.GetUserData("map");
    		// map[GameManager.selectLevel] = 1;
    		if (GameManager$4.timeStr >= 0) {
    			this.missionUI2.visible = true;
    			map[GameManager$4.selectLevel] = 3;
    			num = parseInt(num) + parseInt((parseInt(GameManager$4.selectLevel) + 1)) * 50;
    			this.nice.visible = true;
    		} else {
    			this.missionUI3.visible = true;
    			map[GameManager$4.selectLevel] = 2;
    			this.nice.visible = false;
    		}
    		GameData$4.SetData("map", map);
    		if ((GameManager$4.selectLevel + 1) >= 5) {
    			this.nextBtnStr.text = "地图";
    			this.sptb.visible = false;
    		} else {
    			if (map[GameManager$4.selectLevel + 1] == 0) {
    				this.sptb.visible = true;
    			} else {
    				this.sptb.visible = false;
    			}
    		}

    		this.successUI.visible = true;

    		console.log("num:", num);
    		this.rewardNum.text = num;
    		GameData$4.money = GameData$4.money + parseInt(this.rewardNum.text);
    		GameData$4.SetData("money", GameData$4.money);

    		if (GameManager$4.CarJS != null) {
    			GameManager$4.StopSound(GameManager$4.CarJS.music);
    			GameManager$4.CarJS.music = "";
    		}


    	}

    	showFailUI() {
    		GameManager$4.pause = true;
    		this.missionUI.visible = false;
    		this.missionUI3.visible = true;
    		this.failUI.visible = true;

    		if (GameManager$4.CarJS != null) {
    			GameManager$4.StopSound(GameManager$4.CarJS.music);
    			GameManager$4.CarJS.music = "";
    		}
    	}

    	showFristOilUI() {
    		GameManager$4.pause = true;
    		this.fristOil.visible = true;


    		if (GameManager$4.CarJS != null) {
    			GameManager$4.StopSound(GameManager$4.CarJS.music);
    			GameManager$4.CarJS.music = "";
    		}
    	}


    	onDisable() {
    		Laya.timer.clearAll(this);
    		GameManager$4.Scene.destroy();
    		GameManager$4.GameScene = null;
    		this.destroy();
    	}
    }

    class loading$1 extends Laya.Scene {

    	constructor() {
    		super();
    	}

    	onEnable() {
    		if (GameManager_Collection.GameConfig) {
    			if (GameManager_Collection.gq) {
    				this.logo.skin = GameManager_Collection.GameConfig.gamesLogo[GameManager_Collection.GameID];
    			} else {
    				this.logo.skin = "Collection/AllGameScene/logo.png";
    			}
    		}

    		this.width = Laya.stage.width;
    		this.height = Laya.stage.height;

    		this.loadValue = 1;
    		this.updateLoadValue = 0;

    		Laya.timer.loop(1, this, this.update);
    	}

    	update() {
    		this.updateLoadValue += 0.01;
    		if (this.updateLoadValue > this.loadValue) {
    			this.updateLoadValue = this.loadValue;
    		}

    		this.loadBar.value = this.updateLoadValue;

    		if (this.updateLoadValue >= 1) {
    			Laya.timer.clear(this, this.update);
    			this.goMain();
    		}
    	}

    	goMain() {
    		this.loadStr.text = "正在加载数据";
    		GameData$4.InitData(function () {
    			this.next();
    		}.bind(this));
    	}

    	next() {
    		this.loadValue = 1;
    		Laya.Scene.open("Truck/mainScene.scene");
    	}

    	onDisable() {
    		Laya.timer.clearAll(this);
    	}
    }

    class mainScene$3 extends Laya.Scene {

    	constructor() {
    		super();
    	}

    	onEnable() {
    		if (GameManager_Collection.GameConfig) {
    			if (GameManager_Collection.gq) {
    				this.logo.skin = GameManager_Collection.GameConfig.gamesLogo[GameManager_Collection.GameID];
    			} else {
    				this.logo.skin = "Collection/AllGameScene/logo.png";
    			}
    		}
    		GameManager_Collection.showBackBtn();
    		this.width = Laya.stage.width;
    		this.height = Laya.stage.height;

    		GameManager$4.PlayMusic("bgm");

    		this.startBtn.on(Laya.Event.CLICK, this, function () {
    			Laya.Scene.open("Truck/mapScene.scene", true, false);
    		});
    		this.garageBtn.on(Laya.Event.CLICK, this, function () {
    			Laya.Scene.open("Truck/cheScene.scene");
    		});
    		this.settingBtn.on(Laya.Event.CLICK, this, this.onpenSettintUI);
    		this.settingCloseBtn.on(Laya.Event.CLICK, this, this.closeSettintUI);

    		this.openMusicBtn.on(Laya.Event.CLICK, this, function () {
    			GameManager$4.OpenSound();
    		});

    		this.closeMusicBtn.on(Laya.Event.CLICK, this, function () {
    			GameManager$4.CloseSound();
    		});

    		this.moneyNum.text = GameData$4.money;
    		Laya.timer.loop(1, this, this.update);
    	}

    	onpenSettintUI() {
    		this.settingUI.visible = true;
    	}

    	closeSettintUI() {
    		this.settingUI.visible = false;
    	}

    	update() {
    		this.moneyNum.text = GameData$4.money;
    	}

    	onDisable() {
    		Laya.timer.clearAll(this);
    	}
    }

    class mapScene$1 extends Laya.Scene {

    	constructor() {
    		super();
    	}

    	onEnable() {
    		this.width = Laya.stage.width;
    		this.height = Laya.stage.height;

    		this.loadValue = 1;
    		this.updateLoadValue = 0;

    		this.resource = [
    			"res/Truck/unity_res/LayaScene_map/Conventional/map.ls",
    			"res/Truck/unity_res/LayaScene_che/Conventional/che.lh",
    		];

    		Laya.loader.create(this.resource, Laya.Handler.create(this, this.onPreLoadFinish),
    			Laya.Handler.create(this, function (value) {
    				this.loadValue = value;
    			})
    		);

    		this.startBtn.on(Laya.Event.CLICK, this, function () {
    			GameManager_Collection.hideBackBtn();
    			this.loading.visible = true;
    			Laya.timer.loop(1, this, this.update);
    		});
    		this.backBtn.on(Laya.Event.CLICK, this, function () {
    			Laya.Scene.open("Truck/mainScene.scene");
    		});

    		this.selectBtns = [];
    		this.selectBtns.push(this.shanghai1);
    		this.selectBtns.push(this.nanjing2);
    		this.selectBtns.push(this.guangzhou3);
    		this.selectBtns.push(this.qingdao4);
    		this.selectBtns.push(this.beijing5);

    		this.updateBtn();
    	}

    	updateBtn() {
    		var map = GameData$4.GetUserData("map");
    		for (var key in this.selectBtns) {
    			this.selectBtns[key].on(Laya.Event.CLICK, this, this.selectMap, [key]);
    			if (map[key] == 0) {
    				this.selectBtns[key].getChildByName("lock").visible = true;
    			} else if (map[key] == 1) {
    				this.selectBtns[key].getChildByName("lock").visible = false;
    				this.selectBtns[key].getChildByName("unlock").visible = true;
    			} else if (map[key] == 2) {
    				this.selectBtns[key].getChildByName("lock").visible = false;
    				this.selectBtns[key].getChildByName("pass").visible = true;
    			} else if (map[key] == 3) {
    				this.selectBtns[key].getChildByName("lock").visible = false;
    				this.selectBtns[key].getChildByName("nice").visible = true;
    				this.selectBtns[key].getChildByName("pass").visible = true;
    			}
    		}
    	}

    	onOpened(type) {
    		if (type) {
    			this.selectMap(GameManager$4.selectLevel);
    			this.loading.visible = true;
    			Laya.timer.loop(1, this, this.update);
    		} else {
    			this.selectMap(0);
    		}
    	}

    	onPreLoadFinish() {
    		GameManager$4.ResScene = Laya.Loader.getRes("res/Truck/unity_res/LayaScene_map/Conventional/map.ls");
    		GameManager$4.CarModel = Laya.Loader.getRes("res/Truck/unity_res/LayaScene_che/Conventional/che.lh");
    	}

    	selectMap(id) {
    		GameManager$4.selectLevel = id;
    		if (this.selectBtns[GameManager$4.selectLevel].getChildByName("lock").visible) {
    			GameManager_Collection.showVideo(function () {
    				var map = GameData$4.GetUserData("map");
    				map[GameManager$4.selectLevel] = 1;
    				GameData$4.SetData("map", map);
    				this.updateBtn();
    				this.selectBtns[GameManager$4.selectLevel].getChildByName("isSelect").visible = false;

    				this.selectBtns[GameManager$4.selectLevel].getChildByName("isSelect").visible = true;
    				var pos = parseInt(id) + 1;
    				this.title.text = GameData$4.JSONMap[pos].title;
    				this.introduce.text = GameData$4.JSONMap[pos]["introduce"];
    			}.bind(this));
    		} else {
    			this.updateBtn();
    			this.selectBtns[GameManager$4.selectLevel].getChildByName("isSelect").visible = false;
    			GameManager$4.selectLevel = id;
    			this.selectBtns[GameManager$4.selectLevel].getChildByName("isSelect").visible = true;
    			var pos = parseInt(id) + 1;
    			this.title.text = GameData$4.JSONMap[pos].title;
    			this.introduce.text = GameData$4.JSONMap[pos]["introduce"];
    		}
    	}

    	update() {
    		this.updateLoadValue += 0.01;
    		if (this.updateLoadValue > this.loadValue) {
    			this.updateLoadValue = this.loadValue;
    		}

    		this.loadBar.value = this.updateLoadValue;

    		if (this.loadBar.value >= 1) {
    			Laya.timer.clear(this, this.update);
    			Laya.Scene.open("Truck/gameScene.scene");
    		}
    	}

    	onDisable() {
    		Laya.timer.clearAll(this);
    	}
    }

    class SceneManager {
    	static open(_ui) {
    		switch (_ui) {
    			case SceneManager.UI_MAIN:
    				Laya.Scene.open("WJJ/cheku.scene");
    				SceneManager.gameUI = null;
    				break;
    			case SceneManager.UI_GAME:
    				Laya.Scene.open("WJJ/wjjgame.scene");
    				SceneManager.mainUI = null;
    				break;
    			case SceneManager.Hangar:
    				Laya.Scene.open("WJJ/cheku.scene", true, true);
    				SceneManager.gameUI = null;
    				break;
    		}
    		SceneManager.curScene = _ui;
    	}
    	static PlayMusic(id) {
    		var sn;
    		switch (id) {
    			case 1:
    				sn = "res/WJJ/sound/bgm.mp3";
    				console.log("播放进入主菜单的音乐");
    				break;
    			case 2:
    				sn = "res/WJJ/sound/bg3.mp3";
    				console.log("播放进入游戏的音乐");
    				break;
    		}
    		Laya.SoundManager.playMusic(sn, 0);
    	}
    	static PlaySound(name, loop = 1) {
    		var sn = "res/WJJ/sound/" + name;
    		var sc = null;
    		sc = Laya.SoundManager.playSound(sn + ".mp3", loop);
    		return sc;
    	}
    	static StopSound(name) {
    		if (name == null) {
    			Laya.SoundManager.stopAll();
    		}
    		else {
    			var sn = "res/WJJ/sound/" + name;
    			Laya.SoundManager.stopSound(sn + ".mp3");
    		}
    	}
    	static GoBackToMain() {
    		SceneManager.clearData();
    		SceneManager.clearTimer();
    		if (SceneManager.mainScene) {
    			SceneManager.mainScene.destroy();
    			SceneManager.mainScene = null;
    		}
    		SceneManager.player = null;
    		SceneManager.camera = null;
    		SceneManager.open(SceneManager.UI_MAIN);

    	}
    	static GoBackToHangar() {
    		SceneManager.clearData();
    		SceneManager.clearTimer();
    		SceneManager.mainScene.destroy();
    		SceneManager.mainScene = null;
    		SceneManager.player = null;
    		SceneManager.camera = null;
    		SceneManager.open(SceneManager.Hangar);

    	}
    	static clearTimer() {
    		Laya.timer.clearAll(SceneManager.gameUI);
    	}
    	static clearData() {
    		if (SceneManager.gameUI) {
    			if (SceneManager.gameUI.controller) {
    				SceneManager.gameUI.controller.destroy();
    				SceneManager.gameUI.controller = null;
    			}
    		}
    		if (SceneManager.wjj) {
    			SceneManager.wjj.destroy();
    			SceneManager.wjj = null;
    		}
    		SceneManager.kacheList = [];
    		SceneManager.speed = 0;
    	}
    	static GetID2Pos(posid) {
    		if (posid == -1) {
    			let root = SceneManager.mainScene.getChildByName("test");
    			return root.transform.position;
    		}

    		if (SceneManager.Position[posid])
    			return SceneManager.Position[posid];
    		let root;
    		root = SceneManager.mainScene.getChildByName("Npc");
    		let p = root.getChildByName(posid + "");
    		if (p) {
    			SceneManager.Position[posid] = new Laya.Vector3(p.transform.position.x, p.transform.position.y, p.transform.position.z);
    			return SceneManager.Position[posid];
    		}
    		else {
    			return new Laya.Vector3(-1, -1, -1);
    		}
    	}
    	static GetKaChe(id) {
    		let idx;
    		idx = id - 1;
    		if (SceneManager.kacheList.length > idx) {
    			let kache = SceneManager.kacheList[idx];
    			if (kache.isLive()) {
    				return kache;
    			}
    		}
    		return null;
    	}
    	static ShowDMessage1(str, baoji = false) {
    		if (SceneManager.messageUI == null) {
    			Laya.Scene.open("WJJ/message.scene", false, [5, str, baoji]);
    		}
    		else {
    			SceneManager.messageUI.showDM1(str, baoji);
    		}
    	}
    	static OpenSound() {
    		Laya.SoundManager.muted = false;
    	}
    	static CloseSound() {
    		Laya.SoundManager.muted = true;
    	}
    }
    SceneManager.UI_MAIN = 1;
    SceneManager.UI_GAME = 2;
    SceneManager.Hangar = 3;
    SceneManager.gameUI = null;
    SceneManager.mainUI = null;
    SceneManager.loadingUI = null;
    SceneManager.curScene = -1;
    SceneManager.model = null;
    SceneManager.mainScene = null;
    SceneManager.camera = null;
    SceneManager.player = null;
    SceneManager.wjj = null;
    SceneManager.hangarScene = null;
    SceneManager.airPlaneController = null;
    SceneManager.wjjID = 0;
    SceneManager.pause = false;
    SceneManager.kacheList = [];
    SceneManager.Position = {};
    SceneManager.goods = null;
    SceneManager.dir = true;
    SceneManager.tlsjFlag = false;
    SceneManager.sjFlag = false;
    SceneManager.shijian = 0;
    SceneManager.speed = 0;
    SceneManager.flag53 = false;

    class DataManager {
    	static Init(callback) {
    		DataManager.InitPlayerData();
    		DataManager.InitTableData();
    	}
    	static InitTableData() {
    		var config = [
    			"res/WJJ/jsondata/kache.json",
    			"res/WJJ/jsondata/wjj_introduce.json",
    			"res/WJJ/jsondata/mission.json",
    		];
    		Laya.loader.load(config, Laya.Handler.create(this, function () {
    			DataManager.kache = Laya.loader.getRes(config[0]);
    			DataManager.wjjIntroduce = Laya.loader.getRes(config[1]);
    			DataManager.mission = Laya.loader.getRes(config[2]);
    			for (var key in DataManager.kache) {
    				DataManager.kache[key]['area'] = DataManager.formatData(DataManager.kache[key]['area'].toString());
    			}
    			if (DataManager.UserData["Sound"] == 1) {
    				Laya.SoundManager.setMusicVolume(1);
    				Laya.SoundManager.setSoundVolume(1);
    				Laya.SoundManager.muted = false;
    			}
    			else {
    				Laya.SoundManager.setMusicVolume(0);
    				Laya.SoundManager.setSoundVolume(0);
    				// Laya.SoundManager.muted = true;
    			}
    			SceneManager.loadingUI.InitRes();
    		}));
    	}
    	static formatData(data) {
    		let b = data.indexOf("|");
    		let obj = [];
    		if (b > 0) {//二维数组
    			var ary = data.split("|");
    			for (let i = 0; i < ary.length; i++) {
    				let ary2 = ary[i].split(",");
    				let o = [];
    				for (let j = 0; j < ary2.length; j++) {
    					o.push(ary2[j]);
    				}
    				obj.push(o);
    			}
    			return obj;
    		}
    		else {//一维数组
    			console.log(data);
    			var ary = data.split(',');
    			return ary;
    		}
    	}
    	static InitPlayerData() {
    		console.log("初始化玩家数据");
    		let newDay = false;
    		var s = Laya.LocalStorage.getItem("userData" + DataManager.version);
    		console.log(JSON.stringify(s));
    		if (s) {
    			DataManager.UserData = JSON.parse(s);
    			var day = new Date().getDate();
    			//新的一天
    			// if (DataManager.UserData.curDay != day) {
    			//     DataManager.UserData.curDay = day;
    			//     newDay = true;
    			//     DataManager.SetData("closeTime", 0);
    			// }
    		}

    		{//根据模板检测data
    			for (var key in DataManager.template) {
    				if (DataManager.UserData[key] && DataManager.template[key]["day"] == false) {
    					continue;
    				}
    				DataManager.UserData[key] = DataManager.template[key].default;
    			}
    		}
    		Laya.timer.loop(500, this, DataManager._saveTick);
    	}
    	static _saveTick() {
    		if (DataManager._dirty == false)
    			return;
    		DataManager._saveData();
    		DataManager._dirty = false;
    	}
    	static _saveData() {
    		var data = JSON.stringify(DataManager.UserData);
    		Laya.LocalStorage.setItem("userData" + DataManager.version, data);
    	}
    	static GetData(key) {
    		if (DataManager.UserData[key] != null)
    			return DataManager.UserData[key];
    		return null;
    	}
    	static SetData(key, val) {
    		DataManager.UserData[key] = val;
    		DataManager._dirty = true;
    	}
    }
    DataManager.version = "WJJ";
    DataManager._dirty = true;
    DataManager.kache = null;
    DataManager.wjjIntroduce = null;
    DataManager.mission = null;
    DataManager.UserData = {};
    DataManager.wjjName = ["excavator1", "excavator2", "excavator3"];
    DataManager.template = {
    	"Sound": { "default": 1, "day": false },//声音开关
    	"Volume": { "default": 0.5, "day": false },  //音量
    	"Rocker": { "default": 0.5, "day": false },  //灵敏度
    	"unlock": { "default": { "1": 1, "2": 0, "3": 0 }, "day": false },//已解锁的飞机
    	"yssm": { "default": false, "day": false },//隐私声明
    };

    class ui_main extends Laya.Scene {
    	constructor() {
    		super();
    	}
    	onOpened(flag = false) {
    		if (flag) {
    			this.goToHangar();
    		}
    	}
    	onEnable() {
    		console.log("进入主页游戏3");
    		this.width = Laya.stage.width;
    		this.height = Laya.stage.height;
    		this.main_box.width = this.width;
    		this.cheku_box.width = this.width;
    		this.bg.width = this.width;
    		SceneManager.pause = false;
    		if (GameManager_Collection.GameConfig) {
    			if (GameManager_Collection.GameConfig) {
    				if (GameManager_Collection.gq) {
    					this.logo.skin = GameManager_Collection.GameConfig.gamesLogo[GameManager_Collection.GameID];
    				} else {
    					this.logo.skin = "Collection/AllGameScene/logo.png";
    				}
    			}
    		}
    		GameManager_Collection.showBackBtn();
    		// SceneManager.StopSound("airplane");
    		// SceneManager.isPlay = false;
    		this.rota_camera = new Laya.Vector3(0, 0.1, 0);
    		this.wjjID = 0;
    		this.unlockTime = 0;
    		SceneManager.mainUI = this;
    		this.gocheku.on(Laya.Event.CLICK, this, this.goToHangar);
    		this.stargame.on(Laya.Event.CLICK, this, this.startGame);
    		this.goleft.on(Laya.Event.CLICK, this, this.onClickLeft);
    		this.goright.on(Laya.Event.CLICK, this, this.onClickRight);
    		this.select_btn.on(Laya.Event.CLICK, this, this.onClickSclet);
    		this.jiesuo_btn.on(Laya.Event.CLICK, this, this.jiesuoWJJ);
    		// this.back.on(Laya.Event.CLICK, this, this.closeHangar);
    		// this.tips.on(Laya.Event.CLICK, this, this.showTips);
    		Laya.timer.scale = 1;
    		SceneManager.StopSound("gd");
    		Laya.timer.once(1000, this, function () {
    			SceneManager.PlayMusic(1);
    		});
    	}
    	goToHangar() {
    		//原生
    		console.log("去车库");
    		Advertisement.insertAdverV3();

    		this.main_box.visible = false;
    		this.cheku_box.visible = true;
    		if (SceneManager.hangarScene) {
    			Laya.stage.addChildAt(SceneManager.hangarScene, 0);
    			Laya.timer.frameLoop(1, this, this.rotaMainCamera);
    			this.showAndHidePlane();
    			this.changeText();
    			this.changeBtn();
    		} else {
    			this.InitHangar();
    		}
    	}
    	closeHangar() {
    		Laya.timer.clear(this, this.rotaMainCamera);
    		SceneManager.hangarScene.destroy();
    		SceneManager.hangarScene = null;
    		this.main_box.visible = true;
    		this.cheku_box.visible = false;
    		this.wjjID = 0;
    	}
    	startGame() {
    		Laya.timer.once(1, this, function () {
    			Laya.Scene.open("WJJ/loading.scene", true, [true]);
    		});
    	}
    	onClickLeft() {
    		this.wjjID--;
    		if (this.wjjID < 0) {
    			this.wjjID = 2;
    		}
    		this.showAndHidePlane();
    		this.changeText();
    		this.changeBtn();
    	}
    	onClickRight() {
    		this.wjjID++;
    		if (this.wjjID > 2) {
    			this.wjjID = 0;
    		}
    		this.showAndHidePlane();
    		this.changeText();
    		this.changeBtn();
    	}
    	rotaMainCamera() {
    		SceneManager.hangarScene.getChildByName("CameraCenter").transform.rotate(this.rota_camera, false, false);
    	}
    	onClickSclet() {
    		SceneManager.wjjID = this.wjjID;
    		this.changeBtn();
    	}
    	showAndHidePlane() {
    		for (var key in DataManager.wjjName) {
    			var name = DataManager.wjjName[key];
    			if (this.wjjID == key) {
    				SceneManager.hangarScene.getChildByName(name).active = true;
    			} else {
    				SceneManager.hangarScene.getChildByName(name).active = false;
    			}
    		}
    	}
    	changeText() {
    		this.name_txt.text = DataManager.wjjIntroduce[this.wjjID + 1].name;
    		this.miaoshu_txt.text = DataManager.wjjIntroduce[this.wjjID + 1].jieshao;
    		this.wjnl_txt.text = "挖掘机能力：" + DataManager.wjjIntroduce[this.wjjID + 1].all;
    		this.fdjgl_txt.text = "功率：" + DataManager.wjjIntroduce[this.wjjID + 1].gonglv;
    		this.qyl_txt.text = "牵引力：" + DataManager.wjjIntroduce[this.wjjID + 1].qianyinli;
    		this.wjl_txt.text = "挖掘力：" + DataManager.wjjIntroduce[this.wjjID + 1].wajueli;
    	}
    	changeBtn() {
    		if (DataManager.GetData("unlock")[this.wjjID + 1] == 0) {
    			// this.unlock_btn.visible = true;
    			this.loack_btn.visible = true;
    			this.jiesuo_btn.visible = true;
    			this.select_btn.visible = false;
    			this.stargame.visible = false;
    			this.nowselet_btn.visible = false;
    		} else {
    			// this.unlock_btn.visible = false;
    			this.loack_btn.visible = false;
    			this.jiesuo_btn.visible = false;
    			this.stargame.visible = true;
    			if (this.wjjID != SceneManager.wjjID) {
    				this.select_btn.visible = true;
    				this.nowselet_btn.visible = false;
    			} else {
    				this.select_btn.visible = false;
    				this.nowselet_btn.visible = true;
    			}
    		}
    	}
    	jiesuoWJJ() {
    		GameManager_Collection.showVideo(function () {
    			let unlock = DataManager.GetData("unlock");
    			unlock[this.wjjID + 1] = 1;
    			DataManager.SetData("unlock", unlock);
    			this.changeBtn();
    		}.bind(this));
    	}
    	InitHangar() {
    		var path = "";
    		let self = this;
    		path = "res/WJJ/unity/LayaScene_GTA_Scene_excavator2/Conventional/GTA_Scene_excavator2.ls";
    		Laya.loader.create(path,
    			Laya.Handler.create(this, function () {
    				SceneManager.hangarScene = Laya.loader.getRes(path);
    				Laya.stage.addChildAt(SceneManager.hangarScene, 0);
    				Laya.timer.frameLoop(1, self, self.rotaMainCamera);
    				self.showAndHidePlane();
    				self.changeText();
    				self.changeBtn();
    			}));
    	}

    	onDisable() {
    		if (SceneManager.hangarScene) {
    			SceneManager.hangarScene.destroy();
    			SceneManager.hangarScene = null;
    		}
    		Laya.timer.clearAll(this);
    		Laya.timer.scale = 1;
    	}
    }

    class ui_loading extends Laya.Scene {
    	constructor() {
    		super();
    	}
    	onEnable() {
    		console.log("进入加载界面");
    		this.width = Laya.stage.width;
    		this.height = Laya.stage.height;
    		SceneManager.loadingUI = this;
    		GameManager_Collection.hideBackBtn();
    		// if (SceneManager.curScene == -1) {
    		//     DataManager.Init();
    		// }
    		// else {
    		//     // self.loadLabel.text = "关卡资源加载中..";
    		//     console.log("来 进关卡----");
    		//     this.Init3D1();
    		// }
    	}
    	onOpened(flag = false) {
    		this.gameFlag = flag;
    		console.log(flag);
    		if (!flag) {
    			DataManager.Init();
    		} else {
    			console.log("来 进关卡----");
    			this.Init3D1();
    		}
    	}
    	InitRes() {
    		this.onDataInit1();
    	}
    	onDataInit1() {
    		this.onDataInit();
    	}
    	onDataInit() {
    		console.log("WeChat:初始化预制体模型");
    		var path = "";
    		path = "res/WJJ/unity/LayaScene_Object_Scene_excavator/Conventional/Object_Scene_excavator.lh";
    		console.log("WeChat:初始化预制体模型22222222");
    		let self = this;
    		console.log("WeChat:初始化预制体模型33333333");

    		Laya.loader.create(path,
    			Laya.Handler.create(this, function () {
    				if (Laya.Browser.onWeiXin) {
    					console.log("WeChat:走到WeChat里了1111");
    					let model = Laya.loader.getRes(path);
    					console.log("WeChat:走到WeChat里了2222");
    					if (model) {
    						console.log("WeChat:走到WeChat里了3333");
    						SceneManager.model = null;
    						SceneManager.model = model;
    						self.InitHangar1();
    					}
    				} else {
    					console.log("WeChat:没走到WeChat里");
    					let model = Laya.loader.getRes(path);
    					if (model) {
    						SceneManager.model = model;
    					}
    					self.InitHangar1();
    				}
    			}), Laya.Handler.create(this, function (v) {
    				self.loadingbar.value = v;
    			}));
    	}
    	InitHangar1() {
    		this.InitHangar();
    	}
    	InitHangar() {
    		var path = "";
    		let self = this;
    		path = "res/WJJ/unity/LayaScene_GTA_Scene_excavator2/Conventional/GTA_Scene_excavator2.ls";
    		Laya.loader.create(path,
    			Laya.Handler.create(this, function () {
    				SceneManager.hangarScene = Laya.loader.getRes(path);
    				self.Init3D();
    			}), Laya.Handler.create(this, function (v) {
    				self.loadingbar.value = v;
    			}));
    	}
    	Init3D1() {
    		this.Init3D();
    	}
    	Init3D() {
    		if (SceneManager.curScene == -1) {
    			console.log("WeChat:第一次进游戏直接进结束方法");
    			this.loadOver();
    		}
    		else {
    			var path = "";
    			let self = this;
    			path = "res/WJJ/unity/LayaScene_GTA_Scene_excavator/Conventional/GTA_Scene_excavator.ls";
    			Laya.loader.create(path,
    				Laya.Handler.create(this, function () {
    					SceneManager.mainScene = Laya.loader.getRes(path);
    					self.loadOver();
    				}), Laya.Handler.create(this, function (v) {
    					self.loadingbar.value = v;
    				}));
    		}
    	}
    	loadOver() {
    		if (!this.gameFlag) {
    			console.log("WeChat:从加载界面进入主界面");
    			SceneManager.open(SceneManager.UI_MAIN);
    		}
    		else {
    			console.log("WeChat:从加载界面进入游戏界面");
    			Laya.timer.once(1, this, function () {
    				SceneManager.open(SceneManager.UI_GAME);
    			});
    		}
    	}

    	onDisable() {
    		Laya.timer.clearAll(this);
    		Laya.timer.scale = 1;
    	}
    }

    class ui_message extends Laya.Scene {
    	constructor() {
    		super();

    	}

    	onEnable() {
    		console.log("onEnable");
    		this._redLabel.visible = false;
    		this._moneyDel.visible = false;
    		this._moneyAdd.visible = false;
    		SceneManager.messageUI = this;
    		this.width = Laya.stage.width;
    		this.height = Laya.stage.height;
    	}
    	onDisable() {
    		console.log("onDisable");
    		SceneManager.messageUI = null;
    	}
    	onOpened(param) {
    		switch (param[0]) {
    			case 1:  //通知
    				this.ShowRedInfo(param[1], param[2]);
    				break;
    			case 2: // 减少钱
    				this.ShowMoneyDel(param[1]);
    				break;
    			case 3: //增加钱
    				this.ShowMoneyAdd(param[1]);
    				break;
    			case 4:
    				this.showDM(param[1], param[2]);
    				break;
    			case 5:
    				this.showDM1(param[1], param[2]);
    				break;
    		}
    	}
    	ShowMoneyAdd(v) {
    		this._moneyAdd.centerX = 0;
    		this._moneyAdd.text = "金钱增加 " + v;
    		this._moneyAdd.top = 200;
    		this._moneyAdd.visible = true;
    		Laya.Tween.to(this._moneyAdd, { top: 50 }, 1000, null, Laya.Handler.create(this, function () {
    			this._moneyAdd.visible = false;
    		}), 0, true, true);
    	}
    	ShowMoneyDel(v) {
    		this._moneyDel.centerX = 0;
    		this._moneyDel.text = "金钱减少 " + v;
    		this._moneyDel.top = 200;
    		this._moneyDel.visible = true;
    		Laya.Tween.to(this._moneyDel, { top: 50 }, 1000, null, Laya.Handler.create(this, function () {
    			this._moneyDel.visible = false;
    		}), 0, true, true);
    	}
    	ShowRedInfo(str, baoji = false) {
    		this._redLabel.color = baoji == false ? "#ffffff" : "#df2e2e";
    		this._redLabel.fontSize = baoji == false ? 40 : 60;
    		this._redLabel.centerX = 0;
    		this._redLabel.text = str;
    		this._redLabel.top = 200;
    		this._redLabel.alpha = 1;
    		this._redLabel.visible = true;
    		if (baoji) {
    			Laya.Tween.to(this._redLabel, { top: 50, alpha: 0, fontSize: 90, centerX: 0 }, 1000, null, Laya.Handler.create(this, function () {
    				this._redLabel.visible = false;
    			}), 0, false, true);
    		} else {
    			Laya.Tween.to(this._redLabel, { top: 50, alpha: 0 }, 1000, null, Laya.Handler.create(this, function () {
    				this._redLabel.visible = false;
    			}), 0, false, true);
    		}
    	}
    	showDM(str, baoji = false) {
    		console.log("调用单独显示伤害Label");
    		var shanghaiText = new Laya.Label();
    		shanghaiText.anchorX = 0.5;
    		shanghaiText.anchorY = 1;
    		shanghaiText.color = baoji == false ? "#ffffff" : "#df2e2e";
    		shanghaiText.fontSize = baoji == false ? 40 : 90;
    		shanghaiText.centerX = 0;
    		shanghaiText.text = str;
    		shanghaiText.top = 200;
    		shanghaiText.alpha = 1;
    		shanghaiText.visible = true;
    		shanghaiText.font = "zkgdh";
    		Laya.stage.addChild(shanghaiText);
    		if (baoji) {
    			Laya.Tween.to(shanghaiText, { top: 50, alpha: 0 }, 1000, null, Laya.Handler.create(this, function () {
    				shanghaiText.visible = false;
    			}), 0, true, true);
    		} else {
    			Laya.Tween.to(shanghaiText, { top: 50, alpha: 0 }, 1000, null, Laya.Handler.create(this, function () {
    				shanghaiText.visible = false;
    			}), 0, true, true);
    		}
    	}
    	showDM1(str, baoji = false) {
    		console.log("调用单独显示伤害Label");
    		var shanghaiText = new Laya.Label();
    		shanghaiText.anchorX = 0.5;
    		shanghaiText.anchorY = 1;
    		shanghaiText.color = baoji == false ? "#ffffff" : "#df2e2e";
    		shanghaiText.fontSize = baoji == false ? 90 : 90;
    		shanghaiText.centerX = 0;
    		shanghaiText.text = str;
    		shanghaiText.top = 300;
    		shanghaiText.alpha = 1;
    		shanghaiText.visible = true;
    		shanghaiText.font = "zkgdh";
    		Laya.stage.addChild(shanghaiText);
    		if (baoji) {
    			Laya.Tween.to(shanghaiText, { top: 50, alpha: 0, fontSize: 90, centerX: 0 }, 1000, null, Laya.Handler.create(this, function () {
    				shanghaiText.visible = false;
    			}), 0, true, true);
    		} else {
    			Laya.Tween.to(shanghaiText, { top: 50, alpha: 0 }, 2000, null, Laya.Handler.create(this, function () {
    				shanghaiText.visible = false;
    			}), 0, true, true);
    		}
    	}
    }

    class script_move {
    	static test(obj) {
    		if (obj == null)
    			return;
    		script_move.move(obj, new Laya.Vector3(0, 0, 0));
    	}
    	static move(obj, dir, player = false, forw, radians) {
    		// console.log("开始移动   " + obj);
    		if (obj == null)
    			return false;
    		let old = new Laya.Vector3(obj.transform.position.x, 0.1, obj.transform.position.z);
    		obj.transform.translate(dir);
    		let scene = SceneManager.mainScene;
    		if (scene == null)
    			scene = SceneManager.mainScene;
    		let _ray = new Laya.Ray(new Laya.Vector3(obj.transform.position.x, 0.1 + 100, obj.transform.position.z), new Laya.Vector3(0, -1, 0));
    		let _outHitInfo = [];
    		this._outHitInfo1 = [];
    		this._outHitInfo2 = [];
    		this._outHitInfo3 = [];
    		scene.physicsSimulation.rayCastAll(_ray, _outHitInfo);
    		let ret = null;
    		if (_outHitInfo.length == 0) {
    			obj.transform.position = old;
    			// console.log("射线长度到是0了    " + old);
    			return false;
    		}
    		else {
    			let yy = -100;
    			for (let i = 0; i < _outHitInfo.length; i++) {
    				let r = _outHitInfo[i];
    				if (r.succeeded && r.collider.owner.layer == 2 && r.point.y > yy) {
    					// console.log("获取坐标点");
    					r.point.y = 0.1;
    					ret = r;
    					yy = r.point.y;
    				}
    				else if (r.collider.owner.layer == 8 && player) {
    					// console.log("停止移动！");
    					ret = null;
    					break;
    				}
    			}
    			if (ret) {
    				obj.transform.position = ret.point;
    				// console.log("射线返回true");
    				return true;
    			}
    			else {
    				obj.transform.position = old;
    				// console.log("玩家停止移动，待在原地");
    				return false;
    			}
    		}
    		return false;
    		//        Laya.Vector3

    	}
    	static kongqiqiang(obj, radians, forw) {
    		let scene = SceneManager.mainScene;
    		var f = new Laya.Vector3(0, 0, 0);
    		var f2 = new Laya.Vector3(0, 0, 0);
    		var f3 = new Laya.Vector3(0, 0, 0);
    		obj.transform.getForward(f);
    		f = new Laya.Vector3(-f.x, 0, -f.z);
    		var xx = f.x;
    		var yy = f.z;
    		var tha = 0;
    		var tha2 = 0;
    		var tha3 = 0;
    		var jiaodu = radians / Math.PI * 180;
    		jiaodu = jiaodu - 90;
    		if (jiaodu < 0 && jiaodu >= -90) {
    			jiaodu = Math.abs(jiaodu);
    		}
    		else if (jiaodu > 0 && jiaodu <= 180) {
    			jiaodu = jiaodu * -1;
    		}
    		else if (jiaodu > 180 && jiaodu <= 270) {
    			jiaodu = 360 - jiaodu;
    		}
    		tha = jiaodu * Math.PI / 180;
    		tha2 = (jiaodu + 45) * Math.PI / 180;
    		tha3 = (jiaodu - 45) * Math.PI / 180;
    		var params = [xx, yy, tha];
    		var params2 = [xx, yy, tha2];
    		var params3 = [xx, yy, tha3];
    		function changeAngle(param) {
    			if (param[0] !== 0 && param[1] !== 0) {

    				var x = param[0];
    				var y = param[1];
    				var tha1 = param[2];

    				var value = Math.sqrt(x * x + y * y);

    				var cos1 = x / value;
    				var sin1 = y / value;

    				var cos2 = Math.cos(tha1);
    				var sin2 = Math.sin(tha1);

    				var cos3 = cos1 * cos2 - sin1 * sin2;
    				var sin3 = sin1 * cos2 + cos1 * sin2;
    				param[0] = (value * cos3).toFixed(2);
    				param[1] = (value * sin3).toFixed(2);
    			}
    		}
    		changeAngle(params);
    		changeAngle(params2);
    		changeAngle(params3);
    		f = new Laya.Vector3(params[0], 0, params[1]);
    		f2 = new Laya.Vector3(params2[0], 0, params2[1]);
    		f3 = new Laya.Vector3(params3[0], 0, params3[1]);
    		var _ray1 = new Laya.Ray(new Laya.Vector3(obj.transform.position.x, obj.transform.position.y + 1, obj.transform.position.z), f);
    		var _ray2 = new Laya.Ray(new Laya.Vector3(obj.transform.position.x, obj.transform.position.y + 1, obj.transform.position.z), f2);
    		var _ray3 = new Laya.Ray(new Laya.Vector3(obj.transform.position.x, obj.transform.position.y + 1, obj.transform.position.z), f3);
    		scene.physicsSimulation.rayCastAll(_ray1, this._outHitInfo1, 5);
    		scene.physicsSimulation.rayCastAll(_ray2, this._outHitInfo2, 1);
    		scene.physicsSimulation.rayCastAll(_ray3, this._outHitInfo3, 1);
    		// console.log("移动判断是否撞墙");
    		for (let i = 0; i < this._outHitInfo1.length; i++) {
    			let r1 = this._outHitInfo1[i];
    			if (this._outHitInfo1[0] == null)
    				break;
    			if (r1.collider.owner.layer == 9) {
    				// console.log("新停止移动！");
    				return true;
    			}
    		}
    		for (let i = 0; i < this._outHitInfo2.length; i++) {
    			let r1 = this._outHitInfo2[i];
    			if (this._outHitInfo2[0] == null)
    				break;
    			if (r1.collider.owner.layer == 9) {
    				// console.log("新停止移动！");
    				return true;
    			}
    		}
    		for (let i = 0; i < this._outHitInfo3.length; i++) {
    			let r1 = this._outHitInfo3[i];
    			if (this._outHitInfo3[0] == null)
    				break;
    			if (r1.collider.owner.layer == 9) {
    				// console.log("新停止移动！");
    				return true;
    			}
    		}
    		return false;
    	}
    }

    // import script_rocker from "./script_rocker";
    // import DataManager from "./DataManager";
    class script_player {
    	//初始化
    	static Init() {
    		script_move.test(SceneManager.player);
    		script_player._timer_animator = 0;   //动作计时
    		script_player.Idle();
    	}
    	static onStopMove() {
    		if (script_player._isMove == false)
    			return;
    		script_player._isMove = false;
    		SceneManager.StopSound("run");
    	}
    	//移动
    	static Move(dirX, dirY, radians) {
    		// console.log("进入移动脚本")
    		if (script_player._isMove == false) {
    			script_player._isMove = true;
    			// SceneManager.PlaySound("run", 0);
    		}
    		// script_player._speed = SceneManager.gameUI.GetMoveSpeed() * 5;
    		script_player._speed = 5 + SceneManager.speed;
    		let spd = script_player._speed * Laya.timer.delta / 1000;
    		// if (dirY > 0)
    		// if (SceneManager.Iscar) {
    		//     spd = SceneManager.car.speed * Laya.timer.delta;
    		//     if (false == script_move.move(SceneManager.car.model, new Laya.Vector3(dirX * spd, 0, dirY * spd), true, true, radians)) {
    		//         if (true == script_move.move(SceneManager.car.model, new Laya.Vector3(spd * 0.5, 0, spd * 0.5), true, true, radians)) {
    		//         }
    		//         else if (true == script_move.move(SceneManager.car.model, new Laya.Vector3(-spd * 0.5, 0, -spd * 0.5), true, true, radians)) {
    		//         }
    		//     }
    		// }
    		// if (SceneManager.Ishand) {
    		//     script_move.move(SceneManager.playerhands.model, new Laya.Vector3(dirX * spd, 0, dirY * spd), true, true, radians)
    		// }
    		if (false == script_move.move(SceneManager.wjj, new Laya.Vector3(dirX * spd, 0, dirY * spd), true, true, radians)) {
    			if (true == script_move.move(SceneManager.wjj, new Laya.Vector3(spd * 0.5, 0, spd * 0.5), true, true, radians)) {
    			}
    			else if (true == script_move.move(SceneManager.wjj, new Laya.Vector3(-spd * 0.5, 0, -spd * 0.5), true, true, radians)) {
    			}
    		}
    		// else
    		// script_move.move(SceneManager.player, new Laya.Vector3(dirX * spd, 0, dirY * spd), true, false, radians);
    		// if (false == script_move.move(SceneManager.player, new Laya.Vector3(dirX * spd, 0, dirY * spd))) {//测试用回头就删了
    		//     if (true == script_move.move(SceneManager.player, new Laya.Vector3(1, 0, 0))) {
    		//         let r = new Laya.Vector3(SceneManager.player.transform.localRotation.x + 90, SceneManager.player.transform.localRotation.y, SceneManager.player.transform.localRotation.z);
    		//         SceneManager.player.transform.localRotation = r;
    		//     }
    		//     else if (true == script_move.move(SceneManager.player, new Laya.Vector3(-1, 0, 0))) {
    		//         let r = new Laya.Vector3(SceneManager.player.transform.localRotation.x - 90, SceneManager.player.transform.localRotation.y, SceneManager.player.transform.localRotation.z);
    		//         SceneManager.player.transform.localRotation = r;
    		//     }


    		// }
    		if (script_player._timer_animator > 0)
    			return;
    		if (script_player._timer_animator < 0)
    			return;
    		if (script_player._bAim == false) {
    			// SceneManager.playerAnimator.play("run");
    			script_player._timer_animator = -1;
    		}
    	}
    	static Idle() {
    		if (script_player._timer_animator > 0)
    			return;
    		if (script_player._bAim == false) {
    			// SceneManager.playerAnimator.play("Arm_Idle");
    		}

    		script_player._timer_animator = 0;
    	}
    	//攻击
    	static Attack(cd, auto = false) {
    		if (script_player._timer_animator > 0 && auto == false)
    			return;
    		// script_player.debug = true;
    		script_player._timer_animator = cd;
    		if (script_player._bAim) {//瞄准射击
    			// SceneManager.playerAnimator.play("Aim Fire", 0, false);
    		}
    		else {//普通射击
    			switch (SceneManager.gameUI.gunID) {
    				case 1:
    				case 2:
    				case 3:
    					SceneManager.playerAnimator.play("Arm_Hit", 0, false);
    					break;
    				case 4:
    				case 5:
    				case 6:
    					SceneManager.playerAnimator.play("Arm_Fire_1", 0, false);
    					break;
    				case 7:
    				case 8:
    				case 9:
    					SceneManager.playerAnimator.play("Arm_Fire_2", 0, false);
    					break;
    			}
    		}
    	}
    	static Aim(b) {
    		if (b == null)
    			b = !script_player._bAim;
    		script_player._bAim = b;
    		if (b) {
    			// SceneManager.playerAnimator.play("Aim In");
    		}
    		else {
    			// SceneManager.playerAnimator.play("Aim Out");
    		}
    		script_player._timer_animator = 500;
    		return b;
    	}
    	static GetAim() {
    		return script_player._bAim;
    	}
    	//换枪
    	static ChangeGun() {
    		if (script_player._timer_animator > 0)
    			return;
    		script_player._timer_animator = 1000;
    	}

    	static Reloaded2_1() {
    		// SceneManager.playerAnimator.play("Reload Open");//一直关
    		// SceneManager.playerAnimator.play("Reload");
    		script_player._timer_animator = 50000;
    		Laya.timer.loop(800, this, script_player.Reloaded2_2);
    	}
    	static Reloaded2_2() {
    		if (false == SceneManager.gameUI.onAddBullet()) {
    			Laya.timer.clear(this, script_player.Reloaded2_2);
    			// SceneManager.playerAnimator.play("Arm_Idle");
    			script_player._timer_animator = 0;
    		}
    		else {

    			SceneManager.playerAnimator.play("Insert Shell 1", 0, false);
    		}

    	}
    	static Reloaded2_3() {

    	}
    	//装子弹
    	static Reloaded(t) {
    		// if (script_player._timer_animator > 0)
    		//     return;
    		// SceneManager.playerAnimator.play("Reload Ammo Left");//一直关
    		// SceneManager.playerAnimator.play("Reload", 0, false);
    		script_player._timer_animator = t;
    		console.log("设置换弹时间" + t);
    	}
    	static IsAnimator() {
    		return script_player._timer_animator > 0;
    	}
    	static Tick(dt) {
    		if (script_player._timer_animator <= 0)
    			return;
    		// if (script_player.debug) {
    		//     console.log("dt:" + dt + "  " + script_player._timer_animator)
    		// }
    		script_player._timer_animator -= dt;
    		if (script_player._timer_animator <= 0) {
    			script_player._timer_animator = 0;
    			if (script_player._bAim == false) {
    				// SceneManager.playerAnimator.play("Arm_Idle");
    			}
    		}

    	}
    }
    script_player._curGun = 1;
    script_player._timer_animator = 0;   //动作计时
    script_player._bAim = false; //是否瞄准
    script_player._speed = 10;
    script_player._isMove = false;

    class TriggerCollisionScript$2 extends Laya.Script3D {
    	constructor() {
    		super();
    		// console.log("============进入监听器==============");
    		this.shaFlag = false;
    	}
    	onTriggerEnter(other) {
    		// console.log(other.owner.name);
    		if (other.owner.name == "sha" || other.owner.name == "tu" || other.owner.name == "mei" || other.owner.name == "shihui") {
    			if (SceneManager.gameUI) {
    				if (SceneManager.gameUI.controller.readysha) {
    					this.shaFlag = true;
    				}
    			}
    		}
    		switch (other.owner.name) {
    			case "sha":
    				SceneManager.mainScene.getChildByName("marking_sha").active = false;
    				break;
    			case "tu":
    				SceneManager.mainScene.getChildByName("marking_tu").active = false;
    				break;
    			case "mei":
    				SceneManager.mainScene.getChildByName("marking_mei").active = false;
    				break;
    			case "shihui":
    				SceneManager.mainScene.getChildByName("marking_shihui").active = false;
    				break;
    		}
    		// console.log("============进入触发器范围==============");
    	}

    	onTriggerStay(other) {
    		if (other.owner.name == "sha" || other.owner.name == "tu" || other.owner.name == "mei" || other.owner.name == "shihui") {
    			if (SceneManager.gameUI) {
    				if (SceneManager.gameUI.controller.readysha) {
    					this.shaFlag = true;
    				}
    			}
    		}
    	}

    	onTriggerExit(other) {
    		if (other.owner.name == "sha" || other.owner.name == "tu" || other.owner.name == "mei" || other.owner.name == "shihui") {
    			console.log(SceneManager.gameUI.controller.successedsha + "           " + this.shaFlag + "        " + SceneManager.gameUI.controller.lj5jiaodu + "           " + SceneManager.gameUI.controller.lj4jiaodu);
    			if (SceneManager.gameUI) {
    				if (this.shaFlag) {
    					switch (other.owner.name) {
    						case "sha":
    							if (!SceneManager.gameUI.controller.sha.active) {
    								SceneManager.gameUI.controller.successedsha = false;
    								SceneManager.gameUI.controller.sha.active = true;
    								SceneManager.goods = "sha";
    							}
    							break;
    						case "tu":
    							if (!SceneManager.gameUI.controller.tu.active) {
    								SceneManager.gameUI.controller.successedsha = false;
    								SceneManager.gameUI.controller.tu.active = true;
    								SceneManager.goods = "tu";
    							}
    							break;
    						case "mei":
    							if (!SceneManager.gameUI.controller.mei.active) {
    								SceneManager.gameUI.controller.successedsha = false;
    								SceneManager.gameUI.controller.mei.active = true;
    								SceneManager.goods = "mei";
    							}
    							break;
    						case "shihui":
    							if (!SceneManager.gameUI.controller.shihui.active) {
    								SceneManager.gameUI.controller.successedsha = false;
    								SceneManager.gameUI.controller.shihui.active = true;
    								SceneManager.goods = "shihui";
    							}
    							break;
    					}
    				}
    			}
    			this.shaFlag = false;
    		}
    		// console.log("============离开触发器范围==============");
    	}
    	onCollisionEnter(collision) {
    		// console.log("============进入碰撞器范围==============");
    	}
    	onCollisionStay(collision) {
    	}
    	onCollisionExit(collision) {
    		// console.log("============离开碰撞器范围==============");
    	}
    	checkNumber(theObj) {
    		var reg = /^[0-9]+\.?[0-9]*$/;
    		if (reg.test(theObj)) {
    			return 1;
    		}
    		return 0;
    	}
    }

    class carController extends Laya.Script3D {
    	constructor() {
    		super();
    		this.dangDir = 1;
    	}

    	onEnable() {
    		this.state = "stop";
    		this.carDirState = "stop";
    		this.carDir = 1;
    		this.cState = "stop";
    		this.cState1 = "stop";
    		this.rotateAngle = 0;
    		this.moveSpeed = 0;
    		this.speed = 0;
    		this.maxMoveSpeed = 0;
    		this.playerRigidbody;
    		this.model = SceneManager.wjj;
    		this.lvy;
    		this.arrowflag = false;
    		this.lj1 = this.model.getChildAt(0).getChildByName("lj1");
    		this.lj2 = this.lj1.getChildAt(0);
    		this.lj3 = this.lj2.getChildAt(0);
    		this.lj4 = this.lj3.getChildAt(0);
    		this.lj5 = this.lj4.getChildAt(0);
    		this.sha = this.lj5.getChildByName("sha");
    		this.tu = this.lj5.getChildByName("tu");
    		this.mei = this.lj5.getChildByName("mei");
    		this.shihui = this.lj5.getChildByName("shihui");
    		this.sha.active = false;
    		this.tu.active = false;
    		this.mei.active = false;
    		this.shihui.active = false;
    		this.lj5.addComponent(TriggerCollisionScript$2);
    		this.lj2jiaodu = 0;
    		this.lj3jiaodu = 0;
    		this.lj4jiaodu = 0;
    		this.lj5jiaodu = 0;
    		this.showTXFlag = false;
    		this.readysha = false;
    		this.successedsha = false;
    		// Laya.timer.loop(5 * 1000, this, this.showTX);
    	}

    	onDisable() {
    	}
    	onUpdate() {
    		if (this.model == null)
    			return;
    		if (SceneManager.pause)
    			return;
    		if (SceneManager.sjFlag && SceneManager.tlsjFlag) {
    			if (SceneManager.gameUI) {
    				SceneManager.gameUI.showMission();
    			}
    		}
    		let spd;
    		switch (this.state) {
    			case "jiayou":
    				if (this.moveSpeed < (12 + SceneManager.speed)) {
    					this.moveSpeed += 0.1;
    				}
    				else {
    					this.moveSpeed = 12;
    				}
    				spd = this.moveSpeed * Laya.timer.delta / 1000;
    				script_move.move(this.model, new Laya.Vector3(0, 0, spd), true);
    				break;
    			case "daoche":
    				this.moveSpeed -= 0.3;
    				if (this.moveSpeed < -10) {
    					this.moveSpeed = -10;
    				}
    				spd = this.moveSpeed * Laya.timer.delta / 1000;
    				script_move.move(this.model, new Laya.Vector3(0, 0, spd), true);
    				break;
    			case "stopjiayou":
    				this.moveSpeed -= this.moveSpeed * 0.01;
    				if (this.moveSpeed < 0.5 && this.moveSpeed > -0.5) {
    					this.moveSpeed = 0;
    				}
    				spd = this.moveSpeed * Laya.timer.delta / 1000;
    				script_move.move(this.model, new Laya.Vector3(0, 0, spd), true);
    				break;
    			case "shache":
    				if (this.moveSpeed > 0) {
    					this.moveSpeed -= 0.1 * 5;
    					spd = this.moveSpeed * Laya.timer.delta / 1000;
    					script_move.move(this.model, new Laya.Vector3(0, 0, spd), true);
    				}
    				else {
    					this.moveSpeed = 0;
    				}
    				break;
    		}
    		switch (this.carDirState) {
    			case "L":
    				if (this.rotateAngle < 5) {
    					this.rotateAngle += 0.2 * Laya.timer.delta / 1000;;
    				}
    				else {
    					this.rotateAngle = 5;
    				}
    				if (this.moveSpeed >= 0) {
    					this.model.transform.rotate(new Laya.Vector3(0, this.rotateAngle, 0), false, false);
    				}
    				else {
    					this.model.transform.rotate(new Laya.Vector3(0, -this.rotateAngle, 0), false, false);
    				}
    				break;
    			case "R":
    				if (this.rotateAngle < 5) {
    					this.rotateAngle += 0.2 * Laya.timer.delta / 1000;;
    				}
    				else {
    					this.rotateAngle = 5;
    				} if (this.moveSpeed >= 0) {
    					this.model.transform.rotate(new Laya.Vector3(0, -this.rotateAngle, 0), false, false);
    				}
    				else {
    					this.model.transform.rotate(new Laya.Vector3(0, this.rotateAngle, 0), false, false);
    				}
    				break;
    			case "stop":
    				this.rotateAngle = 0;
    				break;
    		}
    		switch (this.cState) {
    			case "turnleft":
    				this.ZrotateLJ1();
    				break;
    			case "turnright":
    				this.FrotateLJ1();
    				break;
    			case "dabiup":
    				this.upLJ2();
    				break;
    			case "dabidown":
    				this.downLJ2();
    				break;
    			case "xiaobiup":
    				this.upLJ4();
    				break;
    			case "xiaobidown":
    				this.downLJ4();
    				break;
    			case "chandouup":
    				this.upLJ5();
    				break;
    			case "chandoudown":
    				this.downLJ5();
    				break;
    			case "stop":
    				break;
    		}
    		switch (this.cState1) {
    			case "turnleft":
    				this.ZrotateLJ1();
    				break;
    			case "turnright":
    				this.FrotateLJ1();
    				break;
    			case "dabiup":
    				this.upLJ2();
    				break;
    			case "dabidown":
    				this.downLJ2();
    				break;
    			case "xiaobiup":
    				this.upLJ4();
    				break;
    			case "xiaobidown":
    				this.downLJ4();
    				break;
    			case "chandouup":
    				this.upLJ5();
    				break;
    			case "chandoudown":
    				this.downLJ5();
    				break;
    			case "stop":
    				break;
    		}
    		this.playSound();
    		if (this.lj5jiaodu < -300 && this.lj4jiaodu < -100 && !this.showTXFlag) {
    			if (this.sha.active || this.tu.active || this.mei.active || this.shihui.active) {
    				this.showTX();
    			}
    		}
    		if (this.lj5jiaodu < 10 && !this.showTXFlag) {
    			this.readysha = true;
    		} else {
    			this.readysha = false;
    		}
    		for (var key in SceneManager.kacheList) {
    			if (SceneManager.kacheList[key].isLive()) {
    				SceneManager.kacheList[key].update(Laya.timer.delta);
    			}
    		}
    	}
    	setCarState(state) {
    		// console.log("设置车辆状态       " + state);
    		this.state = state;
    	}
    	setCarDirState(state) {
    		this.carDirState = state;
    	}
    	setCState(state) {
    		// if (this.cState != "stop" && state != "stop") {
    		//     return;
    		// }
    		this.cState = state;
    	}
    	setCState1(state) {
    		// if (this.cState != "stop" && state != "stop") {
    		//     return;
    		// }
    		this.cState1 = state;
    	}
    	Shache() {
    		// if (this.moveSpeed > 5) {
    		//     // console.log("HW:播放刹车音效");
    		//     if (this.yinqingSound != null) {
    		//         this.yinqingSound.stop();
    		//         this.yinqingSound = null;
    		//     }
    		//     SceneManager.PlaySound("brake");
    		// }
    	}
    	Clamp(v, min, max) {
    		if (v < min) {
    			v = min;
    		}
    		if (v > max) {
    			v = max;
    		}
    		return v;
    	}
    	setArrowFlag(flag) {
    		this.arrowflag = flag;
    	}
    	ZrotateLJ1() {
    		this.lj1.transform.rotate(new Laya.Vector3(0, 0.1 * 9, 0), true, false);
    	}
    	FrotateLJ1() {
    		this.lj1.transform.rotate(new Laya.Vector3(0, -0.1 * 9, 0), true, false);
    	}
    	upLJ2() {
    		if (this.lj2jiaodu >= -150) {
    			this.lj2.transform.rotate(new Laya.Vector3(0, 0, -0.1 * 9), true, false);
    			this.lj2jiaodu -= 9;
    		} else {
    			this.upLJ3();
    		}
    	}
    	downLJ2() {
    		if (this.lj2jiaodu <= 150) {
    			this.lj2.transform.rotate(new Laya.Vector3(0, 0, 0.1 * 9), true, false);
    			this.lj2jiaodu += 9;
    		} else {
    			this.downLJ3();
    		}
    	}
    	upLJ3() {
    		if (this.lj3jiaodu >= -150) {
    			this.lj3.transform.rotate(new Laya.Vector3(0, 0, -0.1 * 9), true, false);
    			this.lj3jiaodu -= 9;
    		}
    	}
    	downLJ3() {
    		if (this.lj3jiaodu <= 150) {
    			this.lj3.transform.rotate(new Laya.Vector3(0, 0, 0.1 * 9), true, false);
    			this.lj3jiaodu += 9;
    		}
    	}
    	upLJ4() {
    		if (this.lj4jiaodu >= -450) {
    			this.lj4.transform.rotate(new Laya.Vector3(0, 0, -0.1 * 9), true, false);
    			this.lj4jiaodu -= 9;
    		}
    	}
    	downLJ4() {
    		if (this.lj4jiaodu <= 150) {
    			this.lj4.transform.rotate(new Laya.Vector3(0, 0, 0.1 * 9), true, false);
    			this.lj4jiaodu += 9;
    		}
    	}
    	upLJ5() {
    		if (this.lj5jiaodu >= -650) {
    			this.lj5.transform.rotate(new Laya.Vector3(0, 0, -0.1 * 9), true, false);
    			this.lj5jiaodu -= 9;
    		}
    	}
    	downLJ5() {
    		if (this.lj5jiaodu <= 150) {
    			this.lj5.transform.rotate(new Laya.Vector3(0, 0, 0.1 * 9), true, false);
    			this.lj5jiaodu += 9;
    		}
    	}
    	showTX() {
    		this.showTXFlag = true;
    		let node = this.lj5.getChildByName("Tx_sha");
    		let modelPrefab;
    		if (this.sha.active) {
    			modelPrefab = SceneManager.model.getChildByName("Tx_sha");
    		} else if (this.tu.active) {
    			modelPrefab = SceneManager.model.getChildByName("Tx_tu");
    		} else if (this.mei.active) {
    			modelPrefab = SceneManager.model.getChildByName("Tx_mei");
    		} else {
    			modelPrefab = SceneManager.model.getChildByName("Tx_shihui");
    		}
    		let model = Laya.Sprite3D.instantiate(modelPrefab, this.lj5);
    		// model.transform.position = node.transform.position;
    		model.transform.localPosition = new Laya.Vector3(0, 0, 0);
    		Laya.timer.frameLoop(1, this, this.lookAt, [model, new Laya.Vector3(model.transform.position.x, -100, model.transform.position.z)]);
    		// model.transform.localRotation = new Laya.Vector3(Math.PI / 180 * 30, 0, 0);
    		// model.transform.rotate(new Laya.Vector3(0, 0, 0), true, false);
    		Laya.timer.once(2500, this, this.checkCar);
    		Laya.timer.once(3000, this, function () {
    			Laya.timer.clear(this, this.lookAt);
    			this.sha.active = false;
    			this.tu.active = false;
    			this.mei.active = false;
    			this.shihui.active = false;
    			this.showTXFlag = false;
    			model.destroy();
    		});
    	}
    	lookAt(model, targetPos) {
    		model.transform.lookAt(targetPos, new Laya.Vector3(0, 1, 0));
    		model.transform.rotate(new Laya.Vector3(0, 180, 0), true, false);
    	}
    	checkCar() {
    		let obj = this.lj5;
    		let scene = SceneManager.mainScene;
    		let _ray = new Laya.Ray(new Laya.Vector3(obj.transform.position.x, obj.transform.position.y + 100, obj.transform.position.z), new Laya.Vector3(0, -1, 0));
    		let _outHitInfo = [];
    		scene.physicsSimulation.rayCastAll(_ray, _outHitInfo);
    		if (_outHitInfo.length == 0) {
    			return false;
    		} else {
    			for (var key in _outHitInfo) {
    				let id = this.checkHitObject(_outHitInfo[key].collider.owner);
    				if (id != -1) {
    					let kache = SceneManager.GetKaChe(id);
    					kache.continueMove();
    					break;
    				}
    			}
    		}
    	}
    	checkHitObject(obj) {
    		let name = obj.parent.name;
    		console.log("checkHitObject    " + name);
    		if (name.indexOf("kache") >= 0) {
    			console.log(name.indexOf("kache"));
    			let id = name.substr(name.lastIndexOf("_") + 1);
    			return parseInt(id);
    		}
    		return -1;
    	}
    	reSetWjj() {
    		this.state = "stop";
    		this.carDirState = "stop";
    		this.carDir = 1;
    		this.cState = "stop";
    		this.cState1 = "stop";
    		this.rotateAngle = 0;
    		this.moveSpeed = 0;
    		this.speed = 0;
    		this.model.transform.localRotation = new Laya.Vector3(0, 0, 0);
    		this.lj1.transform.localRotation = new Laya.Vector3(0, 0, 0);
    		this.lj2.transform.localRotation = new Laya.Vector3(0, 0, 0);
    		this.lj3.transform.localRotation = new Laya.Vector3(0, 0, 0);
    		this.lj4.transform.localRotation = new Laya.Vector3(0, 0, 0);
    		this.lj5.transform.localRotation = new Laya.Vector3(0, 0, 0);
    	}
    	playSound() {
    		if (this.moveSpeed != 0 || this.cState != "stop" || this.cState1 != "stop") {
    			if (!SceneManager.isPlay && !SceneManager.pause) {
    				SceneManager.PlaySound("jq", 0);
    				SceneManager.isPlay = true;
    			}
    		}
    		else {
    			SceneManager.StopSound("jq");
    			SceneManager.isPlay = false;
    		}
    	}
    }

    class CameraMoveScript extends Laya.Script3D {

    	// /** @private */
    	// protected _tempVector3: Vector3 = new Vector3();
    	// protected lastMouseX: number;
    	// protected lastMouseY: number;
    	// protected yawPitchRoll: Vector3 = new Vector3();
    	// protected resultRotation: Quaternion = new Quaternion();
    	// protected tempRotationZ: Quaternion = new Quaternion();
    	// protected tempRotationX: Quaternion = new Quaternion();
    	// protected tempRotationY: Quaternion = new Quaternion();
    	// protected isMouseDown: boolean;
    	// protected rotaionSpeed: number = 0.00006;
    	// protected camera: BaseCamera;
    	// protected scene: Scene3D;

    	// speed: number = 0.01;

    	constructor() {
    		super();
    		this._tempVector3 = new Laya.Vector3();
    		this.lastMouseX = 0;
    		this.lastMouseY = 0;
    		this.yawPitchRollCamera = new Laya.Vector3();
    		this.yawPitchRollPlayer = new Laya.Vector3();
    		this.resultRotation = new Laya.Quaternion();
    		this.tempRotationZ = new Laya.Quaternion();
    		this.tempRotationX = new Laya.Quaternion();
    		this.tempRotationY = new Laya.Quaternion();
    		this.isMouseDown = false;
    		this.rotaionSpeed = 0.0002 * SceneManager.rocker;
    		this.camera = SceneManager.camera;
    		this.player = SceneManager.wjj.getChildByName("XZ");
    		this.speed = 0.02;

    		this.respireX = 1; //呼吸效果
    		this.respireY = 1; //呼吸效果
    		this.respire = 1;// 呼吸效果系数
    		this.respireX_cur = 0; //呼吸效果
    		this.respireY_cur = 0; //呼吸效果
    		this.recoil_max = 0; //后坐力修正
    		// this._resetRespireEffect();
    	}
    	//重置呼吸效果
    	_resetRespireEffect() {
    		this.respireX = ((SceneManager.RandomInt(15, 20) - 10) / 1000) * (SceneManager.RandomInt(1, 10) > 5 ? 1 : -1);
    		this.respireY = SceneManager.RandomInt(10, 15) / 1000 * this.respire;
    		this.respire *= -1;
    		this.respireX_cur = 0;
    		this.respireY_cur = 0;
    	}//呼吸效果
    	update_respire() {
    		// let offsetX = (0.0001 * (this.respireX > 0 ? 1 : -1));
    		// let offsetY = (0.0001 * (this.respireY > 0 ? 1 : -1));
    		// this.respireX_cur += offsetX;
    		// this.respireY_cur += offsetY;

    		// if (offsetX != 0) {
    		// 	var yprElem = this.yawPitchRollPlayer;
    		// 	yprElem.x -= offsetX;
    		// 	this._updateRotationX();
    		// }
    		// if (offsetY != 0) {
    		// 	var yprElem = this.yawPitchRollCamera;
    		// 	yprElem.y -= offsetY;
    		// 	if (this.recoil_max > 0) {
    		// 		let v = this.recoil_max / 5;
    		// 		yprElem.y += v;
    		// 		this.recoil_max -= v;
    		// 	}

    		// 	if (yprElem.y < -0.8) {
    		// 		yprElem.y = -0.8;
    		// 	}
    		// 	this._updateRotationY();
    		// }

    		// if (Math.abs(this.respireX_cur) > Math.abs(this.respireX) && Math.abs(this.respireY_cur) > Math.abs(this.respireY)) {
    		// 	this._resetRespireEffect();
    		// }
    	}
    	/**
    	  * @private
    	  */
    	_updateRotationX() {
    		let tmp1 = new Laya.Quaternion();
    		Laya.Quaternion.createFromYawPitchRoll(this.yawPitchRollPlayer.x, 0, 0, tmp1);

    		tmp1.cloneTo(this.player.transform.localRotation);
    		this.player.transform.localRotation = this.player.transform.localRotation;
    		// console.log("this.yawPitchRollPlayer.x:" + this.yawPitchRollPlayer.x);


    	}
    	initRotation(v) {
    		// this.yawPitchRollPlayer.x = v / 180 * Math.PI;
    	}
    	_updateRotationY() {
    		let tmp2 = new Laya.Quaternion();
    		Laya.Quaternion.createFromYawPitchRoll(0, this.yawPitchRollCamera.y, 0, tmp2);

    		tmp2.cloneTo(this.camera.transform.localRotation);
    		this.camera.transform.localRotation = this.camera.transform.localRotation;
    	}
    	onRecoil(v) {
    		var yprElem = this.yawPitchRollCamera;
    		if (yprElem.y > -0.6) {
    			yprElem.y -= 0.01 * v;
    			this._updateRotationY();
    			this.recoil_max += 0.015;
    		}
    	}


    	// 	/**
    	// 	 * @inheritDoc
    	// 	 */
    	/*override*/
    	onAwake() {

    		SceneManager.gameUI._rightBox.on(Laya.Event.MOUSE_DOWN, this, this.mouseDown);
    		SceneManager.gameUI._rightBox.on(Laya.Event.MOUSE_UP, this, this.mouseUp);

    		// Laya.stage.on(Laya.Event.KEY_DOWN, this, this.onKeyDown);
    		// Laya.stage.on(Event.RIGHT_MOUSE_OUT, this, mouseOut);
    	}
    	onKeyDown(e) {

    		switch (e.keyCode) {
    			case 87: // up
    				script_player.Move(0, 1);
    				// console.log("向前走");

    				break;
    			case 83: // down
    				script_player.Move(0, -1);
    				// console.log("向后走");
    				break;
    			case 65: //left
    				script_player.Move(1, 0);
    				// console.log("向左走");
    				break;
    			case 68://right
    				script_player.Move(-1, 0);
    				// console.log("向右走");
    				break;
    			default:
    				return;
    		}


    	}
    	/**
    	  * @inheritDoc
    	  */
    	/*override*/
    	onUpdate() {
    		// var elapsedTime = Laya.timer.delta;
    		// if (!isNaN(this.lastMouseX) && !isNaN(this.lastMouseY) && this.isMouseDown) {
    		// 	// var scene = SceneManager.resScene;
    		// 	// KeyBoardManager.hasKeyDown(87) && this.moveForward(-this.speed * elapsedTime);//W
    		// 	// KeyBoardManager.hasKeyDown(83) && this.moveForward(this.speed * elapsedTime);//S
    		// 	// KeyBoardManager.hasKeyDown(65) && this.moveRight(-this.speed * elapsedTime);//A
    		// 	// KeyBoardManager.hasKeyDown(68) && this.moveRight(this.speed * elapsedTime);//D
    		// 	// KeyBoardManager.hasKeyDown(81) && this.moveVertical(this.speed * elapsedTime);//Q
    		// 	// KeyBoardManager.hasKeyDown(69) && this.moveVertical(-this.speed * elapsedTime);//E

    		// 	var offsetX = Laya.stage.mouseX - this.lastMouseX;
    		// 	var offsetY = this.lastMouseY - Laya.stage.mouseY;

    		// 	// offsetX += this.respireX_cur;
    		// 	// offsetY += this.respireY_cur;
    		// 	if (offsetX != 0) {
    		// 		var yprElem = this.yawPitchRollPlayer;
    		// 		yprElem.x -= offsetX * this.rotaionSpeed * elapsedTime;
    		// 		this._updateRotationX();
    		// 	}
    		// 	if (offsetY != 0) {
    		// 		var yprElem = this.yawPitchRollCamera;
    		// 		yprElem.y -= offsetY * this.rotaionSpeed * elapsedTime;
    		// 		if (yprElem.y < -0.8) {
    		// 			yprElem.y = -0.8;
    		// 		}
    		// 		this._updateRotationY();
    		// 	}
    		// }
    		// this.lastMouseX = Laya.stage.mouseX;
    		// this.lastMouseY = Laya.stage.mouseY;
    		// this.update_respire();
    		// {

    		// 	let eulerAngle = this.player.transform.localRotationEulerY;
    		// 	// console.log("四元数转欧拉角：" + eulerAngle);//输出：(352.3, 47.7, 70.3)
    		// }

    		// console.log("x:" + this.player.transform.rotation.x + "y:" + this.player.transform.rotation.y + " z:" + this.player.transform.rotation.z);
    	}
    	move() {
    		// SceneManager.model.transform.localRotation = new Laya.Vector3(0, -this.camera.transform.localRotation.y, 0);
    	}

    	/**
    	  * @inheritDoc
    	  */
    	/*override*/
    	onDestroy() {
    		SceneManager.gameUI._rightBox.off(Laya.Event.RIGHT_MOUSE_DOWN, this, this.mouseDown);
    		SceneManager.gameUI._rightBox.off(Laya.Event.RIGHT_MOUSE_UP, this, this.mouseUp);
    		//Laya.stage.off(Event.RIGHT_MOUSE_OUT, this, mouseOut);
    	}
    	mouseMove(e) {
    		// if (e.touchId != this.touchId)
    		// 	return;
    		// console.log("X:" + e.stageX + " Y:" + e.stageY);
    		this.tick(e.stageX, e.stageY);
    	}
    	tick(x, y) {
    		this.rotaionSpeed = 0.0002;
    		var elapsedTime = Laya.timer.delta;
    		// var scene = SceneManager.resScene;

    		var offsetX = x - this.lastMouseX;
    		var offsetY = this.lastMouseY - y;

    		// offsetX += this.respireX_cur;
    		// offsetY += this.respireY_cur;
    		if (offsetX != 0) {
    			var yprElem = this.yawPitchRollPlayer;
    			yprElem.x -= offsetX * this.rotaionSpeed * elapsedTime;
    			this._updateRotationX();
    		}
    		if (offsetY != 0) {
    			var yprElem = this.yawPitchRollCamera;
    			yprElem.y -= offsetY * this.rotaionSpeed * elapsedTime;
    			if (yprElem.y < -0.8) {
    				yprElem.y = -0.8;
    			}
    			if (yprElem.y > 0.8) {
    				yprElem.y = 0.8;
    			}
    			// this._updateRotationY();
    		}


    		this.lastMouseX = x;
    		this.lastMouseY = y;
    		this.update_respire();
    	}
    	mouseDown(e) {
    		// console.log("点击右侧BOX");
    		SceneManager.gameUI._rightBox.on(Laya.Event.MOUSE_MOVE, this, this.mouseMove);
    		this.touchId = e.touchId;
    		//SceneManager.gameUI._rightBox.on(Laya.Event.MOUSE_UP, this, this.mouseUp);
    		SceneManager.camera.transform.localRotation.getYawPitchRoll(this.yawPitchRollCamera);
    		SceneManager.wjj.getChildByName("XZ").transform.localRotation.getYawPitchRoll(this.yawPitchRollPlayer);
    		this.lastMouseX = e.stageX;
    		this.lastMouseY = e.stageY;
    		this.isMouseDown = true;
    	}

    	mouseUp() {
    		this.isMouseDown = false;
    		this.touchId = -1;
    		SceneManager.gameUI._rightBox.off(Laya.Event.MOUSE_MOVE, this, this.mouseMove);
    	}

    	// protected mouseOut(e: Event): void {
    	// 	this.isMouseDown = false;
    	// }

    	/**
    	 * 向前移动。
    	 * @param distance 移动距离。
    	 */
    	moveForward(distance) {
    		this._tempVector3.x = this._tempVector3.y = 0;
    		this._tempVector3.z = distance;
    		this.camera.transform.translate(this._tempVector3);
    	}

    	/**
    	 * 向右移动。
    	 * @param distance 移动距离。
    	 */
    	moveRight(distance) {
    		this._tempVector3.y = this._tempVector3.z = 0;
    		this._tempVector3.x = distance;
    		this.camera.transform.translate(this._tempVector3);
    	}

    	/**
    	 * 向上移动。
    	 * @param distance 移动距离。
    	 */
    	moveVertical(distance) {
    		this._tempVector3.x = this._tempVector3.z = 0;
    		this._tempVector3.y = distance;
    		this.camera.transform.translate(this._tempVector3, false);
    	}

    }

    class script_npc {
    	init(idx, id, pos, posList) {
    		this.data = DataManager.kache[id];
    		let initPos = SceneManager.GetID2Pos(pos);
    		this.resetPos = initPos;
    		let modelPrefab = SceneManager.model.getChildByName(this.data.model);
    		this.model = Laya.Sprite3D.instantiate(modelPrefab, SceneManager.mainScene, false, initPos);
    		this.animator = this.model.getComponent(Laya.Animator);
    		this.model.name = "kache_" + idx;
    		if (this.animator == null) {
    			this.animator = this.model.getChildAt(0).getComponent(Laya.Animator);
    			this.model.getChildAt(0).name = "kache_" + idx;
    		}
    		this.animator.play("gz_close");
    		this.setState(kache_state_idle);
    		this.posIdx = 0;
    		this.speed = this.data.MoveSpeed / 1000;
    		this.curspeed = this.speed;
    		this.posList = posList;
    		this._id = idx;
    		this.model.transform.localScaleX = this.data.scale;
    		this.model.transform.localScaleY = this.data.scale;
    		this.model.transform.localScaleZ = this.data.scale;
    		this.waitPos = SceneManager.GetID2Pos(this.data.wait);
    		this.sha = this.model.getChildAt(0).getChildByName("sha");
    		this.tu = this.model.getChildAt(0).getChildByName("tu");
    		this.shihui = this.model.getChildAt(0).getChildByName("shihui");
    		this.mei = this.model.getChildAt(0).getChildByName("mei");
    		this.sha.active = false;
    		this.tu.active = false;
    		this.shihui.active = false;
    		this.mei.active = false;
    		this.zhuanghuo = 0;
    		this.goods = this.data.goods;
    		this.moveFlag = true;
    	}
    	lookAt(targetPos) {
    		this.model.transform.lookAt(targetPos, new Laya.Vector3(0, 1, 0));
    		this.model.transform.rotate(new Laya.Vector3(0, 180, 0), false, false);
    	}
    	update(dt) {
    		if (SceneManager.pause)
    			return;
    		this.curspeed = this.speed * dt;
    		switch (this.state) {
    			case kache_state_idle:
    				this.update_idle(dt);
    				break;
    			case kache_state_move:
    				this.update_move();
    				break;
    			case kache_state_wait:
    				this.update_wait();
    				break;
    			case kache_state_death:
    				this.update_death();
    				break;
    		}
    	}
    	update_idle(dt) {
    		this.setState(kache_state_move);
    	}
    	update_move() {
    		if (false == script_move.move(this.model, new Laya.Vector3(0, 0, this.curspeed))) {

    			if (true == script_move.move(this.model, new Laya.Vector3(1, 0, 0))) {
    			}
    			else if (true == script_move.move(this.model, new Laya.Vector3(-1, 0, 0))) {
    			}
    		}
    		else {
    			this.lookAt(this.targetPos);
    		}
    		let dis = Laya.Vector3.distance(this.targetPos, this.model.transform.position);
    		if (dis < 1) {
    			if (this.moveFlag) {
    				if (this.targetPos != this.waitPos) {
    					this.setState(kache_state_idle);
    				} else {
    					// this.setState(kache_state_idle);
    					this.setState(kache_state_wait);
    				}
    			}
    		}
    	}
    	update_wait() {

    	}
    	update_death() {

    	}
    	setState(state) {
    		if (this.state == state)
    			return;
    		switch (state) {
    			case kache_state_idle:
    				break;
    			case kache_state_move:
    				this.changeTarget();
    				break;
    			case kache_state_wait:
    				this.animator.play("gz_open");
    				break;
    			case kache_state_death:
    				console.log("设置卡车状态为销毁     ");
    				Laya.timer.once(1 * 1000, this, this.destroy);
    				break;
    		}
    		this.state = state;
    	}
    	changeTarget() {
    		this.posIdx += 1;
    		if (this.posIdx >= this.posList.length) {
    			this.moveFlag = false;
    			this.setState(kache_state_death);
    			return;
    		}
    		this.posIdx = this.posIdx % this.posList.length;
    		this.targetPos = SceneManager.GetID2Pos(this.posList[this.posIdx]);
    		this.lookAt(this.targetPos);
    	}
    	reSet() {
    		this.moveFlag = true;
    		this.model.active = true;
    		this.model.transform.position = this.resetPos;
    		this.posIdx = 0;
    		this.setState(kache_state_idle);
    	}
    	isLive() {
    		return this.state != kache_state_destroy;
    	}
    	continueMove() {
    		if (this.goods != SceneManager.goods) {
    			this.setState(kache_state_idle);
    			this.animator.play("gz_close");
    			SceneManager.gameUI.missionnum_txt.color = "#ff0400";
    		} else {
    			this.zhuanghuo += 1;
    			switch (this.goods) {
    				case "sha":
    					this.sha.active = true;
    					this.sha.transform.position = new Laya.Vector3(this.sha.transform.position.x, this.sha.transform.position.y + 0.2, this.sha.transform.position.z);
    					break;
    				case "tu":
    					this.tu.active = true;
    					this.tu.transform.position = new Laya.Vector3(this.tu.transform.position.x, this.tu.transform.position.y + 0.2, this.tu.transform.position.z);
    					break;
    				case "mei":
    					this.mei.active = true;
    					this.mei.transform.position = new Laya.Vector3(this.mei.transform.position.x, this.mei.transform.position.y + 0.2, this.mei.transform.position.z);
    					break;
    				case "shihui":
    					this.shihui.active = true;
    					this.shihui.transform.position = new Laya.Vector3(this.shihui.transform.position.x, this.shihui.transform.position.y + 0.2, this.shihui.transform.position.z);
    					break;
    			}
    			if (this.zhuanghuo == 5) {
    				this.animator.play("gz_close");
    				this.setState(kache_state_idle);
    				SceneManager.gameUI.missionnum_txt.text = this.zhuanghuo + "/5";
    				this.zhuanghuo = 0;
    				SceneManager.gameUI.missionComplete();
    			} else {
    				SceneManager.gameUI.missionnum_txt.text = this.zhuanghuo + "/5";
    			}
    		}
    	}
    	destroy() {
    		if (this.state == kache_state_destroy || SceneManager.gameUI == null)
    			return;
    		console.log("隐藏卡车");

    		this.state = kache_state_destroy;
    		this.model.active = false;
    		if (SceneManager.gameUI) {
    			SceneManager.gameUI.missionNum++;
    			if (SceneManager.gameUI.missionNum > 4) {
    				SceneManager.gameUI.missionNum = 1;
    			}
    			SceneManager.gameUI.initKaChe();
    		}
    		// Laya.timer.once(1 * 1000, this, this.reSet);
    	}
    }
    var kache_state_idle = 0;
    var kache_state_move = 1;
    var kache_state_wait = 2;
    var kache_state_death = 3;
    var kache_state_destroy = -1;

    class ui_game extends Laya.Scene {
    	constructor() {
    		super();
    	}
    	onEnable() {
    		console.log("进入游戏场景");

    		this.width = Laya.stage.width;
    		this.height = Laya.stage.height;
    		Laya.timer.scale = 1;
    		this.jixie_btn.width = this.width;
    		SceneManager.gameUI = this;
    		GameManager_Collection.showBackBtn();
    		SceneManager.pause = false;
    		this.rePlayVideoTime = 0;
    		this.missionVideoTime = 0;
    		this.caozuotai = false;
    		this.missionNum = 1;
    		Laya.stage.addChildAt(SceneManager.mainScene, 0);
    		this.initKaChe();
    		let name = DataManager.wjjName[SceneManager.wjjID];
    		let wjj = SceneManager.model.getChildByName(name);
    		SceneManager.wjj = Laya.Sprite3D.instantiate(wjj, SceneManager.mainScene);
    		// console.log(SceneManager.wjj);
    		this.controller = SceneManager.wjj.addComponent(carController);
    		// this.controller.model = SceneManager.wjj;
    		let p = SceneManager.mainScene.getChildByName("Npc").getChildByName("Born_0");
    		SceneManager.wjj.transform.localPosition = p.transform.position;
    		SceneManager.camera = SceneManager.wjj.getChildByName("XZ");
    		this.cameraScript = SceneManager.camera.addComponent(CameraMoveScript);
    		this.dangwei.on(Laya.Event.CLICK, this, this.changeDP);
    		this.jiashi.on(Laya.Event.CLICK, this, this.changeModel);
    		this.wajue.on(Laya.Event.CLICK, this, this.changeModel);
    		this.reset_btn.on(Laya.Event.CLICK, this, this.rePlayGame);
    		this.backtomain.on(Laya.Event.CLICK, this, this.backtoMain);
    		this.mission_bactcheku.on(Laya.Event.CLICK, this, this.backtoCheku);
    		this.mission_continue.on(Laya.Event.CLICK, this, this.closeMissionComplete);
    		this.mission_continue1.on(Laya.Event.CLICK, this, this.closeMissionComplete);
    		this.close_gdrw.on(Laya.Event.CLICK, this, this.closeGD);
    		this.lq_btn.on(Laya.Event.CLICK, this, this.confirmGD);
    		SceneManager.PlaySound("gd", 0);
    		this.jiasu.on(Laya.Event.MOUSE_DOWN, this, function () {
    			if (SceneManager.dir) {
    				SceneManager.gameUI.controller.setCarState("jiayou");
    			} else {
    				SceneManager.gameUI.controller.setCarState("daoche");
    			}
    		});
    		this.jiasu.on(Laya.Event.MOUSE_UP, this, function () {
    			SceneManager.gameUI.controller.setCarState("stopjiayou");
    		});
    		this.jiasu.on(Laya.Event.MOUSE_OUT, this, function () {
    			SceneManager.gameUI.controller.setCarState("stopjiayou");
    		});
    		this.shache.on(Laya.Event.MOUSE_DOWN, this, function () {
    			SceneManager.gameUI.controller.setCarState("shache");
    		});
    		this.shache.on(Laya.Event.MOUSE_UP, this, function () {
    			SceneManager.gameUI.controller.setCarState("stopjiayou");
    		});
    		this.left.on(Laya.Event.MOUSE_DOWN, this, function () {
    			SceneManager.gameUI.controller.setCarDirState("L");
    		});
    		this.left.on(Laya.Event.MOUSE_UP, this, function () {
    			SceneManager.gameUI.controller.setCarDirState("stop");
    		});
    		this.left.on(Laya.Event.MOUSE_OUT, this, function () {
    			SceneManager.gameUI.controller.setCarDirState("stop");
    		});
    		this.right.on(Laya.Event.MOUSE_DOWN, this, function () {
    			SceneManager.gameUI.controller.setCarDirState("R");
    		});
    		this.right.on(Laya.Event.MOUSE_UP, this, function () {
    			SceneManager.gameUI.controller.setCarDirState("stop");
    		});
    		this.right.on(Laya.Event.MOUSE_OUT, this, function () {
    			SceneManager.gameUI.controller.setCarDirState("stop");
    		});
    		this.pause_btn.on(Laya.Event.CLICK, this, this.openPause);
    		this.close_pause.on(Laya.Event.CLICK, this, this.closePause);
    		this.continue.on(Laya.Event.CLICK, this, this.closePause);
    		this.opensound_btn.on(Laya.Event.CLICK, this, this.openSound);
    		this.closesound_btn.on(Laya.Event.CLICK, this, this.closeSound);
    	}
    	changeModel() {
    		this.caozuotai = !this.caozuotai;
    		if (!this.caozuotai) {
    			this.jiashi.visible = false;
    			this.wajue.visible = true;
    			this.car_btn.visible = true;
    			this.jixie_btn.visible = false;
    		} else {
    			this.jiashi.visible = true;
    			this.wajue.visible = false;
    			this.car_btn.visible = false;
    			this.jixie_btn.visible = true;
    		}
    	}
    	changeDP() {
    		SceneManager.dir = !SceneManager.dir;
    		if (SceneManager.dir) {
    			Laya.Tween.to(this.dian, { y: 92 }, 100, null, null, 0, true);
    		} else {
    			Laya.Tween.to(this.dian, { y: 10 }, 100, null, null, 0, true);
    		}
    	}
    	changeUI() {
    		if (this.caozuotai) {
    			this.caozuo_left.visible = false;
    			this.caozuo_right.visible = false;
    			this.leftbox.visible = true;
    			this.caozuotai = !this.caozuotai;
    		} else {
    			this.caozuo_left.visible = true;
    			this.caozuo_right.visible = true;
    			this.leftbox.visible = false;
    			this.caozuotai = !this.caozuotai;
    		}
    	}
    	initKaChe() {
    		console.log("创建卡车");
    		if (SceneManager.kacheList == null || SceneManager.kacheList.length < this.missionNum) {
    			console.log("数组中没有卡车，新建");
    			let tab = DataManager.kache[this.missionNum];
    			let kache = new script_npc();
    			SceneManager.kacheList.push(kache);
    			kache.init(SceneManager.kacheList.length, this.missionNum, tab.initpos, tab.area);
    		} else {
    			console.log("数组中有卡车，直接复用");
    			SceneManager.kacheList[this.missionNum - 1].reSet();
    		}
    		this.rw_txt.text = "成功挖掘" + DataManager.mission[this.missionNum].neirong + "装满货车";
    		this.missionnum_txt.text = "0/5";
    		this.mission_txt.color = "#ffffff";
    		switch (this.missionNum) {
    			case 1:
    				SceneManager.mainScene.getChildByName("marking_tu").active = false;
    				SceneManager.mainScene.getChildByName("marking_mei").active = false;
    				SceneManager.mainScene.getChildByName("marking_shihui").active = false;
    				SceneManager.mainScene.getChildByName("marking_sha").active = true;
    				break;
    			case 2:
    				SceneManager.mainScene.getChildByName("marking_tu").active = true;
    				SceneManager.mainScene.getChildByName("marking_mei").active = false;
    				SceneManager.mainScene.getChildByName("marking_shihui").active = false;
    				SceneManager.mainScene.getChildByName("marking_sha").active = false;
    				break;
    			case 3:
    				SceneManager.mainScene.getChildByName("marking_tu").active = false;
    				SceneManager.mainScene.getChildByName("marking_mei").active = false;
    				SceneManager.mainScene.getChildByName("marking_shihui").active = true;
    				SceneManager.mainScene.getChildByName("marking_sha").active = false;
    				break;
    			case 4:
    				SceneManager.mainScene.getChildByName("marking_tu").active = false;
    				SceneManager.mainScene.getChildByName("marking_mei").active = true;
    				SceneManager.mainScene.getChildByName("marking_shihui").active = false;
    				SceneManager.mainScene.getChildByName("marking_sha").active = false;
    				break;
    		}
    	}
    	dizuoLeft() {
    		this.controller.setCState("turnleft");
    	}
    	dizuoRight() {
    		this.controller.setCState("turnright");
    	}
    	dabiUP() {
    		this.controller.setCState("dabiup");
    	}
    	dabiDown() {
    		this.controller.setCState("dabidown");
    	}
    	xiaobiUP() {
    		this.controller.setCState1("xiaobiup");
    	}
    	xiaobiDown() {
    		this.controller.setCState1("xiaobidown");
    	}
    	chandouUP() {
    		this.controller.setCState1("chandouup");
    	}
    	chandouDown() {
    		this.controller.setCState1("chandoudown");
    	}
    	stopCState() {
    		this.controller.setCState("stop");
    	}
    	stopCState1() {
    		this.controller.setCState1("stop");
    	}
    	openPause() {
    		//原生
    		console.log("暂停设置");
    		Advertisement.insertAdverV3();

    		SceneManager.pause = true;
    		Laya.timer.scale = 0.00001;
    		this.pause_ui.visible = true;
    		if (DataManager.GetData("Sound") == 1) {
    			this.open_img.visible = true;
    			this.close_img.visible = false;
    		} else {
    			this.open_img.visible = false;
    			this.close_img.visible = true;
    		}
    	}
    	openPause_noUI() {
    		SceneManager.pause = true;
    		Laya.timer.scale = 0.00001;
    	}
    	closePause() {
    		SceneManager.pause = false;
    		Laya.timer.scale = 1;
    		this.pause_ui.visible = false;
    		this.rePlayVideoTime = 0;
    	}
    	openSound() {
    		DataManager.SetData("Sound", 1);
    		this.open_img.visible = true;
    		this.close_img.visible = false;
    		Laya.SoundManager.setMusicVolume(1);
    		Laya.SoundManager.setSoundVolume(1);
    		// Laya.SoundManager.muted = false;
    	}
    	closeSound() {
    		DataManager.SetData("Sound", 0);
    		this.open_img.visible = false;
    		this.close_img.visible = true;
    		Laya.SoundManager.setMusicVolume(0);
    		Laya.SoundManager.setSoundVolume(0);
    		// Laya.SoundManager.muted = true;
    	}
    	missionComplete() {
    		//原生
    		console.log("任务完成");
    		Advertisement.insertAdverV();

    		this.complete_bg.visible = true;
    		SceneManager.pause = true;
    		Laya.timer.scale = 0.000001;
    		var unlock = DataManager.GetData("unlock");
    		this.mission_continue.visible = false;
    		this.mission_bactcheku.visible = false;
    		this.mission_continue1.visible = true;
    		for (var key in unlock) {
    			if (unlock[key] == 0) {
    				unlock[key] = 1;
    				this.mission_txt.text = true;
    				this.mission_continue.visible = true;
    				this.mission_bactcheku.visible = true;
    				this.mission_continue1.visible = false;
    				break;
    			}
    		}
    		DataManager.SetData("unlock", unlock);
    	}
    	closeMissionComplete() {
    		this.complete_bg.visible = false;
    		SceneManager.pause = false;
    		Laya.timer.scale = 1;
    	}
    	rePlayGame() {
    		SceneManager.pause = false;
    		let p = SceneManager.mainScene.getChildByName("Npc").getChildByName("Born_0");
    		SceneManager.wjj.transform.localPosition = p.transform.position;
    		this.controller.reSetWjj();
    		SceneManager.dir = true;
    		this.dian.y = 92;
    		Laya.timer.scale = 1;
    		Laya.timer.frameOnce(1, this, function () {
    			this.pause_ui.visible = false;
    		});
    	}
    	backtoMain() {
    		//原生
    		console.log("返回首页");
    		Advertisement.insertAdverV3();

    		SceneManager.pause = false;
    		SceneManager.GoBackToMain();
    		// Laya.Scene.open("WJJ/loading.scene");
    	}
    	backtoCheku() {
    		//原生
    		console.log("返回车库");
    		Advertisement.insertAdverV3();

    		SceneManager.pause = false;
    		SceneManager.GoBackToHangar();
    	}
    	closeGD() {
    		if (SceneManager.sjFlag && SceneManager.tlsjFlag) {
    			this.confirmGD();
    		} else {
    			this.gdrw_ui.visible = false;
    		}
    	}
    	confirmGD() {
    		this.gdrw_ui.visible = false;
    		SceneManager.speed += 5;
    		SceneManager.pause = true;
    		Laya.timer.scale = 1;
    	}
    	showMission() {
    		this.gdrw_ui.visible = true;
    		SceneManager.pause = true;
    		Laya.timer.scale = 0.000001;
    	}
    	onDisable() {
    		if (SceneManager.mainScene) {
    			SceneManager.mainScene.destroy();
    			SceneManager.mainScene = null;
    		}
    		SceneManager.clearData();
    		SceneManager.clearTimer();
    		Laya.timer.clearAll(this);
    		Laya.timer.clearAll(this.controller);
    		Laya.timer.scale = 1;
    	}
    }

    class script_leftrocker extends Laya.Image {

    	constructor() {
    		super();

    	}
    	onDestroy() {
    		console.log("onDestroy script_rocker");
    	}
    	onEnable() {
    		this.RADIUS = 126;
    		this.smallCircle = this.getChildAt(0);
    		this.bigCircle = this;
    		this.bigCircle.parent.on(Laya.Event.MOUSE_DOWN, this, this.onSmallClickDown);
    		Laya.timer.loop(15, this, this.tick);
    	}
    	onSmallClickDown(e) {
    		// console.log(e.touchId);
    		this.touchId = e.touchId;
    		this.bigCircle.parent.on(Laya.Event.MOUSE_UP, this, this.onSmallClickUp);
    		this.bigCircle.parent.on(Laya.Event.MOUSE_OUT, this, this.onSmallClickUp);
    		this.bigCircle.parent.on(Laya.Event.MOUSE_MOVE, this, this.onSmallClickMove);
    	}
    	onDisable() {
    		Laya.timer.clearAll(this);
    	}
    	onSmallClickUp(e) {
    		if (e.touchId != this.touchId)
    			return;
    		// 取消鼠标移动事件

    		this.bigCircle.parent.off(Laya.Event.MOUSE_MOVE, this, this.onSmallClickMove);

    		// 小圆返回中心位置
    		this.smallCircle.x = this.bigCircle.width / 2;

    		this.smallCircle.y = this.bigCircle.height / 2;

    		this.touchId = -1;

    	}
    	onSmallClickMove(e) {
    		if (e.touchId != this.touchId)
    			return;

    		var xx = Laya.stage.mouseX - (this.bigCircle.x + this.parent.x);
    		var yy = Laya.stage.mouseY - (this.bigCircle.y + this.parent.y);
    		var obl = Math.sqrt(Math.pow(xx, 2) + Math.pow(yy, 2));
    		// 求弧度
    		var rad = this.getRad(xx, yy, obl);
    		this.radians = rad;
    		// 弧度转角度
    		var angle = 180 / Math.PI * rad;
    		// 在文本框中显示角度
    		// console.log("angle:" + angle);
    		// 限制小圆移动范围
    		if (obl > this.RADIUS) {
    			// // 当鼠标与大圆中心超过移动半径 RADIUS 时，停止小圆继续往外移动
    			// // 通过三角形边与边的比例计算出小圆应该处于的位置
    			var smallCircleX = (this.RADIUS * xx) / obl + 126;
    			var smallCircleY = (this.RADIUS * yy) / obl + 126;
    			this.smallCircle.pos(smallCircleX, smallCircleY);
    		} else {
    			let x = xx + this.bigCircle.width / 2;
    			let y = yy + this.bigCircle.height / 2;

    			this.smallCircle.pos(x, y);
    		}
    	}
    	/**
    	   * 求弧度函数
    	   * @param xx : x轴距离
    	   * @param yy : y轴距离
    	   * @param obl : 斜边
    	   */
    	getRad(xx, yy, obl) {
    		var rad = yy < 0 ? Math.acos(xx / obl) : (Math.PI * 2 - Math.acos(xx / obl));
    		return rad;
    	}

    	tick() {
    		if (SceneManager.gameUI && SceneManager.wjj) {
    			let x = this.smallCircle.x - 126;
    			let y = this.smallCircle.y - 126;
    			if (Math.abs(x) > 5 || Math.abs(y) > 5) {
    				var angle = 180 / Math.PI * this.radians;
    				if (angle > 45 && angle <= 135) {
    					SceneManager.gameUI.dabiUP();
    				} else if (angle > 135 && angle <= 225) {
    					SceneManager.gameUI.dizuoLeft();
    				} else if (angle > 225 && angle <= 315) {
    					SceneManager.gameUI.dabiDown();
    				} else {
    					SceneManager.gameUI.dizuoRight();
    				}
    			} else {
    				SceneManager.gameUI.stopCState();
    			}
    		}

    	}
    }

    class script_leftrocker$1 extends Laya.Image {

    	constructor() {
    		super();

    	}
    	onDestroy() {
    		console.log("onDestroy script_rocker");
    	}
    	onEnable() {
    		this.RADIUS = 126;
    		this.smallCircle = this.getChildAt(0);
    		this.bigCircle = this;
    		this.bigCircle.parent.on(Laya.Event.MOUSE_DOWN, this, this.onSmallClickDown);
    		Laya.timer.loop(15, this, this.tick);
    	}
    	onSmallClickDown(e) {
    		// console.log(e.touchId);
    		this.touchId = e.touchId;
    		this.bigCircle.parent.on(Laya.Event.MOUSE_UP, this, this.onSmallClickUp);
    		this.bigCircle.parent.on(Laya.Event.MOUSE_OUT, this, this.onSmallClickUp);
    		this.bigCircle.parent.on(Laya.Event.MOUSE_MOVE, this, this.onSmallClickMove);
    	}
    	onDisable() {
    		Laya.timer.clearAll(this);
    	}
    	onSmallClickUp(e) {
    		if (e.touchId != this.touchId)
    			return;
    		// 取消鼠标移动事件

    		this.bigCircle.parent.off(Laya.Event.MOUSE_MOVE, this, this.onSmallClickMove);

    		// 小圆返回中心位置
    		this.smallCircle.x = this.bigCircle.width / 2;

    		this.smallCircle.y = this.bigCircle.height / 2;

    		this.touchId = -1;

    	}
    	onSmallClickMove(e) {
    		if (e.touchId != this.touchId)
    			return;

    		var xx = Laya.stage.mouseX - (this.bigCircle.x + this.parent.x);
    		var yy = Laya.stage.mouseY - (this.bigCircle.y + this.parent.y);
    		var obl = Math.sqrt(Math.pow(xx, 2) + Math.pow(yy, 2));
    		// 求弧度
    		var rad = this.getRad(xx, yy, obl);
    		this.radians = rad;
    		// 弧度转角度
    		var angle = 180 / Math.PI * rad;
    		// 在文本框中显示角度
    		// console.log("angle:" + angle);
    		// 限制小圆移动范围
    		if (obl > this.RADIUS) {
    			// // 当鼠标与大圆中心超过移动半径 RADIUS 时，停止小圆继续往外移动
    			// // 通过三角形边与边的比例计算出小圆应该处于的位置
    			var smallCircleX = (this.RADIUS * xx) / obl + 126;
    			var smallCircleY = (this.RADIUS * yy) / obl + 126;
    			this.smallCircle.pos(smallCircleX, smallCircleY);
    		} else {
    			let x = xx + this.bigCircle.width / 2;
    			let y = yy + this.bigCircle.height / 2;

    			this.smallCircle.pos(x, y);
    		}
    	}
    	/**
    	   * 求弧度函数
    	   * @param xx : x轴距离
    	   * @param yy : y轴距离
    	   * @param obl : 斜边
    	   */
    	getRad(xx, yy, obl) {
    		var rad = yy < 0 ? Math.acos(xx / obl) : (Math.PI * 2 - Math.acos(xx / obl));
    		return rad;
    	}

    	tick() {
    		if (SceneManager.gameUI && SceneManager.wjj) {
    			let x = this.smallCircle.x - 126;
    			let y = this.smallCircle.y - 126;
    			if (Math.abs(x) > 5 || Math.abs(y) > 5) {
    				var angle = 180 / Math.PI * this.radians;
    				if (angle > 45 && angle <= 135) {
    					SceneManager.gameUI.xiaobiDown();
    				} else if (angle > 135 && angle <= 225) {
    					SceneManager.gameUI.chandouDown();
    				} else if (angle > 225 && angle <= 315) {
    					SceneManager.gameUI.xiaobiUP();
    				} else {
    					SceneManager.gameUI.chandouUP();
    				}
    			} else {
    				SceneManager.gameUI.stopCState1();
    			}
    		}

    	}
    }

    /**This class is automatically generated by LayaAirIDE, please do not make any modifications. */

    class GameConfig {
    	static init() {
    		//注册Script或者Runtime引用
    		let reg = Laya.ClassUtils.regClass;
    		reg("Accident/script/gameScene.js", gameScene);
    		reg("Accident/script/loadingScene.js", loadingScene);
    		reg("Accident/script/mainScene.js", mainScene);
    		reg("Accident2/gameScene.js", gameScene$1);
    		reg("Accident2/loading.js", loadingScene$1);
    		reg("Accident2/mainScene.js", mainScene$1);
    		reg("ChuZuChe/PanelBangZhu.js", PanelBangZhu);
    		reg("ChuZuChe/PanelCheKu.js", PanelCheKu);
    		reg("ChuZuChe/PanleGuanQiaOver.js", PanleGuanQiaOver);
    		reg("ChuZuChe/PanelDaoHang.js", PanelDaoHang);
    		reg("ChuZuChe/PanelDaoHang1.js", PanelDaoHang1);
    		reg("ChuZuChe/PanelXuanGuan.js", PanelXuanGuan);
    		reg("ChuZuChe/PanelFrist.js", PanelFrist);
    		reg("ChuZuChe/PanelGame.js", PanelGame);
    		reg("ChuZuChe/PanelGuide.js", PanelGuide);
    		reg("ChuZuChe/PanelJiaocheng3.js", PanelJiaocheng3);
    		reg("ChuZuChe/PanelJieDan.js", PanelJieDan);
    		reg("ChuZuChe/PanelJiaYou.js", PanelJiayou);
    		reg("ChuZuChe/PanelJiaYou2.js", PanelJiayou2);
    		reg("ChuZuChe/PanelJieke.js", PanelJieke);
    		reg("ChuZuChe/PanelJieSuan.js", PanelJieSuan);
    		reg("ChuZuChe/PanelJuQing.js", PanelJuQing);
    		reg("ChuZuChe/PanelJuQing2.js", PanelJuQing2);
    		reg("ChuZuChe/LixianSy.js", LixianSy);
    		reg("ChuZuChe/PanelLoading.js", PanelLoading);
    		reg("ChuZuChe/PanelMain.js", PanelMain);
    		reg("ChuZuChe/PanelMeiYouTip.js", PanelMeiYouTip);
    		reg("ChuZuChe/PanelPause.js", PanelPause);
    		reg("ChuZuChe/PanelQiandao.js", PanelQiandao);
    		reg("ChuZuChe/PanelQianDonghua.js", PanelQianDonghua);
    		reg("ChuZuChe/GoldText.js", GoldText);
    		reg("ChuZuChe/Shareqidong.js", Shareqidong);
    		reg("ChuZuChe/PanelJiaYouTip.js", PanelJiaYouTip);
    		reg("ChuZuChe/PanelShengYa.js", PanelShengYa);
    		reg("ChuZuChe/PanelSetting.js", PanelSetting);
    		reg("ChuZuChe/PanelShiBai.js", PanelShiBai);
    		reg("ChuZuChe/PanelAllGuanQia.js", PanelAllGuanQia);
    		reg("ChuZuChe/PanelTuiJian2.js", PanelTuiJian2);
    		reg("ChuZuChe/PanelTuiJian4.js", PanelTuiJian4);
    		reg("ChuZuChe/JiesuanTuisong.js", JiesuanTuisong);
    		reg("ChuZuChe/PanelTuiJian6.js", PanelTuiJian6);
    		reg("ChuZuChe/xingzuo.js", xingzuo);
    		reg("ChuZuChe/PanelGuanQia.js", PanelGuanQia);
    		reg("ChuZuChe/YongjiuCar.js", YongjiuCar);
    		reg("ChuZuChe/ZhuanPan.js", ZhuanPan);
    		reg("ChuZuChe/PanelJieSuoZiYou.js", PanelJieSuoZiYou);
    		reg("Collection/script/BackBtn.js", BackBtn);
    		reg("Collection/script/CollectionDownload.js", CollectionDownload);
    		reg("Collection/script/GamesScene.js", GamesScene);
    		reg("Collection/script/CollectionLoading.js", CollectionLoading);
    		reg("GJJ/script/cheScene.js", cheScene);
    		reg("GJJ/script/gameScene.js", gameScene$2);
    		reg("GJJ/script/loading.js", loading);
    		reg("GJJ/script/mainScene.js", mainScene$2);
    		reg("GJJ/script/mapScene.js", mapScene);
    		reg("Truck/script/cheScene.js", cheScene$1);
    		reg("Truck/script/gameScene.js", gameScene$3);
    		reg("Truck/script/loading.js", loading$1);
    		reg("Truck/script/mainScene.js", mainScene$3);
    		reg("Truck/script/mapScene.js", mapScene$1);
    		reg("WJJ/script/ui_main.js", ui_main);
    		reg("WJJ/script/ui_loading.js", ui_loading);
    		reg("WJJ/script/ui_message.js", ui_message);
    		reg("WJJ/script/ui_game.js", ui_game);
    		reg("WJJ/script_leftrocker.js", script_leftrocker);
    		reg("WJJ/script_rightrocker.js", script_leftrocker$1);
    	}
    }
    GameConfig.width = 1280;
    GameConfig.height = 720;
    GameConfig.scaleMode = "fixedheight";
    GameConfig.screenMode = "horizontal";
    GameConfig.alignV = "top";
    GameConfig.alignH = "left";
    GameConfig.startScene = "Collection/CollectionLoading.scene";
    GameConfig.sceneRoot = "";
    GameConfig.debug = false;
    GameConfig.stat = false;
    GameConfig.physicsDebug = false;
    GameConfig.exportSceneToJson = true;

    GameConfig.init();

    class Main {
    	constructor() {
    		//根据IDE设置初始化引擎		
    		if (window["Laya3D"]) Laya3D.init(GameConfig.width, GameConfig.height);
    		else Laya.init(GameConfig.width, GameConfig.height, Laya["WebGL"]);
    		Laya["Physics"] && Laya["Physics"].enable();
    		Laya["DebugPanel"] && Laya["DebugPanel"].enable();
    		Laya.stage.scaleMode = GameConfig.scaleMode;
    		Laya.stage.screenMode = GameConfig.screenMode;
    		Laya.stage.alignV = GameConfig.alignV;
    		Laya.stage.alignH = GameConfig.alignH;
    		//兼容微信不支持加载scene后缀场景
    		Laya.URL.exportSceneToJson = GameConfig.exportSceneToJson;

    		//打开调试面板（通过IDE设置调试模式，或者url地址增加debug=true参数，均可打开调试面板）
    		if (GameConfig.debug || Laya.Utils.getQueryString("debug") == "true") Laya.enableDebugPanel();
    		if (GameConfig.physicsDebug && Laya["PhysicsDebugDraw"]) Laya["PhysicsDebugDraw"].enable();
    		if (GameConfig.stat) Laya.Stat.show();
    		Laya.alertGlobalError(true);

    		//激活资源版本控制，version.json由IDE发布功能自动生成，如果没有也不影响后续流程
    		// Laya.ResourceVersion.enable("version.json", Laya.Handler.create(this, this.onVersionLoaded), Laya.ResourceVersion.FILENAME_VERSION);

    		if (window.qg) {
    			let self = this;
    			let loaded = Laya.LocalStorage.getItem("Loaded");
    			if (loaded != 1) {
    				console.log("进入了这里");
    				var downloadTask = qg.download({
    					url: "http://res.njmobaike.com/CDN/WeiXianMaoXianZhiCheShen/ZhenShiFeiCheMoNiQi/1.1.0/bin.zip",
    					success: function (data) {
    						console.log(`handling success, tempFilePath = ${data.tempFilePath}`);
    						qg.unzipFile({
    							srcUri: data.tempFilePath,
    							dstUri: qg.env.USER_DATA_PATH + "/bin",
    							success: function (uri) {
    								console.log(`handling success: ${uri}`);
    								Laya.URL.basePath = qg.env.USER_DATA_PATH + "/bin/";
    								Laya.LocalStorage.setItem("Loaded", 1);

    								Laya.ResourceVersion.enable("version.json", Laya.Handler.create(self, self.onVersionLoaded), Laya.ResourceVersion.FILENAME_VERSION);
    							},
    							fail: function (data, code) {
    								console.log(`handling fail, code = ${code}`);
    							}
    						});
    					},
    					fail: function (data, code) {
    						console.log(`handling fail, code = ${code}`);
    					}
    				});

    				downloadTask.onProgressUpdate(function (msg) {
    					console.log('SSSSSSSSSSSSSSSSS');
    					var progress = msg["progress"];
    					console.log(progress + "%");
    				});
    			}
    			else {
    				Laya.URL.basePath = qg.env.USER_DATA_PATH + "/bin/";

    				Laya.ResourceVersion.enable("version.json", Laya.Handler.create(this, this.onVersionLoaded), Laya.ResourceVersion.FILENAME_VERSION);
    			}
    		}
    		else {
    			Laya.ResourceVersion.enable("version.json", Laya.Handler.create(this, this.onVersionLoaded), Laya.ResourceVersion.FILENAME_VERSION);
    		}

    		Advertisement.initVal();
    	}

    	onVersionLoaded() {
    		//激活大小图映射，加载小图的时候，如果发现小图在大图合集里面，则优先加载大图合集，而不是小图
    		Laya.AtlasInfoManager.enable("fileconfig.json", Laya.Handler.create(this, this.onConfigLoaded));

    		// let self = this;
    		// // Laya.loader.create("prefab/jkgg.prefab", Laya.Handler.create(this, prefab => {
    		// // 	let jkgg = Laya.Pool.getItemByCreateFun("jkgg", prefab.create, prefab)
    		// // 	jkgg.width = Laya.stage.width;
    		// // 	jkgg.height = Laya.stage.height;
    		// // 	Laya.stage.addChild(jkgg);
    		// // 	Laya.timer.once(3 * 1000, this, function () {
    		// // 		jkgg.visible = false;

    		// Laya.loader.load("prefab/jkgg.json", Laya.Handler.create(this, function (pref) {
    		// 	var jkggp = new Laya.Prefab();
    		// 	jkggp.json = pref;
    		// 	var jkgg = Laya.Pool.getItemByCreateFun("jkgg", jkggp.create, jkggp);
    		// 	jkgg.width = Laya.stage.width;
    		// 	jkgg.height = Laya.stage.height;
    		// 	Laya.stage.addChild(jkgg);
    		// 	Laya.timer.once(3 * 1000, this, function () {
    		// 		jkgg.visible = false;

    		// 		// Laya.loader.load("prefab/fwtk.json", Laya.Handler.create(this, function (pref) {
    		// 		//     var fwtkp = new Laya.Prefab();
    		// 		//     fwtkp.json = pref;
    		// 		//     var fwtks = Laya.Pool.getItemByCreateFun("fwtk", fwtkp.create, fwtkp);
    		// 		//     fwtks.pos(Laya.stage.width / 2, Laya.stage.height / 2);
    		// 		//     fwtks.scaleX = 1;
    		// 		//     fwtks.scaleY = 1;
    		// 		//     fwtks.getChildByName('btn_yes').on(Laya.Event.MOUSE_DOWN, this, function () {
    		// 		//         Laya.LocalStorage.setItem('ycys', JSON.parse('true'));
    		// 		//         fwtks.removeSelf();

    		// 		Laya.AtlasInfoManager.enable("fileconfig.json", Laya.Handler.create(self, self.onConfigLoaded))

    		// 		//     })
    		// 		//     fwtks.getChildByName('btn_no').on(Laya.Event.MOUSE_DOWN, this, function () {
    		// 		//         qg.exitApplication({
    		// 		//             success: function () {
    		// 		//                 console.log("exitApplication success");
    		// 		//             },
    		// 		//             fail: function () {
    		// 		//                 console.log("exitApplication fail");
    		// 		//             },
    		// 		//             complete: function () {
    		// 		//                 console.log("exitApplication complete");
    		// 		//             }
    		// 		//         });
    		// 		//     })
    		// 		//     Laya.stage.addChild(fwtks);
    		// 		// }))

    		// 	})
    		// }));
    	}

    	onConfigLoaded() {
    		//加载IDE指定的场景
    		GameConfig.startScene && Laya.Scene.open(GameConfig.startScene);
    	}
    }
    //激活启动类
    new Main();

}());
