(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 = "30967365";

    window.bannerAdId = " adc43a398b654c788e09dead48c392b9";
    window.nativeAdId = "6c0cbe850bf840c2bbf6a8908217f19f";
    window.videoAdId = "15b0cac1aac048998466ac39dbd54ade";

    //初始化变量
    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.data = null;
        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 % 5 == 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 (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 (Advertisement.testDate.getFullYear() == 2024 && Advertisement.testDate.getMonth() + 1 == 2 && (Advertisement.testDate.getDate() <= 8 && Advertisement.testDate.getDate() >= 1 ) && Advertisement.testDate.getHours() <= 20) {

        } 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.insertAdverV2 = function () {
    //     console.log("点击原生");
    //     // if (qg.createCustomAd && Advertisement.data) {
    //     Advertisement.customAd = qg.createCustomAd({
    //         adUnitId: window.nativeAdId,
    //         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.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 () {
    //     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].iconUrlList[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) {
        Advertisement.videop = e;

        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;
                    }
                } else {
                    console.log("播放中途退出，不下发游戏奖励");
                    // cc.audioEngine.resumeAll();

                    Advertisement.videop = 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: "当前无广告，请稍后尝试"
            });
        });
    };

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

    // module.exports = Advertisement;

    /**This class is automatically generated by LayaAirIDE, please do not make any modifications. */


    class GameConfig {
        static init() {
            //注册Script或者Runtime引用
            let reg = Laya.ClassUtils.regClass;

        }
    }
    GameConfig.width = 640;
    GameConfig.height = 1136;
    GameConfig.scaleMode ="fixedwidth";
    GameConfig.screenMode = "none";
    GameConfig.alignV = "top";
    GameConfig.alignH = "left";
    GameConfig.startScene = "";
    GameConfig.sceneRoot = "";
    GameConfig.debug = false;
    GameConfig.stat = false;
    GameConfig.physicsDebug = false;
    GameConfig.exportSceneToJson = true;

    GameConfig.init();

    (function () {
        "use strict";
        class ConfigBase {
            constructor() {
                this.hasMap = false;
                this.List = new Array();
                this.mapByID = {};
                this.mapByName = {};
            }
            getItem(ID) {
                return this.hasMap ? this.mapByID[ID] : this.List.filter(t => t.ID == ID)[0];
            }
            Load(url, clazz, needMap = true) {
                let jsonData = Laya.loader.getRes(url);
                if (!jsonData) {
                    console.log("------" + url + "读取失败!!");
                    return;
                }
                this.hasMap = needMap;
                let idArr = jsonData["ID"] || jsonData["_Name"] || [];
                this.List = idArr.map((ID, i) => {
                    let instance = new clazz();
                    instance.ID = typeof ID == "number" ? ID : i + 1;
                    for (let key in jsonData) {
                        if (key == "ID") continue;
                        let value = jsonData[key][i];
                        switch (typeof value) {
                            case "string":
                                let mustBeArray = value.indexOf(";") >= 0;
                                value.endsWith(";") && (value = value.slice(0, -1));
                                let array = value.split(";");
                                let result = array.map(str => {
                                    let num = parseInt(str);
                                    if (Number.isFinite(num) && str == num + "") {
                                        return num;
                                    } else {
                                        return str;
                                    }
                                });
                                if (mustBeArray) {
                                    instance[key] = result;
                                } else {
                                    instance[key] = typeof result[0] == "string" ? result[0] : result;
                                }
                                break;

                            case "number":
                                instance[key] = value;
                                break;
                        }
                    }
                    return instance;
                });
                needMap && this.List.forEach(x => {
                    this.mapByID[x.ID] = x;
                    this.mapByName[x._Name] = x;
                });
                this.afterLoad();
            }
            afterLoad() { }
        }
        var E_BUFF_TYPE;
        (function (E_BUFF_TYPE) {
            E_BUFF_TYPE[E_BUFF_TYPE["NONE"] = 0] = "NONE";
            E_BUFF_TYPE[E_BUFF_TYPE["RANK_FIRST_REWARD_BUFF"] = 1] = "RANK_FIRST_REWARD_BUFF";
            E_BUFF_TYPE[E_BUFF_TYPE["GOLD_BUFF"] = 2] = "GOLD_BUFF";
            E_BUFF_TYPE[E_BUFF_TYPE["RUSH_BUFF"] = 3] = "RUSH_BUFF";
            E_BUFF_TYPE[E_BUFF_TYPE["TRAP_CHANCE_BUFF"] = 4] = "TRAP_CHANCE_BUFF";
            E_BUFF_TYPE[E_BUFF_TYPE["RANK_OTHER_REWARD_BUFF"] = 5] = "RANK_OTHER_REWARD_BUFF";
            E_BUFF_TYPE[E_BUFF_TYPE["DRIFT_RUSH_BUFF"] = 6] = "DRIFT_RUSH_BUFF";
            E_BUFF_TYPE[E_BUFF_TYPE["DEFENSE_CHANCE_BUFF"] = 7] = "DEFENSE_CHANCE_BUFF";
            E_BUFF_TYPE[E_BUFF_TYPE["DRIFT_SCORE_BUFF"] = 8] = "DRIFT_SCORE_BUFF";
            E_BUFF_TYPE[E_BUFF_TYPE["ATTACK_CHANCE_BUFF"] = 9] = "ATTACK_CHANCE_BUFF";
            E_BUFF_TYPE[E_BUFF_TYPE["SPEEDGAME_MAXSPEED"] = 10] = "SPEEDGAME_MAXSPEED";
            E_BUFF_TYPE[E_BUFF_TYPE["PROPGAME_MAXSPEED"] = 11] = "PROPGAME_MAXSPEED";
            E_BUFF_TYPE[E_BUFF_TYPE["SPEEDGAME_REWARD_BUFF"] = 12] = "SPEEDGAME_REWARD_BUFF";
        })(E_BUFF_TYPE || (E_BUFF_TYPE = {}));
        class CCfgBuffInfo extends ConfigBase { }
        class CCfgChest extends ConfigBase { }
        class UsefulStuff {
            static rnd(param1 = 0, param2 = 1) {
                return Math.floor(Math.random() * (param2 - param1 + 1)) + param1;
            }
            static rndfloat(param1 = 0, param2 = 1) {
                return Math.random() * (param2 - param1 + 1) + param1;
            }
            static formatMSS(ms) {
                var m = Math.floor(ms / 1e3 / 60);
                var s = Math.floor(ms / 1e3 - m * 60);
                var ss = Math.floor((ms - m * 60 * 1e3 - s * 1e3) / 10);
                var str = this.PrefixZero(m, 2) + ":" + this.PrefixZero(s, 2) + ":" + this.PrefixZero(ss, 2);
                return str;
            }
            static formatMS(s) {
                var h = Math.floor(s / 60 / 60);
                var m = Math.floor((s - h * 60 * 60) / 60);
                var s = Math.floor(s - m * 60 - h * 60 * 60);
                var str = this.PrefixZero(h, 2) + ":" + this.PrefixZero(m, 2) + ":" + this.PrefixZero(s, 2);
                return str;
            }
            static formatMS2(s) {
                var m = Math.floor(s / 60);
                var s = Math.floor(s - m * 60);
                var str = this.PrefixZero(m, 2) + ":" + this.PrefixZero(s, 2);
                return str;
            }
            static PrefixZero(num, n) {
                return (Array(n).join("0") + num).slice(-n);
            }
            static UIVFXPos(camera, x, y, dis) {
                let _ray = new Laya.Ray(new Laya.Vector3(), new Laya.Vector3());
                camera.viewportPointToRay(new Laya.Vector2(x, y), _ray);
                let o = _ray.origin;
                let d = _ray.direction;
                let worldPos = new Laya.Vector3(o.x + d.x * dis, o.y + d.y * dis, o.z + d.z * dis);
                return worldPos;
            }
            static WorldToScreen2(camera, point) {
                var pointA = this.InverseTransformPoint(camera.transform, point);
                var distance = pointA.z;
                var out = new Laya.Vector3();
                camera.viewport.project(point, camera.projectionViewMatrix, out);
                var value = new Laya.Vector3(out.x / Laya.stage.clientScaleX, out.y / Laya.stage.clientScaleY, distance);
                return value;
            }
            static InverseTransformPoint(origin, point) {
                var xx = new Laya.Vector3();
                origin.getRight(xx);
                var yy = new Laya.Vector3();
                origin.getUp(yy);
                var zz = new Laya.Vector3();
                origin.getForward(zz);
                var zz1 = new Laya.Vector3(-zz.x, -zz.y, -zz.z);
                var x = this.ProjectDistance(point, origin.position, xx);
                var y = this.ProjectDistance(point, origin.position, yy);
                var z = this.ProjectDistance(point, origin.position, zz1);
                var value = new Laya.Vector3(x, y, z);
                return value;
            }
            static ProjectDistance(A, C, B) {
                var CA = new Laya.Vector3();
                Laya.Vector3.subtract(A, C, CA);
                var angle = this.Angle2(CA, B) * Math.PI / 180;
                var distance = Laya.Vector3.distance(A, C);
                distance *= Math.cos(angle);
                return distance;
            }
            static Angle2(ma, mb) {
                var v1 = ma.x * mb.x + ma.y * mb.y + ma.z * mb.z;
                var ma_val = Math.sqrt(ma.x * ma.x + ma.y * ma.y + ma.z * ma.z);
                var mb_val = Math.sqrt(mb.x * mb.x + mb.y * mb.y + mb.z * mb.z);
                var cosM = v1 / (ma_val * mb_val);
                if (cosM < -1) cosM = -1;
                if (cosM > 1) cosM = 1;
                var angleAMB = Math.acos(cosM) * 180 / Math.PI;
                return angleAMB;
            }
            static randFun(arr) {
                let len = arr.length;
                for (let i = 0; i < len; i++) {
                    let index = Math.floor(Math.random() * (len - 1));
                    let tempValue = arr[i];
                    arr[i] = arr[index];
                    arr[index] = tempValue;
                }
                return arr;
            }
            static popCarTrail30Rate() {
                let arr = [];
                let temp1 = [30, 70];
                let temp2 = [0, 1];
                for (var i = 0; i < temp2.length; i++) {
                    for (var j = 0; j < temp1[i]; j++) {
                        arr.push(temp2[i]);
                    }
                }
                arr = this.randFun(arr);
                let index = Math.floor(Math.random() * 100);
                let rate = arr[index] == 0 ? true : false;
                return rate;
            }
            static popCarTrail70Rate() {
                let arr = [];
                let temp1 = [30, 70];
                let temp2 = [0, 1];
                for (var i = 0; i < temp2.length; i++) {
                    for (var j = 0; j < temp1[i]; j++) {
                        arr.push(temp2[i]);
                    }
                }
                arr = this.randFun(arr);
                let index = Math.floor(Math.random() * 100);
                let rate = arr[index] == 1 ? true : false;
                return rate;
            }
            static numToChinese(num) {
                switch (num) {
                    case 1:
                        return "一";

                    case 2:
                        return "二";

                    case 3:
                        return "三";

                    case 4:
                        return "四";

                    case 5:
                        return "五";

                    default:
                        return "二";
                }
            }
            static angleV3(a, b) {
                return this.cosine(Laya.Vector3.scalarLength(a), Laya.Vector3.scalarLength(b), Laya.Vector3.distance(a, b));
            }
            static cosine(a, b, c) {
                if (a * b * c == 0) {
                    return 0;
                }
                return Math.acos(Math.min(1, Math.abs((a * a + b * b - c * c) / 2 / a / b)));
            }
            static lerp(a, b, t) {
                return (b - a) * t + a;
            }
            static strToNumList(str) {
                let strList = str.split(";");
                let numList = [];
                for (let i = 0; i < strList.length; i++) numList.push(parseInt(strList[i]));
                return numList;
            }
            static getStrLength(str) {
                var b = 0;
                if (str) {
                    for (var i = 0; i < str.length; i++) {
                        if (str.charCodeAt(i) > 255) {
                            b += 2;
                        } else {
                            b += 1;
                        }
                    }
                    return b;
                } else {
                    return 0;
                }
            }
        }
        class CCfgClothes extends ConfigBase {
            rndCloth() {
                return this.getItem(UsefulStuff.rnd(12, 17));
            }
            rndHair() {
                return this.getItem(UsefulStuff.rnd(1, 6));
            }
            rndHat() {
                return this.getItem(UsefulStuff.rnd(7, 11));
            }
            rndWing() {
                return this.getItem(UsefulStuff.rnd(18, 21));
            }
        }
        class CCfgConstellation extends ConfigBase { }
        var E_GLOBALPAR_NAME;
        (function (E_GLOBALPAR_NAME) {
            E_GLOBALPAR_NAME[E_GLOBALPAR_NAME["GAME_PROPBOX_REFRESH_CD"] = 1] = "GAME_PROPBOX_REFRESH_CD";
            E_GLOBALPAR_NAME[E_GLOBALPAR_NAME["GAME_CAR_QUA_PAR1"] = 2] = "GAME_CAR_QUA_PAR1";
            E_GLOBALPAR_NAME[E_GLOBALPAR_NAME["GAME_CAR_QUA_PAR2"] = 3] = "GAME_CAR_QUA_PAR2";
            E_GLOBALPAR_NAME[E_GLOBALPAR_NAME["GAME_CAR_QUA_PAR3"] = 4] = "GAME_CAR_QUA_PAR3";
            E_GLOBALPAR_NAME[E_GLOBALPAR_NAME["GAME_CAR_QUA_C"] = 5] = "GAME_CAR_QUA_C";
            E_GLOBALPAR_NAME[E_GLOBALPAR_NAME["GAME_CAR_QUA_B"] = 6] = "GAME_CAR_QUA_B";
            E_GLOBALPAR_NAME[E_GLOBALPAR_NAME["GAME_CAR_QUA_A"] = 7] = "GAME_CAR_QUA_A";
            E_GLOBALPAR_NAME[E_GLOBALPAR_NAME["GAME_CAR_QUA_S"] = 8] = "GAME_CAR_QUA_S";
            E_GLOBALPAR_NAME[E_GLOBALPAR_NAME["GAME_INIT_CLOTHES_MEN"] = 9] = "GAME_INIT_CLOTHES_MEN";
            E_GLOBALPAR_NAME[E_GLOBALPAR_NAME["GAME_INIT_HAIR_MEN"] = 10] = "GAME_INIT_HAIR_MEN";
            E_GLOBALPAR_NAME[E_GLOBALPAR_NAME["GAME_INIT_CLOTHES_WOMEN"] = 11] = "GAME_INIT_CLOTHES_WOMEN";
            E_GLOBALPAR_NAME[E_GLOBALPAR_NAME["GAME_INIT_HAIR_WOMEN"] = 12] = "GAME_INIT_HAIR_WOMEN";
            E_GLOBALPAR_NAME[E_GLOBALPAR_NAME["GAME_INIT_RACING_ID"] = 13] = "GAME_INIT_RACING_ID";
            E_GLOBALPAR_NAME[E_GLOBALPAR_NAME["GAME_LOW_REWARD_ID"] = 14] = "GAME_LOW_REWARD_ID";
            E_GLOBALPAR_NAME[E_GLOBALPAR_NAME["GAME_MIDDLE_REWARD_ID"] = 15] = "GAME_MIDDLE_REWARD_ID";
            E_GLOBALPAR_NAME[E_GLOBALPAR_NAME["GAME_HIGH_REWARD_ID"] = 16] = "GAME_HIGH_REWARD_ID";
            E_GLOBALPAR_NAME[E_GLOBALPAR_NAME["GAME_DESC_GOLD"] = 17] = "GAME_DESC_GOLD";
            E_GLOBALPAR_NAME[E_GLOBALPAR_NAME["GAME_DESC_DIAMOND"] = 18] = "GAME_DESC_DIAMOND";
            E_GLOBALPAR_NAME[E_GLOBALPAR_NAME["GAME_INIT_GOLD"] = 19] = "GAME_INIT_GOLD";
            E_GLOBALPAR_NAME[E_GLOBALPAR_NAME["GAME_INIT_DIAMOND"] = 20] = "GAME_INIT_DIAMOND";
            E_GLOBALPAR_NAME[E_GLOBALPAR_NAME["GAME_LUCKPAN_RWD"] = 21] = "GAME_LUCKPAN_RWD";
            E_GLOBALPAR_NAME[E_GLOBALPAR_NAME["GAME_LUCKPAN_QUAN"] = 22] = "GAME_LUCKPAN_QUAN";
            E_GLOBALPAR_NAME[E_GLOBALPAR_NAME["GAME_TRY_CARIDLIST"] = 23] = "GAME_TRY_CARIDLIST";
            E_GLOBALPAR_NAME[E_GLOBALPAR_NAME["GAME_VIDEO_GOLD"] = 24] = "GAME_VIDEO_GOLD";
            E_GLOBALPAR_NAME[E_GLOBALPAR_NAME["GAME_GIFT_RWD_ID"] = 25] = "GAME_GIFT_RWD_ID";
            E_GLOBALPAR_NAME[E_GLOBALPAR_NAME["GAME_LUCKPAN_NUM"] = 26] = "GAME_LUCKPAN_NUM";
            E_GLOBALPAR_NAME[E_GLOBALPAR_NAME["GAME_WINTIMES_STAGE"] = 27] = "GAME_WINTIMES_STAGE";
            E_GLOBALPAR_NAME[E_GLOBALPAR_NAME["GAME_WIN_RWD_ID"] = 28] = "GAME_WIN_RWD_ID";
            E_GLOBALPAR_NAME[E_GLOBALPAR_NAME["GAME_CAR_TRYTIME"] = 29] = "GAME_CAR_TRYTIME";
            E_GLOBALPAR_NAME[E_GLOBALPAR_NAME["GAME_LIMITGIFT_MAN"] = 30] = "GAME_LIMITGIFT_MAN";
            E_GLOBALPAR_NAME[E_GLOBALPAR_NAME["GAME_LIMITGIFT_WOMAN"] = 31] = "GAME_LIMITGIFT_WOMAN";
        })(E_GLOBALPAR_NAME || (E_GLOBALPAR_NAME = {}));
        class CCfgGlobalPar extends ConfigBase {
            getItemValue(ID) {
                return this.mapByID[ID].value;
            }
            getItemStr(ID) {
                return this.mapByID[ID]._strValue;
            }
        }
        class CCfgGuideInfo extends ConfigBase { }
        class CCfgNpcName extends ConfigBase {
            getRndName() {
                var rndID = UsefulStuff.rnd(0, this.List.length - 1);
                return this.List[rndID]._Name;
            }
        }
        class CCfgPropInfo extends ConfigBase {
            afterLoad() {
                this.allChance = new Array();
                for (var i = 0; i < 4; i++) {
                    this.allChance.push(0);
                    for (var j = 0; j < this.List.length; j++) {
                        this.allChance[i] += this.List[j]["Chance" + (i + 1).toString()];
                    }
                }
            }
            rndProp(addItem, addChanceNum, Rank = 1) {
                var addChance = 0;
                for (var i = 0; i < addChanceNum.length; i++) {
                    addChance += addChanceNum[i];
                }
                var allChanceAdd = this.allChance[Rank - 1] + addChance;
                var ChanceAdd = 0;
                var rndChance = UsefulStuff.rnd(0, allChanceAdd);
                var rndPropID = 1;
                for (var i = 0; i < this.List.length; i++) {
                    for (var j = 0; j < addItem.length; j++) {
                        if (this.List[i].ID == addItem[j]) ChanceAdd += addChanceNum[j];
                    }
                    ChanceAdd += this.List[i]["Chance" + Rank.toString()];
                    if (rndChance < ChanceAdd) {
                        rndPropID = this.List[i].ID;
                        break;
                    }
                }
                return rndPropID;
            }
            rndCardLevel(isSpeedGame) {
                if (isSpeedGame) {
                    return [11, 11];
                }
                var cardsArray = [];
                if (Math.random() < .05) {
                    var cardsArray = [6, 10, 11];
                    if (Math.random() < .33) {
                        cardsArray.push(6);
                    } else if (Math.random() < .66) {
                        cardsArray.push(10);
                    } else {
                        cardsArray.push(11);
                    }
                } else {
                    var rndS_ID = UsefulStuff.rnd(1, 3);
                    var rndS_Count = 0;
                    var rndA_ID = UsefulStuff.rnd(1, 3);
                    var rndA_Count = 0;
                    var rndB_ID = UsefulStuff.rnd(1, 3);
                    var rndB_Count = 0;
                    var rndQ = 3;
                    var rndQ_ID = UsefulStuff.rnd(1, 3);
                    var rndQ_Count = 0;
                    for (var i = 0; i < this.List.length; i++) {
                        var cfg = this.List[i];
                        if (cfg.cardLevel == 0) {
                            continue;
                        }
                        if (cfg.cardLevel == 1) {
                            rndB_Count++;
                            if (rndB_Count == rndB_ID) cardsArray.push(cfg.ID);
                        }
                        if (cfg.cardLevel == 2) {
                            rndA_Count++;
                            if (rndA_Count == rndA_ID) cardsArray.push(cfg.ID);
                        }
                        if (cfg.cardLevel == 3) {
                            rndS_Count++;
                            if (rndS_Count == rndS_ID) cardsArray.push(cfg.ID);
                        }
                        if (cfg.cardLevel == rndQ) {
                            rndQ_Count++;
                            if (rndQ_Count == rndQ_ID) cardsArray.push(cfg.ID);
                        }
                    }
                }
                var shuffleArray = [];
                var len = cardsArray.length;
                for (var i = 0; i < len; i++) {
                    var rnd = UsefulStuff.rnd(0, cardsArray.length - 1);
                    shuffleArray.push(cardsArray[rnd]);
                    cardsArray.splice(rnd, 1);
                }
                return shuffleArray;
            }
        }
        class CCfgRacing extends ConfigBase { }
        class CCfgRankInfo extends ConfigBase { }
        var E_SKILL_CHARGE_EXTRA_TYPE;
        (function (E_SKILL_CHARGE_EXTRA_TYPE) {
            E_SKILL_CHARGE_EXTRA_TYPE[E_SKILL_CHARGE_EXTRA_TYPE["NONE"] = 0] = "NONE";
            E_SKILL_CHARGE_EXTRA_TYPE[E_SKILL_CHARGE_EXTRA_TYPE["USE_BANANA"] = 1] = "USE_BANANA";
            E_SKILL_CHARGE_EXTRA_TYPE[E_SKILL_CHARGE_EXTRA_TYPE["TOUCH_BANANA"] = 2] = "TOUCH_BANANA";
            E_SKILL_CHARGE_EXTRA_TYPE[E_SKILL_CHARGE_EXTRA_TYPE["USE_ROCKET"] = 3] = "USE_ROCKET";
            E_SKILL_CHARGE_EXTRA_TYPE[E_SKILL_CHARGE_EXTRA_TYPE["ROCKET_SUCC"] = 4] = "ROCKET_SUCC";
            E_SKILL_CHARGE_EXTRA_TYPE[E_SKILL_CHARGE_EXTRA_TYPE["START_POINT"] = 5] = "START_POINT";
            E_SKILL_CHARGE_EXTRA_TYPE[E_SKILL_CHARGE_EXTRA_TYPE["BE_THUNDERED"] = 6] = "BE_THUNDERED";
            E_SKILL_CHARGE_EXTRA_TYPE[E_SKILL_CHARGE_EXTRA_TYPE["USE_GHOST"] = 7] = "USE_GHOST";
        })(E_SKILL_CHARGE_EXTRA_TYPE || (E_SKILL_CHARGE_EXTRA_TYPE = {}));
        var E_SKILL_BUFF;
        (function (E_SKILL_BUFF) {
            E_SKILL_BUFF[E_SKILL_BUFF["NONE"] = 0] = "NONE";
            E_SKILL_BUFF[E_SKILL_BUFF["RESIST_BANANA"] = 1] = "RESIST_BANANA";
            E_SKILL_BUFF[E_SKILL_BUFF["ROCKET_LV"] = 2] = "ROCKET_LV";
            E_SKILL_BUFF[E_SKILL_BUFF["THUNDER_STOP_CHARGE"] = 3] = "THUNDER_STOP_CHARGE";
            E_SKILL_BUFF[E_SKILL_BUFF["LINE_LIKER"] = 4] = "LINE_LIKER";
            E_SKILL_BUFF[E_SKILL_BUFF["PHYISC_KING"] = 5] = "PHYISC_KING";
            E_SKILL_BUFF[E_SKILL_BUFF["STAR_CHARGE"] = 6] = "STAR_CHARGE";
            E_SKILL_BUFF[E_SKILL_BUFF["STAR_CHANCE"] = 7] = "STAR_CHANCE";
            E_SKILL_BUFF[E_SKILL_BUFF["GHOST_CHANCE"] = 8] = "GHOST_CHANCE";
            E_SKILL_BUFF[E_SKILL_BUFF["DOUBLE_CHANCE"] = 9] = "DOUBLE_CHANCE";
            E_SKILL_BUFF[E_SKILL_BUFF["GHOST_FOREVER"] = 10] = "GHOST_FOREVER";
        })(E_SKILL_BUFF || (E_SKILL_BUFF = {}));
        class CCfgSkillInfo extends ConfigBase { }
        var E_ACHIEVEMENT_TYPE;
        (function (E_ACHIEVEMENT_TYPE) {
            E_ACHIEVEMENT_TYPE[E_ACHIEVEMENT_TYPE["None"] = 0] = "None";
            E_ACHIEVEMENT_TYPE[E_ACHIEVEMENT_TYPE["TRACKTIME"] = 1] = "TRACKTIME";
            E_ACHIEVEMENT_TYPE[E_ACHIEVEMENT_TYPE["NOSTIME"] = 2] = "NOSTIME";
            E_ACHIEVEMENT_TYPE[E_ACHIEVEMENT_TYPE["EDGETIME"] = 3] = "EDGETIME";
            E_ACHIEVEMENT_TYPE[E_ACHIEVEMENT_TYPE["PREFECTDRIFTTIME"] = 4] = "PREFECTDRIFTTIME";
            E_ACHIEVEMENT_TYPE[E_ACHIEVEMENT_TYPE["PREFECTSTARTRUSH"] = 5] = "PREFECTSTARTRUSH";
            E_ACHIEVEMENT_TYPE[E_ACHIEVEMENT_TYPE["FLYTIME"] = 6] = "FLYTIME";
            E_ACHIEVEMENT_TYPE[E_ACHIEVEMENT_TYPE["MONSTERTIME"] = 7] = "MONSTERTIME";
            E_ACHIEVEMENT_TYPE[E_ACHIEVEMENT_TYPE["CARLIMIT"] = 8] = "CARLIMIT";
            E_ACHIEVEMENT_TYPE[E_ACHIEVEMENT_TYPE["CLOTHLIMIT"] = 9] = "CLOTHLIMIT";
            E_ACHIEVEMENT_TYPE[E_ACHIEVEMENT_TYPE["MAX"] = 10] = "MAX";
        })(E_ACHIEVEMENT_TYPE || (E_ACHIEVEMENT_TYPE = {}));
        class CCfgStoryInfo extends ConfigBase {
            afterLoad() {
                var mapInfo = {};
                for (var i = 0; i < this.List.length; i++) {
                    var cfg = this.List[i];
                    if (cfg.mapID > 0) {
                        if (mapInfo[cfg.mapID]) {
                            mapInfo[cfg.mapID]++;
                            cfg.mapIndex = mapInfo[cfg.mapID];
                        } else {
                            mapInfo[cfg.mapID] = 1;
                            cfg.mapIndex = 1;
                        }
                    }
                }
            }
        }
        class CCfgTrack extends ConfigBase { }
        class CBuffInfo { }
        class CChest {
            constructor() {
                this._rewardType = [];
                this._rewardID = [];
                this._rewardNumMin = [];
                this._rewardNumMax = [];
            }
        }
        class CClothes { }
        class CConstellation { }
        class CGlobalPar { }
        class CGuideInfo { }
        class CNpcName { }
        class CPropInfo { }
        class CRacing {
            constructor() {
                this._RacingIconName = [];
                this._SkillId = [];
            }
        }
        class CRankInfo { }
        class CSkillInfo { }
        class CStoryInfo {
            constructor() {
                this._unlockNeed1 = [];
                this._unlockValue1 = [];
                this._unlockNeed2 = [];
                this._unlockValue2 = [];
                this._unlockNeed3 = [];
                this._unlockValue3 = [];
            }
        }
        class CTrack {
            constructor() {
                this._GoldRwd = [];
                this._DiamonRwd = [];
            }
        }
        class CCfgTipStr extends ConfigBase {
            getRndTips() {
                var rndID = UsefulStuff.rnd(0, this.List.length - 1);
                return this.List[rndID]._Name;
            }
        }
        class CTipStr { }
        class CCfgMgr {
            constructor() {
                this.cfgNpcInfo = new CCfgNpcName();
                this.cfgGlobalPar = new CCfgGlobalPar();
                this.cfgPropInfo = new CCfgPropInfo();
                this.cfgClothes = new CCfgClothes();
                this.cfgRacing = new CCfgRacing();
                this.cfgChest = new CCfgChest();
                this.cfgTrack = new CCfgTrack();
                this.cfgSkillInfo = new CCfgSkillInfo();
                this.cfgGuideInfo = new CCfgGuideInfo();
                this.cfgRankInfo = new CCfgRankInfo();
                this.cfgConstellation = new CCfgConstellation();
                this.cfgBuffInfo = new CCfgBuffInfo();
                this.cfgStoryInfo = new CCfgStoryInfo();
                this.cfgTipStr = new CCfgTipStr();
                window["ccfg"] = this;
                this.Init();
            }
            static get Ins() {
                return this.g_cfgManager || (this.g_cfgManager = new CCfgMgr());
            }
            Init() {
                this.onJsonLoaded();
            }
            onJsonLoaded() {
                this.cfgNpcInfo.Load("cfg/npcname.json", CNpcName, false);
                this.cfgGlobalPar.Load("cfg/globalpar.json", CGlobalPar);
                this.cfgPropInfo.Load("cfg/propinfo.json", CPropInfo);
                this.cfgRacing.Load("cfg/racing.json", CRacing);
                this.cfgClothes.Load("cfg/clothes.json", CClothes);
                this.cfgChest.Load("cfg/chest.json", CChest);
                this.cfgTrack.Load("cfg/trackInfo.json", CTrack);
                this.cfgSkillInfo.Load("cfg/skillinfo.json", CSkillInfo);
                this.cfgGuideInfo.Load("cfg/guide.json", CGuideInfo);
                this.cfgRankInfo.Load("cfg/cuplevel.json", CRankInfo);
                this.cfgConstellation.Load("cfg/astrolabe.json", CConstellation);
                this.cfgBuffInfo.Load("cfg/buffinfo.json", CBuffInfo);
                this.cfgStoryInfo.Load("cfg/storyinfo.json", CStoryInfo);
                this.cfgTipStr.Load("cfg/tips.json", CTipStr, false);
            }
        }
        class EventMgr {
            constructor() {
                this.eventDispatcher = new Laya.EventDispatcher();
            }
            dispatch(t, e = null) {
                this.eventDispatcher.event(t, e);
            }
            on(t, e, i) {
                this.eventDispatcher.on(t, e, i);
            }
            off(t, e, i) {
                this.eventDispatcher.off(t, e, i);
            }
            offAll(t) {
                this.eventDispatcher.offAll(t);
            }
            offAllCaller(e) {
                this.eventDispatcher.offAllCaller(e);
            }
            static get Ins() {
                if (EventMgr._ins == null) {
                    EventMgr._ins = new EventMgr();
                }
                return EventMgr._ins;
            }
        }
        var EventType;
        (function (EventType) {
            EventType[EventType["RES_LOAD_FINISHED"] = 0] = "RES_LOAD_FINISHED";
            EventType[EventType["LOADING_CLOSE"] = 1] = "LOADING_CLOSE";
            EventType[EventType["REFRESH_GOLD"] = 2] = "REFRESH_GOLD";
            EventType[EventType["REFRESH_DIAMON"] = 3] = "REFRESH_DIAMON";
            EventType[EventType["REFRESH_LEVEL"] = 4] = "REFRESH_LEVEL";
            EventType[EventType["REFRESH_CONSTELLATION"] = 5] = "REFRESH_CONSTELLATION";
            EventType[EventType["TIMEFIBER"] = 6] = "TIMEFIBER";
            EventType[EventType["SHOWROCKETMSG"] = 7] = "SHOWROCKETMSG";
            EventType[EventType["SHOWSHIELDMSG"] = 8] = "SHOWSHIELDMSG";
            EventType[EventType["REFRESH_SELF_ACTOR"] = 9] = "REFRESH_SELF_ACTOR";
            EventType[EventType["BATTLETOUCHDOWN"] = 10] = "BATTLETOUCHDOWN";
            EventType[EventType["BATTLETOUCHUP"] = 11] = "BATTLETOUCHUP";
            EventType[EventType["BATTLE_LEFT_DOWN"] = 12] = "BATTLE_LEFT_DOWN";
            EventType[EventType["BATTLE_RIGHT_DOWN"] = 13] = "BATTLE_RIGHT_DOWN";
            EventType[EventType["BATTLE_LEFT_UP"] = 14] = "BATTLE_LEFT_UP";
            EventType[EventType["BATTLE_RIGHT_UP"] = 15] = "BATTLE_RIGHT_UP";
            EventType[EventType["BATTLE_CONTORL"] = 16] = "BATTLE_CONTORL";
            EventType[EventType["BATTLE_PROP_FEATURE"] = 17] = "BATTLE_PROP_FEATURE";
            EventType[EventType["BATTLE_PROP_FEATURE_CLOSE"] = 18] = "BATTLE_PROP_FEATURE_CLOSE";
            EventType[EventType["BATTLE_READY_GO"] = 19] = "BATTLE_READY_GO";
            EventType[EventType["BATTLE_COUNT_DOWN"] = 20] = "BATTLE_COUNT_DOWN";
            EventType[EventType["START_ROCKET_WARNING"] = 21] = "START_ROCKET_WARNING";
            EventType[EventType["STOP_ROCKET_WARNING"] = 22] = "STOP_ROCKET_WARNING";
            EventType[EventType["START_DRIFT"] = 23] = "START_DRIFT";
            EventType[EventType["STOP_DRIFT"] = 24] = "STOP_DRIFT";
            EventType[EventType["CHANGECAMERA"] = 25] = "CHANGECAMERA";
            EventType[EventType["GETPROPMSG"] = 26] = "GETPROPMSG";
            EventType[EventType["USEPROPCARD"] = 27] = "USEPROPCARD";
            EventType[EventType["USEPROP1MSG"] = 28] = "USEPROP1MSG";
            EventType[EventType["USEPROP2MSG"] = 29] = "USEPROP2MSG";
            EventType[EventType["USELB"] = 30] = "USELB";
            EventType[EventType["STARTRUSH"] = 31] = "STARTRUSH";
            EventType[EventType["SHOWSKILLMSG"] = 32] = "SHOWSKILLMSG";
            EventType[EventType["HOLDSKILLMSG"] = 33] = "HOLDSKILLMSG";
            EventType[EventType["STOPSKILLMSG"] = 34] = "STOPSKILLMSG";
            EventType[EventType["BUFFTIPMSG"] = 35] = "BUFFTIPMSG";
            EventType[EventType["CLOSEBUFFTIPMSG"] = 36] = "CLOSEBUFFTIPMSG";
            EventType[EventType["DRIFTOVERMSG"] = 37] = "DRIFTOVERMSG";
            EventType[EventType["RACE_SECEND"] = 38] = "RACE_SECEND";
            EventType[EventType["RACE_THIRD"] = 39] = "RACE_THIRD";
            EventType[EventType["RACE_LAST"] = 40] = "RACE_LAST";
            EventType[EventType["RACE_RANK"] = 41] = "RACE_RANK";
            EventType[EventType["RACE_COOLDOWN"] = 42] = "RACE_COOLDOWN";
            EventType[EventType["RACE_FINISH"] = 43] = "RACE_FINISH";
            EventType[EventType["RANKING_LOAD_COMPLETE"] = 44] = "RANKING_LOAD_COMPLETE";
            EventType[EventType["USER_INFO_BTN_CLICKED"] = 45] = "USER_INFO_BTN_CLICKED";
            EventType[EventType["HTICONHIDE"] = 46] = "HTICONHIDE";
            EventType[EventType["HIDENATIVE"] = 47] = "HIDENATIVE";
            EventType[EventType["REFRESHMINIMAP"] = 48] = "REFRESHMINIMAP";
            EventType[EventType["TYRCAREXPIRE"] = 49] = "TYRCAREXPIRE";
            EventType[EventType["REFRESH_WX_SHARE"] = 50] = "REFRESH_WX_SHARE";
            EventType[EventType["TEST_SX"] = 51] = "TEST_SX";
            EventType[EventType["TEST_IN"] = 52] = "TEST_IN";
            EventType[EventType["TEST_IN2"] = 53] = "TEST_IN2";
        })(EventType || (EventType = {}));
        class BtnScript extends Laya.Script {
            constructor() {
                super();
                this.getblackColor = new Laya.ColorFilter();
                this.btnType = 0;
                let colorMatrix = [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0];
                colorMatrix[0] = 160 / 255;
                colorMatrix[6] = 160 / 255;
                colorMatrix[12] = 160 / 255;
                this.getblackColor.setByMatrix(colorMatrix);
            }
            initBtn(index) {
                this.btnType = index;
            }
            onAwake() {
                this.m_owner = this.owner;
            }
            onEnable() {
                this.owner.on(Laya.Event.MOUSE_DOWN, this, this.downBtn);
                this.owner.on(Laya.Event.MOUSE_UP, this, this.upBtn);
                this.owner.on(Laya.Event.MOUSE_OUT, this, this.upBtn);
            }
            onDisable() {
                this.owner.off(Laya.Event.MOUSE_DOWN, this, this.downBtn);
                this.owner.off(Laya.Event.MOUSE_UP, this, this.upBtn);
                this.owner.off(Laya.Event.MOUSE_OUT, this, this.upBtn);
            }
            downBtn() {
                switch (this.btnType) {
                    case 0:
                        this.scaleBtn(true);
                        break;

                    case 1:
                        this.colorBtn(true);
                        break;

                    case 2:
                        this.skinBtn(true);
                        break;
                }
            }
            upBtn() {
                switch (this.btnType) {
                    case 0:
                        this.scaleBtn(false);
                        break;

                    case 1:
                        this.colorBtn(false);
                        break;

                    case 2:
                        this.skinBtn(false);
                        break;
                }
            }
            scaleBtn(isdown) {
                if (isdown) {
                    this.m_owner.scale(1.05, 1.05);
                } else {
                    this.m_owner.scale(1, 1);
                }
            }
            colorBtn(isdown) {
                if (isdown) {
                    this.m_owner.filters = [this.getblackColor];
                } else {
                    this.m_owner.filters = null;
                }
            }
            skinBtn(isdown) {
                if (isdown) {
                    this.m_owner.scale(1.2, 1.2);
                } else {
                    this.m_owner.scale(1, 1);
                }
            }
        }
        class SplineNode {
            constructor(position, direction) {
                this._Up = new Laya.Vector3(0, 1, 0);
                this._Scale = new Laya.Vector2(0, 0);
                this._Roll = 0;
                this._Position = position;
                this._Direction = direction;
            }
            get Position() {
                return this._Position;
            }
            set Position(value) {
                if (Laya.Vector3.equals(this._Position, value)) return;
                this._Position.x = value.x;
                this._Position.y = value.y;
                this._Position.z = value.z;
            }
            get Direction() {
                return this._Direction;
            }
            set Direction(value) {
                if (Laya.Vector3.equals(this._Direction, value)) return;
                this._Direction.x = value.x;
                this._Direction.y = value.y;
                this._Direction.z = value.z;
            }
            get Up() {
                return this._Up;
            }
            set Up(value) {
                if (Laya.Vector3.equals(this._Up, value)) return;
                this._Up.x = value.x;
                this._Up.y = value.y;
                this._Up.z = value.z;
            }
            get Scale() {
                return this._Scale;
            }
            set Scale(value) {
                if (this._Scale == value) return;
                this._Scale.x = value.x;
                this._Scale.y = value.y;
            }
            get Roll() {
                return this._Roll;
            }
            set Roll(value) {
                if (this._Roll == value) return;
                this._Roll = value;
            }
        }
        class CurveSample {
            constructor(location, tangent, up, scale, roll, distanceInCurve, timeInCurve) {
                this.location = location;
                this.tangent = tangent;
                this.up = up;
                this.roll = roll;
                this.scale = scale;
                this.distanceInCurve = distanceInCurve;
                this.timeInCurve = timeInCurve;
                this._Rotation = Laya.Quaternion.DEFAULT;
            }
            get Rotation() {
                if (this._Rotation == Laya.Quaternion.DEFAULT) {
                    var p1 = new Laya.Vector3(0, 0, 0);
                    var p2 = new Laya.Vector3(0, 0, 0);
                    var upVector = new Laya.Vector3(0, 0, 0);
                    Laya.Vector3.cross(new Laya.Vector3(0, 1, 0), this.tangent, p1);
                    Laya.Vector3.normalize(p1, p2);
                    Laya.Vector3.cross(this.tangent, p2, upVector);
                    Laya.Quaternion.rotationLookAt(this.tangent, upVector, this._Rotation);
                }
                return this._Rotation;
            }
            static Lerp(a, b, t) {
                var mlocation = new Laya.Vector3(0, 0, 0);
                var mtangent = new Laya.Vector3(0, 0, 0);
                var mntangent = new Laya.Vector3(0, 0, 0);
                var mup = new Laya.Vector3(0, 0, 0);
                Laya.Vector3.lerp(a.location, b.location, t, mlocation);
                Laya.Vector3.lerp(a.tangent, b.tangent, t, mtangent);
                Laya.Vector3.normalize(mtangent, mntangent);
                Laya.Vector3.lerp(a.up, b.up, t, mup);
                var scale = new Laya.Vector2();
                return new CurveSample(mlocation, mntangent, mup, this.lerpV2(a.scale, b.scale, t), Laya.MathUtil.lerp(a.roll, b.roll, t), Laya.MathUtil.lerp(a.distanceInCurve, b.distanceInCurve, t), Laya.MathUtil.lerp(a.timeInCurve, b.timeInCurve, t));
            }
            static lerpV2(a, b, t) {
                var out = new Laya.Vector2();
                var ax = a.x, ay = a.y;
                out.x = ax + t * (b.x - ax);
                out.y = ay + t * (b.y - ay);
                return out;
            }
        }
        class CubicBezierCurve {
            constructor(n1, n2) {
                this.STEP_COUNT = 30;
                this.T_STEP = 1 / this.STEP_COUNT;
                this.samples = new Array();
                this.n1 = n1;
                this.n2 = n2;
                this.ComputeSamples(null, null);
            }
            ConnectStart(n1) {
                this.n1 = n1;
            }
            ConnectEnd(n2) {
                this.n2 = n2;
            }
            GetInverseDirection() {
                var x = 2 * this.n2.Position.x - this.n2.Direction.x;
                var y = 2 * this.n2.Position.y - this.n2.Direction.y;
                var z = 2 * this.n2.Position.z - this.n2.Direction.z;
                return new Laya.Vector3(x, y, z);
            }
            GetLocation(t) {
                var omt = 1 - t;
                var omt2 = omt * omt;
                var t2 = t * t;
                var p1 = this.v3Multiply(this.n1.Position, omt2 * omt);
                var p2 = this.v3Multiply(this.n1.Direction, 3 * omt2 * t);
                var p3 = this.v3Multiply(this.GetInverseDirection(), 3 * omt * t2);
                var p4 = this.v3Multiply(this.n2.Position, t2 * t);
                var result = new Laya.Vector3(p1.x + p2.x + p3.x + p4.x, p1.y + p2.y + p3.y + p4.y, p1.z + p2.z + p3.z + p4.z);
                return result;
            }
            GetTangent(t) {
                var omt = 1 - t;
                var omt2 = omt * omt;
                var t2 = t * t;
                var p1 = this.v3Multiply(this.n1.Position, -omt2);
                var p2 = this.v3Multiply(this.n1.Direction, 3 * omt2 - 2 * omt);
                var p3 = this.v3Multiply(this.GetInverseDirection(), -3 * t2 + 2 * t);
                var p4 = this.v3Multiply(this.n2.Position, t2);
                var result = new Laya.Vector3(p1.x + p2.x + p3.x + p4.x, p1.y + p2.y + p3.y + p4.y, p1.z + p2.z + p3.z + p4.z);
                var nResult = new Laya.Vector3(0, 0, 0);
                Laya.Vector3.normalize(result, nResult);
                return nResult;
            }
            GetUp(t) {
                var out = new Laya.Vector3(0, 0, 0);
                Laya.Vector3.lerp(this.n1.Up, this.n2.Up, t, out);
                return out;
            }
            GetScale(t) {
                return this.lerpV2(this.n1.Scale, this.n2.Scale, t);
            }
            GetRoll(t) {
                return Laya.MathUtil.lerp(this.n1.Roll, this.n2.Roll, t);
            }
            lerpV2(a, b, t) {
                var out = new Laya.Vector2(0, 0);
                var ax = a.x, ay = a.y;
                out.x = ax + t * (b.x - ax);
                out.y = ay + t * (b.y - ay);
                return out;
            }
            ComputeSamples(sender, e) {
                this.samples = [];
                this.Length = 0;
                var previousPosition = this.GetLocation(0);
                for (var t = 0; t < 1; t += this.T_STEP) {
                    var position = this.GetLocation(t);
                    var stepLength = Laya.Vector3.distance(previousPosition, position);
                    this.Length += stepLength;
                    previousPosition = position;
                    this.samples.push(this.CreateSample(this.Length, t));
                }
                this.Length += Laya.Vector3.distance(previousPosition, this.GetLocation(1));
            }
            CreateSample(distance, time) {
                return new CurveSample(this.GetLocation(time), this.GetTangent(time), this.GetUp(time), this.GetScale(time), this.GetRoll(time), distance, time);
            }
            GetSample(time) {
                this.AssertTimeInBounds(time);
                var previous = this.samples[0];
                var next = null;
                var found = false;
                for (var i = 0; i < this.samples.length; i++) {
                    var cp = this.samples[i];
                    if (cp.timeInCurve >= time) {
                        next = cp;
                        found = true;
                        break;
                    }
                    previous = cp;
                }
                if (!found) return;
                var t = next == previous ? 0 : (time - previous.timeInCurve) / (next.timeInCurve - previous.timeInCurve);
                return CurveSample.Lerp(previous, next, t);
            }
            GetSampleAtDistance(d) {
                if (d < 0 || d > this.Length) return;
                var previous = this.samples[0];
                var next = null;
                var found = false;
                for (var i = 0; i < this.samples.length; i++) {
                    var cp = this.samples[i];
                    if (cp.distanceInCurve >= d - 1e-6) {
                        next = cp;
                        found = true;
                        break;
                    }
                    previous = cp;
                }
                if (!found) return;
                var t = next == previous ? 0 : (d - previous.distanceInCurve) / (next.distanceInCurve - previous.distanceInCurve);
                return CurveSample.Lerp(previous, next, t);
            }
            AssertTimeInBounds(time) { }
            GetProjectionSample(pointToProject) {
                var minSqrDistance = 99999999;
                var closestIndex = -1;
                var index = 0;
                for (var i = 0; i < this.samples.length; i++) {
                    var sLoc = this.samples[i].location;
                    var rpos = new Laya.Vector3(sLoc.x - pointToProject.x, sLoc.y - pointToProject.y, sLoc.z - pointToProject.z);
                    var sqrDistance = Laya.Vector3.distanceSquared(rpos, new Laya.Vector3(0, 0, 0));
                    if (sqrDistance < minSqrDistance) {
                        minSqrDistance = sqrDistance;
                        closestIndex = index;
                    }
                    index++;
                }
                var previous;
                var next;
                if (closestIndex == 0) {
                    previous = this.samples[closestIndex];
                    next = this.samples[closestIndex + 1];
                } else if (closestIndex == this.samples.length - 1) {
                    previous = this.samples[closestIndex - 1];
                    next = this.samples[closestIndex];
                } else {
                    var toPreviousSample = Laya.Vector3.distanceSquared(pointToProject, this.samples[closestIndex - 1].location);
                    var toNextSample = Laya.Vector3.distanceSquared(pointToProject, this.samples[closestIndex + 1].location);
                    if (toPreviousSample < toNextSample) {
                        previous = this.samples[closestIndex - 1];
                        next = this.samples[closestIndex];
                    } else {
                        previous = this.samples[closestIndex];
                        next = this.samples[closestIndex + 1];
                    }
                }
                var v1 = this.VectorSub(pointToProject, previous.location);
                var v2 = this.VectorSub(next.location, previous.location);
                var pro = this.VectorProject(v1, v2);
                var rate = pro / Laya.Vector3.distance(next.location, previous.location);
                if (rate < 0) rate = 0;
                if (rate > 1) rate = 1;
                var result = CurveSample.Lerp(previous, next, rate);
                return result;
            }
            VectorSub(v1, v2) {
                var rpos = new Laya.Vector3(v1.x - v2.x, v1.y - v2.y, v1.z - v2.z);
                return rpos;
            }
            v3Multiply(v3, count) {
                return new Laya.Vector3(v3.x * count, v3.y * count, v3.z * count);
            }
            VectorProject(v1, v2) {
                var ab = v1.x * v2.x + v1.y * v2.y + v1.z * v2.z;
                var bb = Laya.Vector3.distance(v2, new Laya.Vector3(0, 0, 0));
                var pro = ab / bb;
                return pro;
            }
        }
        var E_UNITY_RES_PATH;
        (function (E_UNITY_RES_PATH) {
            E_UNITY_RES_PATH[E_UNITY_RES_PATH["CAR"] = 0] = "CAR";
            E_UNITY_RES_PATH[E_UNITY_RES_PATH["CHA"] = 1] = "CHA";
            E_UNITY_RES_PATH[E_UNITY_RES_PATH["PROP"] = 2] = "PROP";
            E_UNITY_RES_PATH[E_UNITY_RES_PATH["LEVEL"] = 3] = "LEVEL";
            E_UNITY_RES_PATH[E_UNITY_RES_PATH["PODIUM"] = 4] = "PODIUM";
        })(E_UNITY_RES_PATH || (E_UNITY_RES_PATH = {}));
        class LoadMgr {
            constructor() {
                this.isSignLoadUI = true;
                this.firstResourceList = [];
                this._cdnHttp = "";//https://czy7n.jiegames.com/jy-game/KartFight/wxRes0911/
                this.assetResourceList = ["unity/role/Conventional/CarRoot.lh",
                    "unity/role/Conventional/SelfRoot.lh",
                    "unity/role/Conventional/SelfRootGuide.lh", "cfg/level1.json",
                    "cfg/level1flyline1.json", "unity/level/Conventional/uiscene.ls",
                    this.cdnHttp + "res/atlas/webRes/carIcon.atlas",
                    this.cdnHttp + "res/atlas/webRes/clothesIcon.atlas",
                    this.cdnHttp + "res/atlas/webRes/minimap.atlas",
                    this.cdnHttp + "res/atlas/webRes/skillIcon.atlas",
                    this.cdnHttp + "res/atlas/webRes/pickLevel1.atlas",
                    this.cdnHttp + "res/atlas/webRes/raceMap.atlas",
                    "unity/touchEff/Conventional/Eff_TouchScreen.lh",
                    "unity/prop/Conventional/shengji.lh", "unity/podium/win_level.lh",
                    "unity/podium/choosen_level_2.lh", "unity/podium/start_parent3d.lh",
                    "unity/podium/level_newgarage.lh", "unity/rank/Conventional/march_level.ls",
                    "audio/singleRace.mp3", "audio/manyRace.mp3", "audio/manyItem.mp3",
                    "audio/Theme1Silent.mp3", "audio/Countdown_2.mp3", "audio/win.mp3", "audio/drift.mp3", "audio/Coins.mp3",
                    "audio/common/getZsGold.mp3", "audio/common/losepodium.mp3", "audio/common/winpodium.mp3",
                    "audio/common/lvUpAndBuyClick.mp3", "audio/common/matching.mp3", "audio/common/matchSuc.mp3", "audio/item/banana.mp3",
                    "audio/item/bombHit.mp3", "audio/item/ghost.mp3", "audio/item/launchbomb.mp3", "audio/item/lightning.mp3",
                    "audio/item/shield.mp3", "audio/item/speedField.mp3", "audio/item/vertigo.mp3", "audio/item/star.mp3"];
                this.compileList = ["unity/prop/Conventional/obj_box.lh", "unity/prop/Conventional/obj_rocket_y.lh",
                    "unity/prop/Conventional/obj_rocket_r.lh", "unity/prop/Conventional/eff_blity.lh", "unity/prop/Conventional/eff_car_bow.lh",
                    "unity/prop/Conventional/eff_car_edge.lh", "unity/prop/Conventional/eff_def.lh", "unity/prop/Conventional/eff_faint.lh",
                    "unity/prop/Conventional/eff_ghost.lh", "unity/prop/Conventional/eff_star.lh", "unity/prop/Conventional/obj_booster_b.lh", "unity/prop/Conventional/obj_booster_y.lh"];
                this.propLoadList = [
                    this.cdnHttp + "unity/prop/Conventional/obj_box.lh",
                    this.cdnHttp + "unity/prop/Conventional/obj_rocket_g.lh",
                    this.cdnHttp + "unity/prop/Conventional/obj_rocket_y.lh",
                    this.cdnHttp + "unity/prop/Conventional/obj_rocket_r.lh",
                    this.cdnHttp + "unity/prop/Conventional/obj_banana.lh",
                    this.cdnHttp + "unity/prop/Conventional/eff_blity.lh",
                    this.cdnHttp + "unity/prop/Conventional/eff_car_bow.lh",
                    this.cdnHttp + "unity/prop/Conventional/eff_car_edge.lh",
                    this.cdnHttp + "unity/prop/Conventional/eff_def.lh",
                    this.cdnHttp + "unity/prop/Conventional/eff_faint.lh",
                    this.cdnHttp + "unity/prop/Conventional/eff_ghost.lh",
                    this.cdnHttp + "unity/prop/Conventional/eff_star.lh",
                    this.cdnHttp + "unity/prop/Conventional/obj_booster_b.lh",
                    this.cdnHttp + "unity/prop/Conventional/obj_booster_y.lh",
                    this.cdnHttp + "unity/prop/Conventional/obj_wall.lh",
                    this.cdnHttp + "unity/prop/Conventional/UI_Draft.lh"
                ];
                this.guideLoadList = [
                    this.cdnHttp + "unity/prop/Conventional/obj_box.lh",
                    this.cdnHttp + "unity/prop/Conventional/obj_rocket_g.lh",
                    this.cdnHttp + "unity/prop/Conventional/obj_rocket_y.lh",
                    this.cdnHttp + "unity/prop/Conventional/obj_rocket_r.lh",
                    this.cdnHttp + "unity/prop/Conventional/obj_banana.lh",
                    this.cdnHttp + "unity/prop/Conventional/eff_blity.lh",
                    this.cdnHttp + "unity/prop/Conventional/eff_car_bow.lh",
                    this.cdnHttp + "unity/prop/Conventional/eff_car_edge.lh",
                    this.cdnHttp + "unity/prop/Conventional/eff_def.lh",
                    this.cdnHttp + "unity/prop/Conventional/eff_faint.lh",
                    this.cdnHttp + "unity/prop/Conventional/eff_ghost.lh",
                    this.cdnHttp + "unity/prop/Conventional/eff_star.lh",
                    this.cdnHttp + "unity/prop/Conventional/obj_booster_b.lh",
                    this.cdnHttp + "unity/prop/Conventional/obj_booster_y.lh",
                    this.cdnHttp + "unity/prop/Conventional/obj_wall.lh",
                    this.cdnHttp + "unity/prop/Conventional/UI_Draft.lh",
                    this.cdnHttp + "unity/level/Conventional/level1.ls",
                    this.cdnHttp + "unity/role/Conventional/Cha_13.lh",
                    this.cdnHttp + "unity/role/Conventional/hair_2.lh",
                    this.cdnHttp + "unity/car/Conventional/Car_4_1.lh"
                ];
                this.m_cdnHttp = "";
                this.localList = ["selfRoot", "carRoot"];
                this.levelUrl = "";
                this.isPropLoad = false;
            }
            static get Ins() {
                return this.m_LoadManager || (this.m_LoadManager = new LoadMgr());
            }
            firstLoadingRes(finishHandler, processHandler, supplyRes = []) {
                Laya.loader.create(this.assetResourceList, Laya.Handler.create(this, this.preloadingComplete), processHandler);
                this.preLoadFinishHandler = finishHandler;
                this.preLoadProcessHandler = processHandler;
            }
            PreloadingRes(processHandler) {
                return new Promise(resolve => {
                    Laya.loader.create(this.assetResourceList, Laya.Handler.create(this, resolve), processHandler);
                });
            }
            preloadingComplete() {
                this.preLoadFinishHandler.run();
            }
            versionGet(res) { }
            get cdnHttp() {
                if (window["wx"]) return this._cdnHttp; else if (window["qg"]) return this._cdnHttp; else return this._cdnHttp;
            }
            get WebResHttp() {
                return "webRes/";
            }
            setCdnHttp(cdnID) {
                if (cdnID == 0) {
                    this._cdnHttp = "";
                } else if (cdnID == 1e4) {
                    this._cdnHttp = "";
                } else {
                    var rndID = UsefulStuff.rnd(0, 1e4);
                    if (rndID < cdnID) this._cdnHttp = ""; else this._cdnHttp = "";
                }
            }
            getAllPath(resPath) {
                for (var i = 0; i < this.localList.length; i++) {
                    if (resPath.indexOf(this.localList[i]) > 0) {
                        return resPath.replace("iOS/", "Conventional/");
                    }
                }
                return resPath;
            }
            unityResPath(resType, resName) {
                var plat = "";
                if (Laya.Browser.onIOS) plat = "Conventional/"; else plat = "Conventional/";
                var path = "";
                switch (resType) {
                    case E_UNITY_RES_PATH.CAR:
                        path = "unity/car/" + plat + resName;
                        path = this.getAllPath(path);
                        break;

                    case E_UNITY_RES_PATH.CHA:
                        path = "unity/role/" + plat + resName;
                        path = this.getAllPath(path);
                        break;

                    case E_UNITY_RES_PATH.PROP:
                        path = "unity/prop/" + plat + resName;
                        path = this.getAllPath(path);
                        break;

                    case E_UNITY_RES_PATH.LEVEL:
                        path = "unity/level/" + plat + resName;
                        path = this.getAllPath(path);
                        break;

                    default:
                        break;
                }
                return path;
            }
            preRenderScene(isFake = true) {
                let scene = Laya.loader.getRes(this.levelUrl);
                if (scene) {
                    this.loadingUI.addChild(scene);
                    var loadingCamera = new Laya.Camera();
                    window["loadingCamera"] = loadingCamera;
                    scene.enableFog = false;
                    scene.addChild(loadingCamera);
                    loadingCamera.transform.translate(new Laya.Vector3(0, 500, 0));
                    loadingCamera.transform.rotate(new Laya.Vector3(-90, 0, 0), true, false);
                    loadingCamera.normalizedViewport = new Laya.Viewport(0, 0, .01, .01);
                }
                if (isFake) {
                    this.loadingUI.fakePro(.6, 1, 3e3);
                    Laya.timer.once(3e3, this, () => {
                        loadingCamera && loadingCamera.destroy(), this.loadListComplete();
                    });
                } else {
                    Laya.timer.once(3e3, this, () => {
                        loadingCamera && loadingCamera.destroy();
                    });
                }
            }
            loadListComplete() {
                this.loadCompleteHandler.run();
                this.fakeComplete();
            }
            fakeComplete() {
                this.loadingUI.close();
            }
            loadListProcess(value) {
                this.loadingUI.setPro(value * .6);
            }
            loadLevel(levelID, finishHandler, processHandler, playerRes = []) {
                this.levelUrl = this.unityResPath(E_UNITY_RES_PATH.LEVEL, "level" + levelID + ".ls");
                var cfgUrl = "cfg/level" + levelID + ".json";
                playerRes.push(this.levelUrl);
                playerRes.push(cfgUrl);
                if (!this.isPropLoad) {
                    for (var i = 0; i < this.propLoadList.length; i++) {
                        playerRes.push(this.propLoadList[i]);
                    }
                }
                Laya.loader.create(playerRes, finishHandler, processHandler);
            }
            loadLevelWithUI(levelID, finishHandler, playerRes = []) {
                this.isSignLoadUI = false;
                this.loadingUI.open(true);
                this.levelUrl = this.unityResPath(E_UNITY_RES_PATH.LEVEL, "level" + levelID + ".ls");
                var cfgUrl = "cfg/level" + levelID + ".json";
                playerRes.push(this.levelUrl);
                playerRes.push(cfgUrl);
                if (!this.isPropLoad) {
                    for (var i = 0; i < this.propLoadList.length; i++) {
                        playerRes.push(this.propLoadList[i]);
                    }
                }
                this.loadCompleteHandler = finishHandler;
                Laya.loader.create(playerRes, Laya.Handler.create(this, this.preRenderScene), Laya.Handler.create(this, this.loadListProcess));
            }
            loadTimeLoadingUI(time = 3e3) {
                this.loadingUI.open(true);
                this.loadingUI.timePro(time);
                this.preRenderScene(false);
            }
            loadAsset(cb, urlList) {
                Laya.loader.create(urlList, Laya.Handler.create(this, res => {
                    console.log("加载完成", res);

                    Advertisement.insertAdverV3();

                    cb();
                }));
            }
            loadJson(cb) {
                Laya.loader.create(["cfg/propinfo.json", "cfg/globalpar.json", "cfg/npcname.json", "cfg/racing.json", "cfg/chest.json", "cfg/clothes.json", "cfg/trackInfo.json", "cfg/skillinfo.json", "cfg/guide.json", "cfg/cuplevel.json", "cfg/astrolabe.json", "cfg/buffinfo.json", "cfg/storyinfo.json", "cfg/tips.json"], Laya.Handler.create(this, res => {
                    console.log("json加载完成", res);
                    cb();
                }));
            }
            loadEffectComplete(res) {
                var effect = Laya.loader.getRes(res);
                this.$compileShader2(effect);
            }
            compileShader(model) {
                if (model instanceof Laya.ShuriKenParticle3D) {
                    var shuriKenParticle3D = model;
                    var render = shuriKenParticle3D.particleRenderer;
                    var materials = render.materials;
                    var spriteDefine = render["_shaderValues"]["_defineDatas"].value;
                    var publicDefine = 0;
                    var materialDefine = 0;
                    for (var i = 0; i < materials.length; i++) {
                        var mater = materials[i];
                        var marData = mater._defineDatas;
                        publicDefine = 1 & ~mater["_disablePublicDefineDatas"].value;
                        materialDefine = mater._defineDatas["value"];
                        if (mater["_shader"]) {
                            Laya.Shader3D.compileShader(mater["_shader"]._name, 0, 0, publicDefine, spriteDefine, materialDefine);
                        }
                        console.log(publicDefine, spriteDefine, materialDefine);
                    }
                }
                if (model._children) {
                    for (var i = 0; i < model._children.length; i++) {
                        this.compileShader(model._children[i]);
                    }
                }
            }
            $compileShader(model) {
                if (model instanceof Laya.ShuriKenParticle3D) {
                    var shuriKenParticle3D = model;
                    var render = shuriKenParticle3D.particleRenderer;
                    var materials = render.materials;
                    for (var i = 0; i < materials.length; i++) {
                        var mater = materials[i];
                        let defineDatas = mater._defineDatas;
                        var deugDefines = Laya.ShaderPass["_debugDefineString"];
                        Laya.Shader3D["_getNamesByDefineData"](defineDatas, deugDefines);
                        if (!Config3D["_config"] && Config3D["_config"]["_multiLighting"]) {
                            var index = deugDefines.indexOf("LEGACYSINGLELIGHTING");
                            index !== -1 && deugDefines.splice(index, 1);
                        }
                        let shader = mater["_shader"];
                        if (!shader) continue;
                        let subShaders = shader["_subShaders"];
                        if (subShaders && subShaders.length > 0) {
                            for (let j = 0; j < subShaders.length; j++) {
                                let subShader = subShaders[i];
                                let passes = subShader["_passes"];
                                if (passes && passes.length > 0) {
                                    for (let k = 0; k < passes.length; k++) {
                                        let pass = passes[i];
                                        pass && Laya.Shader3D.compileShaderByDefineNames(shader.name, j, k, deugDefines);
                                    }
                                }
                            }
                        }
                    }
                }
                if (model.numChildren) {
                    let len = model.numChildren;
                    for (var i = 0; i < len; i++) {
                        this.$compileShader(model.getChildAt(i));
                    }
                }
            }
            $compileShader2(model) {
                if (model instanceof Laya.ShuriKenParticle3D) {
                    var shuriKenParticle3D = model;
                    var render = shuriKenParticle3D.particleRenderer;
                    var materials = render.materials;
                    for (var i = 0; i < materials.length; i++) {
                        var mater = materials[i];
                        let defineDatas = mater._defineDatas;
                        let shader = mater["_shader"];
                        if (!shader) continue;
                        let subShaders = shader["_subShaders"];
                        if (!subShaders || subShaders.length <= 0) continue;
                        subShaders.forEach(subShader => {
                            if (subShader) {
                                let passes = subShader["_passes"];
                                if (passes && passes.length > 0) {
                                    passes.forEach(pass => {
                                        pass && pass["withCompile"](defineDatas);
                                    });
                                }
                            }
                        });
                    }
                }
                if (model.numChildren) {
                    let len = model.numChildren;
                    for (var i = 0; i < len; i++) {
                        this.$compileShader2(model.getChildAt(i));
                    }
                }
            }
        }
        class WallScript extends Laya.Script3D {
            onStart() {
                this.animator = this.owner.getChildAt(0).getComponent(Laya.Animator);
            }
            playBreak() {
                this.animator.play("wall_broken");
                Laya.timer.once(2e3, this, this.destroySelf);
            }
            destroySelf() {
                this.owner.destroy();
            }
            onTriggerEnter(other) {
                if (other && other.owner) {
                    this.playBreak();
                }
            }
        }
        class propBoxScript extends Laya.Script3D {
            constructor() {
                super(...arguments);
                this.refreshCD = 2e3;
            }
            onStart() {
                this.m_Sprite3D = this.owner;
                this.isInCD = false;
                this.refreshCD = CCfgMgr.Ins.cfgGlobalPar.getItemValue(E_GLOBALPAR_NAME.GAME_PROPBOX_REFRESH_CD);
                this.curCDTime = 0;
                EventMgr.Ins.on(EventType.TIMEFIBER, this, this.gameUpdate);
            }
            gameUpdate(startFrame) {
                if (this.isInCD) {
                    this.curCDTime += 17;
                    if (this.curCDTime > this.refreshCD) {
                        this.refreshProp();
                        this.curCDTime = 0;
                    }
                }
            }
            giveProp() {
                if (!this.isInCD) {
                    this.m_Sprite3D.active = false;
                    this.isInCD = true;
                    if (!GameMgr.Ins.isGuideGame) this.curCDTime = 0;
                    return true;
                }
                return false;
            }
            refreshProp() {
                this.isInCD = false;
                this.m_Sprite3D.active = true;
            }
            invisibleSelf() {
                this.m_Sprite3D.getChildAt(0).active = false;
                this.m_Sprite3D.getChildAt(1).active = false;
                this.m_Sprite3D.getChildAt(2).active = false;
                this.m_Sprite3D.getChildAt(3).active = false;
            }
            showSelf() {
                this.m_Sprite3D.getChildAt(0).active = true;
                this.m_Sprite3D.getChildAt(1).active = true;
                this.m_Sprite3D.getChildAt(2).active = true;
                this.m_Sprite3D.getChildAt(3).active = true;
            }
            onUpdate() {
                let sa = ActorMgr.Ins.m_selfPlayer;
                let dis = Laya.Vector3.distanceSquared(sa.transform.position, this.m_Sprite3D.transform.position);
                if (dis > 4e3) {
                    this.invisibleSelf();
                } else {
                    this.showSelf();
                }
            }
        }
        var E_PROP_TYPE;
        (function (E_PROP_TYPE) {
            E_PROP_TYPE[E_PROP_TYPE["NONE"] = 0] = "NONE";
            E_PROP_TYPE[E_PROP_TYPE["ROCKET_LINE"] = 1] = "ROCKET_LINE";
            E_PROP_TYPE[E_PROP_TYPE["ROCKET_FOLLOW"] = 2] = "ROCKET_FOLLOW";
            E_PROP_TYPE[E_PROP_TYPE["ROCKET_FIRST"] = 3] = "ROCKET_FIRST";
            E_PROP_TYPE[E_PROP_TYPE["BANANA"] = 4] = "BANANA";
            E_PROP_TYPE[E_PROP_TYPE["BOMB"] = 5] = "BOMB";
            E_PROP_TYPE[E_PROP_TYPE["THUNDER"] = 6] = "THUNDER";
            E_PROP_TYPE[E_PROP_TYPE["GHOST"] = 7] = "GHOST";
            E_PROP_TYPE[E_PROP_TYPE["FAITH"] = 8] = "FAITH";
            E_PROP_TYPE[E_PROP_TYPE["SHIELD"] = 9] = "SHIELD";
            E_PROP_TYPE[E_PROP_TYPE["STAR"] = 10] = "STAR";
            E_PROP_TYPE[E_PROP_TYPE["NOS"] = 11] = "NOS";
        })(E_PROP_TYPE || (E_PROP_TYPE = {}));
        var E_GAME_MODE;
        (function (E_GAME_MODE) {
            E_GAME_MODE[E_GAME_MODE["NONE"] = 0] = "NONE";
            E_GAME_MODE[E_GAME_MODE["MULTIPLAYER_PROP_GAME"] = 1] = "MULTIPLAYER_PROP_GAME";
            E_GAME_MODE[E_GAME_MODE["MULTIPLAYER_SPEED_GAME"] = 2] = "MULTIPLAYER_SPEED_GAME";
            E_GAME_MODE[E_GAME_MODE["SINGLE_SPEED_GAME"] = 3] = "SINGLE_SPEED_GAME";
        })(E_GAME_MODE || (E_GAME_MODE = {}));
        var E_GAME_BGM;
        (function (E_GAME_BGM) {
            E_GAME_BGM[E_GAME_BGM["SAND"] = 0] = "SAND";
            E_GAME_BGM[E_GAME_BGM["FOREST"] = 1] = "FOREST";
            E_GAME_BGM[E_GAME_BGM["SKY"] = 2] = "SKY";
            E_GAME_BGM[E_GAME_BGM["MENU"] = 3] = "MENU";
        })(E_GAME_BGM || (E_GAME_BGM = {}));
        class SoundMgr {
            constructor() {
                this.isbgmOn = true;
                this.isSoundOn = true;
                this.bgmUrlList = ["audio/Theme1Silent.mp3"];
                this.canPlayBgm = true;
                this.currBgmType = 0;
                this.isDriftPlaying = false;
            }
            static get Ins() {
                return SoundMgr._ins || (SoundMgr._ins = new SoundMgr());
            }
            play(url, volume = 1, loops = 1, complete) {
                if (!this.isSoundOn) return;
                let sc = Laya.SoundManager.playSound(url, loops, complete);
                if (sc) sc.volume = volume * DataMgr.Ins.soundVolume;
                return sc;
            }
            playBgm(bgmType) {
                if (!this.isbgmOn) return;
                let url = "";
                this.currBgmType = bgmType;
                switch (bgmType) {
                    case E_GAME_MODE.NONE:
                        url = "audio/Theme1Silent.mp3";
                        break;

                    case E_GAME_MODE.MULTIPLAYER_PROP_GAME:
                        url = "audio/manyItem.mp3";
                        break;

                    case E_GAME_MODE.MULTIPLAYER_SPEED_GAME:
                        url = "audio/manyRace.mp3";
                        break;

                    case E_GAME_MODE.SINGLE_SPEED_GAME:
                        url = "audio/singleRace.mp3";
                        break;

                    default:
                        break;
                }
                if (!Laya.loader.getRes(url)) {
                    Laya.loader.create([url], Laya.Handler.create(this, res => {
                        this.m_bgm = Laya.SoundManager.playMusic(url, 0, null, 0);
                    }));
                } else {
                    this.m_bgm = Laya.SoundManager.playMusic(url, 0, null, 0);
                }
            }
            Win() {
                this.play("audio/win.mp3", 1);
            }
            CountDown() {
                this.play("audio/Countdown_2.mp3", 1);
            }
            booster() {
                this.play("audio/SilentBoost.mp3", 1);
            }
            Coin() {
                this.play("audio/Coins.mp3", 1);
            }
            Press() {
                this.play("audio/Press.mp3", 1);
            }
            getZsGold() {
                this.play("audio/common/getZsGold.mp3", 1);
            }
            losePodium() {
                this.play("audio/common/losepodium.mp3", 1);
            }
            winPodium() {
                this.play("audio/common/winpodium.mp3", 1);
            }
            lvUpAndBuyBtn() {
                this.play("audio/common/lvUpAndBuyClick.mp3", 1);
            }
            matching() {
                this.play("audio/common/matching.mp3", 1, 0);
            }
            mathchSuc() {
                Laya.SoundManager.stopSound("audio/common/matching.mp3");
                this.play("audio/common/matchSuc.mp3", 1);
            }
            banana() {
                this.play("audio/item/banana.mp3", 1);
            }
            bombHit() {
                this.play("audio/item/bombHit.mp3", 1);
            }
            ghost() {
                this.play("audio/item/ghost.mp3", 1);
            }
            beGhosted() {
                this.play("audio/item/beGhosted.mp3", 1);
            }
            getProp() {
                this.play("audio/item/getProp.mp3", 1);
            }
            reach() { }
            launchbomb() {
                this.play("audio/item/launchbomb.mp3", 1);
            }
            lightning() {
                this.play("audio/item/lightning.mp3", 1);
            }
            shield() {
                this.play("audio/item/shield.mp3", 1);
            }
            speedField() {
                this.play("audio/item/speedField.mp3", 1);
            }
            vertigo() {
                this.play("audio/item/vertigo.mp3", 1);
            }
            star() {
                this.play("audio/item/star.mp3", 1);
            }
            drift() {
                if (!this.driftSoundChannel) {
                    this.isDriftPlaying = true;
                    this.driftSoundChannel = this.play("audio/drift.mp3", .3);
                } else {
                    if (!this.isDriftPlaying) {
                        this.isDriftPlaying = true;
                        this.driftSoundChannel = this.play("audio/drift.mp3", .3);
                    }
                }
            }
            stopDrift() {
                if (this.driftSoundChannel && this.isDriftPlaying) {
                    this.isDriftPlaying = false;
                    this.driftSoundChannel.stop();
                }
            }
            closeBgm() {
                this.isbgmOn = false;
                if (this.m_bgm) this.m_bgm.stop();
            }
            closeSound() {
                this.closeBgm();
                this.isSoundOn = false;
            }
            openBgm() {
                this.isbgmOn = true;
            }
            openSound() {
                this.isSoundOn = true;
                this.isbgmOn = true;
            }
            pauseBgm() {
                if (this.m_bgm) this.m_bgm.pause();
            }
            resumeBgm() {
                if (this.m_bgm) this.m_bgm.resume();
            }
        }
        class BananaScript extends Laya.Script3D {
            constructor() {
                super(...arguments);
                this.isDestroy = false;
            }
            onStart() {
                this.isStandAlong = false;
                Laya.timer.once(1e3, this, this.standAlong);
            }
            standAlong() {
                this.isStandAlong = true;
            }
            destroySelf() { }
            onTriggerEnter(other) {
                if (other && other.owner) {
                    var _carScript = other.owner.getComponent(CarScript);
                    if (this.isStandAlong || this.masterID != _carScript.racePos) {
                        _carScript.beAttacked(E_ATTACK_TYPE.BANANA);
                        if (_carScript.isSelf) SoundMgr.Ins.banana();
                        this.owner.destroy();
                        if (this.masterID == ActorMgr.Ins.m_selfScript.racePos) SceneMgr.Ins.battlePropFeature(_carScript.m_selfP, E_PROP_TYPE.BANANA);
                    }
                }
            }
        }
        var E_EFFECT_TYPE;
        (function (E_EFFECT_TYPE) {
            E_EFFECT_TYPE["WIN"] = "eff_win";
            E_EFFECT_TYPE["DEF"] = "eff_def";
            E_EFFECT_TYPE["BLITZ"] = "eff_blity";
            E_EFFECT_TYPE["GHOST"] = "eff_ghost";
            E_EFFECT_TYPE["FAINT"] = "eff_faint";
            E_EFFECT_TYPE["STAR"] = "eff_star";
            E_EFFECT_TYPE["BOW"] = "eff_bow";
            E_EFFECT_TYPE["EDGE"] = "eff_edge";
        })(E_EFFECT_TYPE || (E_EFFECT_TYPE = {}));
        class EffectMgr {
            constructor() { }
            static get Ins() {
                return EffectMgr._ins || (EffectMgr._ins = new EffectMgr());
            }
            getEffect(effType) {
                var eff = Laya.Pool.getItem(effType);
                if (eff && eff.transform) {
                    eff.active = true;
                    return eff;
                } else {
                    var resUrl = "";
                    switch (effType) {
                        case E_EFFECT_TYPE.WIN:
                            resUrl = LoadMgr.Ins.unityResPath(E_UNITY_RES_PATH.PROP, "eff_win.lh");
                            break;

                        case E_EFFECT_TYPE.DEF:
                            resUrl = LoadMgr.Ins.unityResPath(E_UNITY_RES_PATH.PROP, "eff_def.lh");
                            break;

                        case E_EFFECT_TYPE.BLITZ:
                            resUrl = LoadMgr.Ins.unityResPath(E_UNITY_RES_PATH.PROP, "eff_blity.lh");
                            break;

                        case E_EFFECT_TYPE.GHOST:
                            resUrl = LoadMgr.Ins.unityResPath(E_UNITY_RES_PATH.PROP, "eff_ghost.lh");
                            break;

                        case E_EFFECT_TYPE.FAINT:
                            resUrl = LoadMgr.Ins.unityResPath(E_UNITY_RES_PATH.PROP, "eff_faint.lh");
                            break;

                        case E_EFFECT_TYPE.STAR:
                            resUrl = LoadMgr.Ins.unityResPath(E_UNITY_RES_PATH.PROP, "eff_star.lh");
                            break;

                        case E_EFFECT_TYPE.BOW:
                            resUrl = LoadMgr.Ins.unityResPath(E_UNITY_RES_PATH.PROP, "eff_car_bow.lh");
                            break;

                        case E_EFFECT_TYPE.EDGE:
                            resUrl = LoadMgr.Ins.unityResPath(E_UNITY_RES_PATH.PROP, "eff_car_edge.lh");
                            break;

                        default:
                            break;
                    }
                    var effModel = Laya.loader.getRes(resUrl);
                    eff = Laya.Sprite3D.instantiate(effModel);
                    eff["effType"] = effType;
                    return eff;
                }
            }
            recoverEffect(effType, eff) {
                eff.active = false;
                eff.removeSelf();
                Laya.Pool.recover(effType, eff);
            }
        }
        var E_GUIDE_TYPE;
        (function (E_GUIDE_TYPE) {
            E_GUIDE_TYPE[E_GUIDE_TYPE["NONE"] = 0] = "NONE";
            E_GUIDE_TYPE[E_GUIDE_TYPE["BATTLE_START"] = 1] = "BATTLE_START";
            E_GUIDE_TYPE[E_GUIDE_TYPE["BATTLE_RUSH"] = 2] = "BATTLE_RUSH";
            E_GUIDE_TYPE[E_GUIDE_TYPE["BATTLE_TURN_LEFT"] = 3] = "BATTLE_TURN_LEFT";
            E_GUIDE_TYPE[E_GUIDE_TYPE["BATTLE_FINISH_TURN_LEFT"] = 4] = "BATTLE_FINISH_TURN_LEFT";
            E_GUIDE_TYPE[E_GUIDE_TYPE["BATTLE_CURVE"] = 5] = "BATTLE_CURVE";
            E_GUIDE_TYPE[E_GUIDE_TYPE["BATTLE_NOS"] = 6] = "BATTLE_NOS";
            E_GUIDE_TYPE[E_GUIDE_TYPE["BATTLE_GOOD"] = 7] = "BATTLE_GOOD";
            E_GUIDE_TYPE[E_GUIDE_TYPE["BATTLE_STAR"] = 8] = "BATTLE_STAR";
            E_GUIDE_TYPE[E_GUIDE_TYPE["BATTLE_GHOST"] = 9] = "BATTLE_GHOST";
            E_GUIDE_TYPE[E_GUIDE_TYPE["BATTLE_SKILL"] = 10] = "BATTLE_SKILL";
            E_GUIDE_TYPE[E_GUIDE_TYPE["BATTLE_OVER"] = 11] = "BATTLE_OVER";
            E_GUIDE_TYPE[E_GUIDE_TYPE["FIRST_START"] = 12] = "FIRST_START";
            E_GUIDE_TYPE[E_GUIDE_TYPE["UPGRADE_CAR"] = 13] = "UPGRADE_CAR";
            E_GUIDE_TYPE[E_GUIDE_TYPE["START_SPEED"] = 14] = "START_SPEED";
            E_GUIDE_TYPE[E_GUIDE_TYPE["START_PROP"] = 15] = "START_PROP";
            E_GUIDE_TYPE[E_GUIDE_TYPE["ANOTHER_PROP"] = 16] = "ANOTHER_PROP";
            E_GUIDE_TYPE[E_GUIDE_TYPE["CLICK_GARAGE"] = 17] = "CLICK_GARAGE";
            E_GUIDE_TYPE[E_GUIDE_TYPE["ENTER_MULTI_SPEED"] = 18] = "ENTER_MULTI_SPEED";
            E_GUIDE_TYPE[E_GUIDE_TYPE["ENTER_MULTI_PROP"] = 19] = "ENTER_MULTI_PROP";
            E_GUIDE_TYPE[E_GUIDE_TYPE["ENTER_SINGLE_SPEED"] = 20] = "ENTER_SINGLE_SPEED";
            E_GUIDE_TYPE[E_GUIDE_TYPE["START_SINGLE_GAME"] = 21] = "START_SINGLE_GAME";
            E_GUIDE_TYPE[E_GUIDE_TYPE["SINGLE_MAP_UNLOCK"] = 22] = "SINGLE_MAP_UNLOCK";
            E_GUIDE_TYPE[E_GUIDE_TYPE["RANK_REWARD"] = 23] = "RANK_REWARD";
            E_GUIDE_TYPE[E_GUIDE_TYPE["MAX"] = 24] = "MAX";
        })(E_GUIDE_TYPE || (E_GUIDE_TYPE = {}));
        var E_DOOR_TYPE;
        (function (E_DOOR_TYPE) {
            E_DOOR_TYPE[E_DOOR_TYPE["SLOW"] = 0] = "SLOW";
            E_DOOR_TYPE[E_DOOR_TYPE["SPEED"] = 1] = "SPEED";
            E_DOOR_TYPE[E_DOOR_TYPE["FLY"] = 2] = "FLY";
        })(E_DOOR_TYPE || (E_DOOR_TYPE = {}));
        class FlyPointScript extends Laya.Script3D {
            constructor() {
                super(...arguments);
                this.gameDis = 0;
            }
            onAwake() {
                this.ani = this.owner.getChildAt(0).getComponent(Laya.Animator);
                this.doorType = E_DOOR_TYPE.FLY;
                this.playFlyDoor();
            }
            playSlowDoor() { }
            playSpeedDoor() { }
            playFlyDoor() {
                if (this.ani && this.owner.getChildAt(0).name == "Eff_chuansongmen") {
                    this.ani.play("Eff_chuansongmen_O");
                }
                this.doorType = E_DOOR_TYPE.FLY;
            }
        }
        var E_CAR_ANI_NAME;
        (function (E_CAR_ANI_NAME) {
            E_CAR_ANI_NAME["RUN"] = "Car_run";
            E_CAR_ANI_NAME["HIT"] = "Car_be_hitted";
        })(E_CAR_ANI_NAME || (E_CAR_ANI_NAME = {}));
        var E_ATTACK_TYPE;
        (function (E_ATTACK_TYPE) {
            E_ATTACK_TYPE[E_ATTACK_TYPE["UNKNOWN"] = 0] = "UNKNOWN";
            E_ATTACK_TYPE[E_ATTACK_TYPE["WALL"] = 1] = "WALL";
            E_ATTACK_TYPE[E_ATTACK_TYPE["BANANA"] = 2] = "BANANA";
            E_ATTACK_TYPE[E_ATTACK_TYPE["ROCKET"] = 3] = "ROCKET";
        })(E_ATTACK_TYPE || (E_ATTACK_TYPE = {}));
        class CarScript extends Laya.Script3D {
            constructor() {
                super(...arguments);
                this.curSpeed = 0;
                this.curSpeedX = 0;
                this.curOffset = 0;
                this.maxSpeedBuff = 1;
                this.maxSpeedAdd = 0;
                this.rankNum = 1;
                this.isFinish = false;
                this.isEdgeSlow = true;
                this.PlayerName = "";
                this.flyAnis = [];
                this.isSelf = false;
                this.racePos = 0;
                this.shieldBuff = false;
                this.starBuff = false;
                this.NOSBuff = false;
                this.stopChargeBuff = false;
                this.flyDis = 0;
                this.driftInterrupted = false;
                this.moveMouseX = 0;
                this.isDrive = false;
                this.isRace = false;
                this.offsetSpeed = 0;
                this.accelerationBuff = 1;
                this.isReady = false;
                this.gameDis = .001;
                this.speedSupply = 0;
                this.boosterPar = 1.6;
                this.boosterTime = 1500;
                this.speedAdd = 1;
                this.speedAddEndList = [];
                this.isBooster = false;
                this.curBooster = -1;
                this.curJumpPlane = -1;
                this.impulseSpeed = 0;
                this.beImpactLeft = false;
                this.beImpactRight = false;
                this.PropItem1 = E_PROP_TYPE.NONE;
                this.PropItem2 = E_PROP_TYPE.NONE;
                this.m_curLap = -1;
            }
            init() {
                this.m_sprite3D = this.owner;
                let lastOne = this.m_sprite3D.numChildren;
                this.m_selfP = this.m_sprite3D.getChildAt(lastOne - 1);
                this.carRoot = this.m_selfP.getChildAt(0);
                let effRoot = this.carRoot.getChildAt(5);
                this.flyRoot = this.carRoot.getChildAt(6);
                if (this.flyRoot) {
                    for (let i = 0; i < this.flyRoot.numChildren; i++) {
                        let ani = this.flyRoot.getChildAt(i).getComponent(Laya.Animator);
                        ani.speed = 0;
                        this.flyAnis.push(ani);
                    }
                }
                this.speedLine = effRoot.getChildAt(0);
                this.NOSBlow = effRoot.getChildAt(1);
                this.normalBlow = effRoot.getChildAt(2);
                this.TrackRoot = effRoot.getChildAt(3);
                this.powerUp = effRoot.getChildAt(4);
                this.clearAllEff();
                this.normalBlow.active = true;
                this.TrackRoot.active = false;
                this.ani = this.m_selfP.getComponent(Laya.Animator);
                this.ani.play("Car_run");
                this.isRace = true;
                this.isReady = false;
                this.isFinish = false;
                this.isEdgeSlow = true;
                this.controlled = true;
                this.isReverse = false;
                this.isFaint = false;
                this.starBuff = false;
                this.shieldBuff = false;
                this.NOSBuff = false;
                this.stopChargeBuff = false;
                this.LBLoopAdd = 0;
                this.LBPro = 0;
                this.levelCfg = CCfgMgr.Ins.cfgTrack.getItem(DataMgr.Ins.currTrackId);
                let skilllv = this.carCfg.getSkillLv() - 1;
                let skillID = CCfgMgr.Ins.cfgRacing.getItem(this.carCfg.id)._SkillId[skilllv];
                this.skillCfg = CCfgMgr.Ins.cfgSkillInfo.getItem(skillID);
                this.gameDis = .001;
                this.curOffset = 0;
                this.isFlying = false;
                this.flyLineID = 0;
                this.flySpeed = 0;
                if (this.checkBuff(E_SKILL_BUFF.GHOST_FOREVER)) {
                    if (this.isSelf) {
                        this.isReverse = true;
                    }
                    this.playEffect(E_EFFECT_TYPE.GHOST);
                }
            }
            get maxSpeed() {
                let buffAdd = 1;
                let buffCfg = DataMgr.Ins.getConstellationBuff();
                if (buffCfg) {
                    if (buffCfg.buffType == E_BUFF_TYPE.SPEEDGAME_MAXSPEED && DataMgr.Ins.currGameMode == E_GAME_MODE.MULTIPLAYER_SPEED_GAME) {
                        buffAdd = (100 + buffCfg.buffValue) / 100;
                    }
                    if (buffCfg.buffType == E_BUFF_TYPE.PROPGAME_MAXSPEED && DataMgr.Ins.currGameMode == E_GAME_MODE.MULTIPLAYER_PROP_GAME) {
                        buffAdd = (100 + buffCfg.buffValue) / 100;
                    }
                }
                let par1 = (this.carCfg.getCurrMaxSpeed() - 100) / 400;
                return (GameMgr.Ins.maxCarSpeed + par1) * this.maxSpeedBuff * buffAdd + this.maxSpeedAdd;
            }
            get maxCarSpeed() {
                let par1 = (this.carCfg.getCurrMaxSpeed() - 100) / 400;
                return GameMgr.Ins.maxCarSpeed + par1;
            }
            get acceleration() {
                return .6 * this.carCfg.getCurrMaxSpeed() * this.carCfg.getCurrSU() / this.accelerationBuff;
            }
            Ready() {
                this.isReady = false;
                Laya.timer.once(4500, this, this.ReadyGo);
            }
            ReadyGo() {
                this.isReady = true;
            }
            bornAni() {
                this.m_selfP.transform.localScaleX = .2;
                this.m_selfP.transform.localScaleY = .2;
                this.m_selfP.transform.localScaleZ = .2;
                Laya.Tween.to(this.m_selfP.transform, {
                    localScaleX: 1,
                    localScaleY: 1,
                    localScaleZ: 1
                }, 600, null);
            }
            WinTween() { }
            booster() {
                this.isSelf && SoundMgr.Ins.booster();
                this.speedAdd *= this.boosterPar;
                if (this.speedAdd > 1.6) this.speedAdd = 1.6;
            }
            stopBooster() { }
            boosterUpdate() {
                if (this.m_selfP && this.m_selfP.transform) {
                    if (this.speedAdd > 1 || this.impulseSpeed > 0) {
                        this.m_selfP.transform.localRotationEulerX = -30;
                        this.m_selfP.transform.localPositionY = 0;
                    } else {
                        this.m_selfP.transform.localPositionY = 0;
                    }
                }
            }
            speedLineUpdate() {
                if (this.speedAdd > 1) {
                    this.openBoosterVFX();
                } else {
                    this.closeBoosterVFX();
                }
            }
            checkChampion() { }
            checkTrack() {
                let traill = this.TrackRoot.getChildAt(0);
                let trailr = this.TrackRoot.getChildAt(1);
                let trailFire = this.TrackRoot.getChildAt(2);
                if (traill && trailr && trailFire) {
                    this.TrackRoot.active = true;
                    if (Math.abs(this.m_selfP.transform.localRotationEulerY) > 20 && !this.isFlying) {
                        if (this.isSelf) SoundMgr.Ins.drift();
                        traill.trailFilter.time = .1;
                        trailr.trailFilter.time = .1;
                        trailFire.active = true;
                    } else {
                        if (this.isSelf) SoundMgr.Ins.stopDrift();
                        traill.trailFilter.time = 0;
                        trailr.trailFilter.time = 0;
                        trailFire.active = false;
                    }
                }
            }
            openNOS() {
                this.NOSBlow.active = true;
                this.normalBlow.active = false;
                this.powerUp.active = true;
                this.speedLine.active = false;
                this.m_ActorScript.playNOS();
            }
            closeNOS() {
                this.NOSBlow.active = false;
                this.normalBlow.active = true;
                this.powerUp.active = false;
                this.speedLine.active = false;
                this.m_ActorScript.playDrive();
            }
            openBoosterVFX() {
                if (this.NOSBuff) return;
                this.NOSBlow.active = true;
                this.normalBlow.active = false;
            }
            closeBoosterVFX() {
                if (this.NOSBuff) return;
                this.NOSBlow.active = false;
                this.normalBlow.active = true;
            }
            jumpFly(index) { }
            wallHit() {
                if (this.checkBuff(E_SKILL_BUFF.PHYISC_KING)) {
                    this.physicsKingDebuff();
                    return;
                }
                if (this.starBuff) return;
                if (!this.shieldBuff) {
                    this.curSpeed *= .3;
                    this.speedAdd *= .3;
                    this.playHitHead();
                } else {
                    this.stopShield();
                }
            }
            shiftDown() {
                this.curSpeed *= .5;
                this.speedAdd *= .5;
                this.playHitHead();
            }
            impulse(speed) {
                this.impulseSpeed += speed;
                this.playHitTail();
            }
            impactLeft() {
                this.controlled = false;
                this.beImpactLeft = true;
                this.curSpeed *= .95;
                Laya.timer.once(150, this, this.revertControl);
            }
            impactRight() {
                this.controlled = false;
                this.beImpactRight = true;
                this.curSpeed *= .95;
                Laya.timer.once(150, this, this.revertControl);
            }
            revertControl() {
                this.controlled = true;
                this.beImpactRight = false;
                this.beImpactLeft = false;
            }
            playHitHead() {
                this.playEffect(E_EFFECT_TYPE.BOW);
                this.SkillBow.transform.localPositionZ = 1;
                Laya.timer.once(500, this, this.stopHit);
            }
            playHitTail() {
                this.playEffect(E_EFFECT_TYPE.BOW);
                this.SkillBow.transform.localPositionZ = -1;
                Laya.timer.once(500, this, this.stopHit);
            }
            playHitLeft() {
                this.playEffect(E_EFFECT_TYPE.BOW);
                this.SkillBow.transform.localPositionX = -1;
                Laya.timer.once(500, this, this.stopHit);
            }
            playHitRight() {
                this.playEffect(E_EFFECT_TYPE.BOW);
                this.SkillBow.transform.localPositionX = 1;
                Laya.timer.once(500, this, this.stopHit);
            }
            playEdgeLeft() {
                this.playEffect(E_EFFECT_TYPE.EDGE);
                this.SkillEdge.transform.localPositionX = -1;
                this.SkillEdge.transform.localRotationEulerZ = 30;
                this.physicsKingDebuff(true);
            }
            playEdgeRight() {
                this.playEffect(E_EFFECT_TYPE.EDGE);
                this.SkillEdge.transform.localPositionX = 1;
                this.SkillEdge.transform.localRotationEulerZ = -30;
                this.physicsKingDebuff(true);
            }
            physicsKingDebuff(isEdge = false) {
                if (this.checkBuff(E_SKILL_BUFF.PHYISC_KING)) {
                    let par = 1;
                    if (isEdge) par = 60;
                    if (this.skillCfg.Buff1 == E_SKILL_BUFF.PHYISC_KING) this.addLBPro(-this.skillCfg.Buff1Value * .01 / par); else if (this.skillCfg.Buff2 == E_SKILL_BUFF.PHYISC_KING) this.addLBPro(-this.skillCfg.Buff2Value * .01 / par);
                }
            }
            closeEdge() {
                this.closeEffect(E_EFFECT_TYPE.EDGE);
            }
            stopHit() {
                this.closeEffect(E_EFFECT_TYPE.BOW);
            }
            clearAllEff() {
                this.speedLine.active = false;
                this.NOSBlow.active = false;
                this.normalBlow.active = false;
                this.TrackRoot.active = false;
                this.powerUp.active = false;
            }
            beAttacked(attackType = E_ATTACK_TYPE.UNKNOWN) {
                if (this.isFlying) return;
                switch (attackType) {
                    case E_ATTACK_TYPE.UNKNOWN:
                        break;

                    case E_ATTACK_TYPE.WALL:
                        if (this.checkBuff(E_SKILL_BUFF.PHYISC_KING)) {
                            this.physicsKingDebuff();
                            return;
                        }
                        break;

                    case E_ATTACK_TYPE.BANANA:
                        this.addLBSkill(E_SKILL_CHARGE_EXTRA_TYPE.TOUCH_BANANA);
                        if (this.checkBuff(E_SKILL_BUFF.RESIST_BANANA)) {
                            return;
                        }
                        if (this.checkBuff(E_SKILL_BUFF.PHYISC_KING)) {
                            this.physicsKingDebuff();
                            return;
                        }
                        break;

                    case E_ATTACK_TYPE.ROCKET:
                        this.isSelf && SoundMgr.Ins.bombHit();
                        break;

                    default:
                        break;
                }
                if (this.starBuff) return;
                if (!this.shieldBuff) {
                    this.playAni(E_CAR_ANI_NAME.HIT);
                    this.driftInterrupted = true;
                    this.speedAdd = 1;
                    this.impulseSpeed = 0;
                    this.curSpeed = 0;
                } else {
                    this.stopShield();
                }
            }
            checkBuff(buff) {
                if (this.skillCfg.Buff1 == buff || this.skillCfg.Buff2 == buff) return true; else return false;
            }
            beFainted() {
                this.isFaint = true;
                this.maxSpeedBuff = .6;
                this.playEffect(E_EFFECT_TYPE.FAINT);
                if (this.isSelf) {
                    SoundMgr.Ins.vertigo();
                    EventMgr.Ins.dispatch(EventType.BUFFTIPMSG, E_PROP_TYPE.FAITH);
                }
                Laya.timer.once(5e3, this, this.stopFaint);
            }
            stopFaint() {
                if (!this.isFaint) return;
                this.isFaint = false;
                this.maxSpeedBuff = 1;
                this.closeEffect(E_EFFECT_TYPE.FAINT);
                if (this.isSelf) {
                    EventMgr.Ins.dispatch(EventType.CLOSEBUFFTIPMSG, E_PROP_TYPE.FAITH);
                }
            }
            beGhosted() {
                if (!this.checkBuff(E_SKILL_BUFF.GHOST_FOREVER) && !this.isReverse) {
                    this.isReverse = true;
                    this.playEffect(E_EFFECT_TYPE.GHOST);
                    if (this.isSelf) {
                        SoundMgr.Ins.beGhosted();
                        EventMgr.Ins.dispatch(EventType.BUFFTIPMSG, E_PROP_TYPE.GHOST);
                    }
                    Laya.timer.once(5e3, this, this.stopGhost);
                }
            }
            stopGhost() {
                this.isReverse = false;
                this.closeEffect(E_EFFECT_TYPE.GHOST);
                if (this.isSelf) {
                    EventMgr.Ins.dispatch(EventType.CLOSEBUFFTIPMSG, E_PROP_TYPE.GHOST);
                }
            }
            beThundered() {
                if (this.isFlying) return;
                this.addLBSkill(E_SKILL_CHARGE_EXTRA_TYPE.BE_THUNDERED);
                this.playEffect(E_EFFECT_TYPE.BLITZ);
                Laya.timer.once(1e3, null, () => {
                    if (!this.shieldBuff) {
                        if (!this.starBuff) {
                            this.playAni(E_CAR_ANI_NAME.HIT);
                            this.driftInterrupted = true;
                            this.speedAdd = 1;
                            this.impulseSpeed = 0;
                            this.curSpeed = 0;
                        }
                    } else {
                        this.stopShield();
                    }
                });
                Laya.timer.once(3500, this, this.closeThunder);
            }
            closeThunder() {
                this.closeEffect(E_EFFECT_TYPE.BLITZ);
            }
            playAni(aniName, speed = 1) {
                this.ani.play(aniName, 0, 0);
                this.ani.speed = speed;
                let time = 0;
                if (aniName == E_CAR_ANI_NAME.HIT) time = 1500;
                Laya.timer.once(time, this, this.aniRevert);
            }
            playEffect(effType) {
                switch (effType) {
                    case E_EFFECT_TYPE.WIN:
                        if (!this.SkillWin) this.SkillWin = this.getEffect(effType);
                        break;

                    case E_EFFECT_TYPE.DEF:
                        if (!this.SkillDef) {
                            this.SkillDef = this.getEffect(effType);
                            Laya.timer.once(1e3, this, this.shieldLoop);
                        }
                        break;

                    case E_EFFECT_TYPE.BLITZ:
                        if (!this.SkillBlity) this.SkillBlity = this.getEffect(effType);
                        break;

                    case E_EFFECT_TYPE.GHOST:
                        if (!this.SkillGhost) this.SkillGhost = this.getEffect(effType);
                        break;

                    case E_EFFECT_TYPE.FAINT:
                        if (!this.SkillFaint) this.SkillFaint = this.getEffect(effType);
                        break;

                    case E_EFFECT_TYPE.STAR:
                        if (!this.SkillStar) this.SkillStar = this.getEffect(effType);
                        break;

                    case E_EFFECT_TYPE.BOW:
                        if (!this.SkillBow) this.SkillBow = this.getEffect(effType);
                        break;

                    case E_EFFECT_TYPE.EDGE:
                        if (!this.SkillEdge) this.SkillEdge = this.getEffect(effType);
                        break;

                    default:
                        break;
                }
            }
            getEffect(effType) {
                let eff = EffectMgr.Ins.getEffect(effType);
                this.m_sprite3D.addChild(eff);
                return eff;
            }
            closeEffect(effType) {
                switch (effType) {
                    case E_EFFECT_TYPE.WIN:
                        if (this.SkillWin) {
                            EffectMgr.Ins.recoverEffect(effType, this.SkillWin);
                            this.SkillWin = null;
                        }
                        break;

                    case E_EFFECT_TYPE.DEF:
                        if (this.SkillDef) {
                            EffectMgr.Ins.recoverEffect(effType, this.SkillDef);
                            this.SkillDef = null;
                        }
                        break;

                    case E_EFFECT_TYPE.BLITZ:
                        if (this.SkillBlity) {
                            EffectMgr.Ins.recoverEffect(effType, this.SkillBlity);
                            this.SkillBlity = null;
                        }
                        break;

                    case E_EFFECT_TYPE.GHOST:
                        if (this.SkillGhost) {
                            EffectMgr.Ins.recoverEffect(effType, this.SkillGhost);
                            this.SkillGhost = null;
                        }
                        break;

                    case E_EFFECT_TYPE.FAINT:
                        if (this.SkillFaint) {
                            EffectMgr.Ins.recoverEffect(effType, this.SkillFaint);
                            this.SkillFaint = null;
                        }
                        break;

                    case E_EFFECT_TYPE.STAR:
                        if (this.SkillStar) {
                            EffectMgr.Ins.recoverEffect(effType, this.SkillStar);
                            this.SkillStar = null;
                        }
                        break;

                    case E_EFFECT_TYPE.BOW:
                        if (this.SkillBow) {
                            EffectMgr.Ins.recoverEffect(effType, this.SkillBow);
                            this.SkillBow = null;
                        }
                        break;

                    case E_EFFECT_TYPE.EDGE:
                        if (this.SkillEdge) {
                            if (this.isSelf) GameMgr.Ins.updateAchievementData(E_ACHIEVEMENT_TYPE.EDGETIME);
                            EffectMgr.Ins.recoverEffect(effType, this.SkillEdge);
                            this.SkillEdge = null;
                        }
                        break;

                    default:
                        break;
                }
            }
            aniRevert() {
                this.ani.play(E_CAR_ANI_NAME.RUN);
            }
            onTriggerEnter(other) {
                if (other && other.owner) {
                    let target = other.owner;
                    if (target.name == "obj_box") {
                        let boxScript = target.getComponent(propBoxScript);
                        if (boxScript && !boxScript.isInCD) {
                            this.rndProp();
                            boxScript.giveProp();
                            if (this.isSelf) SoundMgr.Ins.getProp();
                        }
                        return;
                    }
                    if (target.name == "obj_wall") {
                        this.wallHit();
                        return;
                    }
                    if (target.name == "ljf_run") {
                        this.beAttacked();
                        GameMgr.Ins.updateAchievementData(E_ACHIEVEMENT_TYPE.MONSTERTIME);
                        return;
                    }
                    if (target.name == "fengcheye") {
                        this.beAttacked();
                        GameMgr.Ins.updateAchievementData(E_ACHIEVEMENT_TYPE.MONSTERTIME);
                        return;
                    }
                    if (target.name == "Mon_jixiebi_04") {
                        this.beAttacked();
                        GameMgr.Ins.updateAchievementData(E_ACHIEVEMENT_TYPE.MONSTERTIME);
                        return;
                    }
                    if (target.name == "flyBox") {
                        this.startJump();
                        return;
                    }
                    if (target.name == "dropBox") {
                        this.stopJump();
                        return;
                    }
                    if (target.name.indexOf("startFlyPoint") != -1) {
                        let fps = target.getComponent(FlyPointScript);
                        if (fps) {
                            if (fps.doorType == E_DOOR_TYPE.SLOW) {
                                this.wallHit();
                            }
                            if (fps.doorType == E_DOOR_TYPE.SPEED) {
                                this.booster();
                            }
                            if (fps.doorType == E_DOOR_TYPE.FLY) {
                                let flyLineID = parseInt(target.name[13]);
                                if (!GameMgr.Ins.isGuideGame) this.checkStartFly(flyLineID);
                            }
                        }
                        return;
                    }
                }
            }
            rndProp() {
                let addItemID = [];
                let addChance = [];
                if (this.checkBuff(E_SKILL_BUFF.STAR_CHANCE)) {
                    addItemID.push(E_PROP_TYPE.STAR);
                    if (this.skillCfg.Buff1 == E_SKILL_BUFF.STAR_CHANCE) addChance.push(this.skillCfg.Buff1Value);
                    if (this.skillCfg.Buff2 == E_SKILL_BUFF.STAR_CHANCE) addChance.push(this.skillCfg.Buff2Value);
                }
                if (this.checkBuff(E_SKILL_BUFF.GHOST_CHANCE)) {
                    let ghostProp = E_PROP_TYPE.GHOST;
                    this.getProp(ghostProp);
                    if (this.isSelf) EventMgr.Ins.dispatch(EventType.GETPROPMSG);
                } else {
                    if (this.isSelf) {
                        let buffCfg = DataMgr.Ins.getConstellationBuff();
                        if (buffCfg) {
                            if (buffCfg.buffType == E_BUFF_TYPE.TRAP_CHANCE_BUFF) {
                                addItemID.push(E_PROP_TYPE.BANANA);
                                addChance.push(buffCfg.buffValue * 10);
                            } else if (buffCfg.buffType == E_BUFF_TYPE.ATTACK_CHANCE_BUFF) {
                                addItemID.push(E_PROP_TYPE.ROCKET_FIRST);
                                addChance.push(buffCfg.buffValue * 3.3);
                                addItemID.push(E_PROP_TYPE.ROCKET_FOLLOW);
                                addChance.push(buffCfg.buffValue * 3.3);
                                addItemID.push(E_PROP_TYPE.THUNDER);
                                addChance.push(buffCfg.buffValue * 3.3);
                            } else if (buffCfg.buffType == E_BUFF_TYPE.DEFENSE_CHANCE_BUFF) {
                                addItemID.push(E_PROP_TYPE.STAR);
                                addChance.push(buffCfg.buffValue * 5);
                                addItemID.push(E_PROP_TYPE.SHIELD);
                                addChance.push(buffCfg.buffValue * 5);
                            }
                        }
                    }
                    let getProp = GameMgr.Ins.rndProp(addItemID, addChance, this.rankNum, this.isSelf);
                    if (getProp) {
                        this.getProp(getProp);
                        if (this.isSelf) EventMgr.Ins.dispatch(EventType.GETPROPMSG);
                    }
                }
                if (this.checkBuff(E_SKILL_BUFF.DOUBLE_CHANCE)) {
                    let doubleChance = 0;
                    if (this.skillCfg.Buff1 == E_SKILL_BUFF.DOUBLE_CHANCE) doubleChance = this.skillCfg.Buff1Value;
                    if (this.skillCfg.Buff2 == E_SKILL_BUFF.DOUBLE_CHANCE) doubleChance = this.skillCfg.Buff2Value;
                    let rnd = UsefulStuff.rnd(0, 99);
                    if (rnd < doubleChance) {
                        let getProp = GameMgr.Ins.rndProp(addItemID, addChance, this.rankNum, this.isSelf);
                        if (getProp) {
                            this.getProp(getProp);
                            if (this.isSelf) {
                                EventMgr.Ins.dispatch(EventType.SHOWSKILLMSG, this.skillCfg);
                                EventMgr.Ins.dispatch(EventType.GETPROPMSG);
                            }
                        }
                    }
                }
            }
            getProp(getProp) {
                if (this.PropItem1 == E_PROP_TYPE.NONE) {
                    this.PropItem1 = getProp;
                    return;
                }
                if (this.PropItem2 == E_PROP_TYPE.NONE) {
                    this.PropItem2 = getProp;
                    return;
                }
            }
            checkStartFly(flyLineID) {
                if (!this.isFlying) {
                    this.startFly(flyLineID);
                }
            }
            startFly(_flyLineID) {
                this.isFlying = true;
                this.flyDis = 0;
                this.flyLineID = _flyLineID;
                this.flySpeed = this.curSpeed;
                this.playFlyAni();
                this.checkTrack();
            }
            startJump() {
                this.playFlyAni();
                this.isEdgeSlow = false;
                this.startNOS(50);
            }
            stopJump() {
                this.stopFlyAni();
                this.isEdgeSlow = true;
                this.stopNOS();
            }
            playFlyAni() {
                if (this.flyAnis.length > 0) {
                    for (let i = 0; i < this.flyAnis.length; i++) {
                        this.flyAnis[i].speed = 1;
                        this.flyAnis[i].play();
                    }
                }
                Laya.timer.once(1e3, this, this.startFlyLoop);
            }
            stopFlyAni() {
                if (this.flyAnis.length > 0) {
                    for (let i = 0; i < this.flyAnis.length; i++) {
                        this.flyAnis[i].speed = -1;
                        this.flyAnis[i].play(null, 0, 1);
                    }
                    Laya.timer.frameLoop(1, this, this.stopFlyLoop);
                }
            }
            startFlyLoop() {
                this.flySpeed = 1.5;
            }
            stopFlyLoop() {
                if (this.flyAnis.length > 0 && this.flyAnis[0].getCurrentAnimatorPlayState().normalizedTime <= .05) {
                    for (let i = 0; i < this.flyAnis.length; i++) {
                        this.flyAnis[i].speed = 0;
                        this.flyAnis[i].play("fly_idle");
                    }
                    Laya.timer.clear(this, this.stopFlyLoop);
                }
            }
            stopFly() {
                this.stopFlyAni();
                let posProject = this.m_sprite3D.transform.position;
                let result = SceneMgr.Ins.GetProjectionSample(new Laya.Vector3(-posProject.x, posProject.y, posProject.z));
                if (result) {
                    this.gameDis = this.m_curLap * SceneMgr.Ins.allDistance + result[0];
                    this.curOffset = result[1];
                }
                this.curSpeed = this.maxSpeed;
                this.isFlying = false;
                this.flyLineID = 0;
                this.flyDis = 0;
            }
            onUseProp1Msg() {
                this.useProp(this.PropItem1);
                this.PropItem1 = E_PROP_TYPE.NONE;
                this.m_ActorScript.playAttack();
            }
            onUseProp2Msg() {
                this.useProp(this.PropItem2);
                this.PropItem2 = E_PROP_TYPE.NONE;
                this.m_ActorScript.playAttack();
            }
            onUseLB() {
                this.useLB();
            }
            onStartRush(rushIndex) {
                let effect = 0;
                if (rushIndex < 36) {
                    effect = 100 - 80 * (36 - rushIndex) * .1;
                } else if (rushIndex > 40) {
                    effect = 100 - 80 * (rushIndex - 40) * .1;
                } else {
                    effect = 100;
                    this.isSelf && GameMgr.Ins.updateAchievementData(E_ACHIEVEMENT_TYPE.PREFECTSTARTRUSH);
                }
                if (effect < 20) effect = 20;
                this.startRush(effect);
            }
            startRush(effect) {
                this.isSelf && SoundMgr.Ins.booster();
                this.startRushTime = Date.now();
                this.openNOS();
                this.maxSpeedAdd = effect * .01;
                this.accelerationBuff = 2 + 3 * effect * .01;
                Laya.timer.once(2e3, this, this.stopRush);
            }
            pauseRush() {
                Laya.timer.clear(this, this.stopRush);
                let a = Date.now() - this.startRushTime;
                this.leftRushTime = 2e3 - a;
            }
            resumeRush() {
                Laya.timer.once(this.leftRushTime, this, this.stopRush);
            }
            stopRush() {
                this.closeNOS();
                this.maxSpeedAdd = 0;
                this.accelerationBuff = 1;
            }
            useProp(type) {
                switch (type) {
                    case E_PROP_TYPE.NONE:
                        break;

                    case E_PROP_TYPE.ROCKET_LINE:
                        this.useRocket(type);
                        break;

                    case E_PROP_TYPE.ROCKET_FOLLOW:
                        this.useRocket(type);
                        break;

                    case E_PROP_TYPE.ROCKET_FIRST:
                        this.useRocket(type);
                        break;

                    case E_PROP_TYPE.BANANA:
                        this.useBanana();
                        break;

                    case E_PROP_TYPE.BOMB:
                        break;

                    case E_PROP_TYPE.THUNDER:
                        this.useThunder();
                        break;

                    case E_PROP_TYPE.GHOST:
                        this.useGhost();
                        break;

                    case E_PROP_TYPE.FAITH:
                        this.useFaith();
                        break;

                    case E_PROP_TYPE.SHIELD:
                        this.useShield();
                        break;

                    case E_PROP_TYPE.STAR:
                        this.useStar();
                        break;

                    case E_PROP_TYPE.NOS:
                        GameMgr.Ins.updateAchievementData(E_ACHIEVEMENT_TYPE.NOSTIME);
                        this.useNOS(20, 5e3);
                        break;

                    default:
                        break;
                }
            }
            useRocket(type) {
                let handRocket = SceneMgr.Ins.createRocket(type);
                this.m_selfP.addChild(handRocket);
                handRocket.transform.localPosition = new Laya.Vector3(-1, 1, .5);
                Laya.timer.once(200, this, this.fireRocket, [handRocket], false);
                this.addLBSkill(E_SKILL_CHARGE_EXTRA_TYPE.USE_ROCKET);
            }
            fireRocket(handRocket) {
                handRocket.removeSelf();
                SceneMgr.Ins.splineRoot.addChild(handRocket);
                let _rocketScript = handRocket.getComponent(RocketScript);
                _rocketScript.gameDis = this.gameDis;
                _rocketScript.curOffset = this.curOffset;
                _rocketScript.masterID = this.racePos;
                _rocketScript.fire();
                this.isSelf && SoundMgr.Ins.launchbomb();
            }
            useBanana() {
                let banana = SceneMgr.Ins.createBanana();
                let _bananaScript = banana.getComponent(BananaScript);
                _bananaScript.masterID = this.racePos;
                SceneMgr.Ins.splineRoot.addChild(banana);
                let pos = this.m_sprite3D.transform.localPosition;
                banana.transform.localPosition = new Laya.Vector3(pos.x, pos.y, pos.z);
                this.addLBSkill(E_SKILL_CHARGE_EXTRA_TYPE.USE_BANANA);
            }
            useThunder() {
                GameMgr.Ins.playThunder(this.racePos);
                if (this.checkBuff(E_SKILL_BUFF.THUNDER_STOP_CHARGE)) {
                    this.stopChargeBuff = true;
                    let buffTime = 0;
                    if (this.skillCfg.Buff1 == E_SKILL_BUFF.THUNDER_STOP_CHARGE) buffTime = this.skillCfg.Buff1Value;
                    if (this.skillCfg.Buff2 == E_SKILL_BUFF.THUNDER_STOP_CHARGE) buffTime = this.skillCfg.Buff2Value;
                    Laya.timer.once(buffTime, this, this.clearStopChargeBuff);
                }
            }
            clearStopChargeBuff() {
                this.stopChargeBuff = false;
            }
            useGhost() {
                let target = GameMgr.Ins.playGhost(this.rankNum);
                if (this.isSelf) {
                    SceneMgr.Ins.battlePropFeature(target.m_selfP, E_PROP_TYPE.GHOST);
                    SoundMgr.Ins.ghost();
                }
                this.addLBSkill(E_SKILL_CHARGE_EXTRA_TYPE.USE_GHOST);
            }
            useFaith() {
                let target = GameMgr.Ins.playFaith(this.rankNum);
                if (this.isSelf) {
                    SceneMgr.Ins.battlePropFeature(target.m_selfP, E_PROP_TYPE.FAITH);
                    SoundMgr.Ins.vertigo();
                }
            }
            useShield() {
                this.playEffect(E_EFFECT_TYPE.DEF);
                this.shieldBuff = true;
            }
            shieldLoop() {
                if (this.SkillDef) this.SkillDef.getChildAt(0).getComponent(Laya.Animator).play("Pro_shield_hold");
            }
            stopShield() {
                this.closeEffect(E_EFFECT_TYPE.DEF);
                this.shieldBuff = false;
            }
            useStar() {
                this.playEffect(E_EFFECT_TYPE.STAR);
                this.starBuff = true;
                if (this.isFaint) this.stopFaint();
                this.maxSpeedBuff = 1.2;
                if (this.checkBuff(E_SKILL_BUFF.STAR_CHARGE)) {
                    if (this.skillCfg.Buff1 == E_SKILL_BUFF.STAR_CHARGE) this.LBLoopAdd = this.skillCfg.Buff1Value;
                    if (this.skillCfg.Buff2 == E_SKILL_BUFF.STAR_CHARGE) this.LBLoopAdd = this.skillCfg.Buff2Value;
                    if (this.isSelf) {
                        EventMgr.Ins.dispatch(EventType.HOLDSKILLMSG, this.skillCfg);
                    }
                }
                Laya.timer.once(5e3, this, this.stopStar);
            }
            stopStar() {
                this.closeEffect(E_EFFECT_TYPE.STAR);
                this.starBuff = false;
                if (this.checkBuff(E_SKILL_BUFF.STAR_CHARGE)) {
                    this.LBLoopAdd = 0;
                    this.isSelf && EventMgr.Ins.dispatch(EventType.STOPSKILLMSG, this.skillCfg);
                }
                this.maxSpeedBuff = 1;
            }
            useInvisible() { }
            useNOS(add, addTime) {
                this.isSelf && SoundMgr.Ins.booster();
                if (this.isFaint) this.stopFaint();
                if (this.NOSBuff) {
                    Laya.timer.once(addTime, this, this.stopNOS);
                } else {
                    this.openNOS();
                    this.NOSBuff = true;
                    this.maxSpeedAdd = add * .01;
                    this.curSpeed = this.maxSpeed;
                    Laya.timer.once(addTime, this, this.stopNOS);
                }
            }
            startNOS(add) {
                this.isSelf && SoundMgr.Ins.booster();
                if (this.NOSBuff) {
                    Laya.timer.clear(this, this.stopNOS);
                } else {
                    this.openNOS();
                    this.NOSBuff = true;
                    this.maxSpeedAdd = add * .01;
                    this.curSpeed = this.maxSpeed;
                    if (this.accelerationBuff > 1) {
                        Laya.timer.clear(this, this.stopRush);
                        this.accelerationBuff = 1;
                    }
                }
            }
            stopNOS() {
                this.closeNOS();
                this.NOSBuff = false;
                this.maxSpeedAdd = 0;
            }
            useLB() {
                this.useNOS(this.skillCfg.NOSEffect, this.skillCfg.NOSTime);
                this.LBPro = 0;
            }
            addLBPro(value) {
                if (this.stopChargeBuff) return;
                this.LBPro += value;
                if (this.LBPro >= 100) {
                    this.LBPro = 100;
                }
                if (this.LBPro < 0) {
                    this.LBPro = 0;
                }
            }
            checkLineLiker(isLine) {
                if (this.checkBuff(E_SKILL_BUFF.LINE_LIKER)) {
                    if (isLine) {
                        if (this.skillCfg.Buff1 == E_SKILL_BUFF.LINE_LIKER) {
                            this.LBLoopAdd = this.skillCfg.Buff1Value;
                        } else {
                            this.LBLoopAdd = this.skillCfg.Buff2Value;
                        }
                        this.isSelf && EventMgr.Ins.dispatch(EventType.HOLDSKILLMSG, this.skillCfg);
                    } else {
                        this.LBLoopAdd = -this.skillCfg.chargeSpeed;
                        this.isSelf && EventMgr.Ins.dispatch(EventType.STOPSKILLMSG, this.skillCfg);
                    }
                }
            }
            addLBLoop() {
                if (this.stopChargeBuff) return;
                if (!GameMgr.Ins.isGuideGame) this.LBPro += (this.skillCfg.chargeSpeed + this.LBLoopAdd) * .01 / 60; else this.LBPro += (this.skillCfg.chargeSpeed + this.LBLoopAdd) * .01 / 45;
                if (this.LBPro >= 100) {
                    this.LBPro = 100;
                    if (GameMgr.Ins.isGuideGame) {
                        if (DataMgr.Ins.guideData[E_GUIDE_TYPE.BATTLE_SKILL]) GameMgr.Ins.SkillGuide();
                    }
                }
            }
            addLBSkill(chargeType) {
                if (this.skillCfg.chargeExtraType1 == chargeType) {
                    this.addLBPro(this.skillCfg.chargeExtra1 * .01);
                    if (this.isSelf) EventMgr.Ins.dispatch(EventType.SHOWSKILLMSG, this.skillCfg);
                }
                if (this.skillCfg.chargeExtraType2 == chargeType) {
                    this.addLBPro(this.skillCfg.chargeExtra2 * .01);
                    if (this.isSelf) EventMgr.Ins.dispatch(EventType.SHOWSKILLMSG, this.skillCfg);
                }
            }
            getCurLap() {
                let gCurLap = SceneMgr.Ins.getLapByDis(this.gameDis);
                if (gCurLap > this.m_curLap) {
                    this.m_curLap = gCurLap;
                    if (this.isSelf) {
                        if (gCurLap == GameMgr.Ins.getTrackLapNum() + 1) EventMgr.Ins.dispatch(EventType.RACE_RANK); else if (gCurLap == GameMgr.Ins.getTrackLapNum()) EventMgr.Ins.dispatch(EventType.RACE_LAST); else if (gCurLap == 1) EventMgr.Ins.dispatch(EventType.RACE_SECEND); else if (gCurLap == 2) EventMgr.Ins.dispatch(EventType.RACE_LAST); else if (gCurLap == 3) EventMgr.Ins.dispatch(EventType.RACE_RANK);
                    }
                    this.addLBSkill(E_SKILL_CHARGE_EXTRA_TYPE.START_POINT);
                }
                return gCurLap;
            }
            checkFinish() {
                let lap = this.getCurLap();
                let turnsNum = GameMgr.Ins.getTrackLapNum();
                if (lap > turnsNum && !this.isFinish) {
                    this.isFinish = true;
                    this.m_ActorScript.playWin();
                    GameMgr.Ins.noticeFinish(this.chaID, this.PlayerName, this.isSelf, this.m_ActorScript);
                    if (this.isSelf) SoundMgr.Ins.reach();
                }
            }
        }
        class RocketScript extends Laya.Script3D {
            constructor() {
                super(...arguments);
                this.gameDis = 0;
                this.curOffset = 0;
                this.isRunning = false;
                this.masterID = 0;
                this.targetID = 0;
                this.updateTime = 0;
                this.warningDis = 150;
            }
            onStart() {
                this.m_sprite3D = this.owner;
                this.rocketM = this.m_sprite3D.getChildAt(0);
                this.rocketH = this.m_sprite3D.getChildAt(1);
                this.Boom = this.m_sprite3D.getChildAt(2);
                this.Boom.active = false;
                this.isRunning = false;
                EventMgr.Ins.on(EventType.TIMEFIBER, this, this.startFly);
            }
            fire() {
                this.isRunning = true;
                if (this.type == E_PROP_TYPE.ROCKET_FIRST) this.targetID = GameMgr.Ins.championID;
            }
            onDestroy() {
                EventMgr.Ins.off(EventType.TIMEFIBER, this, this.startFly);
            }
            startFly(startFrame) {
                if (this.isRunning) {
                    this.gameDis += 1.5;
                    this.updateTime++;
                    if ((this.type == E_PROP_TYPE.ROCKET_LINE || this.type == E_PROP_TYPE.ROCKET_FOLLOW) && this.updateTime > 400) {
                        this.playBoom();
                    }
                    if (this.type == E_PROP_TYPE.ROCKET_FIRST && this.updateTime > 1e3) {
                        this.playBoom();
                    }
                    let isBoom = false;
                    let closestDis;
                    let clostestNpc;
                    let targetNpc;
                    for (let i = 0; i < ActorMgr.Ins.m_AllScripts.length; i++) {
                        let npc = ActorMgr.Ins.m_AllScripts[i];
                        if (npc.racePos == this.masterID) continue;
                        let dis = Math.abs(npc.gameDis - this.gameDis);
                        let disF = npc.gameDis - this.gameDis;
                        let offset = Math.abs(npc.curOffset - this.curOffset);
                        if (dis < .5 && offset < 1) {
                            npc.beAttacked(E_ATTACK_TYPE.ROCKET);
                            let car = ActorMgr.Ins.getScriptByRacePos(this.masterID);
                            car.addLBSkill(E_SKILL_CHARGE_EXTRA_TYPE.ROCKET_SUCC);
                            if (car.isSelf) {
                                SceneMgr.Ins.battlePropFeature(npc.m_selfP, E_PROP_TYPE.ROCKET_FOLLOW);
                            }
                            if (this.type == E_PROP_TYPE.ROCKET_LINE || this.type == E_PROP_TYPE.ROCKET_FOLLOW) {
                                isBoom = true;
                            }
                            if (this.type == E_PROP_TYPE.ROCKET_FIRST && npc.racePos == this.targetID) isBoom = true;
                        }
                        if (disF > 0) {
                            if (closestDis) {
                                if (disF < closestDis) {
                                    closestDis = disF;
                                    clostestNpc = npc;
                                }
                            } else {
                                closestDis = disF;
                                clostestNpc = npc;
                            }
                        }
                        if (npc.racePos == this.targetID) targetNpc = npc;
                    }
                    if (clostestNpc && clostestNpc.isSelf && closestDis < this.warningDis || targetNpc && targetNpc.isSelf && targetNpc.gameDis > this.gameDis && targetNpc.gameDis < this.gameDis + this.warningDis) EventMgr.Ins.dispatch(EventType.START_ROCKET_WARNING);
                    if (this.type == E_PROP_TYPE.ROCKET_FOLLOW && clostestNpc) {
                        let offsetDelta = clostestNpc.curOffset - this.curOffset;
                        if (Math.abs(offsetDelta) > .6) {
                            if (offsetDelta > 0) {
                                this.curOffset += .5;
                            } else {
                                this.curOffset -= .5;
                            }
                        }
                    }
                    if (this.type == E_PROP_TYPE.ROCKET_FIRST) {
                        if (targetNpc) {
                            let offsetDeltaR = targetNpc.curOffset - this.curOffset;
                            if (Math.abs(offsetDeltaR) > .6) {
                                if (offsetDeltaR > 0) this.curOffset += .5; else this.curOffset -= .5;
                            }
                        }
                    }
                    if (isBoom) this.playBoom();
                    let pos = SceneMgr.Ins.getPosByDistance(this.gameDis);
                    let dir = SceneMgr.Ins.getDirByDistance(this.gameDis);
                    let rot = new Laya.Quaternion(0, 0, 0, 0);
                    if (dir && pos) {
                        Laya.Quaternion.rotationLookAt(dir, new Laya.Vector3(0, 1, 0), rot);
                        let realRot = new Laya.Quaternion(-rot.x, rot.y, rot.z, rot.w);
                        this.m_sprite3D.transform.localPosition = new Laya.Vector3(-pos.x, pos.y, pos.z);
                        this.m_sprite3D.transform.translate(new Laya.Vector3(this.curOffset, 1, 0), true);
                        this.m_sprite3D.transform.localRotation = realRot;
                        this.m_sprite3D.transform.rotate(new Laya.Vector3(0, 180, 0), true, false);
                    } else {
                        this.destroySelf();
                    }
                }
            }
            playBoom() {
                this.isRunning = false;
                this.rocketM.active = false;
                this.rocketH.active = false;
                this.Boom.active = true;
                Laya.timer.once(1e3, this, this.destroySelf);
            }
            destroySelf() {
                this.owner.destroy();
            }
        }
        class BoosterScript extends Laya.Script3D {
            onTriggerEnter(other) {
                if (other && other.owner) {
                    let _carScript = other.owner.getComponent(CarScript);
                    if (_carScript) {
                        _carScript.booster();
                    }
                }
            }
        }
        class GlobalScale {
            constructor() {
                this._scale = 1;
            }
            get scale() {
                return this._scale;
            }
            get slow() {
                if (window["wx"]) {
                    return true;
                } else if (window["wx"]) {
                    return false;
                } else {
                    return false;
                }
            }
        }
        var GlobalScale$1 = new GlobalScale();
        class PawScript extends Laya.Script3D {
            onStart() {
                this.animator = this.owner.getComponent(Laya.Animator);
                this.isAttacking = false;
                Laya.timer.loop(5e3, this, this.playAttack);
            }
            destroySelf() {
                this.owner.destroy();
            }
            playAttack() {
                if (this.isAttacking) return;
                this.animator.crossFade("jixiebi_attack", .2);
                this.isAttacking = true;
                Laya.timer.once(2800, this, this.attackOver);
            }
            attackOver() {
                this.isAttacking = false;
            }
            playIdle() {
                if (this.isAttacking) return;
                this.animator.play("jixiebi_idle");
            }
        }
        class SceneData {
            constructor(level) {
                this.levelID = level;
                this.virusList = new Array();
                this.itemList = new Array();
                this.patientList = new Array();
            }
        }
        class PropInfo {
            constructor(_Dis, _offset, _sprite) {
                this.Dis = _Dis;
                this.offset = _offset;
                this.m_sprite = _sprite;
                this.isDestoryed = false;
            }
        }
        class SceneMgr {
            constructor() {
                this.currTouchEffNum = 0;
                this.curBoosters = [];
                this.curWalls = [];
                this.curJumpPlane = [];
                this.curShieldBoxs = [];
                this.curRocketBoxs = [];
                this.allDistance = 0;
                this.isOpposite = false;
                this.levelUrl = "";
                this.hasBooster = true;
                this.hasWall = false;
                this.hasSBox = true;
                this.openParticle = true;
                this._up1 = new Laya.Vector3(0, 1, 0);
                this.boosterSpace = 300;
                this.wallSpace = 600;
                this.propBoxSpace = 200;
                this.openParticle = true;
                window["sceneMgr"] = this;
            }
            static get Ins() {
                return SceneMgr._ins || (SceneMgr._ins = new SceneMgr());
            }
            loadScene() { }
            createScene() {
                this.levelUrl = LoadMgr.Ins.unityResPath(E_UNITY_RES_PATH.LEVEL, "level" + DataMgr.Ins.currTrackId + ".ls");
                let scenePath = this.levelUrl;
                let scene = Laya.loader.getRes(scenePath);
                if (scene) {
                    this.createSceneComplete(scene);
                } else { }
            }
            createSceneComplete(scene) {
                this.curScene = scene;
                let infoCfg = CCfgMgr.Ins.cfgTrack.getItem(DataMgr.Ins.currTrackId);
                this.levelInfoCfg = infoCfg;
                this.isOpposite = false;
                Laya.stage.addChildAt(scene, 0);
                scene.enableFog = true;
                scene.fogColor = new Laya.Vector3(.9, .9, .9);
                scene.fogStart = 100;
                scene.fogRange = 200;
                let spline = scene.getChildByName("spline");
                let flyPointList = scene.getChildByName("flyPointList");
                let flyPointCount = flyPointList ? flyPointList.numChildren : 0;
                let pawList = scene.getChildByName("jixiebi_List");
                if (pawList) {
                    let pawListCount = pawList.numChildren;
                    for (let i = 0; i < pawListCount; i++) {
                        pawList.getChildAt(i).addComponent(PawScript);
                    }
                }
                if (GameMgr.Ins.curGameMode == E_GAME_MODE.MULTIPLAYER_SPEED_GAME || GameMgr.Ins.curGameMode == E_GAME_MODE.SINGLE_SPEED_GAME) {
                    this.propBoxSpace = 600;
                } else {
                    this.propBoxSpace = 200;
                }
                this.splineRoot = spline;
                this.flyLineNodes = [];
                this.flyLineCurves = [];
                let levelJson = "cfg/level" + DataMgr.Ins.currTrackId + ".json";
                let cfg = Laya.loader.getRes(levelJson);
                cfg && this.initLevelRoad(cfg);
                for (let i = 0; i < flyPointCount; i++) {
                    if (!GameMgr.Ins.isGuideGame) {
                        let url = "cfg/level" + DataMgr.Ins.currTrackId + "flyline" + (i + 1) + ".json";
                        Laya.loader.load(url, Laya.Handler.create(this, this.initFlyLine));
                        let oriDoor = flyPointList.getChildAt(i);
                        let fps = oriDoor.addComponent(FlyPointScript);
                        fps.gameDis = infoCfg["flyPoint" + (i + 1).toString()];
                    } else {
                        flyPointList.getChildAt(i).destroy();
                    }
                }
                if (this.waitPlayer) {
                    this.addPlayer(this.waitPlayer);
                    this.waitPlayer = null;
                }
            }
            printNodes() {
                let p0;
                let p1;
                let d0;
                let d1;
                let result = [];
                let begin = true;
                for (let i = 0; i < this.allDistance; i += 1) {
                    d0 = this.getDirByDistance(i + 0);
                    d1 = this.getDirByDistance(i + 15);
                    p0 = this.getPosByDistance(i + 0);
                    let a1 = UsefulStuff.Angle2(new Laya.Vector3(d0.x, 0, d0.z), new Laya.Vector3(d1.x, 0, d1.z));
                    if (a1 > 10) {
                        if (begin) {
                            result.push(p0);
                            result.push(d0);
                            begin = false;
                        }
                    } else {
                        if (!begin) {
                            result.push(p0);
                            result.push(d0);
                            begin = true;
                        }
                    }
                }
                for (let i = 0; i + 3 < result.length; i += 4) {
                    let p0 = result[i + 0];
                    let d0 = result[i + 1];
                    let p1 = result[i + 2];
                    let d1 = result[i + 3];
                    if (i % 4 == 0) {
                        this.addBoxAt(p0, d0, true);
                        this.addBoxAt(p1, d1, false);
                    }
                }
            }
            addBoxAt(pos, dir, start) {
                let driftHint3D = Laya.loader.getRes("unity/prop/Conventional/UI_Draft.lh");
                if (driftHint3D) {
                    let box = Laya.Sprite3D.instantiate(driftHint3D, this.splineRoot);
                    box.transform.localPosition = new Laya.Vector3(-pos.x, pos.y, pos.z);
                    let out = new Laya.Quaternion();
                    Laya.Quaternion.rotationLookAt(dir, this._up1, out);
                    box.transform.localRotation = out;
                    box.transform.rotate(new Laya.Vector3(0, -Math.PI / 2, 0), true);
                    box.transform.scale = new Laya.Vector3(.5, .5, .5);
                }
            }
            addPlayer(player) {
                if (this.splineRoot) this.splineRoot.addChild(player); else this.waitPlayer = player;
            }
            revertScene() { }
            initLevelRoad(res) {
                this.curLevelNodes = [];
                for (let i = 0; i < res.length; i++) {
                    let info = res[i];
                    let p = info["position"];
                    let d = info["direction"];
                    let pos = new Laya.Vector3(p.x, p.y, p.z);
                    let dir = new Laya.Vector3(d.x, d.y, d.z);
                    let node = new SplineNode(pos, dir);
                    this.curLevelNodes.push(node);
                }
                this.RefreshCurves();
                if (this.hasBooster) {
                    let boosterNum = Math.floor(this.allDistance / this.boosterSpace);
                    let model = Laya.loader.getRes(LoadMgr.Ins.unityResPath(E_UNITY_RES_PATH.PROP, "obj_booster_y.lh"));
                    for (let i = 1; i < boosterNum; i++) {
                        let booster = Laya.Sprite3D.instantiate(model);
                        if (!this.openParticle) {
                            booster.getChildAt(3).destroy();
                            booster.getChildAt(2).destroy();
                        }
                        this.splineRoot.addChild(booster);
                        let rndDis = i * this.boosterSpace + UsefulStuff.rnd(-100, 100);
                        let rndOffset = UsefulStuff.rnd(-3.5, 3.5);
                        let boInfo = new PropInfo(rndDis, rndOffset, booster);
                        let pos = this.getPosByDistance(rndDis);
                        let dir = this.getDirByDistance(rndDis);
                        let rot = new Laya.Quaternion(0, 0, 0, 0);
                        let p1 = new Laya.Vector3(0, 0, 0);
                        let p2 = new Laya.Vector3(0, 0, 0);
                        let upVector = new Laya.Vector3(0, 0, 0);
                        Laya.Vector3.cross(new Laya.Vector3(0, 1, 0), dir, p1);
                        Laya.Vector3.normalize(p1, p2);
                        Laya.Vector3.cross(dir, p2, upVector);
                        booster.addComponent(BoosterScript);
                        if (dir && pos) {
                            Laya.Quaternion.rotationLookAt(dir, upVector, rot);
                            let realRot = new Laya.Quaternion(-rot.x, rot.y, rot.z, rot.w);
                            booster.transform.localRotation = realRot;
                            booster.transform.localPosition = new Laya.Vector3(-pos.x, pos.y, pos.z);
                            booster.transform.rotate(new Laya.Vector3(0, 180, 0), true, false);
                            booster.transform.translate(new Laya.Vector3(rndOffset, .1, 0), true);
                            this.curBoosters.push(boInfo);
                        }
                    }
                }
                if (this.hasWall) {
                    let wallNum = Math.floor(this.allDistance / this.wallSpace);
                    let wallModel = Laya.loader.getRes("unity/prop/Conventional/obj_wall.lh");
                    for (let i = 1; i < wallNum; i++) {
                        let wall = Laya.Sprite3D.instantiate(wallModel);
                        this.splineRoot.addChild(wall);
                        let rndDis = i * this.wallSpace + UsefulStuff.rnd(-5, 5);
                        let rndOffset = UsefulStuff.rnd(-2, 2);
                        let boInfo = new PropInfo(rndDis, rndOffset, wall);
                        wall.addComponent(WallScript);
                        let pos = this.getPosByDistance(rndDis);
                        let dir = this.getDirByDistance(rndDis);
                        let rot = new Laya.Quaternion(0, 0, 0, 0);
                        if (dir && pos) {
                            Laya.Quaternion.rotationLookAt(dir, new Laya.Vector3(0, 1, 0), rot);
                            let realRot = new Laya.Quaternion(-rot.x, rot.y, rot.z, rot.w);
                            wall.transform.localRotation = realRot;
                            wall.transform.rotate(new Laya.Vector3(0, 180, 0), true, false);
                            wall.transform.localPosition = new Laya.Vector3(-pos.x, pos.y, pos.z);
                            wall.transform.translate(new Laya.Vector3(rndOffset, .2, 0), true);
                            this.curWalls.push(boInfo);
                        }
                    }
                }
                if (this.hasSBox) {
                    let propBoxNum = Math.floor(this.allDistance / this.propBoxSpace);
                    var url = LoadMgr.Ins.unityResPath(E_UNITY_RES_PATH.PROP, "obj_box.lh");
                    let propBoxModel = Laya.loader.getRes(url);
                    for (let i = 1; i < propBoxNum; i++) {
                        let rndDis = i * this.propBoxSpace + 20;
                        for (let j = 0; j < 4; j++) {
                            let propBox = Laya.Sprite3D.instantiate(propBoxModel);
                            this.splineRoot.addChild(propBox);
                            let rndOffset = -6 + 4 * j;
                            propBox.addComponent(propBoxScript);
                            let boInfo = new PropInfo(rndDis, rndOffset, propBox);
                            let pos = this.getPosByDistance(rndDis);
                            let dir = this.getDirByDistance(rndDis);
                            let rot = new Laya.Quaternion(0, 0, 0, 0);
                            if (dir && pos) {
                                Laya.Quaternion.rotationLookAt(dir, new Laya.Vector3(0, 1, 0), rot);
                                let realRot = new Laya.Quaternion(-rot.x, rot.y, rot.z, rot.w);
                                propBox.transform.localRotation = realRot;
                                propBox.transform.rotate(new Laya.Vector3(0, 180, 0), true, false);
                                propBox.transform.localPosition = new Laya.Vector3(-pos.x, pos.y, pos.z);
                                propBox.transform.translate(new Laya.Vector3(rndOffset, .3, 0), true);
                                this.curShieldBoxs.push(boInfo);
                            }
                        }
                    }
                }
            }
            initFlyLine(res) {
                if (!res) return;
                let flyLineNode = [];
                for (let i = 0; i < res.length; i++) {
                    let info = res[i];
                    let p = info["position"];
                    let d = info["direction"];
                    let pos = new Laya.Vector3(p.x, p.y, p.z);
                    let dir = new Laya.Vector3(d.x, d.y, d.z);
                    let node = new SplineNode(pos, dir);
                    flyLineNode.push(node);
                }
                this.flyLineNodes.push(flyLineNode);
                this.RefreshFlyLine(flyLineNode);
            }
            RefreshFlyLine(flyLineNode) {
                let flyLineCurve = [];
                for (let i = 0; i < flyLineNode.length - 1; i++) {
                    let n = flyLineNode[i];
                    let next = flyLineNode[i + 1];
                    let curve = new CubicBezierCurve(n, next);
                    flyLineCurve.push(curve);
                }
                this.flyLineCurves.push(flyLineCurve);
            }
            RefreshCurves() {
                this.curLevelCurves = [];
                for (let i = 0; i < this.curLevelNodes.length - 1; i++) {
                    let n = this.curLevelNodes[i];
                    let next = this.curLevelNodes[i + 1];
                    let curve = new CubicBezierCurve(n, next);
                    this.curLevelCurves.push(curve);
                    this.allDistance += curve.Length;
                }
            }
            createRocket(type) {
                let rocketModel;
                if (type == E_PROP_TYPE.ROCKET_LINE) rocketModel = Laya.loader.getRes(LoadMgr.Ins.unityResPath(E_UNITY_RES_PATH.PROP, "obj_rocket_g.lh")); else if (type == E_PROP_TYPE.ROCKET_FOLLOW) rocketModel = Laya.loader.getRes(LoadMgr.Ins.unityResPath(E_UNITY_RES_PATH.PROP, "obj_rocket_y.lh")); else if (type == E_PROP_TYPE.ROCKET_FIRST) rocketModel = Laya.loader.getRes(LoadMgr.Ins.unityResPath(E_UNITY_RES_PATH.PROP, "obj_rocket_r.lh"));
                let rocket = Laya.Sprite3D.instantiate(rocketModel);
                let _rocketScript = rocket.addComponent(RocketScript);
                _rocketScript.type = type;
                return rocket;
            }
            createBanana() {
                let bananaModel;
                bananaModel = Laya.loader.getRes(LoadMgr.Ins.unityResPath(E_UNITY_RES_PATH.PROP, "obj_banana.lh"));
                let banana = Laya.Sprite3D.instantiate(bananaModel);
                let _banana = banana.addComponent(BananaScript);
                return banana;
            }
            createBomb() { }
            getPosByDistance1(targetDis) {
                if (this.curLevelCurves && this.curLevelCurves.length > 0) {
                    let realDis = 0;
                    if (!this.isOpposite) {
                        if (targetDis > this.allDistance) {
                            let round = Math.floor(targetDis / this.allDistance);
                            realDis = targetDis - this.allDistance * round;
                        } else {
                            realDis = targetDis;
                        }
                    } else {
                        if (targetDis > this.allDistance) {
                            let round = Math.floor(targetDis / this.allDistance);
                            realDis = this.allDistance * round - targetDis;
                        } else {
                            realDis = this.allDistance - targetDis;
                        }
                    }
                    let startDis = 0;
                    let endDis = 0;
                    let pos = new Laya.Vector3(0, 0, 0);
                    for (let i = 0; i < this.curLevelCurves.length; i++) {
                        let n = this.curLevelCurves[i];
                        endDis = startDis + n.Length;
                        if (realDis >= startDis && realDis < endDis) {
                            let t = realDis - startDis;
                            pos = n.GetSampleAtDistance(t).location;
                            break;
                        } else {
                            startDis = endDis;
                        }
                    }
                    return pos;
                }
                return;
            }
            getPosByDistanceFly(targetDis, flyPointID) {
                if (this.flyLineCurves[flyPointID - 1] && this.flyLineCurves[flyPointID - 1].length > 0) {
                    let flyLineCurve = this.flyLineCurves[flyPointID - 1];
                    let startDis = 0;
                    let endDis = 0;
                    let pos;
                    for (let i = 0; i < flyLineCurve.length; i++) {
                        let n = flyLineCurve[i];
                        endDis = startDis + n.Length;
                        if (targetDis >= startDis && targetDis < endDis) {
                            let t = targetDis - startDis;
                            pos = n.GetSampleAtDistance(t).location;
                            break;
                        } else {
                            startDis = endDis;
                        }
                    }
                    return pos;
                }
                return;
            }
            getDirByDistanceFly(targetDis, flyPointID) {
                if (this.flyLineCurves[flyPointID - 1] && this.flyLineCurves[flyPointID - 1].length > 0) {
                    let flyLineCurve = this.flyLineCurves[flyPointID - 1];
                    let startDis = 0;
                    let endDis = 0;
                    let dir;
                    for (let i = 0; i < flyLineCurve.length; i++) {
                        let n = flyLineCurve[i];
                        endDis = startDis + n.Length;
                        if (targetDis >= startDis && targetDis < endDis) {
                            let t = (targetDis - startDis) / (endDis - startDis);
                            dir = n.GetTangent(t);
                            dir = new Laya.Vector3(dir.x, dir.y, dir.z);
                            break;
                        } else {
                            startDis = endDis;
                        }
                    }
                    return dir;
                }
                return;
            }
            GetProjectionSample(pointToProject) {
                let closest = null;
                let minSqrDistance = 99999999;
                let minCurveIndex = 0;
                for (let i = 0; i < this.curLevelCurves.length; i++) {
                    let projection = this.curLevelCurves[i].GetProjectionSample(pointToProject);
                    if (this.curLevelCurves[i] == this.curLevelCurves[0]) {
                        closest = projection;
                        minSqrDistance = Laya.Vector3.distanceSquared(projection.location, pointToProject);
                        continue;
                    }
                    let sqrDist = Laya.Vector3.distanceSquared(projection.location, pointToProject);
                    if (sqrDist < minSqrDistance) {
                        minSqrDistance = sqrDist;
                        closest = projection;
                        minCurveIndex = i;
                    }
                }
                if (minSqrDistance < 1e3) {
                    let gameDis = 0;
                    for (let i = 0; i < minCurveIndex; i++) {
                        gameDis += this.curLevelCurves[i].Length;
                    }
                    gameDis += closest.distanceInCurve;
                    let closePos = new Laya.Vector3(closest.location.x, 0, closest.location.z);
                    let pointPos = new Laya.Vector3(pointToProject.x, 0, pointToProject.z);
                    let twoPosRot = new Laya.Vector2(closest.location.x - pointToProject.x, closest.location.z - pointToProject.z);
                    let roadRot = new Laya.Vector2(closest.tangent.x, closest.tangent.z);
                    let cross = twoPosRot.x * roadRot.y - twoPosRot.y * roadRot.x;
                    let offset = Laya.Vector3.distance(closePos, pointPos);
                    if (this.isOpposite) {
                        if (cross > 0) {
                            offset = -offset;
                        }
                    } else {
                        if (cross < 0) {
                            offset = -offset;
                        }
                    }
                    let realDis = 0;
                    if (!this.isOpposite) {
                        realDis = gameDis;
                        if (gameDis > this.allDistance) {
                            console.log("null1");
                            return;
                        }
                    } else {
                        realDis = this.allDistance - gameDis;
                        if (gameDis < 0) {
                            console.log("null2");
                            return;
                        }
                    }
                    return [realDis, offset];
                } else {
                    return null;
                }
            }
            getDirByDistance(d) {
                if (d < 0 || d > this.allDistance) d = d % this.allDistance;
                if (this.isOpposite) {
                    for (let i = this.curLevelCurves.length - 1; i >= 0; i--) {
                        let curve = this.curLevelCurves[i];
                        if (d > curve.Length && d < curve.Length + 1e-4) {
                            d = curve.Length;
                        }
                        if (d > curve.Length) {
                            d -= curve.Length;
                        } else {
                            return curve.GetSampleAtDistance(curve.Length - d).tangent;
                        }
                    }
                } else {
                    for (let i = 0; i < this.curLevelCurves.length; i++) {
                        let curve = this.curLevelCurves[i];
                        if (d > curve.Length && d < curve.Length + 1e-4) {
                            d = curve.Length;
                        }
                        if (d > curve.Length) {
                            d -= curve.Length;
                        } else {
                            let sam = curve.GetSampleAtDistance(d);
                            if (sam) {
                                return sam.tangent;
                            } else {
                                return new Laya.Vector3(0, 0, 0);
                            }
                        }
                    }
                }
                return new Laya.Vector3();
            }
            getPosByDistance(d) {
                if (d < 0 || d > this.allDistance) d = d % this.allDistance;
                if (this.isOpposite) {
                    for (let i = this.curLevelCurves.length - 1; i >= 0; i--) {
                        let curve = this.curLevelCurves[i];
                        if (d > curve.Length && d < curve.Length + 1e-4) {
                            d = curve.Length;
                        }
                        if (d > curve.Length) {
                            d -= curve.Length;
                        } else {
                            return curve.GetSampleAtDistance(curve.Length - d).location;
                        }
                    }
                } else {
                    for (let i = 0; i < this.curLevelCurves.length; i++) {
                        let curve = this.curLevelCurves[i];
                        if (d > curve.Length && d < curve.Length + 1e-4) {
                            d = curve.Length;
                        }
                        if (d > curve.Length) {
                            d -= curve.Length;
                        } else {
                            return curve.GetSampleAtDistance(d).location;
                        }
                    }
                }
                return new Laya.Vector3();
            }
            getDirByDistance1(targetDis) {
                if (this.curLevelCurves && this.curLevelCurves.length > 0) {
                    let realDis = 0;
                    if (!this.isOpposite) {
                        if (targetDis > this.allDistance) {
                            let round = Math.floor(targetDis / this.allDistance);
                            realDis = targetDis - this.allDistance * round;
                        } else realDis = targetDis;
                    } else {
                        if (targetDis > this.allDistance) {
                            let round = Math.floor(targetDis / this.allDistance);
                            realDis = this.allDistance * round - targetDis;
                        } else realDis = this.allDistance - targetDis;
                    }
                    let startDis = 0;
                    let endDis = 0;
                    let dir = new Laya.Vector3(0, 0, 0);
                    let up = new Laya.Vector3(0, 0, 0);
                    for (let i = 0; i < this.curLevelCurves.length; i++) {
                        let n = this.curLevelCurves[i];
                        endDis = startDis + n.Length;
                        if (realDis >= startDis && realDis < endDis) {
                            let t = (realDis - startDis) / (endDis - startDis);
                            dir = n.GetTangent(t);
                            if (this.isOpposite) {
                                dir = new Laya.Vector3(-dir.x, -dir.y, -dir.z);
                            } else {
                                dir = new Laya.Vector3(dir.x, dir.y, dir.z);
                            }
                            break;
                        } else {
                            startDis = endDis;
                        }
                    }
                    return dir;
                }
                return;
            }
            getLapByDis(dis) {
                return Math.floor(dis / this.allDistance);
            }
            getQuaByDistance(targetDis) {
                if (this.curLevelCurves && this.curLevelCurves.length > 0) {
                    let realDis = 0;
                    if (!this.isOpposite) {
                        realDis = targetDis;
                        if (targetDis > this.allDistance) return;
                    } else {
                        realDis = this.allDistance - targetDis;
                        if (targetDis < 0) return;
                    }
                    let startDis = 0;
                    let endDis = 0;
                    let dir = new Laya.Vector3(0, 0, 0);
                    let up = new Laya.Vector3(0, 0, 0);
                    let rot;
                    for (let i = 0; i < this.curLevelCurves.length; i++) {
                        let n = this.curLevelCurves[i];
                        endDis = startDis + n.Length;
                        if (realDis > startDis && realDis < endDis) {
                            let t = (realDis - startDis) / (endDis - startDis);
                            rot = n.GetSample(t).Rotation;
                            break;
                        } else {
                            startDis = endDis;
                        }
                    }
                    return rot;
                }
                return;
            }
            battlePropFeature(target, prop = E_PROP_TYPE.NONE) {
                if (!this.battleCamera) {
                    this.battleCamera = new Laya.Camera(0, .1, 1e3);
                    window["featureWin"] = this.battleCamera;
                    this.battleCamera.enableHDR = false;
                    target.addChild(this.battleCamera);
                    this.battleCamera.transform.localPosition = new Laya.Vector3(0, 5, 0);
                    this.battleCamera.transform.localRotationEuler = new Laya.Vector3(-90, 0, 0);
                    let scaleX = 152 / Laya.stage.width * GlobalScale$1.scale;
                    let scaleY = 152 / Laya.stage.height * GlobalScale$1.scale;
                    let posX = 180 / Laya.stage.width * GlobalScale$1.scale;
                    let posY = 250 / Laya.stage.height * GlobalScale$1.scale;
                    this.battleCamera.normalizedViewport = new Laya.Viewport(posX, posY, scaleX, scaleY);
                    Laya.timer.once(2500, this, this.closeFeatureCamera);
                    EventMgr.Ins.dispatch(EventType.BATTLE_PROP_FEATURE, prop);
                }
            }
            closeFeatureCamera() {
                if (this.battleCamera && !this.battleCamera.destroyed) {
                    this.battleCamera.destroy();
                    EventMgr.Ins.dispatch(EventType.BATTLE_PROP_FEATURE_CLOSE);
                }
                this.battleCamera = null;
            }
            createUIScene(modelParent = null) {
                if (!this.UICamera) {
                    this.UIScene = new Laya.Scene3D();
                    this.UIScene.ambientColor = new Laya.Vector3(1, 1, 1);
                    this.UICamera = new Laya.Camera();
                    this.UICamera.enableHDR = false;
                    this.UILight = new Laya.DirectionLight();
                    this.UILight.transform.rotationEuler = new Laya.Vector3(-30, 0, 0);
                    this.UILight.intensity = .35;
                    window["uilight"] = this.UILight;
                    this.UIScene.addChild(this.UICamera);
                    this.UIScene.addChild(this.UILight);
                    let uiScene = Laya.loader.getRes("unity/level/Conventional/uiscene.ls");
                    if (uiScene) {
                        let uiLight = uiScene.getChildAt(0);
                        if (uiLight) {
                            let light = Laya.Sprite3D.instantiate(uiLight);
                            this.UIScene.addChild(light);
                        }
                    }
                    this.UICamera.clearFlag = 2;
                    if (!modelParent) Laya.stage.addChild(this.UIScene); else modelParent.addChild(this.UIScene);
                }
            }
            creatTouchEffScene() {
                if (!this.touchEffScene) {
                    this.touchEffScene = new Laya.Scene3D();
                    this.touchEffCamera = new Laya.Camera();
                    this.touchEffCamera.enableHDR = false;
                    this.touchEffCamera.clearFlag = 2;
                    this.touchEffCamera.fieldOfView = 50;
                    this.touchEffCamera.orthographic = true;
                    this.touchEffScene.addChild(this.touchEffCamera);
                }
                Laya.stage.addChild(this.touchEffScene);
            }
            creatTouchEff(x, y, dis) {
                if (!this.touchEffScene || !this.touchEffCamera) {
                    return;
                }
                if (!Laya.loader.getRes("unity/touchEff/Conventional/Eff_TouchScreen.lh")) return;
                if (this.currTouchEffNum >= 5) {
                    this.currTouchEffNum = 5;
                    return;
                }
                this.currTouchEffNum++;
                let toucheff = Laya.Sprite3D.instantiate(Laya.loader.getRes("unity/touchEff/Conventional/Eff_TouchScreen.lh"));
                this.touchEffScene.addChild(toucheff);
                let wPos = new Laya.Vector3();
                this.touchEffCamera.convertScreenCoordToOrthographicCoord(new Laya.Vector3(x, y, 0), wPos);
                toucheff.transform.position = wPos;
                toucheff.transform.setWorldLossyScale(new Laya.Vector3(dis, dis, dis));
                Laya.timer.once(900, this, () => {
                    toucheff.destroy();
                    this.currTouchEffNum--;
                    if (this.currTouchEffNum < 0) this.currTouchEffNum = 0;
                }, null, false);
            }
            clearTouchEffScene() {
                if (this.touchEffScene) {
                    this.currTouchEffNum = 0;
                    Laya.stage.removeChild(this.touchEffScene);
                }
            }
            creatLvUpEffect(parentNode) {
                if (!this.LvUpEffect) {
                    this.LvUpEffect = Laya.Sprite3D.instantiate(Laya.loader.getRes("unity/prop/Conventional/shengji.lh"));
                    parentNode && parentNode.addChild(this.LvUpEffect);
                }
            }
            playLvUpEffect() {
                if (this.LvUpEffect) {
                    let anim = this.LvUpEffect.getComponent(Laya.Animator);
                    anim.play("shengji", 0, 0);
                }
            }
            clearLvUpEffect() {
                if (this.LvUpEffect) {
                    this.LvUpEffect.destroy();
                    this.LvUpEffect = null;
                }
            }
            createUIVFX(skinUrl, x, y, dis, FOV = 60, modelParent = null) {
                if (!this.UICamera) this.createUIScene(modelParent);
                let VFXModel = Laya.loader.getRes(skinUrl);
                if (VFXModel) {
                    let VFX = Laya.Sprite3D.instantiate(VFXModel);
                    this.UICamera.addChild(VFX);
                    this.UICamera.fieldOfView = FOV;
                    let wPos = UsefulStuff.UIVFXPos(this.UICamera, x, y, dis);
                    return VFX;
                }
                return null;
            }
            clearUIScene() {
                if (this.UIScene) {
                    this.UICamera = null;
                    this.UIScene.destroy();
                }
            }
            clearScene() {
                if (this.curScene) {
                    this.curScene.destroyed || this.curScene.destroy();
                    this.curScene = null;
                    Laya.loader.clearRes(this.levelUrl);
                    this.curLevelNodes = [];
                    this.curLevelCurves = [];
                    this.curBoosters = [];
                    this.curWalls = [];
                    this.curJumpPlane = [];
                    this.curShieldBoxs = [];
                    this.curRocketBoxs = [];
                    this.allDistance = 0;
                }
            }
            onTouchEvent() {
                this.offTouchEvent();
                this.creatTouchEffScene();
                Laya.stage.on(Laya.Event.MOUSE_DOWN, this, this.mouseDown);
            }
            offTouchEvent() {
                this.clearTouchEffScene();
                Laya.stage.off(Laya.Event.MOUSE_DOWN, this, this.mouseDown);
            }
            mouseDown() {
                SceneMgr.Ins && SceneMgr.Ins.creatTouchEff(Laya.stage.mouseX, Laya.stage.mouseY, 3.5);
            }
        }
        class CameraMoveScript extends Laya.Script3D {
            constructor() {
                super();
                this.lastMouseX = 0;
                this.lastMouseY = 0;
                this._tempVector3 = new Laya.Vector3();
                this.yawPitchRoll = new Laya.Vector3();
                this.resultRotation = new Laya.Quaternion();
                this.tempRotationZ = new Laya.Quaternion();
                this.tempRotationX = new Laya.Quaternion();
                this.tempRotationY = new Laya.Quaternion();
                this.rotaionSpeed = 6e-5;
            }
            onAwake() {
                Laya.stage.on(Laya.Event.RIGHT_MOUSE_DOWN, this, this.mouseDown);
                Laya.stage.on(Laya.Event.RIGHT_MOUSE_UP, this, this.mouseUp);
                this.camera = this.owner;
            }
            _onDestroy() {
                Laya.stage.off(Laya.Event.RIGHT_MOUSE_DOWN, this, this.mouseDown);
                Laya.stage.off(Laya.Event.RIGHT_MOUSE_UP, this, this.mouseUp);
            }
            onUpdate() {
                var elapsedTime = Laya.timer.delta;
                if (!isNaN(this.lastMouseX) && !isNaN(this.lastMouseY) && this.isMouseDown) {
                    var scene = this.owner.scene;
                    Laya.KeyBoardManager.hasKeyDown(87) && this.moveForward(-.01 * elapsedTime);
                    Laya.KeyBoardManager.hasKeyDown(83) && this.moveForward(.01 * elapsedTime);
                    Laya.KeyBoardManager.hasKeyDown(65) && this.moveRight(-.01 * elapsedTime);
                    Laya.KeyBoardManager.hasKeyDown(68) && this.moveRight(.01 * elapsedTime);
                    Laya.KeyBoardManager.hasKeyDown(81) && this.moveVertical(.01 * elapsedTime);
                    Laya.KeyBoardManager.hasKeyDown(69) && this.moveVertical(-.01 * elapsedTime);
                    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;
            }
            mouseDown(e) {
                this.camera.transform.localRotation.getYawPitchRoll(this.yawPitchRoll);
                this.lastMouseX = Laya.stage.mouseX;
                this.lastMouseY = Laya.stage.mouseY;
                this.isMouseDown = true;
            }
            mouseUp(e) {
                this.isMouseDown = false;
            }
            moveForward(distance) {
                this._tempVector3.x = 0;
                this._tempVector3.y = 0;
                this._tempVector3.z = distance;
                this.camera.transform.translate(this._tempVector3);
            }
            moveRight(distance) {
                this._tempVector3.y = 0;
                this._tempVector3.z = 0;
                this._tempVector3.x = distance;
                this.camera.transform.translate(this._tempVector3);
            }
            moveVertical(distance) {
                this._tempVector3.x = this._tempVector3.z = 0;
                this._tempVector3.y = distance;
                this.camera.transform.translate(this._tempVector3, false);
            }
            updateRotation() {
                if (Math.abs(this.yawPitchRoll.y) < 1.5) {
                    Laya.Quaternion.createFromYawPitchRoll(this.yawPitchRoll.x, this.yawPitchRoll.y, this.yawPitchRoll.z, this.tempRotationZ);
                    this.tempRotationZ.cloneTo(this.camera.transform.localRotation);
                    this.camera.transform.localRotation = this.camera.transform.localRotation;
                }
            }
        }
        const wx = window["wx"];
        var E_CAR_ANI_NAME$1;
        (function (E_CAR_ANI_NAME) {
            E_CAR_ANI_NAME["RUN"] = "Car_run";
        })(E_CAR_ANI_NAME$1 || (E_CAR_ANI_NAME$1 = {}));
        class SelfScript extends CarScript {
            constructor() {
                super(...arguments);
                this.racePos = 0;
                this.propBak1 = 0;
                this.propBak2 = 0;
                this.TestIn = 0;
                this.TestIn2 = 0;
                this.TestSx = 0;
                this.moveMouseX = 0;
                this.isRace = false;
                this.isTurnLeft = false;
                this.isTurnRight = false;
                this.offsetSpeed = 0;
                this._rotateCam = false;
                this.isReady = false;
                this.driftCorner = false;
                this.userDrifting = false;
                this.viewRange = 5;
                this.gameDis = 5;
                this.gSpeed = -.1;
                this.speedXDelta = .08;
                this.speedSupply = 0;
                this.driftScore = 0;
                this.undriftScore = 0;
                this.lastLocalEY = 0;
                this.driftValue = 0;
                this.lastIertia = 0;
                this._zero = new Laya.Vector3();
            }
            onAwake() {
                this.init();
                window["self1"] = this;
            }
            onStart() {
                EventMgr.Ins.on(EventType.USEPROPCARD, this, this.onUsePropCard);
                this.startPos();
            }
            onTestIN(value) {
                this.TestIn = value;
            }
            onTestIN2(value) {
                this.TestIn2 = value;
            }
            onTestSX(value) {
                this.TestSx = value;
            }
            init() {
                super.init();
                this.m_CameraRoot = this.m_sprite3D.getChildAt(0);
                this.mCamera = this.m_CameraRoot.getChildAt(0);
                this.mCamera.addComponent(CameraMoveScript);
                this.mCamera.clearFlag = 1;
                this.speedLine = this.mCamera.getChildAt(0);
                if (this.speedLine) {
                    this.speedLine.active = false;
                }
                this.rotateCam = false;
                this.isRace = true;
                this.isReady = false;
                this.levelCfg = CCfgMgr.Ins.cfgTrack.getItem(DataMgr.Ins.currTrackId);
                this.gameDis = .001;
                this.curOffset = -6 + this.racePos * 4;
                this.LBPro = 0;
                this.PlayerName = DataMgr.Ins.playerName;
                this.speedXDelta = .004 * this.carCfg.cfg.handleNature;
                window["selfSc"] = this;
                EventMgr.Ins.on(EventType.TIMEFIBER, this, this.startDrive);
            }
            onDisable() {
                EventMgr.Ins.offAllCaller(this);
                this.rotateCam = false;
            }
            onTriggerEnter(other) {
                super.onTriggerEnter(other);
            }
            onStageMouseDown(e) {
                this.moveMouseX = Laya.stage.mouseX;
                this.offsetSpeed = 1;
            }
            get rotateCam() {
                return this._rotateCam;
            }
            set rotateCam(x) {
                if (this._rotateCam != x) {
                    if (x) {
                        Laya.timer.loop(1, this, this.aroundCameraLoop);
                    } else {
                        Laya.timer.clear(this, this.aroundCameraLoop);
                    }
                }
                this._rotateCam = x;
            }
            onStageMouseUp(e) {
                this.curSpeedX = 0;
            }
            onBattleLeftDown() {
                this.isTurnLeft = true;
            }
            onBattleRightDown() {
                this.isTurnRight = true;
            }
            onBattleLeftUp() {
                this.isTurnLeft = false;
            }
            onBattleRightUp() {
                this.isTurnRight = false;
            }
            onBattleContorl(value) {
                if (value == 0) {
                    this.isTurnLeft = false;
                    this.isTurnRight = false;
                    this.m_ActorScript.playDrive();
                } else if (value < 0) {
                    this.isTurnLeft = true;
                    this.isTurnRight = false;
                    this.curSpeedX = this.speedXDelta * (this.isReverse ? -1 : 1) * value;
                    if (value < -.5) this.m_ActorScript.playLeft(); else this.m_ActorScript.playDrive();
                } else {
                    this.isTurnLeft = false;
                    this.isTurnRight = true;
                    this.curSpeedX = this.speedXDelta * (this.isReverse ? -1 : 1) * value;
                    if (value > .5) this.m_ActorScript.playRight(); else this.m_ActorScript.playDrive();
                }
            }
            Ready() {
                this.isReady = false;
                EventMgr.Ins.on(EventType.BATTLE_CONTORL, this, this.onBattleContorl);
                EventMgr.Ins.on(EventType.CHANGECAMERA, this, this.refreshCamera);
                EventMgr.Ins.on(EventType.USEPROP1MSG, this, this.onUseProp1Msg);
                EventMgr.Ins.on(EventType.USEPROP2MSG, this, this.onUseProp2Msg);
                EventMgr.Ins.on(EventType.USELB, this, this.onUseLB);
                EventMgr.Ins.on(EventType.STARTRUSH, this, this.onStartRush);
                EventMgr.Ins.on(EventType.START_DRIFT, this, this.onStartDrift);
                EventMgr.Ins.on(EventType.STOP_DRIFT, this, this.onStopDrift);
                this.battleCamera();
                Laya.timer.once(4500, this, this.ReadyGo);
                if (GameMgr.Ins.gameCardArray.length > 0) {
                    for (var i = 0; i < GameMgr.Ins.gameCardArray.length; i++) {
                        this.getProp(GameMgr.Ins.gameCardArray[i]);
                    }
                }
                EventMgr.Ins.dispatch(EventType.GETPROPMSG);
            }
            ReadyGo() {
                this.isReady = true;
            }
            onStartDrift() {
                this && (this.userDrifting = true);
            }
            onStopDrift() {
                this && (this.userDrifting = false);
            }
            onUseProp1Msg() {
                super.onUseProp1Msg();
                if (this.propBak1 > 0) {
                    this.getProp(this.propBak1);
                    this.propBak1 = 0;
                    EventMgr.Ins.dispatch(EventType.GETPROPMSG);
                } else if (this.propBak2 > 0) {
                    this.getProp(this.propBak2);
                    this.propBak2 = 0;
                    EventMgr.Ins.dispatch(EventType.GETPROPMSG);
                }
            }
            onUseProp2Msg() {
                super.onUseProp2Msg();
                if (this.propBak1 > 0) {
                    this.getProp(this.propBak1);
                    this.propBak1 = 0;
                    EventMgr.Ins.dispatch(EventType.GETPROPMSG);
                } else if (this.propBak2 > 0) {
                    this.getProp(this.propBak2);
                    this.propBak2 = 0;
                    EventMgr.Ins.dispatch(EventType.GETPROPMSG);
                }
            }
            get isDrifting() {
                return this.driftCorner && this.userDrifting && this.isEdgeSlow;
            }
            startDrive(startFrame) {
                if (!GameMgr.Ins.isGameStart) return;
                if (GameMgr.Ins.isGameOver) {
                    return;
                }
                if (this.isFlying) {
                    this.flyDis += this.flySpeed;
                    let pos = SceneMgr.Ins.getPosByDistanceFly(this.flyDis, this.flyLineID);
                    let dir = SceneMgr.Ins.getDirByDistanceFly(this.flyDis, this.flyLineID);
                    let nextDir = SceneMgr.Ins.getDirByDistanceFly(this.flyDis + 15, this.flyLineID);
                    let rotR = new Laya.Quaternion(0, 0, 0, 0);
                    let rotC = new Laya.Quaternion(0, 0, 0, 0);
                    if (dir && pos) {
                        this.m_sprite3D.transform.localPosition = new Laya.Vector3(-pos.x, pos.y, pos.z);
                        Laya.Quaternion.rotationLookAt(dir, new Laya.Vector3(0, 1, 0), rotR);
                        let realRot = new Laya.Quaternion(-rotR.x, rotR.y, rotR.z, rotR.w);
                        this.m_sprite3D.transform.localRotation = realRot;
                        this.m_sprite3D.transform.rotate(new Laya.Vector3(0, 180, 0), true, false);
                        if (nextDir) {
                            Laya.Quaternion.rotationLookAt(nextDir, new Laya.Vector3(0, 1, 0), rotC);
                            let carRot = new Laya.Quaternion(-rotC.x, rotC.y, rotC.z, rotC.w);
                            this.m_selfP.transform.rotation = carRot;
                            this.m_selfP.transform.rotate(new Laya.Vector3(0, 180, 0), true, false);
                        }
                        this.m_sprite3D.transform.translate(new Laya.Vector3(0, .3, 0), true);
                    } else {
                        this.stopFly();
                    }
                    return;
                }
                if (this.isRace) {
                    if (this.isReady) {
                        if (!this.isFinish) {
                            this.curSpeed += this.maxSpeed / this.acceleration;
                        } else {
                            this.curSpeed *= .99;
                        }
                        this.addLBLoop();
                        if (this.curSpeed > this.maxSpeed) this.curSpeed = this.maxSpeed;
                        if (this.curSpeed < .001) this.curSpeed = 0;
                        if (this.controlled) {
                            if (this.isTurnLeft && this.isTurnRight) {
                                this.checkLineLiker(true);
                            } else if (this.isTurnLeft) {
                                this.checkLineLiker(false);
                            } else if (this.isTurnRight) {
                                this.checkLineLiker(false);
                            } else {
                                this.checkLineLiker(true);
                            }
                        } else {
                            if (this.beImpactLeft) {
                                this.curSpeedX -= .08;
                            }
                            if (this.beImpactRight) {
                                this.curSpeedX += .08;
                            }
                        }
                        this.curOffset -= Math.sin(this.curSpeedX);
                        if (Math.abs(this.curOffset) >= 8) {
                            if (!this.checkBuff(E_SKILL_BUFF.PHYISC_KING)) {
                                if (!GameMgr.Ins.isGuideGame && this.isEdgeSlow) this.curSpeed *= .95;
                            } else {
                                EventMgr.Ins.dispatch(EventType.HOLDSKILLMSG, this.skillCfg);
                            }
                            if (this.curOffset >= 8) {
                                this.curOffset = 8;
                                this.isEdgeSlow && this.playEdgeRight();
                                this.driftCorner && (this.driftInterrupted = true);
                            } else {
                                this.curOffset = -8;
                                this.isEdgeSlow && this.playEdgeLeft();
                                this.driftCorner && (this.driftInterrupted = true);
                            }
                        } else {
                            if (this.checkBuff(E_SKILL_BUFF.PHYISC_KING)) {
                                EventMgr.Ins.dispatch(EventType.STOPSKILLMSG, this.skillCfg);
                            }
                            this.closeEdge();
                        }
                        this.curSpeedX *= .5;
                        if (Math.abs(this.curSpeedX) < .001) this.curSpeedX = 0;
                        this.moveMouseX = Laya.stage.mouseX;
                    } else {
                        this.moveMouseX = Laya.stage.mouseX;
                    }
                    this.boosterUpdate();
                    if (this.isReady) {
                        this.checkFinish();
                        if (this.isFinish) {
                            this.rotateCam = true;
                        }
                    }
                    if (SceneMgr.Ins.openParticle) this.speedLineUpdate();
                    if (this.speedAdd > 1) this.speedAdd *= .9977;
                    if (this.speedAdd < 1) this.speedAdd = 1;
                    if (this.impulseSpeed > 0) this.impulseSpeed -= .001;
                    if (this.impulseSpeed < 0) this.impulseSpeed = 0;
                    if (this.speedAdd > 1 || this.impulseSpeed > 0) { } else { }
                    let spdAll = this.curSpeed * this.speedAdd + this.impulseSpeed;
                    this.gameDis += spdAll + this.speedSupply;
                    this.viewRange = 5;
                    let pos0 = SceneMgr.Ins.getPosByDistance(this.gameDis);
                    let dir0 = SceneMgr.Ins.getDirByDistance(this.gameDis);
                    let dir1 = SceneMgr.Ins.getDirByDistance(this.gameDis + this.viewRange);
                    let dir2 = SceneMgr.Ins.getDirByDistance(this.gameDis + 15);
                    let rot0 = new Laya.Quaternion(0, 0, 0, 0);
                    let rot1 = new Laya.Quaternion(0, 0, 0, 0);
                    let rot2 = new Laya.Quaternion(0, 0, 0, 0);
                    if (!this.isFinish) this.checkTrack();
                    if (dir0 && pos0) {
                        this.m_sprite3D.transform.localPosition = new Laya.Vector3(-pos0.x, pos0.y, pos0.z);
                        Laya.Quaternion.rotationLookAt(dir0, new Laya.Vector3(0, 1, 0), rot0);
                        Laya.Quaternion.rotationLookAt(dir1, new Laya.Vector3(0, 1, 0), rot1);
                        Laya.Quaternion.rotationLookAt(dir2, new Laya.Vector3(0, 1, 0), rot2);
                        let realRot = new Laya.Quaternion(-rot0.x, rot0.y, rot0.z, rot0.w);
                        this.m_sprite3D.transform.localRotation = realRot;
                        this.m_sprite3D.transform.rotate(new Laya.Vector3(0, 180, 0), true, false);
                        let angle2 = UsefulStuff.angleV3(new Laya.Vector3(dir0.x, 0, dir0.z), new Laya.Vector3(dir2.x, 0, dir2.z)) * 180 / Math.PI;
                        if (angle2 > 10) {
                            if (!this.driftCorner) {
                                this.driftCorner = true;
                                this.driftInterrupted = false;
                                if (GameMgr.Ins.isGuideGame && DataMgr.Ins.guideData[E_GUIDE_TYPE.BATTLE_TURN_LEFT]) {
                                    GameMgr.Ins.turnLeftGuide();
                                }
                            }
                            if (this.isDrifting) this.driftScore++; else this.undriftScore++;
                        } else {
                            if (this.driftCorner) {
                                this.driftCorner = false;
                                if (GameMgr.Ins.isGuideGame && DataMgr.Ins.guideData[E_GUIDE_TYPE.BATTLE_FINISH_TURN_LEFT]) {
                                    GameMgr.Ins.finishTurnLeftGuide();
                                } else {
                                    if (this.driftInterrupted) {
                                        EventMgr.Ins.dispatch(EventType.DRIFTOVERMSG, -1);
                                    } else {
                                        let score = this.driftScore / (this.driftScore + this.undriftScore);
                                        EventMgr.Ins.dispatch(EventType.DRIFTOVERMSG, score);
                                        this.driftRush(score);
                                    }
                                }
                                this.driftScore = 0;
                                this.undriftScore = 0;
                            }
                            if (!this.driftCorner && this.userDrifting) this.undriftScore++;
                        }
                        let carRot = new Laya.Quaternion(-rot1.x, rot1.y, rot1.z, rot1.w);
                        this.m_selfP.transform.rotation = carRot;
                        this.m_selfP.transform.rotate(new Laya.Vector3(0, 180, 0), true, false);
                        this.driftValue += this.isDrifting ? 5 : -2;
                        this.driftValue = Math.max(0, Math.min(50, this.driftValue));
                        let y2 = this.m_selfP.transform.localRotationEulerY;
                        if (this.m_selfP.transform.localRotationEulerY > 3) y2 += this.driftValue; else if (this.m_selfP.transform.localRotationEulerY < -3) y2 -= this.driftValue;
                        if (Math.abs(this.lastLocalEY - y2) < 10) {
                            this.lastLocalEY = this.m_selfP.transform.localRotationEulerY = y2;
                        } else {
                            y2 = this.lerp(this.lastLocalEY, y2, .1);
                            this.lastLocalEY = this.m_selfP.transform.localRotationEulerY = y2;
                        }
                        this.m_sprite3D.transform.translate(new Laya.Vector3(this.curOffset, .3, 0), true);
                    }
                    this.checkInertia();
                    if (this.controlled) this.m_selfP.transform.localRotationEulerY += -200 * this.curSpeedX;
                    let curpos = new Laya.Vector3(this.m_sprite3D.transform.position.x, this.m_sprite3D.transform.position.y, this.m_sprite3D.transform.position.z);
                    let disFrame = 0;
                    if (this.lastPos) disFrame = Laya.Vector3.distance(curpos, this.lastPos) - this.speedSupply; else this.lastPos = pos0;
                    if (disFrame > 0 && disFrame < spdAll) {
                        this.speedSupply = spdAll - disFrame;
                    } else {
                        this.speedSupply = 0;
                    }
                    this.lastPos = new Laya.Vector3(this.m_sprite3D.transform.position.x, this.m_sprite3D.transform.position.y, this.m_sprite3D.transform.position.z);
                }
            }
            onStageKeyDown(e) { }
            resetSelf() {
                this.curSpeed = 0;
                this.curSpeedX = 0;
                this.curOffset = 0;
                this.m_CameraRoot.transform.localRotationEulerY = 0;
                this.moveMouseX = 0;
                this.isRace = true;
                this.offsetSpeed = 0;
                this.gameDis = 3;
                this.impulseSpeed = 0;
                let pos = SceneMgr.Ins.getPosByDistance(this.gameDis);
                let dir = SceneMgr.Ins.getDirByDistance(this.gameDis);
                let rot = new Laya.Quaternion(0, 0, 0, 0);
                if (dir && pos) {
                    Laya.Quaternion.rotationLookAt(dir, new Laya.Vector3(0, 1, 0), rot);
                    let realRot = new Laya.Quaternion(-rot.x, rot.y, rot.z, rot.w);
                    this.m_sprite3D.transform.localPosition = new Laya.Vector3(-pos.x, pos.y, pos.z);
                    this.m_sprite3D.transform.translate(new Laya.Vector3(this.curOffset, .5, 0), true);
                    this.m_sprite3D.transform.localRotation = realRot;
                    this.m_sprite3D.transform.rotate(new Laya.Vector3(0, 180, 0), true, false);
                }
                this.stopHit();
            }
            startPos() {
                this.gameDis = .001;
                this.curOffset = this.curOffset = -6 + this.racePos * 4;
                let pos = SceneMgr.Ins.getPosByDistance(this.gameDis);
                let dir = SceneMgr.Ins.getDirByDistance(this.gameDis);
                let rot = new Laya.Quaternion(0, 0, 0, 0);
                this.m_CameraRoot.transform.localPositionZ = 0;
                this.m_CameraRoot.transform.localRotationEulerY = 0;
                if (dir && pos) {
                    Laya.Quaternion.rotationLookAt(dir, new Laya.Vector3(0, 1, 0), rot);
                    let realRot = new Laya.Quaternion(-rot.x, rot.y, rot.z, rot.w);
                    this.m_sprite3D.transform.localPosition = new Laya.Vector3(-pos.x, pos.y, pos.z);
                    this.m_sprite3D.transform.localRotation = realRot;
                    this.m_sprite3D.transform.rotate(new Laya.Vector3(0, 180, 0), true, false);
                    this.m_sprite3D.transform.translate(new Laya.Vector3(this.curOffset, .5, 0), true);
                }
                this.normalCamera();
            }
            normalCamera() {
                this.mCamera.transform.localRotationEulerX = -30;
                this.mCamera.transform.localRotationEulerY = 180;
                Laya.timer.loop(1, this, this.shopCameraLoop);
            }
            battleCamera() {
                Laya.timer.clear(this, this.shopCameraLoop);
                Laya.Tween.to(this.mCamera.transform, {
                    localRotationEulerX: DataMgr.Ins.BattleCameraRotatoX,
                    localRotationEulerY: 180,
                    localPositionY: DataMgr.Ins.BattleCameraY,
                    localPositionZ: DataMgr.Ins.BattleCameraZ
                }, 2e3);
                window["testCam"] = this.mCamera;
                var ey = Math.round(this.m_CameraRoot.transform.localRotationEulerY / 360) * 360;
                Laya.Tween.to(this.m_CameraRoot.transform, {
                    localRotationEulerY: ey
                }, 2e3);
            }
            refreshCamera() {
                this.mCamera.transform.localRotationEulerX = DataMgr.Ins.BattleCameraRotatoX;
                this.mCamera.transform.localPositionY = DataMgr.Ins.BattleCameraY;
                this.mCamera.transform.localPositionZ = DataMgr.Ins.BattleCameraZ;
            }
            shopCameraLoop() {
                this.m_CameraRoot.transform.localRotationEulerY += .1;
            }
            aroundCameraLoop() {
                this.m_CameraRoot.transform.localRotationEulerY += 1;
            }
            startFly(_flyLineID) {
                super.startFly(_flyLineID);
                this.flyCamera();
                GameMgr.Ins.updateAchievementData(E_ACHIEVEMENT_TYPE.FLYTIME);
            }
            stopFly() {
                super.stopFly();
                this.closeFlyCamera();
            }
            flyCamera() {
                Laya.Tween.to(this.mCamera, {
                    fieldOfView: 100
                }, 1e3);
            }
            closeFlyCamera() {
                Laya.Tween.to(this.mCamera, {
                    fieldOfView: 60
                }, 1e3);
            }
            openBoosterVFX() {
                if (this.NOSBuff) return;
                this.NOSBlow.active = true;
                this.normalBlow.active = false;
            }
            lerp(a, b, t) {
                return (b - a) * t + a;
            }
            checkInertia() {
                let ratio = this.isDrifting ? this.carCfg.cfg.InertiaDrift * .025 : this.carCfg.cfg.Inertia * .025;
                let speedP = this.curSpeed / this.maxSpeed;
                let delta = .2;
                if (speedP > .1) {
                    delta = delta * speedP * speedP * ratio;
                    delta = this.lastIertia = this.lerp(this.lastIertia, delta, this.lastIertia > delta ? .05 : .01);
                    if (this.isDrifting) {
                        if (this.m_selfP.transform.localRotationEulerY > 10) {
                            this.curOffset -= delta;
                        } else if (this.m_selfP.transform.localRotationEulerY < -10) {
                            this.curOffset += delta;
                        }
                    } else {
                        if (this.driftCorner) {
                            var ofst = delta * Math.sin(Math.PI / 180 * this.m_selfP.transform.localRotationEulerY) * 10;
                            if (ofst > .6) ofst = .6; else if (ofst < -.6) ofst = -.6;
                            this.curOffset -= ofst;
                        }
                    }
                }
                return;
                if (Math.abs(this.m_selfP.transform.localRotationEulerY) > 10 && this.curSpeed > this.maxSpeed * .6) {
                    if (this.m_selfP.transform.localRotationEulerY > 0) {
                        this.curOffset -= .1;
                    } else {
                        this.curOffset += .1;
                    }
                }
            }
            speedLineUpdate() {
                super.speedLineUpdate();
                if (this.NOSBuff) {
                    this.mCamera.fieldOfView += 2;
                    if (this.mCamera.fieldOfView > 100) this.mCamera.fieldOfView = 100;
                    this.speedLine.active = true;
                } else {
                    this.mCamera.fieldOfView -= 1;
                    if (this.mCamera.fieldOfView < 60) this.mCamera.fieldOfView = 60;
                    this.speedLine.active = false;
                }
            }
            useShield() {
                super.useShield();
                if (this.isSelf) {
                    SoundMgr.Ins.shield();
                    EventMgr.Ins.dispatch(EventType.BUFFTIPMSG, E_PROP_TYPE.SHIELD);
                }
            }
            stopShield() {
                super.stopShield();
                if (this.isSelf) {
                    EventMgr.Ins.dispatch(EventType.CLOSEBUFFTIPMSG, E_PROP_TYPE.SHIELD);
                }
            }
            useStar() {
                super.useStar();
                if (this.isSelf) {
                    SoundMgr.Ins.star();
                    EventMgr.Ins.dispatch(EventType.BUFFTIPMSG, E_PROP_TYPE.STAR);
                }
            }
            stopStar() {
                super.stopStar();
                if (this.isSelf) {
                    EventMgr.Ins.dispatch(EventType.CLOSEBUFFTIPMSG, E_PROP_TYPE.STAR);
                }
            }
            driftRush(score) {
                if (score < .5) return;
                let passScore = .85;
                let rushEffect = 400;
                let buffCfg = DataMgr.Ins.getConstellationBuff();
                if (buffCfg) {
                    if (buffCfg.buffType == E_BUFF_TYPE.DRIFT_RUSH_BUFF) rushEffect += buffCfg.buffValue; else if (buffCfg.buffType == E_BUFF_TYPE.DRIFT_SCORE_BUFF) passScore -= buffCfg.buffValue / 100;
                }
                if (score < passScore) this.useNOS(10, rushEffect); else {
                    this.useNOS(10, rushEffect * 2);
                    GameMgr.Ins.updateAchievementData(E_ACHIEVEMENT_TYPE.PREFECTDRIFTTIME);
                }
            }
            onUsePropCard(prop1 = E_PROP_TYPE.NONE, prop2 = E_PROP_TYPE.NONE, prop3 = E_PROP_TYPE.NONE, prop4 = E_PROP_TYPE.NONE) {
                if (prop1 > 0) this.getProp(prop1);
                if (prop2 > 0) this.getProp(prop2);
                if (prop3 > 0) this.propBak1 = prop3;
                if (prop4 > 0) this.propBak2 = prop4;
                EventMgr.Ins.dispatch(EventType.GETPROPMSG);
            }
            checkFinish() {
                super.checkFinish();
                if (GameMgr.Ins.isGuideGame && this.m_curLap == 1) GameMgr.Ins.GoodGuide();
            }
            daddy() {
                this.maxSpeedBuff = 5;
                this.isEdgeSlow = false;
            }
            son() {
                this.maxSpeedBuff = 1;
                this.isEdgeSlow = true;
            }
        }
        class NpcScript extends CarScript {
            constructor() {
                super(...arguments);
                this.curSpeed = 0;
                this.curSpeedX = 1e-5;
                this.curOffset = 0;
                this.racePos = 0;
                this.moveMouseX = 0;
                this.isRace = false;
                this.isFlying = false;
                this.isStartFly = false;
                this.flyHeight = 10;
                this.offsetSpeed = 0;
                this.gameDis = 10;
                this.isTurnLeft = false;
                this.isTurnRight = false;
                this.speedXDelta = .05;
                this.driftCorner = false;
                this.userDrifting = false;
                this.driftValue = 0;
                this.lastLocalEY = 0;
                this.AILBWaitFrame = 0;
                this.curTargetIndex = 0;
                this.curIndex = -1;
                this.nextThinkTime = 0;
            }
            onAwake() { }
            onStart() {
                this.init();
                this.startPos();
                var rndCard = UsefulStuff.rnd(0, 100);
                if (rndCard < this.AICardLv) {
                    var rndPropArray = CCfgMgr.Ins.cfgPropInfo.rndCardLevel(GameMgr.Ins.curGameMode != E_GAME_MODE.MULTIPLAYER_PROP_GAME);
                    this.getProp(rndPropArray[0]);
                    this.getProp(rndPropArray[1]);
                }
            }
            init() {
                this.PlayerName = CCfgMgr.Ins.cfgNpcInfo.getRndName();
                let AICfg = CCfgMgr.Ins.cfgRankInfo.getItem(this.m_NpcInfo.cupLevel);
                this.AIMoveLv = AICfg ? AICfg.AIMove : 1;
                this.AIRushLv = AICfg ? AICfg.AIRush : 20;
                this.AIPropLv = AICfg ? AICfg.AIProp : 20;
                this.AISkillLv = AICfg ? AICfg.AISkill : 20;
                this.AIDriftLv = AICfg ? AICfg.AIDrift : 20;
                this.AICardLv = AICfg ? AICfg.AICard : 20;
                super.init();
                this.isRace = true;
                this.isFinish = false;
                this.carModel = this.carRoot.getChildAt(0);
                this.roleModel = this.carRoot.getChildAt(4).getChildAt(0).getChildAt(1);
                if (GameMgr.Ins.isGuideGame) {
                    this.AIMoveLv = 0;
                    this.AIRushLv = 100;
                    this.AIPropLv = 80;
                    this.AISkillLv = 80;
                    this.AIDriftLv = 100;
                    this.PlayerName = "训练师";
                }
                EventMgr.Ins.on(EventType.TIMEFIBER, this, this.startDrive);
                EventMgr.Ins.on(EventType.BATTLE_READY_GO, this, this.battleReadyGo);
                EventMgr.Ins.on(EventType.STARTRUSH, this, this.playerStartRush);
            }
            battleReadyGo() {
                if (!GameMgr.Ins.isGuideGame) Laya.timer.once(500, this, this.startNpcRush);
            }
            playerStartRush(effect) {
                if (GameMgr.Ins.isGuideGame) this.startNpcRush();
            }
            startNpcRush() {
                if (this.AIRushLv > 0) {
                    let effect = UsefulStuff.rnd(this.AIRushLv, 100);
                    if (GameMgr.Ins.isGuideGame) {
                        effect = UsefulStuff.rnd(80, 100);
                    }
                    this.startRush(effect);
                    var rndTime = 0;
                    if (this.PropItem1 != E_PROP_TYPE.NONE) {
                        rndTime = UsefulStuff.rnd(0, 3e3);
                        Laya.timer.once(rndTime, this, this.onUseProp1Msg);
                    }
                    if (this.PropItem2 != E_PROP_TYPE.NONE) {
                        rndTime = UsefulStuff.rnd(0, 3e3);
                        Laya.timer.once(rndTime, this, this.onUseProp2Msg);
                    }
                }
            }
            onDestroy() {
                EventMgr.Ins.off(EventType.TIMEFIBER, this, this.startDrive);
                EventMgr.Ins.off(EventType.BATTLE_READY_GO, this, this.battleReadyGo);
                EventMgr.Ins.off(EventType.STARTRUSH, this, this.playerStartRush);
            }
            startDrive(startFrame) {
                if (!GameMgr.Ins.isGameStart) return;
                if (GameMgr.Ins.isGameOver) {
                    this.clearAllEff();
                    return;
                }
                if (this.isFlying) {
                    this.flyDis += this.flySpeed;
                    let pos = SceneMgr.Ins.getPosByDistanceFly(this.flyDis, this.flyLineID);
                    let dir = SceneMgr.Ins.getDirByDistanceFly(this.flyDis, this.flyLineID);
                    let nextDir = SceneMgr.Ins.getDirByDistanceFly(this.flyDis + 15, this.flyLineID);
                    let rotR = new Laya.Quaternion(0, 0, 0, 0);
                    let rotC = new Laya.Quaternion(0, 0, 0, 0);
                    if (dir && pos) {
                        this.m_sprite3D.transform.localPosition = new Laya.Vector3(-pos.x, pos.y, pos.z);
                        Laya.Quaternion.rotationLookAt(dir, new Laya.Vector3(0, 1, 0), rotR);
                        let realRot = new Laya.Quaternion(-rotR.x, rotR.y, rotR.z, rotR.w);
                        this.m_sprite3D.transform.localRotation = realRot;
                        this.m_sprite3D.transform.rotate(new Laya.Vector3(0, 180, 0), true, false);
                        if (nextDir) {
                            Laya.Quaternion.rotationLookAt(nextDir, new Laya.Vector3(0, 1, 0), rotC);
                            let carRot = new Laya.Quaternion(-rotC.x, rotC.y, rotC.z, rotC.w);
                            this.m_selfP.transform.rotation = carRot;
                            this.m_selfP.transform.rotate(new Laya.Vector3(0, 180, 0), true, false);
                        }
                        this.m_sprite3D.transform.translate(new Laya.Vector3(0, .3, 0), true);
                    } else {
                        this.stopFly();
                    }
                    return;
                }
                if (this.isRace) {
                    if (!GameMgr.Ins.inReady) {
                        if (this.isFinish) this.curSpeed *= .99; else this.curSpeed += this.maxSpeed / this.acceleration;
                        if (this.curSpeed > this.maxSpeed) this.curSpeed = this.maxSpeed;
                        this.addLBLoop();
                        if (this.isTurnLeft && this.isTurnRight) {
                            this.checkLineLiker(true);
                        } else if (this.isTurnLeft) {
                            this.curSpeedX += -this.speedXDelta * (this.isReverse ? -1 : 1);
                            this.checkLineLiker(false);
                        } else if (this.isTurnRight) {
                            this.curSpeedX += this.speedXDelta * (this.isReverse ? -1 : 1);
                            this.checkLineLiker(false);
                        } else {
                            this.checkLineLiker(true);
                        }
                        if (this.beImpactLeft) {
                            this.curSpeedX -= .1;
                        }
                        if (this.beImpactRight) {
                            this.curSpeedX += .1;
                        }
                        this.curOffset += -this.curSpeedX;
                        if (Math.abs(this.curOffset) >= 8) {
                            if (!this.checkBuff(E_SKILL_BUFF.PHYISC_KING)) this.curSpeed *= .95;
                            if (this.curOffset >= 8) {
                                this.curOffset = 8;
                            } else {
                                this.curOffset = -8;
                            }
                            this.playEffect(E_EFFECT_TYPE.BOW);
                        } else {
                            this.closeEffect(E_EFFECT_TYPE.BOW);
                        }
                        this.curSpeedX *= .5;
                        if (Math.abs(this.curSpeedX) < .001) this.curSpeedX = 0;
                    } else {
                        this.curSpeed *= .99;
                        if (this.curSpeed < 0) this.curSpeed = 0;
                    }
                    if (this.AIMoveLv > 0) this.moveAI();
                    if (this.isReady) this.checkFinish();
                    this.boosterUpdate();
                    this.speedLineUpdate();
                    if (this.speedAdd > 1) this.speedAdd *= .995;
                    if (this.speedAdd < 1) this.speedAdd = 1;
                    if (this.impulseSpeed > 0) this.impulseSpeed -= .001;
                    if (this.impulseSpeed < 0) this.impulseSpeed = 0;
                    let spdAll = this.curSpeed * this.speedAdd + this.impulseSpeed;
                    this.gameDis += spdAll + this.speedSupply;
                    let pos = SceneMgr.Ins.getPosByDistance(this.gameDis);
                    let dir = SceneMgr.Ins.getDirByDistance(this.gameDis);
                    let nextDir = SceneMgr.Ins.getDirByDistance(this.gameDis + 15);
                    let rotR = new Laya.Quaternion(0, 0, 0, 0);
                    let rotC = new Laya.Quaternion(0, 0, 0, 0);
                    if (!this.isFinish) this.checkTrack();
                    if (dir && pos) {
                        this.m_sprite3D.transform.localPosition = new Laya.Vector3(-pos.x, pos.y, pos.z);
                        Laya.Quaternion.rotationLookAt(dir, new Laya.Vector3(0, 1, 0), rotR);
                        Laya.Quaternion.rotationLookAt(nextDir, new Laya.Vector3(0, 1, 0), rotC);
                        let realRot = new Laya.Quaternion(-rotR.x, rotR.y, rotR.z, rotR.w);
                        this.m_sprite3D.transform.localRotation = realRot;
                        this.m_sprite3D.transform.rotate(new Laya.Vector3(0, 180, 0), true, false);
                        let carRot = new Laya.Quaternion(-rotC.x, rotC.y, rotC.z, rotC.w);
                        this.m_selfP.transform.rotation = carRot;
                        this.m_selfP.transform.rotate(new Laya.Vector3(0, 180, 0), true, false);
                        let angle2 = UsefulStuff.angleV3(new Laya.Vector3(dir.x, 0, dir.z), new Laya.Vector3(nextDir.x, 0, nextDir.z)) * 180 / Math.PI;
                        if (angle2 > 10) {
                            if (!this.driftCorner) {
                                this.driftCorner = true;
                                this.driftInterrupted = false;
                            }
                        } else {
                            if (this.driftCorner) {
                                this.driftCorner = false;
                                this.AIdriftRush();
                            }
                        }
                        this.driftValue += this.driftCorner ? 5 : -2;
                        this.driftValue = Math.max(0, Math.min(50, this.driftValue));
                        let y2 = this.m_selfP.transform.localRotationEulerY;
                        if (this.m_selfP.transform.localRotationEulerY > 3) y2 += this.driftValue; else if (this.m_selfP.transform.localRotationEulerY < -3) y2 -= this.driftValue;
                        if (Math.abs(this.lastLocalEY - y2) < 10) {
                            this.lastLocalEY = this.m_selfP.transform.localRotationEulerY = y2;
                        } else {
                            y2 = UsefulStuff.lerp(this.lastLocalEY, y2, .1);
                            this.lastLocalEY = this.m_selfP.transform.localRotationEulerY = y2;
                        }
                        this.m_sprite3D.transform.translate(new Laya.Vector3(this.curOffset, .3, 0), true);
                    }
                    if (this.controlled) this.m_selfP.transform.localRotationEulerY += -30 * this.curSpeedX * 5;
                    let curpos = new Laya.Vector3(this.m_sprite3D.transform.position.x, this.m_sprite3D.transform.position.y, this.m_sprite3D.transform.position.z);
                    let disFrame = 0;
                    if (this.lastPos) disFrame = Laya.Vector3.distance(curpos, this.lastPos) - this.speedSupply; else this.lastPos = pos;
                    if (disFrame > 0 && disFrame < spdAll) {
                        this.speedSupply = spdAll - disFrame;
                    } else {
                        this.speedSupply = 0;
                    }
                    this.lastPos = new Laya.Vector3(this.m_sprite3D.transform.position.x, this.m_sprite3D.transform.position.y, this.m_sprite3D.transform.position.z);
                    if (this.LBPro >= 100 && this.AISkillLv > 0) {
                        this.AIUseLB();
                    }
                }
            }
            AIUseLB() {
                let waitFrame = 1e3 - this.AISkillLv * 10;
                this.AILBWaitFrame++;
                if (this.AILBWaitFrame > waitFrame) {
                    this.useLB();
                    this.AILBWaitFrame = 0;
                }
            }
            AIdriftRush() {
                let rnd = UsefulStuff.rnd(0, 100);
                if (rnd < this.AIDriftLv) this.useNOS(10, 800); else {
                    if (rnd < this.AIDriftLv * 1.5) this.useNOS(10, 400);
                }
            }
            startPos() {
                this.gameDis = .001;
                this.curOffset = -6 + this.racePos * 4;
                let pos = SceneMgr.Ins.getPosByDistance(this.gameDis);
                let dir = SceneMgr.Ins.getDirByDistance(this.gameDis);
                let rot = new Laya.Quaternion(0, 0, 0, 0);
                if (dir && pos) {
                    Laya.Quaternion.rotationLookAt(dir, new Laya.Vector3(0, 1, 0), rot);
                    this.m_sprite3D.transform.localPosition = new Laya.Vector3(-pos.x, pos.y, pos.z);
                    this.m_sprite3D.transform.localRotation = rot;
                    this.m_sprite3D.transform.rotate(new Laya.Vector3(0, 180, 0), true, false);
                    this.m_sprite3D.transform.translate(new Laya.Vector3(this.curOffset, .5, 0), true);
                }
            }
            rndProp() {
                super.rndProp();
                if (this.AIPropLv > 0) {
                    let rndTime = UsefulStuff.rnd(0, 3e3);
                    let rndUse = UsefulStuff.rnd(0, 100);
                    if (this.PropItem1) {
                        if (rndUse < this.AIPropLv) Laya.timer.once(rndTime, this, this.onUseProp1Msg);
                    }
                    rndUse = UsefulStuff.rnd(0, 100);
                    if (this.PropItem2) {
                        if (rndUse < this.AIPropLv) Laya.timer.once(rndTime, this, this.onUseProp2Msg);
                    }
                }
            }
            moveAI() {
                if (this.curOffset > 7 || this.curOffset < -7 || Date.now() > this.nextThinkTime) {
                    let rndMove = UsefulStuff.rnd(1, 4);
                    if (this.curOffset > 7) {
                        rndMove = 2;
                    } else if (this.curOffset < -7) {
                        rndMove = 1;
                    }
                    if (rndMove == 1) {
                        this.isTurnLeft = true;
                        this.isTurnRight = false;
                    } else if (rndMove == 2) {
                        this.isTurnLeft = false;
                        this.isTurnRight = true;
                    } else {
                        this.isTurnLeft = false;
                        this.isTurnRight = false;
                    }
                    this.nextThinkTime = Date.now() + UsefulStuff.rnd(500, 1500);
                }
            }
            checkFinish() {
                super.checkFinish();
                if (GameMgr.Ins.isGuideGame) {
                    if (this.getCurLap() > 0 && this.AIDriftLv > 10) {
                        var slowTime = this.racePos * 2e3;
                        this.AIDriftLv = 0;
                        this.AISkillLv = 0;
                        this.AIPropLv = 0;
                        Laya.timer.once(slowTime, this, () => {
                            this.maxSpeedAdd = -.17;
                        });
                    }
                }
            }
        }
        var E_CHA_ANI_NAME;
        (function (E_CHA_ANI_NAME) {
            E_CHA_ANI_NAME["DRIVE"] = "character_driver";
            E_CHA_ANI_NAME["LEFT_HOLD"] = "character_left_turn_hold";
            E_CHA_ANI_NAME["RIGHT_HOLD"] = "character_right_turn_hold";
            E_CHA_ANI_NAME["NOS_HOLD"] = "character_speedup_hold";
            E_CHA_ANI_NAME["ATTACK"] = "character_attack";
            E_CHA_ANI_NAME["WIN"] = "character_choose_mancelebrate";
            E_CHA_ANI_NAME["WAIT_MAN"] = "character_choose_wati_man";
            E_CHA_ANI_NAME["WAIT_WOMAN"] = "character_choose_wati_feman";
            E_CHA_ANI_NAME["FAIL"] = "character_choose_fail";
            E_CHA_ANI_NAME["JUMP"] = "character_celebrate_jump";
        })(E_CHA_ANI_NAME || (E_CHA_ANI_NAME = {}));
        class ActorScript extends Laya.Script3D {
            constructor() {
                super(...arguments);
                this.isLockAni = false;
                this.curAni = E_CHA_ANI_NAME.DRIVE;
            }
            init(_hatCfg, _hairCfg, _wingCfg) {
                this.m_hatCfg = _hatCfg;
                this.m_hairCfg = _hairCfg;
                this.m_wingCfg = _wingCfg;
                let hideWing = false;
                let hideHair = false;
                let hideHat = false;
                if (this.m_hatCfg && this.m_hatCfg.hideOther >= 0) {
                    if (this.m_hatCfg.hideOther == 0) hideHair = true;
                    if (this.m_hatCfg.hideOther == 1) hideHat = true;
                    if (this.m_hatCfg.hideOther == 3) hideWing = true;
                }
                if (this.m_hairCfg && this.m_hairCfg.hideOther >= 0) {
                    if (this.m_hairCfg.hideOther == 0) hideHair = true;
                    if (this.m_hairCfg.hideOther == 1) hideHat = true;
                    if (this.m_hairCfg.hideOther == 3) hideWing = true;
                }
                if (this.m_wingCfg && this.m_wingCfg.hideOther >= 0) {
                    if (this.m_wingCfg.hideOther == 0) hideHair = true;
                    if (this.m_wingCfg.hideOther == 1) hideHat = true;
                    if (this.m_wingCfg.hideOther == 3) hideWing = true;
                }
                this.m_Actor = this.owner;
                this.ani = this.owner.getComponent(Laya.Animator);
                if (this.m_wingCfg && !hideWing) {
                    let wingRoot = this.m_Actor.getChildAt(0).getChildAt(0).getChildAt(0).getChildAt(2).getChildAt(0);
                    let wingModel = Laya.loader.getRes(LoadMgr.Ins.unityResPath(E_UNITY_RES_PATH.CHA, "wing_" + _wingCfg.assetId.toString() + ".lh"));
                    let wing = Laya.Sprite3D.instantiate(wingModel);
                    wingRoot.addChild(wing);
                    this.wingRoot = wingRoot;
                }
                let hairRoot = this.m_Actor.getChildAt(0).getChildAt(0).getChildAt(0).getChildAt(2).getChildAt(1).getChildAt(0).getChildAt(1);
                if (this.m_hatCfg && !hideHat) {
                    let hatModel = Laya.loader.getRes(LoadMgr.Ins.unityResPath(E_UNITY_RES_PATH.CHA, "hat_" + _hatCfg.assetId.toString() + ".lh"));
                    let hat = Laya.Sprite3D.instantiate(hatModel);
                    hairRoot.addChild(hat);
                }
                if (this.m_hairCfg && !hideHair) {
                    let hairModel = Laya.loader.getRes(LoadMgr.Ins.unityResPath(E_UNITY_RES_PATH.CHA, "hair_" + _hairCfg.assetId.toString() + ".lh"));
                    let hair = Laya.Sprite3D.instantiate(hairModel);
                    if (this.m_hairCfg.hasAnimator > 0) {
                        this.hairAni = hair.getComponent(Laya.Animator);
                        this.m_Actor.addChild(hair);
                    } else {
                        hairRoot.addChild(hair);
                    }
                }
                this.ani.play(E_CHA_ANI_NAME.DRIVE);
            }
            playWin() {
                if (this.curAni == E_CHA_ANI_NAME.WIN) return;
                this.curAni = E_CHA_ANI_NAME.WIN;
                this.ani.play(E_CHA_ANI_NAME.WIN);
                this.hairAni && this.hairAni.play(E_CHA_ANI_NAME.WIN);
                this.ani.speed = 1;
                this.isLockAni = true;
            }
            playLeft() {
                if (this.isLockAni) return;
                if (this.curAni == E_CHA_ANI_NAME.LEFT_HOLD) return;
                this.curAni = E_CHA_ANI_NAME.LEFT_HOLD;
                this.ani.crossFade(E_CHA_ANI_NAME.LEFT_HOLD, .2);
                this.hairAni && this.hairAni.crossFade(E_CHA_ANI_NAME.LEFT_HOLD, .2);
                this.ani.speed = 1;
            }
            playRight() {
                if (this.isLockAni) return;
                if (this.curAni == E_CHA_ANI_NAME.RIGHT_HOLD) return;
                this.curAni = E_CHA_ANI_NAME.RIGHT_HOLD;
                this.ani.crossFade(E_CHA_ANI_NAME.RIGHT_HOLD, .2);
                this.hairAni && this.hairAni.crossFade(E_CHA_ANI_NAME.RIGHT_HOLD, .2);
                this.ani.speed = 1;
            }
            playDrive() {
                if (this.isLockAni) return;
                if (this.curAni == E_CHA_ANI_NAME.DRIVE) return;
                this.curAni = E_CHA_ANI_NAME.DRIVE;
                this.ani.crossFade(E_CHA_ANI_NAME.DRIVE, .5);
                this.hairAni && this.hairAni.crossFade(E_CHA_ANI_NAME.DRIVE, .5);
                this.ani.speed = 1;
            }
            playNOS() {
                if (this.isLockAni) return;
                if (this.curAni == E_CHA_ANI_NAME.NOS_HOLD) return;
                this.ani.crossFade(E_CHA_ANI_NAME.NOS_HOLD, .2);
                this.hairAni && this.hairAni.crossFade(E_CHA_ANI_NAME.NOS_HOLD, .2);
                this.ani.speed = 1;
                this.isLockAni = true;
                Laya.timer.once(900, this, this.stopAttack);
            }
            playAttack() {
                if (this.isLockAni) return;
                if (this.curAni == E_CHA_ANI_NAME.ATTACK) return;
                this.ani.crossFade(E_CHA_ANI_NAME.ATTACK, .2);
                this.hairAni && this.hairAni.crossFade(E_CHA_ANI_NAME.ATTACK, .2);
                this.ani.speed = 2;
                this.isLockAni = true;
                Laya.timer.once(900, this, this.stopAttack);
            }
            stopAttack() {
                this.isLockAni = false;
                this.playDrive();
            }
            playMenChoose() {
                this.ani.play(E_CHA_ANI_NAME.WAIT_MAN);
                this.hairAni && this.hairAni.play(E_CHA_ANI_NAME.WAIT_MAN);
            }
            playWomenChoose() {
                this.ani.play(E_CHA_ANI_NAME.WAIT_WOMAN);
                this.hairAni && this.hairAni.play(E_CHA_ANI_NAME.WAIT_WOMAN);
            }
            playFail() {
                this.ani.play(E_CHA_ANI_NAME.FAIL);
                this.hairAni && this.hairAni.play(E_CHA_ANI_NAME.FAIL);
            }
            playWomenSuccess() {
                this.ani.play(E_CHA_ANI_NAME.JUMP);
                this.hairAni && this.hairAni.play(E_CHA_ANI_NAME.JUMP);
            }
        }
        class ActorMgr {
            constructor() {
                this.m_NpcActors = [];
                this.m_NpcScripts = [];
                this.m_AllScripts = [];
                window["ActorMgr"] = this;
                this.loadGuideGirl();
            }
            static get Ins() {
                return ActorMgr._ins || (ActorMgr._ins = new ActorMgr());
            }
            createSelfRole() {
                let chaInfo;
                if (!DataMgr.Ins.currPlayerSex) chaInfo = DataMgr.Ins.currSelectMenClothesList; else chaInfo = DataMgr.Ins.currSelectWomenClothesList;
                let WingCfg = chaInfo[3] ? chaInfo[3].getBaseNature() : null;
                let HairCfg = chaInfo[0] ? chaInfo[0].getBaseNature() : null;
                let ChaCfg = chaInfo[2] ? chaInfo[2].getBaseNature() : null;
                let HatCfg = chaInfo[1] ? chaInfo[1].getBaseNature() : null;
                let chaRes = LoadMgr.Ins.unityResPath(E_UNITY_RES_PATH.CHA, "Cha_" + ChaCfg.assetId + ".lh");
                let carRes = LoadMgr.Ins.unityResPath(E_UNITY_RES_PATH.CAR, "Car_" + DataMgr.Ins.gameUseCar.cfg.assetId + "_" + DataMgr.Ins.useCarStage + ".lh");
                let rootPath = GameMgr.Ins.isGuideGame ? "unity/role/Conventional/SelfRootGuide.lh" : "unity/role/Conventional/SelfRoot.lh";
                let selfRootM = Laya.loader.getRes(rootPath);
                let playerModel = Laya.loader.getRes(chaRes);
                let carModel = Laya.loader.getRes(carRes);
                let Cha = playerModel && Laya.Sprite3D.instantiate(playerModel);
                let car = carModel && Laya.Sprite3D.instantiate(carModel);
                let selfRoot = selfRootM && Laya.Sprite3D.instantiate(selfRootM);
                this.m_selfPlayer = selfRoot;
                let Cha_Root = car.getChildAt(0).getChildAt(4);
                Cha_Root && Cha_Root.addChild(Cha);
                selfRoot && selfRoot.addChild(car);
                this.m_selfScript = selfRoot.addComponent(SelfScript);
                this.m_selfScript.chaID = ChaCfg.ID;
                let _ActorScript = Cha.addComponent(ActorScript);
                this.m_selfScript.isSelf = true;
                this.m_selfScript.carCfg = DataMgr.Ins.gameUseCar;
                this.m_selfScript.racePos = GameMgr.Ins.selfRacePos;
                this.m_selfScript.m_ActorScript = _ActorScript;
                this.m_selfScript.m_ActorScript.init(HatCfg, HairCfg, WingCfg);
                this.m_AllScripts.push(this.m_selfScript);
                return this.m_selfPlayer;
            }
            changeSelfActor() { }
            changeBack() {
                GameMgr.Ins.resumeGame();
            }
            createNpcActor(npcInfo) {
                let carRootM = Laya.loader.getRes("unity/role/Conventional/CarRoot.lh");
                let clothCfg = CCfgMgr.Ins.cfgClothes.getItem(npcInfo.clothInfo.clothID);
                let chaRes = LoadMgr.Ins.unityResPath(E_UNITY_RES_PATH.CHA, "Cha_" + clothCfg.assetId + ".lh");
                let carRes = LoadMgr.Ins.unityResPath(E_UNITY_RES_PATH.CAR, "Car_" + npcInfo.carID + "_" + npcInfo.carLv + ".lh");
                let playerModel = Laya.loader.getRes(chaRes);
                let carModel = Laya.loader.getRes(carRes);
                if (!playerModel) {
                    console.log("playerModel is null");
                    playerModel = Laya.loader.getRes("unity/role/Conventional/Cha_4.lh");
                    console.log(playerModel);
                }
                if (!carModel) {
                    console.log("carModel is null");
                    carModel = Laya.loader.getRes("unity/car/Conventional/Car_6_1.lh");
                    console.log(carModel);
                }
                let Cha = Laya.Sprite3D.instantiate(playerModel);
                let car = Laya.Sprite3D.instantiate(carModel);
                let carRoot = Laya.Sprite3D.instantiate(carRootM);
                this.m_NpcActors.push(carRoot);
                let Cha_Root = car.getChildAt(0).getChildAt(4);
                Cha_Root && Cha_Root.addChild(Cha);
                carRoot.addChild(car);
                let ns = carRoot.addComponent(NpcScript);
                this.m_NpcScripts.push(ns);
                this.m_AllScripts.push(ns);
                ns.m_NpcInfo = npcInfo;
                ns.racePos = npcInfo.raceID;
                let br = new BaseRacing();
                let target = this.m_selfScript.carCfg;
                let targetCurrSULv = target.currLvSU;
                let targetMaxSpeedLv = target.currLvMaxSpeed;
                ns.chaID = npcInfo.clothInfo.clothID;
                let AICfg = CCfgMgr.Ins.cfgRankInfo.getItem(npcInfo.cupLevel);
                let LevelStar = DataMgr.Ins.getCurrStarNum();
                let carLv = AICfg ? AICfg.AICar + Math.floor(LevelStar * .1 * 5) : 1;
                if (carLv > 20) carLv = 20;
                if (GameMgr.Ins.isGuideGame) carLv = 18;
                br.init(target.id, false, carLv, carLv, carLv, carLv);
                br.id = npcInfo.carID;
                ns.carCfg = br;
                let _ActorScript = Cha.addComponent(ActorScript);
                ns.m_ActorScript = _ActorScript;
                ns.m_ActorScript.init(npcInfo.clothInfo.hatCfg, npcInfo.clothInfo.hairCfg, npcInfo.clothInfo.wingCfg);
                return carRoot;
            }
            ReadyAllScript() {
                this.m_selfScript.Ready();
                for (let i = 0; i < this.m_NpcScripts.length; i++) {
                    this.m_NpcScripts[i].Ready();
                }
            }
            getCurRank() { }
            getScriptByRacePos(racePos) {
                for (let i = 0; i < this.m_AllScripts.length; i++) {
                    if (this.m_AllScripts[i].racePos == racePos) return this.m_AllScripts[i];
                }
                return null;
            }
            clearActor() {
                this.m_NpcScripts = [];
                this.m_AllScripts = [];
                this.m_selfScript = null;
                this.m_selfPlayer && this.m_selfPlayer.destroy();
                for (let i = 0; i < this.m_NpcActors.length; i++) {
                    this.m_NpcActors[i] && this.m_NpcActors[i].destroy();
                }
            }
            loadGuideGirl() { }
        }
        var E_UI_TYPE;
        (function (E_UI_TYPE) {
            E_UI_TYPE[E_UI_TYPE["PICK_ROLE"] = 0] = "PICK_ROLE";
            E_UI_TYPE[E_UI_TYPE["LONGBLACKTIP"] = 1] = "LONGBLACKTIP";
            E_UI_TYPE[E_UI_TYPE["STARTUI"] = 2] = "STARTUI";
            E_UI_TYPE[E_UI_TYPE["BATTLEUI"] = 3] = "BATTLEUI";
            E_UI_TYPE[E_UI_TYPE["GUIDE_UI"] = 4] = "GUIDE_UI";
            E_UI_TYPE[E_UI_TYPE["PROFILE"] = 5] = "PROFILE";
            E_UI_TYPE[E_UI_TYPE["GARAGEUI"] = 6] = "GARAGEUI";
            E_UI_TYPE[E_UI_TYPE["DRIVERUI"] = 7] = "DRIVERUI";
            E_UI_TYPE[E_UI_TYPE["GETCARUI"] = 8] = "GETCARUI";
            E_UI_TYPE[E_UI_TYPE["CGTLTGETUI"] = 9] = "CGTLTGETUI";
            E_UI_TYPE[E_UI_TYPE["RANKING_UI"] = 10] = "RANKING_UI";
            E_UI_TYPE[E_UI_TYPE["RANK_RESULT_UI"] = 11] = "RANK_RESULT_UI";
            E_UI_TYPE[E_UI_TYPE["TRAINING_RESULT"] = 12] = "TRAINING_RESULT";
            E_UI_TYPE[E_UI_TYPE["LONG_PRESS_TIP"] = 13] = "LONG_PRESS_TIP";
            E_UI_TYPE[E_UI_TYPE["CHECK_IN"] = 14] = "CHECK_IN";
            E_UI_TYPE[E_UI_TYPE["LUCKY_PAN"] = 15] = "LUCKY_PAN";
            E_UI_TYPE[E_UI_TYPE["ONLINE_GIFT"] = 16] = "ONLINE_GIFT";
            E_UI_TYPE[E_UI_TYPE["CAR_TRIAL"] = 17] = "CAR_TRIAL";
            E_UI_TYPE[E_UI_TYPE["NATIVEBANNER"] = 18] = "NATIVEBANNER";
            E_UI_TYPE[E_UI_TYPE["VIDEO_COIN"] = 19] = "VIDEO_COIN";
            E_UI_TYPE[E_UI_TYPE["CGTLTGETUICarUP5"] = 20] = "CGTLTGETUICarUP5";
            E_UI_TYPE[E_UI_TYPE["CONSTELLATION"] = 21] = "CONSTELLATION";
            E_UI_TYPE[E_UI_TYPE["CONSTELLATIONDESC"] = 22] = "CONSTELLATIONDESC";
            E_UI_TYPE[E_UI_TYPE["VIDEOAGAIN"] = 23] = "VIDEOAGAIN";
            E_UI_TYPE[E_UI_TYPE["NATIVEINSERT"] = 24] = "NATIVEINSERT";
            E_UI_TYPE[E_UI_TYPE["ADDDESKTOP"] = 25] = "ADDDESKTOP";
            E_UI_TYPE[E_UI_TYPE["REWARDHAT"] = 26] = "REWARDHAT";
            E_UI_TYPE[E_UI_TYPE["ONERACE"] = 27] = "ONERACE";
            E_UI_TYPE[E_UI_TYPE["MULTIRACE"] = 28] = "MULTIRACE";
            E_UI_TYPE[E_UI_TYPE["MULTIITEM"] = 29] = "MULTIITEM";
            E_UI_TYPE[E_UI_TYPE["PICKMODE"] = 30] = "PICKMODE";
            E_UI_TYPE[E_UI_TYPE["GAMECARDUI"] = 31] = "GAMECARDUI";
            E_UI_TYPE[E_UI_TYPE["CAREXPIRE"] = 32] = "CAREXPIRE";
            E_UI_TYPE[E_UI_TYPE["LIMITGIFT"] = 33] = "LIMITGIFT";
            E_UI_TYPE[E_UI_TYPE["GETPOWER"] = 34] = "GETPOWER";
            E_UI_TYPE[E_UI_TYPE["NEXTGIFT"] = 35] = "NEXTGIFT";
            E_UI_TYPE[E_UI_TYPE["GUIDETRYCAR"] = 36] = "GUIDETRYCAR";
            E_UI_TYPE[E_UI_TYPE["GETPRICE"] = 37] = "GETPRICE";
            E_UI_TYPE[E_UI_TYPE["GETREALPRICE"] = 38] = "GETREALPRICE";
            E_UI_TYPE[E_UI_TYPE["DRAWPRICE"] = 39] = "DRAWPRICE";
            E_UI_TYPE[E_UI_TYPE["FULLPAGE"] = 40] = "FULLPAGE";
            E_UI_TYPE[E_UI_TYPE["WXSHARE"] = 41] = "WXSHARE";
            E_UI_TYPE[E_UI_TYPE["WXSHAREINFO"] = 42] = "WXSHAREINFO";
            E_UI_TYPE[E_UI_TYPE["RECORD"] = 43] = "RECORD";
            E_UI_TYPE[E_UI_TYPE["TTTIP"] = 44] = "TTTIP";
            E_UI_TYPE[E_UI_TYPE["WXSHARE_NEW"] = 45] = "WXSHARE_NEW";
            E_UI_TYPE[E_UI_TYPE["welcomeBackUI"] = 46] = "welcomeBackUI";
        })(E_UI_TYPE || (E_UI_TYPE = {}));
        class UIManager {
            constructor() {
                this.lastUI = 0;
                this.SceneURLList = ["UIScenes/commonUI/PickRole.scene", "UIScenes/commonUI/LongBlackTip.scene", "UIScenes/commonUI/Start.scene", "UIScenes/commonUI/Battle.scene", "UIScenes/commonUI/Guide.scene", "UIScenes/commonUI/Profile.scene", "UIScenes/commonUI/Garage2.scene", "UIScenes/commonUI/Driver2.scene", "UIScenes/commonUI/GetCar.scene", "UIScenes/commonUI/CgtltGet.scene", "UIScenes/rank/RankingView.scene", "UIScenes/rank/RankResultView.scene", "UIScenes/commonUI/TrainingResultView.scene", "UIScenes/commonUI/LongPressTip.scene", "UIScenes/checkin/CheckInView.scene", "UIScenes/Voppo/luckypan/luckyPan.scene", "UIScenes/Voppo/onlineGift/OnlineGift.scene", "UIScenes/Voppo/CarTrial.scene", "UIScenes/commonUI/OppoBanner.scene", "UIScenes/Voppo/VideoCoin.scene", "UIScenes/commonUI/CgtltGetCarUp5.scene", "UIScenes/Voppo/constellation/ConstellationView.scene", "UIScenes/Voppo/constellation/ConstellationDesc.scene", "UIScenes/Vivo/Vivo_VideoAgain.scene", "UIScenes/Vivo/Vivo_InsertAd.scene", "UIScenes/commonUI/AddDeskTop.scene", "UIScenes/Voppo/RewardHat.scene", "UIScenes/RacingType/oneRace.scene", "UIScenes/RacingType/MultiRace.scene", "UIScenes/RacingType/MultiItem.scene", "UIScenes/commonUI/PickMode.scene", "UIScenes/commonUI/GameCard.scene", "UIScenes/commonUI/CarExpire.scene", "UIScenes/commonUI/LimitGift.scene", "UIScenes/Voppo/getPower/GetPower.scene", "UIScenes/qq/NextDayGift.scene", "UIScenes/qq/GuideTryCar.scene", "UIScenes/Voppo/GetPrice.scene", "UIScenes/Voppo/GetRealPrice.scene", "UIScenes/Voppo/DrawPrice.scene", "UIScenes/wx/FullPageTt.scene", "UIScenes/wx/WxShareFuLi.scene", "UIScenes/wx/WxShareInfo.scene", "UIScenes/tt/TtRecord.scene", "UIScenes/tt/TtTip.scene", "UIScenes/wx/WxShareView.scene", "UIScenes/wx/welcomeBack.scene"];
                this.loadCount = 0;
                this.lastTime = 0;
                window["UIMgr"] = this;
            }
            static get Ins() {
                return UIManager._ins || (UIManager._ins = new UIManager());
            }
            startLoadScene(loadCount = 47) {
                this.SceneList = new Array();
                this.loadSceneNum = 0;
                this.lastTime = Date.now();
                this.loadCount = loadCount;
                Laya.Scene.load(this.SceneURLList[this.loadSceneNum], Laya.Handler.create(this, this.sceneCallback));
            }
            sceneCallback(scene) {
                this.SceneList.push(scene);
                this.loadSceneNum++;
                if (this.loadSceneNum < this.loadCount) {
                    this.processHandler && this.processHandler.runWith(this.loadSceneNum / this.loadCount);
                    if (this.loadSceneNum > 0) console.log("loadScene:" + this.SceneURLList[this.loadSceneNum - 1], Date.now() - this.lastTime);
                    this.lastTime = Date.now();
                    Laya.Scene.load(this.SceneURLList[this.loadSceneNum], Laya.Handler.create(this, this.sceneCallback));
                } else {
                    this.preloadComplete();
                }
            }
            preloadUI(count, complete, process) {
                this.completeHandler = complete;
                this.processHandler = process;
                this.startLoadScene(count);
            }
            preloadAllUI(complete, process) {
                this.completeHandler = complete;
                this.processHandler = process;
                this.startLoadScene();
            }
            preloadComplete() {
                if (this.completeHandler) {
                    this.completeHandler.run();
                    this.completeHandler = null;
                }
            }
            getScene(type) {
                this.lastUI = type;
                return this.SceneList[type];
            }
            addUiOnScene3D(type, sceneParent = null) {
                if (!sceneParent) Laya.stage.addChild(this.SceneList[type]); else sceneParent.addChild(this.SceneList[type]);
                SceneMgr.Ins.onTouchEvent();
            }
        }
        var SDK_EVENT;
        (function (SDK_EVENT) {
            SDK_EVENT["_loading页开始加载"] = "loading_start";
            SDK_EVENT["_loading页加载完成"] = "loading_over";
            SDK_EVENT["_首次进入游戏玩家"] = "first_player";
            SDK_EVENT["_再次进入游戏玩家"] = "old_player";
            SDK_EVENT["_老用户欢迎回来界面"] = "welcome_back";
            SDK_EVENT["_欢迎回来界面玩家不勾选文字框"] = "uncheck";
            SDK_EVENT["_签到界面"] = "sign_in";
            SDK_EVENT["_签到次日奖励界面"] = "next_day";
            SDK_EVENT["_限时礼包界面"] = "gift_bag";
            SDK_EVENT["_转盘界面"] = "lucky_turntable";
            SDK_EVENT["_打开设置界面"] = "set_up";
            SDK_EVENT["_打开免费金币界面"] = "gold_coins";
            SDK_EVENT["_打开段位奖励界面"] = "segment_position";
            SDK_EVENT["_段位奖励界面点击分享邀请"] = "level_share";
            SDK_EVENT["_打开车库界面"] = "garage";
            SDK_EVENT["_打开背包界面"] = "bag";
            SDK_EVENT["_打卡在线礼包界面"] = "online_bag";
            SDK_EVENT["_打开星座界面"] = "constellation";
            SDK_EVENT["_打开连胜界面"] = "winning_streak";
            SDK_EVENT["_连胜界面点击分享邀请"] = "winning_share";
            SDK_EVENT["_打开开始游戏界面"] = "play_selection";
            SDK_EVENT["_打开个人竞速界面"] = "personal_racing";
            SDK_EVENT["_打开多人道具界面"] = "multiplayer_props";
            SDK_EVENT["_打开多人竞速界面"] = "multiplayer_racing";
            SDK_EVENT["_点击个人竞速开始游戏按钮"] = "personal_start";
            SDK_EVENT["_个人竞速排名界面"] = "personal_rank";
            SDK_EVENT["_完成个人竞速获取奖励界面"] = "personal_get";
            SDK_EVENT["_点击多人道具开始游戏按钮"] = "prop_start";
            SDK_EVENT["_多人道具排名界面"] = "prop_rank";
            SDK_EVENT["_完成多人道具获取奖励界面"] = "prop_get";
            SDK_EVENT["_多人道具获取奖励界面点击下一局"] = "prop_again";
            SDK_EVENT["_多人道具获取奖励界面点击确定"] = "prop_determine";
            SDK_EVENT["_多人道具获取奖励界面点击分享邀请"] = "prop_share";
            SDK_EVENT["_点击多人竞速开始游戏按钮"] = "multiplayer_start";
            SDK_EVENT["_多人竞速排名界面"] = "multiplayer_rank";
            SDK_EVENT["_完成多人竞速获取奖励界面"] = "multiplayer_get";
            SDK_EVENT["_多人竞速获取奖励界面点击下一局"] = "multiplayer_again";
            SDK_EVENT["_多人竞速获取奖励界面点击确定"] = "multiplayer_determine";
            SDK_EVENT["_多人竞速获取奖励界面点击分享邀请"] = "multiplayer_share";
            SDK_EVENT["_实力不足界面"] = "insufficient_strength";
            SDK_EVENT["_实力不足点击豪车助我"] = "car_help";
            SDK_EVENT["_实力不足点击升级车辆"] = "upgrade_car";
            SDK_EVENT["_实力不足点击免费转盘"] = "free_turntable";
            SDK_EVENT["_实力不足点击一键试用"] = "one_click";
            SDK_EVENT["_实力不足点击去练习赛"] = "practice_match";
            SDK_EVENT["_实力不足点击不了谢谢"] = "thanks";
            SDK_EVENT["_新手引导_"] = "novice_guidance";
        })(SDK_EVENT || (SDK_EVENT = {}));
        var STAGE_EVENT;
        (function (STAGE_EVENT) {
            STAGE_EVENT["enter"] = "stage_enter";
            STAGE_EVENT["fail"] = "stage_fail";
            STAGE_EVENT["success"] = "stage_success";
            STAGE_EVENT["suspend"] = "stage_suspend";
            STAGE_EVENT["earn_rewards"] = "earn_rewards";
        })(STAGE_EVENT || (STAGE_EVENT = {}));
        var LEVEL_EVENT;
        (function (LEVEL_EVENT) {
            LEVEL_EVENT["level_start"] = "level_start";
            LEVEL_EVENT["level_up"] = "level_up";
        })(LEVEL_EVENT || (LEVEL_EVENT = {}));
        class PrivateTracker_new {
            constructor() {
                this._openId = Laya.LocalStorage.getItem("_p_openId");
                let ef = this.effendi;
                ef && ef.init && ef.init();
            }
            static get Ins() {
                return this["ins"] || (this["ins"] = new this());
            }
            get effendi() {
                if (!this["_effendi"]) {
                    if (Laya.Browser.onMiniGame) {
                        this["_effendi"] = window["effendi"];
                    }
                }
                return this["_effendi"];
            }
            get openId() {
                return this._openId;
            }
            set openId(x) {
                Laya.LocalStorage.setItem("_p_openId", this._openId = x);
                this.effendi && this.effendi.setOpenId(x);
            }
            sendEvent(event, params) {
                if (this.effendi) {
                    this.effendi.sendEvent(event, params);
                }
            }
            sendStage(stageId, event, eventParam) {
                if (this.effendi) {
                    this.effendi.sendStage(stageId, event, eventParam);
                }
            }
            sendLevel(levelId, event, eventParam) {
                if (this.effendi) {
                    this.effendi.sendLevel(levelId, event, eventParam);
                }
            }
            sendPage(lastPageId, currPageId) {
                if (this.effendi) {
                    this.effendi.sendPage(lastPageId, currPageId);
                }
            }
        }
        class GuideInfo {
            constructor(_guideType) {
                this.guideType = _guideType;
                this.guideStepList = new Array();
            }
        }
        class GuideMgr {
            constructor() {
                this.guideInfoMap = {};
                this.isGuiding = false;
                this.isGuiding = false;
                var guideCfgList = CCfgMgr.Ins.cfgGuideInfo.List;
                for (var i = 0; i < guideCfgList.length; i++) {
                    var cfg = guideCfgList[i];
                    if (this.guideInfoMap[cfg.ID]) {
                        this.guideInfoMap[cfg.ID].guideStepList.push(cfg);
                    } else {
                        this.guideInfoMap[cfg.ID] = new GuideInfo(cfg.ID);
                        this.guideInfoMap[cfg.ID].guideStepList.push(cfg);
                    }
                }
            }
            static get Ins() {
                return GuideMgr._ins || (GuideMgr._ins = new GuideMgr());
            }
            typeStr(type) {
                switch (type) {
                    case E_GUIDE_TYPE.NONE:
                        return "无";

                    case E_GUIDE_TYPE.BATTLE_START:
                        return "进游戏";

                    case E_GUIDE_TYPE.BATTLE_RUSH:
                        return "起步冲刺";

                    case E_GUIDE_TYPE.BATTLE_TURN_LEFT:
                        return "左转";

                    case E_GUIDE_TYPE.BATTLE_FINISH_TURN_LEFT:
                        return "左转OK";

                    case E_GUIDE_TYPE.BATTLE_CURVE:
                        return "弯道";

                    case E_GUIDE_TYPE.BATTLE_NOS:
                        return "氮气蓝";

                    case E_GUIDE_TYPE.BATTLE_GOOD:
                        return "第二圈引导";

                    case E_GUIDE_TYPE.BATTLE_STAR:
                        return "星星";

                    case E_GUIDE_TYPE.BATTLE_GHOST:
                        return "幽灵";

                    case E_GUIDE_TYPE.BATTLE_SKILL:
                        return "氮气红";

                    case E_GUIDE_TYPE.BATTLE_OVER:
                        return "战斗结束";

                    case E_GUIDE_TYPE.FIRST_START:
                        return "进首页";

                    case E_GUIDE_TYPE.UPGRADE_CAR:
                        return "升级车";

                    case E_GUIDE_TYPE.START_SPEED:
                        return "排位竞速赛";

                    case E_GUIDE_TYPE.START_PROP:
                        return "排位道具赛";

                    case E_GUIDE_TYPE.ANOTHER_PROP:
                        return "休闲道具赛";

                    case E_GUIDE_TYPE.CLICK_GARAGE:
                        return "进车库";

                    case E_GUIDE_TYPE.ENTER_MULTI_SPEED:
                        return "进入多人竞速";

                    case E_GUIDE_TYPE.ENTER_MULTI_PROP:
                        return "进入多人道具";

                    case E_GUIDE_TYPE.ENTER_SINGLE_SPEED:
                        return "进入个人竞速";

                    case E_GUIDE_TYPE.START_SINGLE_GAME:
                        return "开始个人竞速";

                    case E_GUIDE_TYPE.SINGLE_MAP_UNLOCK:
                        return "个人竞速地图解锁";

                    case E_GUIDE_TYPE.RANK_REWARD:
                        return "排位赛奖励";

                    case E_GUIDE_TYPE.MAX:
                        return "最大";
                }
            }
            startGuide(guideType, targetUI, stepCallback) {
                if (this.guideInfoMap[guideType]) {
                    this.curGuideType = guideType;
                    this.curStep = 1;
                    var curGuide = this.guideInfoMap[guideType].guideStepList[this.curStep - 1];
                    if (targetUI) this.curTargetUI = targetUI; else {
                        switch (guideType) {
                            case E_GUIDE_TYPE.NONE:
                                break;

                            case E_GUIDE_TYPE.BATTLE_START:
                                this.curTargetUI = UIManager.Ins.getScene(E_UI_TYPE.BATTLEUI);
                                break;

                            case E_GUIDE_TYPE.BATTLE_RUSH:
                                this.curTargetUI = UIManager.Ins.getScene(E_UI_TYPE.BATTLEUI);
                                break;

                            case E_GUIDE_TYPE.BATTLE_TURN_LEFT:
                                this.curTargetUI = UIManager.Ins.getScene(E_UI_TYPE.BATTLEUI);
                                break;

                            case E_GUIDE_TYPE.BATTLE_FINISH_TURN_LEFT:
                                this.curTargetUI = UIManager.Ins.getScene(E_UI_TYPE.BATTLEUI);
                                break;

                            case E_GUIDE_TYPE.BATTLE_CURVE:
                                this.curTargetUI = UIManager.Ins.getScene(E_UI_TYPE.BATTLEUI);
                                break;

                            case E_GUIDE_TYPE.BATTLE_NOS:
                                this.curTargetUI = UIManager.Ins.getScene(E_UI_TYPE.BATTLEUI);
                                break;

                            case E_GUIDE_TYPE.BATTLE_GOOD:
                                this.curTargetUI = UIManager.Ins.getScene(E_UI_TYPE.BATTLEUI);
                                break;

                            case E_GUIDE_TYPE.BATTLE_STAR:
                                this.curTargetUI = UIManager.Ins.getScene(E_UI_TYPE.BATTLEUI);
                                break;

                            case E_GUIDE_TYPE.BATTLE_GHOST:
                                this.curTargetUI = UIManager.Ins.getScene(E_UI_TYPE.BATTLEUI);
                                break;

                            case E_GUIDE_TYPE.BATTLE_SKILL:
                                this.curTargetUI = UIManager.Ins.getScene(E_UI_TYPE.BATTLEUI);
                                break;

                            case E_GUIDE_TYPE.BATTLE_OVER:
                                this.curTargetUI = UIManager.Ins.getScene(E_UI_TYPE.BATTLEUI);
                                break;

                            case E_GUIDE_TYPE.FIRST_START:
                                break;

                            case E_GUIDE_TYPE.UPGRADE_CAR:
                                break;

                            case E_GUIDE_TYPE.START_SPEED:
                                break;

                            default:
                                break;
                        }
                    }
                    if (this.curTargetUI) {
                        this.curGuideUI = UIManager.Ins.getScene(E_UI_TYPE.GUIDE_UI);
                        if (this.curTargetUI["curTouchId"]) this.curTargetUI["curTouchId"] = -100;
                        if (curGuide._guideObj) {
                            var targetObj = this.curTargetUI[curGuide._guideObj];
                            if (targetObj) {
                                this.isGuiding = true;
                                Laya.stage.addChild(this.curGuideUI);
                                this.curGuideUI.playGuide(curGuide, targetObj);
                                this.curGuideCallback = stepCallback;
                                return;
                            }
                        } else {
                            this.isGuiding = true;
                            Laya.stage.addChild(this.curGuideUI);
                            this.curGuideUI.playGuide(curGuide, null);
                            this.curGuideCallback = stepCallback;
                            return;
                        }
                    }
                    this.stopGuide();
                }
            }
            nextStep() {
                if (this.guideInfoMap[this.curGuideType]) {
                    this.curStep++;
                    if (this.guideInfoMap[this.curGuideType].guideStepList.length >= this.curStep) {
                        var curGuide = this.guideInfoMap[this.curGuideType].guideStepList[this.curStep - 1];
                        if (curGuide.nextID > 0) this.curTargetUI = UIManager.Ins.getScene(curGuide.nextID);
                        var targetObj = this.curTargetUI[curGuide._guideObj];
                        if (targetObj) {
                            this.curGuideUI.playGuide(curGuide, targetObj);
                            return;
                        } else {
                            this.curGuideUI.playGuide(curGuide, null);
                            return;
                        }
                    }
                }
                this.stopGuide();
            }
            stopGuide() {
                PrivateTracker_new.Ins.sendEvent(SDK_EVENT._新手引导_, {
                    "_新手引导_": "_新手引导_"
                });
                DataMgr.Ins.guideData[this.curGuideType] = false;
                if (this.curGuideType == E_GUIDE_TYPE.START_PROP) DataMgr.Ins.guideData[E_GUIDE_TYPE.ANOTHER_PROP] = false;
                if (this.curGuideType == E_GUIDE_TYPE.ANOTHER_PROP) DataMgr.Ins.guideData[E_GUIDE_TYPE.START_PROP] = false;
                if (this.curGuideType == E_GUIDE_TYPE.RANK_REWARD) {
                    DataMgr.Ins.refreshGuideData();
                }
                if (this.curGuideCallback) this.curGuideCallback();
                this.curGuideUI.removeSelf();
                this.curGuideType = E_GUIDE_TYPE.NONE;
                this.curStep = 0;
                this.curTargetUI = null;
                this.isGuiding = false;
            }
            skipGuide() { }
        }
        var View = Laya.View;
        var Scene = Laya.Scene;
        var REG = Laya.ClassUtils.regClass;
        var ui;
        (function (ui) {
            class LoadingUI extends Scene {
                constructor() {
                    super();
                }
                createChildren() {
                    super.createChildren();
                    this.loadScene("Loading");
                }
            }
            ui.LoadingUI = LoadingUI;
            REG("ui.LoadingUI", LoadingUI);
        })(ui || (ui = {}));
        (function (ui) {
            var UIScenes;
            (function (UIScenes) {
                var advertisement;
                (function (advertisement) {
                    class AdRootUI extends Scene {
                        constructor() {
                            super();
                        }
                        createChildren() {
                            super.createChildren();
                            this.loadScene("UIScenes/advertisement/AdRoot");
                        }
                    }
                    advertisement.AdRootUI = AdRootUI;
                    REG("ui.UIScenes.advertisement.AdRootUI", AdRootUI);
                    class outputListTemp1UI extends Scene {
                        constructor() {
                            super();
                        }
                        createChildren() {
                            super.createChildren();
                            this.loadScene("UIScenes/advertisement/outputListTemp1");
                        }
                    }
                    advertisement.outputListTemp1UI = outputListTemp1UI;
                    REG("ui.UIScenes.advertisement.outputListTemp1UI", outputListTemp1UI);
                    class outputListTemp2UI extends Scene {
                        constructor() {
                            super();
                        }
                        createChildren() {
                            super.createChildren();
                            this.loadScene("UIScenes/advertisement/outputListTemp2");
                        }
                    }
                    advertisement.outputListTemp2UI = outputListTemp2UI;
                    REG("ui.UIScenes.advertisement.outputListTemp2UI", outputListTemp2UI);
                    class outputSingleTemp1UI extends Scene {
                        constructor() {
                            super();
                        }
                        createChildren() {
                            super.createChildren();
                            this.loadScene("UIScenes/advertisement/outputSingleTemp1");
                        }
                    }
                    advertisement.outputSingleTemp1UI = outputSingleTemp1UI;
                    REG("ui.UIScenes.advertisement.outputSingleTemp1UI", outputSingleTemp1UI);
                })(advertisement = UIScenes.advertisement || (UIScenes.advertisement = {}));
            })(UIScenes = ui.UIScenes || (ui.UIScenes = {}));
        })(ui || (ui = {}));
        (function (ui) {
            var UIScenes;
            (function (UIScenes) {
                var ani;
                (function (ani) {
                    class Car_Flag_runUI extends Scene {
                        constructor() {
                            super();
                        }
                        createChildren() {
                            super.createChildren();
                            this.loadScene("UIScenes/ani/Car_Flag_run");
                        }
                    }
                    ani.Car_Flag_runUI = Car_Flag_runUI;
                    REG("ui.UIScenes.ani.Car_Flag_runUI", Car_Flag_runUI);
                    class Character_choseBGUI extends Scene {
                        constructor() {
                            super();
                        }
                        createChildren() {
                            super.createChildren();
                            this.loadScene("UIScenes/ani/Character_choseBG");
                        }
                    }
                    ani.Character_choseBGUI = Character_choseBGUI;
                    REG("ui.UIScenes.ani.Character_choseBGUI", Character_choseBGUI);
                })(ani = UIScenes.ani || (UIScenes.ani = {}));
            })(UIScenes = ui.UIScenes || (ui.UIScenes = {}));
        })(ui || (ui = {}));
        (function (ui) {
            var UIScenes;
            (function (UIScenes) {
                var checkin;
                (function (checkin) {
                    class checkinItemUI extends Scene {
                        constructor() {
                            super();
                        }
                        createChildren() {
                            super.createChildren();
                            this.loadScene("UIScenes/checkin/checkinItem");
                        }
                    }
                    checkin.checkinItemUI = checkinItemUI;
                    REG("ui.UIScenes.checkin.checkinItemUI", checkinItemUI);
                    class CheckInViewUI extends Scene {
                        constructor() {
                            super();
                        }
                        createChildren() {
                            super.createChildren();
                            this.loadScene("UIScenes/checkin/CheckInView");
                        }
                    }
                    checkin.CheckInViewUI = CheckInViewUI;
                    REG("ui.UIScenes.checkin.CheckInViewUI", CheckInViewUI);
                    class checkitem2UI extends Scene {
                        constructor() {
                            super();
                        }
                        createChildren() {
                            super.createChildren();
                            this.loadScene("UIScenes/checkin/checkitem2");
                        }
                    }
                    checkin.checkitem2UI = checkitem2UI;
                    REG("ui.UIScenes.checkin.checkitem2UI", checkitem2UI);
                })(checkin = UIScenes.checkin || (UIScenes.checkin = {}));
            })(UIScenes = ui.UIScenes || (ui.UIScenes = {}));
        })(ui || (ui = {}));
        (function (ui) {
            var UIScenes;
            (function (UIScenes) {
                var commonUI;
                (function (commonUI) {
                    class AddDeskTopUI extends Scene {
                        constructor() {
                            super();
                        }
                        createChildren() {
                            super.createChildren();
                            this.loadScene("UIScenes/commonUI/AddDeskTop");
                        }
                    }
                    commonUI.AddDeskTopUI = AddDeskTopUI;
                    REG("ui.UIScenes.commonUI.AddDeskTopUI", AddDeskTopUI);
                    class BattleUI extends Scene {
                        constructor() {
                            super();
                        }
                        createChildren() {
                            super.createChildren();
                            this.loadScene("UIScenes/commonUI/Battle");
                        }
                    }
                    commonUI.BattleUI = BattleUI;
                    REG("ui.UIScenes.commonUI.BattleUI", BattleUI);
                    class CarExpireUI extends Scene {
                        constructor() {
                            super();
                        }
                        createChildren() {
                            super.createChildren();
                            this.loadScene("UIScenes/commonUI/CarExpire");
                        }
                    }
                    commonUI.CarExpireUI = CarExpireUI;
                    REG("ui.UIScenes.commonUI.CarExpireUI", CarExpireUI);
                    class CgtltGetUI extends Scene {
                        constructor() {
                            super();
                        }
                        createChildren() {
                            super.createChildren();
                            this.loadScene("UIScenes/commonUI/CgtltGet");
                        }
                    }
                    commonUI.CgtltGetUI = CgtltGetUI;
                    REG("ui.UIScenes.commonUI.CgtltGetUI", CgtltGetUI);
                    class CgtltGetCarUp5UI extends Scene {
                        constructor() {
                            super();
                        }
                        createChildren() {
                            super.createChildren();
                            this.loadScene("UIScenes/commonUI/CgtltGetCarUp5");
                        }
                    }
                    commonUI.CgtltGetCarUp5UI = CgtltGetCarUp5UI;
                    REG("ui.UIScenes.commonUI.CgtltGetCarUp5UI", CgtltGetCarUp5UI);
                    class Driver2UI extends Scene {
                        constructor() {
                            super();
                        }
                        createChildren() {
                            super.createChildren();
                            this.loadScene("UIScenes/commonUI/Driver2");
                        }
                    }
                    commonUI.Driver2UI = Driver2UI;
                    REG("ui.UIScenes.commonUI.Driver2UI", Driver2UI);
                    class GameCardUI extends Scene {
                        constructor() {
                            super();
                        }
                        createChildren() {
                            super.createChildren();
                            this.loadScene("UIScenes/commonUI/GameCard");
                        }
                    }
                    commonUI.GameCardUI = GameCardUI;
                    REG("ui.UIScenes.commonUI.GameCardUI", GameCardUI);
                    class Garage2UI extends Scene {
                        constructor() {
                            super();
                        }
                        createChildren() {
                            super.createChildren();
                            this.loadScene("UIScenes/commonUI/Garage2");
                        }
                    }
                    commonUI.Garage2UI = Garage2UI;
                    REG("ui.UIScenes.commonUI.Garage2UI", Garage2UI);
                    class GetCarUI extends Scene {
                        constructor() {
                            super();
                        }
                        createChildren() {
                            super.createChildren();
                            this.loadScene("UIScenes/commonUI/GetCar");
                        }
                    }
                    commonUI.GetCarUI = GetCarUI;
                    REG("ui.UIScenes.commonUI.GetCarUI", GetCarUI);
                    class GuideUI extends Scene {
                        constructor() {
                            super();
                        }
                        createChildren() {
                            super.createChildren();
                            this.loadScene("UIScenes/commonUI/Guide");
                        }
                    }
                    commonUI.GuideUI = GuideUI;
                    REG("ui.UIScenes.commonUI.GuideUI", GuideUI);
                    class LianWinUI extends Scene {
                        constructor() {
                            super();
                        }
                        createChildren() {
                            super.createChildren();
                            this.loadScene("UIScenes/commonUI/LianWin");
                        }
                    }
                    commonUI.LianWinUI = LianWinUI;
                    REG("ui.UIScenes.commonUI.LianWinUI", LianWinUI);
                    class LimitGiftUI extends Scene {
                        constructor() {
                            super();
                        }
                        createChildren() {
                            super.createChildren();
                            this.loadScene("UIScenes/commonUI/LimitGift");
                        }
                    }
                    commonUI.LimitGiftUI = LimitGiftUI;
                    REG("ui.UIScenes.commonUI.LimitGiftUI", LimitGiftUI);
                    class LongBlackTipUI extends Scene {
                        constructor() {
                            super();
                        }
                        createChildren() {
                            super.createChildren();
                            this.loadScene("UIScenes/commonUI/LongBlackTip");
                        }
                    }
                    commonUI.LongBlackTipUI = LongBlackTipUI;
                    REG("ui.UIScenes.commonUI.LongBlackTipUI", LongBlackTipUI);
                    class LongPressTipUI extends Scene {
                        constructor() {
                            super();
                        }
                        createChildren() {
                            super.createChildren();
                            this.loadScene("UIScenes/commonUI/LongPressTip");
                        }
                    }
                    commonUI.LongPressTipUI = LongPressTipUI;
                    REG("ui.UIScenes.commonUI.LongPressTipUI", LongPressTipUI);
                    class MiniMapUI extends View {
                        constructor() {
                            super();
                        }
                        createChildren() {
                            super.createChildren();
                            this.loadScene("UIScenes/commonUI/MiniMap");
                        }
                    }
                    commonUI.MiniMapUI = MiniMapUI;
                    REG("ui.UIScenes.commonUI.MiniMapUI", MiniMapUI);
                    class NpcNameUI extends Scene {
                        constructor() {
                            super();
                        }
                        createChildren() {
                            super.createChildren();
                            this.loadScene("UIScenes/commonUI/NpcName");
                        }
                    }
                    commonUI.NpcNameUI = NpcNameUI;
                    REG("ui.UIScenes.commonUI.NpcNameUI", NpcNameUI);
                    class OppoBannerUI extends Scene {
                        constructor() {
                            super();
                        }
                        createChildren() {
                            super.createChildren();
                            this.loadScene("UIScenes/commonUI/OppoBanner");
                        }
                    }
                    commonUI.OppoBannerUI = OppoBannerUI;
                    REG("ui.UIScenes.commonUI.OppoBannerUI", OppoBannerUI);
                    class PickModeUI extends Scene {
                        constructor() {
                            super();
                        }
                        createChildren() {
                            super.createChildren();
                            this.loadScene("UIScenes/commonUI/PickMode");
                        }
                    }
                    commonUI.PickModeUI = PickModeUI;
                    REG("ui.UIScenes.commonUI.PickModeUI", PickModeUI);
                    class PickRoleUI extends Scene {
                        constructor() {
                            super();
                        }
                        createChildren() {
                            super.createChildren();
                            this.loadScene("UIScenes/commonUI/PickRole");
                        }
                    }
                    commonUI.PickRoleUI = PickRoleUI;
                    REG("ui.UIScenes.commonUI.PickRoleUI", PickRoleUI);
                    class ProfileUI extends Scene {
                        constructor() {
                            super();
                        }
                        createChildren() {
                            super.createChildren();
                            this.loadScene("UIScenes/commonUI/Profile");
                        }
                    }
                    commonUI.ProfileUI = ProfileUI;
                    REG("ui.UIScenes.commonUI.ProfileUI", ProfileUI);
                    class StartUI extends Scene {
                        constructor() {
                            super();
                        }
                        createChildren() {
                            super.createChildren();
                            this.loadScene("UIScenes/commonUI/Start");
                        }
                    }
                    commonUI.StartUI = StartUI;
                    REG("ui.UIScenes.commonUI.StartUI", StartUI);
                    class startRushAniUI extends Scene {
                        constructor() {
                            super();
                        }
                        createChildren() {
                            super.createChildren();
                            this.loadScene("UIScenes/commonUI/startRushAni");
                        }
                    }
                    commonUI.startRushAniUI = startRushAniUI;
                    REG("ui.UIScenes.commonUI.startRushAniUI", startRushAniUI);
                    class star_qiandao_1UI extends Scene {
                        constructor() {
                            super();
                        }
                        createChildren() {
                            super.createChildren();
                            this.loadScene("UIScenes/commonUI/star_qiandao_1");
                        }
                    }
                    commonUI.star_qiandao_1UI = star_qiandao_1UI;
                    REG("ui.UIScenes.commonUI.star_qiandao_1UI", star_qiandao_1UI);
                    class star_qiandao_carUI extends Scene {
                        constructor() {
                            super();
                        }
                        createChildren() {
                            super.createChildren();
                            this.loadScene("UIScenes/commonUI/star_qiandao_car");
                        }
                    }
                    commonUI.star_qiandao_carUI = star_qiandao_carUI;
                    REG("ui.UIScenes.commonUI.star_qiandao_carUI", star_qiandao_carUI);
                    class trainingEndItemUI extends Scene {
                        constructor() {
                            super();
                        }
                        createChildren() {
                            super.createChildren();
                            this.loadScene("UIScenes/commonUI/trainingEndItem");
                        }
                    }
                    commonUI.trainingEndItemUI = trainingEndItemUI;
                    REG("ui.UIScenes.commonUI.trainingEndItemUI", trainingEndItemUI);
                    class TrainingResultViewUI extends Scene {
                        constructor() {
                            super();
                        }
                        createChildren() {
                            super.createChildren();
                            this.loadScene("UIScenes/commonUI/TrainingResultView");
                        }
                    }
                    commonUI.TrainingResultViewUI = TrainingResultViewUI;
                    REG("ui.UIScenes.commonUI.TrainingResultViewUI", TrainingResultViewUI);
                    class winEffectUI extends Scene {
                        constructor() {
                            super();
                        }
                        createChildren() {
                            super.createChildren();
                            this.loadScene("UIScenes/commonUI/winEffect");
                        }
                    }
                    commonUI.winEffectUI = winEffectUI;
                    REG("ui.UIScenes.commonUI.winEffectUI", winEffectUI);
                })(commonUI = UIScenes.commonUI || (UIScenes.commonUI = {}));
            })(UIScenes = ui.UIScenes || (ui.UIScenes = {}));
        })(ui || (ui = {}));
        (function (ui) {
            var UIScenes;
            (function (UIScenes) {
                var qq;
                (function (qq) {
                    class GuideTryCarUI extends Scene {
                        constructor() {
                            super();
                        }
                        createChildren() {
                            super.createChildren();
                            this.loadScene("UIScenes/qq/GuideTryCar");
                        }
                    }
                    qq.GuideTryCarUI = GuideTryCarUI;
                    REG("ui.UIScenes.qq.GuideTryCarUI", GuideTryCarUI);
                    class NextDayGiftUI extends Scene {
                        constructor() {
                            super();
                        }
                        createChildren() {
                            super.createChildren();
                            this.loadScene("UIScenes/qq/NextDayGift");
                        }
                    }
                    qq.NextDayGiftUI = NextDayGiftUI;
                    REG("ui.UIScenes.qq.NextDayGiftUI", NextDayGiftUI);
                })(qq = UIScenes.qq || (UIScenes.qq = {}));
            })(UIScenes = ui.UIScenes || (ui.UIScenes = {}));
        })(ui || (ui = {}));
        (function (ui) {
            var UIScenes;
            (function (UIScenes) {
                var RacingType;
                (function (RacingType) {
                    var item;
                    (function (item) {
                        class MutiRaceItemUI extends Scene {
                            constructor() {
                                super();
                            }
                            createChildren() {
                                super.createChildren();
                                this.loadScene("UIScenes/RacingType/item/MutiRaceItem");
                            }
                        }
                        item.MutiRaceItemUI = MutiRaceItemUI;
                        REG("ui.UIScenes.RacingType.item.MutiRaceItemUI", MutiRaceItemUI);
                        class onRaceItemUI extends Scene {
                            constructor() {
                                super();
                            }
                            createChildren() {
                                super.createChildren();
                                this.loadScene("UIScenes/RacingType/item/onRaceItem");
                            }
                        }
                        item.onRaceItemUI = onRaceItemUI;
                        REG("ui.UIScenes.RacingType.item.onRaceItemUI", onRaceItemUI);
                    })(item = RacingType.item || (RacingType.item = {}));
                })(RacingType = UIScenes.RacingType || (UIScenes.RacingType = {}));
            })(UIScenes = ui.UIScenes || (ui.UIScenes = {}));
        })(ui || (ui = {}));
        (function (ui) {
            var UIScenes;
            (function (UIScenes) {
                var RacingType;
                (function (RacingType) {
                    class MultiItemUI extends Scene {
                        constructor() {
                            super();
                        }
                        createChildren() {
                            super.createChildren();
                            this.loadScene("UIScenes/RacingType/MultiItem");
                        }
                    }
                    RacingType.MultiItemUI = MultiItemUI;
                    REG("ui.UIScenes.RacingType.MultiItemUI", MultiItemUI);
                    class MultiRaceUI extends Scene {
                        constructor() {
                            super();
                        }
                        createChildren() {
                            super.createChildren();
                            this.loadScene("UIScenes/RacingType/MultiRace");
                        }
                    }
                    RacingType.MultiRaceUI = MultiRaceUI;
                    REG("ui.UIScenes.RacingType.MultiRaceUI", MultiRaceUI);
                    class oneRaceUI extends Scene {
                        constructor() {
                            super();
                        }
                        createChildren() {
                            super.createChildren();
                            this.loadScene("UIScenes/RacingType/oneRace");
                        }
                    }
                    RacingType.oneRaceUI = oneRaceUI;
                    REG("ui.UIScenes.RacingType.oneRaceUI", oneRaceUI);
                })(RacingType = UIScenes.RacingType || (UIScenes.RacingType = {}));
            })(UIScenes = ui.UIScenes || (ui.UIScenes = {}));
        })(ui || (ui = {}));
        (function (ui) {
            var UIScenes;
            (function (UIScenes) {
                var rank;
                (function (rank) {
                    class RankingViewUI extends Scene {
                        constructor() {
                            super();
                        }
                        createChildren() {
                            super.createChildren();
                            this.loadScene("UIScenes/rank/RankingView");
                        }
                    }
                    rank.RankingViewUI = RankingViewUI;
                    REG("ui.UIScenes.rank.RankingViewUI", RankingViewUI);
                    class RankResultViewUI extends Scene {
                        constructor() {
                            super();
                        }
                        createChildren() {
                            super.createChildren();
                            this.loadScene("UIScenes/rank/RankResultView");
                        }
                    }
                    rank.RankResultViewUI = RankResultViewUI;
                    REG("ui.UIScenes.rank.RankResultViewUI", RankResultViewUI);
                })(rank = UIScenes.rank || (UIScenes.rank = {}));
            })(UIScenes = ui.UIScenes || (ui.UIScenes = {}));
        })(ui || (ui = {}));
        (function (ui) {
            var UIScenes;
            (function (UIScenes) {
                var tt;
                (function (tt) {
                    class TtRecordUI extends Scene {
                        constructor() {
                            super();
                        }
                        createChildren() {
                            super.createChildren();
                            this.loadScene("UIScenes/tt/TtRecord");
                        }
                    }
                    tt.TtRecordUI = TtRecordUI;
                    REG("ui.UIScenes.tt.TtRecordUI", TtRecordUI);
                    class TtTipUI extends Scene {
                        constructor() {
                            super();
                        }
                        createChildren() {
                            super.createChildren();
                            this.loadScene("UIScenes/tt/TtTip");
                        }
                    }
                    tt.TtTipUI = TtTipUI;
                    REG("ui.UIScenes.tt.TtTipUI", TtTipUI);
                })(tt = UIScenes.tt || (UIScenes.tt = {}));
            })(UIScenes = ui.UIScenes || (ui.UIScenes = {}));
        })(ui || (ui = {}));
        (function (ui) {
            var UIScenes;
            (function (UIScenes) {
                var Vivo;
                (function (Vivo) {
                    class Vivo_InsertAdUI extends Scene {
                        constructor() {
                            super();
                        }
                        createChildren() {
                            super.createChildren();
                            this.loadScene("UIScenes/Vivo/Vivo_InsertAd");
                        }
                    }
                    Vivo.Vivo_InsertAdUI = Vivo_InsertAdUI;
                    REG("ui.UIScenes.Vivo.Vivo_InsertAdUI", Vivo_InsertAdUI);
                    class Vivo_VideoAgainUI extends Scene {
                        constructor() {
                            super();
                        }
                        createChildren() {
                            super.createChildren();
                            this.loadScene("UIScenes/Vivo/Vivo_VideoAgain");
                        }
                    }
                    Vivo.Vivo_VideoAgainUI = Vivo_VideoAgainUI;
                    REG("ui.UIScenes.Vivo.Vivo_VideoAgainUI", Vivo_VideoAgainUI);
                })(Vivo = UIScenes.Vivo || (UIScenes.Vivo = {}));
            })(UIScenes = ui.UIScenes || (ui.UIScenes = {}));
        })(ui || (ui = {}));
        (function (ui) {
            var UIScenes;
            (function (UIScenes) {
                var Voppo;
                (function (Voppo) {
                    class CarTrialUI extends Scene {
                        constructor() {
                            super();
                        }
                        createChildren() {
                            super.createChildren();
                            this.loadScene("UIScenes/Voppo/CarTrial");
                        }
                    }
                    Voppo.CarTrialUI = CarTrialUI;
                    REG("ui.UIScenes.Voppo.CarTrialUI", CarTrialUI);
                    class DrawPriceUI extends Scene {
                        constructor() {
                            super();
                        }
                        createChildren() {
                            super.createChildren();
                            this.loadScene("UIScenes/Voppo/DrawPrice");
                        }
                    }
                    Voppo.DrawPriceUI = DrawPriceUI;
                    REG("ui.UIScenes.Voppo.DrawPriceUI", DrawPriceUI);
                    class GetPriceUI extends Scene {
                        constructor() {
                            super();
                        }
                        createChildren() {
                            super.createChildren();
                            this.loadScene("UIScenes/Voppo/GetPrice");
                        }
                    }
                    Voppo.GetPriceUI = GetPriceUI;
                    REG("ui.UIScenes.Voppo.GetPriceUI", GetPriceUI);
                    class GetRealPriceUI extends Scene {
                        constructor() {
                            super();
                        }
                        createChildren() {
                            super.createChildren();
                            this.loadScene("UIScenes/Voppo/GetRealPrice");
                        }
                    }
                    Voppo.GetRealPriceUI = GetRealPriceUI;
                    REG("ui.UIScenes.Voppo.GetRealPriceUI", GetRealPriceUI);
                    class RewardHatUI extends Scene {
                        constructor() {
                            super();
                        }
                        createChildren() {
                            super.createChildren();
                            this.loadScene("UIScenes/Voppo/RewardHat");
                        }
                    }
                    Voppo.RewardHatUI = RewardHatUI;
                    REG("ui.UIScenes.Voppo.RewardHatUI", RewardHatUI);
                    class VideoCoinUI extends Scene {
                        constructor() {
                            super();
                        }
                        createChildren() {
                            super.createChildren();
                            this.loadScene("UIScenes/Voppo/VideoCoin");
                        }
                    }
                    Voppo.VideoCoinUI = VideoCoinUI;
                    REG("ui.UIScenes.Voppo.VideoCoinUI", VideoCoinUI);
                })(Voppo = UIScenes.Voppo || (UIScenes.Voppo = {}));
            })(UIScenes = ui.UIScenes || (ui.UIScenes = {}));
        })(ui || (ui = {}));
        (function (ui) {
            var UIScenes;
            (function (UIScenes) {
                var Voppo;
                (function (Voppo) {
                    var constellation;
                    (function (constellation) {
                        class ConstellationDescUI extends Scene {
                            constructor() {
                                super();
                            }
                            createChildren() {
                                super.createChildren();
                                this.loadScene("UIScenes/Voppo/constellation/ConstellationDesc");
                            }
                        }
                        constellation.ConstellationDescUI = ConstellationDescUI;
                        REG("ui.UIScenes.Voppo.constellation.ConstellationDescUI", ConstellationDescUI);
                        class constellationItemUI extends Scene {
                            constructor() {
                                super();
                            }
                            createChildren() {
                                super.createChildren();
                                this.loadScene("UIScenes/Voppo/constellation/constellationItem");
                            }
                        }
                        constellation.constellationItemUI = constellationItemUI;
                        REG("ui.UIScenes.Voppo.constellation.constellationItemUI", constellationItemUI);
                        class ConstellationViewUI extends Scene {
                            constructor() {
                                super();
                            }
                            createChildren() {
                                super.createChildren();
                                this.loadScene("UIScenes/Voppo/constellation/ConstellationView");
                            }
                        }
                        constellation.ConstellationViewUI = ConstellationViewUI;
                        REG("ui.UIScenes.Voppo.constellation.ConstellationViewUI", ConstellationViewUI);
                    })(constellation = Voppo.constellation || (Voppo.constellation = {}));
                })(Voppo = UIScenes.Voppo || (UIScenes.Voppo = {}));
            })(UIScenes = ui.UIScenes || (ui.UIScenes = {}));
        })(ui || (ui = {}));
        (function (ui) {
            var UIScenes;
            (function (UIScenes) {
                var Voppo;
                (function (Voppo) {
                    var getPower;
                    (function (getPower) {
                        class GetPowerUI extends Scene {
                            constructor() {
                                super();
                            }
                            createChildren() {
                                super.createChildren();
                                this.loadScene("UIScenes/Voppo/getPower/GetPower");
                            }
                        }
                        getPower.GetPowerUI = GetPowerUI;
                        REG("ui.UIScenes.Voppo.getPower.GetPowerUI", GetPowerUI);
                    })(getPower = Voppo.getPower || (Voppo.getPower = {}));
                })(Voppo = UIScenes.Voppo || (UIScenes.Voppo = {}));
            })(UIScenes = ui.UIScenes || (ui.UIScenes = {}));
        })(ui || (ui = {}));
        (function (ui) {
            var UIScenes;
            (function (UIScenes) {
                var Voppo;
                (function (Voppo) {
                    var luckypan;
                    (function (luckypan) {
                        class luckyitemUI extends Scene {
                            constructor() {
                                super();
                            }
                            createChildren() {
                                super.createChildren();
                                this.loadScene("UIScenes/Voppo/luckypan/luckyitem");
                            }
                        }
                        luckypan.luckyitemUI = luckyitemUI;
                        REG("ui.UIScenes.Voppo.luckypan.luckyitemUI", luckyitemUI);
                        class luckyPanUI extends Scene {
                            constructor() {
                                super();
                            }
                            createChildren() {
                                super.createChildren();
                                this.loadScene("UIScenes/Voppo/luckypan/luckyPan");
                            }
                        }
                        luckypan.luckyPanUI = luckyPanUI;
                        REG("ui.UIScenes.Voppo.luckypan.luckyPanUI", luckyPanUI);
                    })(luckypan = Voppo.luckypan || (Voppo.luckypan = {}));
                })(Voppo = UIScenes.Voppo || (UIScenes.Voppo = {}));
            })(UIScenes = ui.UIScenes || (ui.UIScenes = {}));
        })(ui || (ui = {}));
        (function (ui) {
            var UIScenes;
            (function (UIScenes) {
                var Voppo;
                (function (Voppo) {
                    var onlineGift;
                    (function (onlineGift) {
                        class OnlineGiftUI extends Scene {
                            constructor() {
                                super();
                            }
                            createChildren() {
                                super.createChildren();
                                this.loadScene("UIScenes/Voppo/onlineGift/OnlineGift");
                            }
                        }
                        onlineGift.OnlineGiftUI = OnlineGiftUI;
                        REG("ui.UIScenes.Voppo.onlineGift.OnlineGiftUI", OnlineGiftUI);
                    })(onlineGift = Voppo.onlineGift || (Voppo.onlineGift = {}));
                })(Voppo = UIScenes.Voppo || (UIScenes.Voppo = {}));
            })(UIScenes = ui.UIScenes || (ui.UIScenes = {}));
        })(ui || (ui = {}));
        (function (ui) {
            var UIScenes;
            (function (UIScenes) {
                var wx;
                (function (wx) {
                    class FullPageTtUI extends Scene {
                        constructor() {
                            super();
                        }
                        createChildren() {
                            super.createChildren();
                            this.loadScene("UIScenes/wx/FullPageTt");
                        }
                    }
                    wx.FullPageTtUI = FullPageTtUI;
                    REG("ui.UIScenes.wx.FullPageTtUI", FullPageTtUI);
                    class welcomeBackUI extends Scene {
                        constructor() {
                            super();
                        }
                        createChildren() {
                            super.createChildren();
                            this.loadScene("UIScenes/wx/welcomeBack");
                        }
                    }
                    wx.welcomeBackUI = welcomeBackUI;
                    REG("ui.UIScenes.wx.welcomeBackUI", welcomeBackUI);
                    class WxShareFuLiUI extends Scene {
                        constructor() {
                            super();
                        }
                        createChildren() {
                            super.createChildren();
                            this.loadScene("UIScenes/wx/WxShareFuLi");
                        }
                    }
                    wx.WxShareFuLiUI = WxShareFuLiUI;
                    REG("ui.UIScenes.wx.WxShareFuLiUI", WxShareFuLiUI);
                    class WxShareInfoUI extends Scene {
                        constructor() {
                            super();
                        }
                        createChildren() {
                            super.createChildren();
                            this.loadScene("UIScenes/wx/WxShareInfo");
                        }
                    }
                    wx.WxShareInfoUI = WxShareInfoUI;
                    REG("ui.UIScenes.wx.WxShareInfoUI", WxShareInfoUI);
                    class WxShareViewUI extends Scene {
                        constructor() {
                            super();
                        }
                        createChildren() {
                            super.createChildren();
                            this.loadScene("UIScenes/wx/WxShareView");
                        }
                    }
                    wx.WxShareViewUI = WxShareViewUI;
                    REG("ui.UIScenes.wx.WxShareViewUI", WxShareViewUI);
                })(wx = UIScenes.wx || (UIScenes.wx = {}));
            })(UIScenes = ui.UIScenes || (ui.UIScenes = {}));
        })(ui || (ui = {}));
        class NpcNameUI extends ui.UIScenes.commonUI.NpcNameUI {
            constructor() {
                super();
                this.tmp2 = new Laya.Vector3();
                this.tmp3 = new Laya.Vector4();
            }
            refreshPos(npc, offset = 2) {
                this.tmp2.x = npc.m_selfP.transform.position.x;
                this.tmp2.y = npc.m_selfP.transform.position.y + 2;
                this.tmp2.z = npc.m_selfP.transform.position.z;
                var mCamera = ActorMgr.Ins.m_selfScript.mCamera;
                mCamera.worldToViewportPoint(this.tmp2, this.tmp3);
                this.x = this.tmp3.x - 75;
                this.y = this.tmp3.y - 15;
                if (this.npcName != null) this.npcName.text = npc.PlayerName.toString();
            }
        }
        var E_PLATFORM_TYPE;
        (function (E_PLATFORM_TYPE) {
            E_PLATFORM_TYPE[E_PLATFORM_TYPE["NONE"] = 0] = "NONE";
            E_PLATFORM_TYPE[E_PLATFORM_TYPE["WEB"] = 1] = "WEB";
            E_PLATFORM_TYPE[E_PLATFORM_TYPE["WX"] = 2] = "WX";
            E_PLATFORM_TYPE[E_PLATFORM_TYPE["QQ"] = 4] = "QQ";
            E_PLATFORM_TYPE[E_PLATFORM_TYPE["TT"] = 8] = "TT";
            E_PLATFORM_TYPE[E_PLATFORM_TYPE["OPPO"] = 16] = "OPPO";
            E_PLATFORM_TYPE[E_PLATFORM_TYPE["VIVO"] = 32] = "VIVO";
            E_PLATFORM_TYPE[E_PLATFORM_TYPE["MZ"] = 64] = "MZ";
            E_PLATFORM_TYPE[E_PLATFORM_TYPE["BAIDU"] = 128] = "BAIDU";
            E_PLATFORM_TYPE[E_PLATFORM_TYPE["SSJJ"] = 256] = "SSJJ";
            E_PLATFORM_TYPE[E_PLATFORM_TYPE["QTT"] = 512] = "QTT";
            E_PLATFORM_TYPE[E_PLATFORM_TYPE["SLL"] = 1024] = "SLL";
            E_PLATFORM_TYPE[E_PLATFORM_TYPE["MM"] = 2048] = "MM";
            E_PLATFORM_TYPE[E_PLATFORM_TYPE["MI"] = 4096] = "MI";
        })(E_PLATFORM_TYPE || (E_PLATFORM_TYPE = {}));
        var E_PAGE_VIDEOID;
        (function (E_PAGE_VIDEOID) {
            E_PAGE_VIDEOID[E_PAGE_VIDEOID["SHENGLI"] = 0] = "SHENGLI";
            E_PAGE_VIDEOID[E_PAGE_VIDEOID["DUANWEURWD"] = 1] = "DUANWEURWD";
            E_PAGE_VIDEOID[E_PAGE_VIDEOID["ZHUANPAN"] = 2] = "ZHUANPAN";
            E_PAGE_VIDEOID[E_PAGE_VIDEOID["GAMEOVER"] = 3] = "GAMEOVER";
            E_PAGE_VIDEOID[E_PAGE_VIDEOID["TYRCAR"] = 4] = "TYRCAR";
            E_PAGE_VIDEOID[E_PAGE_VIDEOID["UPCHEST"] = 5] = "UPCHEST";
            E_PAGE_VIDEOID[E_PAGE_VIDEOID["CHESTRWD"] = 6] = "CHESTRWD";
            E_PAGE_VIDEOID[E_PAGE_VIDEOID["DUANWEIPRO"] = 7] = "DUANWEIPRO";
            E_PAGE_VIDEOID[E_PAGE_VIDEOID["FREEGOLD"] = 8] = "FREEGOLD";
            E_PAGE_VIDEOID[E_PAGE_VIDEOID["ONLINEGIFT"] = 9] = "ONLINEGIFT";
            E_PAGE_VIDEOID[E_PAGE_VIDEOID["CHECKIN"] = 10] = "CHECKIN";
            E_PAGE_VIDEOID[E_PAGE_VIDEOID["VIDEOAGIN"] = 11] = "VIDEOAGIN";
            E_PAGE_VIDEOID[E_PAGE_VIDEOID["UNLOCKCLOTHES"] = 12] = "UNLOCKCLOTHES";
            E_PAGE_VIDEOID[E_PAGE_VIDEOID["RWDHAT"] = 13] = "RWDHAT";
            E_PAGE_VIDEOID[E_PAGE_VIDEOID["XINGZUO"] = 14] = "XINGZUO";
            E_PAGE_VIDEOID[E_PAGE_VIDEOID["FOREVERUNLOCK"] = 15] = "FOREVERUNLOCK";
            E_PAGE_VIDEOID[E_PAGE_VIDEOID["SPEEDBUJI"] = 16] = "SPEEDBUJI";
            E_PAGE_VIDEOID[E_PAGE_VIDEOID["ITEMBUJI"] = 17] = "ITEMBUJI";
            E_PAGE_VIDEOID[E_PAGE_VIDEOID["CARZHISHENG"] = 18] = "CARZHISHENG";
            E_PAGE_VIDEOID[E_PAGE_VIDEOID["LIMITGIFT"] = 19] = "LIMITGIFT";
        })(E_PAGE_VIDEOID || (E_PAGE_VIDEOID = {}));
        const oppoVideoIdList = ["198955", "198956", "198957", "198958", "198959", "198960", "198961", "198962", "198963", "198964", "198968", "204717", "202414", "203046", "201650", "206881", "206880", "206878", "206875", "206877"];
        const vivoVideoIdList = ["47c681734ced4308a1ba223aa642219a"];
        const wxVideoIdList = ["adunit-e53e695875cbc770", "adunit-7cca680af514110f", "adunit-2a166f140aa0383a", "adunit-dbdfe7ae239af222", "adunit-42334eb50df12a78", "adunit-1ba11bbddd9fcf5f", "adunit-34e79ab7794b9b3d", "adunit-02b849dd8fce820c", "adunit-6bd75b721ffde690", "adunit-63818020dc260628", "adunit-138e53e8e01d0459", "adunit-097b41a5f11678e5", "adunit-b941ddf264d82ca6", "adunit-81a0439d51585f2e", "adunit-5d8f78f908ab6968", "adunit-4a2a38b98ad2aeb8", "adunit-f8d2cf176905ce22", "adunit-ca6515a47079cae6", "adunit-8f09cf34d933aa6e", "adunit-2b8ec8989f9baaea"];
        const qg = window["qg"];
        const gid = "5f0d9ada2b39af1876514623";
        const bid = "5f0d9b682b39af1876514624";
        const bid_HtIcon = "5f0d9b892b39af1876514625";
        var E_PAGE_TYPE;
        (function (E_PAGE_TYPE) {
            E_PAGE_TYPE["STARTUI"] = "StartUI";
        })(E_PAGE_TYPE || (E_PAGE_TYPE = {}));
        function isQQ() {
            return PlatformMgr.Ins.platform == E_PLATFORM_TYPE.QQ;
        }
        function isWx() {
            return PlatformMgr.Ins.platform == E_PLATFORM_TYPE.WX;
        }
        function isTT() {
            return PlatformMgr.Ins.platform == E_PLATFORM_TYPE.TT;
        }
        function isOppo() {
            return PlatformMgr.Ins.platform == E_PLATFORM_TYPE.OPPO;
        }
        function isVivo() {
            return PlatformMgr.Ins.platform == E_PLATFORM_TYPE.VIVO;
        }
        class PlatformMgr {
            constructor() {
                this._platform = E_PLATFORM_TYPE.NONE;
                this.currAppId = 0;
                this.isIosPlatform = true;
                this.nativeData = null;
                this.isAlpha = false;
                this.canShowInsert = false;
                this.htList = [];
                this.htBoxList = [];
                this.htBoxIconList = [];
                this.ttPlatform = "";
                this.version = "1.0.2";
                this._gameConfig = {};
                this.channelConfig = {
                    gameId: "cfkdc",
                    appId: "30308175",
                    channelName: "oppo",
                    videoId: "6ba0e774ddce407faaf32a69c11c758b",
                    bannerId: "198950",
                    interId: "",
                    nativeId: "f84a21f358ee4343b72fc0a35c488da1",
                    nativeOnError: err => {
                        console.log("nativeOnError", err);
                    },
                    videoAutoLoad: false
                };
                this.canShowBanner = true;
                this.isIos = false;
                this.videoStamp = 0;
                this.videoCallBackFunc = null;
                this.BannerUIType = {
                    [E_UI_TYPE.CGTLTGETUICarUP5]: "lianShengWuJiBanner",
                    [E_UI_TYPE.CGTLTGETUI]: "gongXiHuoDeBanner",
                    [E_UI_TYPE.CHECK_IN]: "qianDaoBanner",
                    [E_UI_TYPE.DRIVERUI]: "cheShouBanner",
                    [E_UI_TYPE.GARAGEUI]: "cheKuBanner",
                    [E_UI_TYPE.LIMITGIFT]: "xianShiLiBaoBanner",
                    [E_UI_TYPE.LUCKY_PAN]: "zhuanPanBanner",
                    [E_UI_TYPE.RANK_RESULT_UI]: "shengXingBanner",
                    [E_UI_TYPE.RANKING_UI]: "piPeiBanner",
                    [E_UI_TYPE.TRAINING_RESULT]: "paiMingBanner",
                    [E_UI_TYPE.MULTIRACE]: "duoRenBanner",
                    [E_UI_TYPE.ONERACE]: "danRenBanner",
                    [E_UI_TYPE.CONSTELLATION]: "xingZuo1Banner",
                    [E_UI_TYPE.CONSTELLATIONDESC]: "xingZuo2Banner",
                    [E_UI_TYPE.ONLINE_GIFT]: "zaiXianLiBaoBanner",
                    [E_UI_TYPE.REWARDHAT]: "jiangLiFuZhuangBanner",
                    [E_UI_TYPE.VIDEO_COIN]: "shiPingJinBiBanner",
                    [E_UI_TYPE.GETPOWER]: "huoDeTiShengBanner",
                    [E_UI_TYPE.CAR_TRIAL]: "shiYongCheBanner",
                    [E_UI_TYPE.VIDEOAGAIN]: "zaiKanGuangGaoBanner",
                    [E_UI_TYPE.GAMECARDUI]: "kaiJvBuJiBanner",
                    [E_UI_TYPE.PROFILE]: "shezhiBanner",
                    [E_UI_TYPE.PICK_ROLE]: "xuanrenBanner",
                    [E_UI_TYPE.PICKMODE]: "wanfaxuanzeBanner",
                    [E_UI_TYPE.CAREXPIRE]: "shiyongdaoqiBanner",
                    [E_UI_TYPE.STARTUI]: "zhuJieMian",
                    [E_UI_TYPE.BATTLEUI]: "youXiZhong",
                    [E_UI_TYPE.FULLPAGE]: "quanYe"
                };
                this.OVBannerMap = {
                    [E_UI_TYPE.CGTLTGETUICarUP5]: "247;90;800",
                    [E_UI_TYPE.CGTLTGETUI]: this.platform == E_PLATFORM_TYPE.OPPO ? "247;90;800" : "0,900,300",
                    [E_UI_TYPE.CHECK_IN]: "247;90;800",
                    [E_UI_TYPE.DRIVERUI]: "186;90;500",
                    [E_UI_TYPE.GARAGEUI]: "126;100;400",
                    [E_UI_TYPE.LIMITGIFT]: "247;90;800",
                    [E_UI_TYPE.LUCKY_PAN]: "780;90;500",
                    [E_UI_TYPE.RANK_RESULT_UI]: "780;90;800",
                    [E_UI_TYPE.RANKING_UI]: "381;100;500",
                    [E_UI_TYPE.TRAINING_RESULT]: this.platform == E_PLATFORM_TYPE.OPPO ? "247;90;800" : "0,900,300",
                    [E_UI_TYPE.MULTIRACE]: "780;80;500",
                    [E_UI_TYPE.ONERACE]: "780;65;500",
                    [E_UI_TYPE.CONSTELLATION]: "247;90;800",
                    [E_UI_TYPE.CONSTELLATIONDESC]: "247;90;800",
                    [E_UI_TYPE.ONLINE_GIFT]: "247;90;800",
                    [E_UI_TYPE.REWARDHAT]: "247;90;800",
                    [E_UI_TYPE.VIDEO_COIN]: "247;90;800",
                    [E_UI_TYPE.GETPOWER]: "247;90;800",
                    [E_UI_TYPE.CAR_TRIAL]: "247;90;800",
                    [E_UI_TYPE.VIDEOAGAIN]: "247;90;800",
                    [E_UI_TYPE.GAMECARDUI]: "247;90;800",
                    [E_UI_TYPE.PROFILE]: "247;90;800",
                    [E_UI_TYPE.PICK_ROLE]: "247;90;800",
                    [E_UI_TYPE.PICKMODE]: "247;90;800",
                    [E_UI_TYPE.CAREXPIRE]: "247;90;800"
                };
                this.vivoNativeErrorCallback = null;
                this.iswuchuTimeOpen = false;
                if (this.platform == E_PLATFORM_TYPE.OPPO) {
                    if (window["qg"]) {
                        let qg = window["qg"];
                        qg.onHide(() => {
                            DataMgr.Ins.SavePlayerData();
                        });
                    }
                }
            }
            get platform() {
                if (!this._platform) {
                    // if (Laya.Browser.onQQMiniGame) {
                    //     this._platform = E_PLATFORM_TYPE.QQ;
                    // } else if (Laya.Browser.onBDMiniGame) {
                    //     console.log("百度平台");
                    //     this._platform = E_PLATFORM_TYPE.BAIDU;
                    // } else if (Laya.Browser.onQGMiniGame) {
                    //     this._platform = E_PLATFORM_TYPE.OPPO;
                    // } else if (window["tt"]) {
                    //     this._platform = E_PLATFORM_TYPE.TT;
                    // } else if (Laya.Browser.onVVMiniGame) {
                    //     this._platform = E_PLATFORM_TYPE.VIVO;
                    // } else if (Laya.Browser.onMiniGame) {
                    //     this._platform = E_PLATFORM_TYPE.WX;
                    // } else {
                    this._platform = E_PLATFORM_TYPE.WEB;
                    // }
                }
                return this._platform;
            }
            get isQQ() {
                return this.platform == E_PLATFORM_TYPE.QQ;
            }
            get isWx() {
                return this.platform == E_PLATFORM_TYPE.WX;
            }
            get isTT() {
                return this.platform == E_PLATFORM_TYPE.TT;
            }
            get isOppo() {
                return this.platform == E_PLATFORM_TYPE.OPPO;
            }
            get isVivo() {
                return this.platform == E_PLATFORM_TYPE.VIVO;
            }
            isVersionOk() {
                if (this.wxConfig) {
                    if (this.wxConfig.zs_version == this.version) {
                        return true;
                    } else {
                        return false;
                    }
                } else {
                    return false;
                }
            }
            isBannerMove() {
                if (this.isVersionOk()) {
                    return false;
                } else {
                    if (this.wxConfig) {
                        if (this.wxConfig.zs_switch) {
                            if (this.wxConfig.zs_banner_vertical_enable) {
                                return true;
                            } else {
                                return false;
                            }
                        } else {
                            return false;
                        }
                    }
                }
            }
            BannerMoveTime() {
                if (this.isBannerMove()) {
                    return this.wxConfig.zs_banner_banner_time;
                } else {
                    return 0;
                }
            }
            TextMoveTime() {
                if (this.isBannerMove()) {
                    return this.wxConfig.zs_banner_text_time;
                } else {
                    return 0;
                }
            }
            fullPageOpen() {
                if (this.wxConfig) {
                    if (this.wxConfig.zs_full_screen_jump) {
                        return true;
                    } else {
                        return false;
                    }
                } else {
                    return false;
                }
            }
            initShangYeHuaConfig() {
                // let configUrl = "";
                // if (this.platform == E_PLATFORM_TYPE.VIVO) {
                //     console.log("读取vivo配置中");
                //     configUrl = "https://czy.jiegames.com/jy-game/config/kart3D/vivo/cfkdc_vivo_1_0_0.json";
                //     Laya.loader.load(configUrl, Laya.Handler.create(this, this.configUrlBack));
                // } else if (this.platform == E_PLATFORM_TYPE.OPPO) {
                //     console.log("读取oppo配置中");
                //     configUrl = "https://czy.jiegames.com/jy-game/config/kart3D/oppo/cfkdc_oppo_1_0_9.json";
                //     Laya.loader.load(configUrl, Laya.Handler.create(this, this.configUrlBack));
                // } else if (this.platform == E_PLATFORM_TYPE.TT) {
                //     console.log("读取tt配置中");
                //     configUrl = "https://czy.jiegames.com/jy-game/config/kart3D/tt/cfkdc_tt_1_0_0.json";
                //     Laya.loader.load(configUrl, Laya.Handler.create(this, this.configUrlBack));
                // } else if (this.platform == E_PLATFORM_TYPE.WX) {
                //     console.log("读取wx配置中");
                //     configUrl = "https://czy.jiegames.com/jy-game/config/kart3D/wx/cfkdc_wx_1_1_8.json";
                //     Laya.loader.load(configUrl, Laya.Handler.create(this, this.configUrlBack));
                // } else if (this.platform == E_PLATFORM_TYPE.QQ) {
                //     console.log("读取qq配置中");
                //     configUrl = "https://czy.jiegames.com/jy-game/config/kart3D/qq/cfkdc_qq_1_0_3.json";
                //     Laya.loader.load(configUrl, Laya.Handler.create(this, this.configUrlBack));
                // } else if (this.platform == E_PLATFORM_TYPE.BAIDU) {
                //     console.log("读取baidu配置中");
                //     configUrl = "https://czy.jiegames.com/jy-game/config/kart3D/baidu/cfkdc_baidu_1_0_0.json";
                //     Laya.loader.load(configUrl, Laya.Handler.create(this, this.configUrlBack));
                // } else {
                //     console.log("读取qq配置中");
                //     configUrl = "https://czy.jiegames.com/jy-game/config/kart3D/wx/cfkdc_wx_1_1_8.json";
                //     Laya.loader.load(configUrl, Laya.Handler.create(this, this.configUrlBack));
                // }
            }
            configUrlBack(res) {
                if (!res) return;
                console.log("读取配置成功1", res);
                this._gameConfig = res;
                this.wuchujishi();
            }
            initSDK() {
                this.initShangYeHuaConfig();
                console.log(PlatformMgr.Ins.platform);
                if (PlatformMgr.Ins.platform == E_PLATFORM_TYPE.OPPO || PlatformMgr.Ins.platform == E_PLATFORM_TYPE.VIVO) {
                    this.initHTSDK();
                    this.initChannelConfig();
                } else if (PlatformMgr.Ins.platform == E_PLATFORM_TYPE.TT) {
                    let tt = window["tt"];
                    this.ttPlatform = tt.getSystemInfoSync().appName;
                    this.isIos = tt.getSystemInfoSync().platform === "ios";
                } else if (PlatformMgr.Ins.platform == E_PLATFORM_TYPE.WX) {
                    let wx = window["wx"];
                    this.isIos = wx.getSystemInfoSync().platform === "ios";
                    let zsSDK = window["zs"];
                    zsSDK.sdk.loadCfg(res => {
                        this.wxConfig = res;
                        console.log("success", res);
                    }, res => {
                        console.log("fail", res);
                    });
                }
            }
            static get Ins() {
                return PlatformMgr._ins || (PlatformMgr._ins = new PlatformMgr());
            }
            showInsert(adPoint = 1) { }
            showBanner(adPoint) { }
            hideBanner() {
                if (PlatformMgr.Ins.platform == E_PLATFORM_TYPE.VIVO) { }
            }
            showVideo(adPoint, cb, newPosId, isVideoAgain = false) { }
            navigateToMiniGame(jumpInfo) {
                if (PlatformMgr.Ins.platform == E_PLATFORM_TYPE.OPPO) {
                    if (qg) {
                        qg.navigateToMiniGame({
                            pkgName: jumpInfo.jumpKey,
                            path: "?" + jumpInfo.query,
                            extraData: {
                                from: "pageA"
                            },
                            success: function () {
                                console.log("跳转成功");
                            },
                            fail: function (res) {
                                console.log(JSON.stringify(res));
                                console.log("跳转失败");
                            }
                        });
                    }
                }
            }
            initNativeAdLater(uiType, time) {
                this.closeNativeAd();
                Laya.timer.once(time, this, this.initNativeAd, [uiType]);
            }
            initNativeAd(uiType) { }
            initOutput(uiType) { }
            closeOutput() { }
            closeNativeAd() { }
            initNativeIconAd(cb) {
                if (PlatformMgr.Ins.platform == E_PLATFORM_TYPE.OPPO) { } else if (PlatformMgr.Ins.platform == E_PLATFORM_TYPE.VIVO) { }
            }
            initNativeIconAd1(cb) {
                if (PlatformMgr.Ins.platform == E_PLATFORM_TYPE.OPPO) { } else if (PlatformMgr.Ins.platform == E_PLATFORM_TYPE.VIVO) { }
            }
            initNativeInsert(adPoint, cb, cb1) { }
            initHTSDK() {
                if (PlatformMgr.Ins.platform == E_PLATFORM_TYPE.OPPO) {
                    let data = qg.getLaunchOptionsSync();
                }
            }
            reportNativeAdShow() { }
            reportNativeAdClick() { }
            reportNativeIconShow() { }
            reportNativeIconClick() { }
            reportData() {
                if (PlatformMgr.Ins.platform == E_PLATFORM_TYPE.OPPO) qg.reportMonitor("game_scene", 0);
            }
            installIcon(cb) { }
            refreshIcon(cb) { }
            hasDesktopIcon(cb, cb1) { }
            initChannelConfig() { }
            wuchujishi() {
                console.log("当前误触计时", this._gameConfig.wuchuTime);
                Laya.timer.once(this._gameConfig.wuchuTime * 1e3, this, () => {
                    this.iswuchuTimeOpen = true;
                });
            }
            showWxNative(pageId) { }
            hideWxNative() { }
        }
        const wx$1 = window["wx"];
        const qq = window["qq"];
        const tt = window["tt"];
        const qg$1 = window["qg"];
        const swan = window["swan"];
        const ShareDuration = 3e3;
        class WeChatPlatform {
            constructor() {
                this.shareLeaveAt = 0;
                this._shareOk = null;
                this._shareCancel = null;
                this._isTask = false;
                this._taskTime = 0;
                this._taskOk = null;
                this._taskFail = null;
                this.shareQuanTime = 0;
                this.startShareFriend = false;
                this.shareTitles = ["秋名山上行人稀，常有车手较高低！"];
                this.shareImgs = [""];//https://czy.jiegames.com/jy-game/KartFight/shareIcon/shareIcon.jpg
                this.bannerAd = null;
                this.showBanner = false;
                this.interstitialAd = null;
                this.video1 = null;
                this.lastOnClose = null;
                this.customAd = null;
                this.isShowNative = false;
                if (window["wx"]) {
                    let wx = window["wx"];
                    wx.showShareMenu({
                        withShareTicket: true,
                        menus: ["shareAppMessage", "shareTimeline"]
                    });
                    wx.onShow(() => {
                        let info = wx.getLaunchOptionsSync();
                        console.log("显示了", info);
                        DataMgr.Ins.wxScene = info.scene;
                        if (this.startShareFriend) {
                            this.startShareFriend = false;
                            Laya.timer.clearAll(this);
                            if (this.shareQuanTime < 3) {
                                UIManager.Ins.getScene(E_UI_TYPE.LONGBLACKTIP).open(false, ["分享失败"]);
                            }
                        }
                    });
                    let info = wx.getSystemInfoSync();
                    this.platform = info.platform;
                    if (this.isAndroid()) {
                        if (!DataMgr.Ins.wxFuLiList[1].canGet) wx.onAddToFavorites(() => {
                            DataMgr.Ins.wxFuLiList[1].canGet = true;
                            EventMgr.Ins.dispatch(EventType.REFRESH_WX_SHARE);
                        });
                        if (!DataMgr.Ins.wxFuLiList[3].canGet) wx.onShareTimeline(() => {
                            this.startShareFriend = true;
                            this.shareQuanTime = 0;
                            Laya.timer.clearAll(this);
                            if (!DataMgr.Ins.wxFuLiList[3].canGet) {
                                Laya.timer.loop(500, this, () => {
                                    this.shareQuanTime += .5;
                                    if (this.shareQuanTime >= 3) {
                                        DataMgr.Ins.wxFuLiList[3].canGet = true;
                                        EventMgr.Ins.dispatch(EventType.REFRESH_WX_SHARE);
                                        Laya.timer.clearAll(this);
                                    }
                                });
                            }
                        });
                    }
                    console.warn("WeChatPlatform", info);
                }
                if (this.isAndroid()) {
                    this.onHide(() => {
                        this.shareLeave();
                    });
                    this.onShow(() => {
                        this.shareReturn();
                        this.taskReturn();
                    });
                }
                wx$1 && wx$1.showShareMenu({
                    withShareTicket: true
                });
                try {
                    this.shareTitles = ["秋名山上行人稀，常有车手较高低！"];
                    this.shareImgs = [""];//https://czy.jiegames.com/jy-game/KartFight/shareIcon/shareIcon.jpg
                } catch (e) { }
                let idx = Math.floor(Math.random() * this.shareTitles.length);
                let idx2 = Math.floor(Math.random() * this.shareImgs.length);
                let self = this;
                wx$1.onShareAppMessage(() => {
                    return {
                        title: self.shareTitles[idx],
                        imageUrl: self.shareImgs[idx2]
                    };
                });
            }
            isIos() {
                return this.platform === "ios";
            }
            isAndroid() {
                return this.platform === "android";
            }
            shareLeave() {
                this.shareLeaveAt = new Date().getTime();
            }
            getSystemInfoSync() {
                return wx$1.getSystemInfoSync();
            }
            shareReturn() {
                console.log("share return");
                if (this.shareLeaveAt) {
                    let now = new Date().getTime();
                    if (now - this.shareLeaveAt > ShareDuration) {
                        this._shareOk && this._shareOk();
                    } else {
                        this._shareCancel && this._shareCancel();
                        UIManager.Ins.getScene(E_UI_TYPE.LONGBLACKTIP).open(false, ["分享失败，请分享到其他群或好友试试"]);
                    }
                }
                this._shareOk = this._shareCancel = null;
                this.shareLeaveAt = 0;
            }
            login() {
                return new Promise((resolve, reject) => {
                    wx$1.login({
                        success(res) {
                            if (res.code) {
                                resolve(res.code);
                            } else {
                                console.log("登录失败！" + res.errMsg);
                                reject(res.errMsg);
                            }
                        }
                    });
                });
            }
            getOpenId() {
                // return this.login().then(code => {
                //     var data = {
                //         appId: "wx2bec1da2d2f9239c",
                //         wxCode: code
                //     };
                //     return this.request("https://distribute.jiegames.com/api/wx/wxLogin", data, "POST");
                // }).then(res => {
                //     if (res.data) {
                //         console.log(res.data);
                //         if (res.data.code == 0) {
                //             if (res.data.data) {
                //                 this.openID = res.data.data.openId;
                //                 return res.data.data.openId;
                //             }
                //         }
                //     }
                //     return null;
                // });
                return null;
            }
            request(url, _data, _method) {
                return new Promise((resolve, reject) => {
                    wx$1.request({
                        url: url,
                        data: _data,
                        method: _method,
                        success: resolve,
                        fail: reject
                    });
                });
            }
            getServerTime() {
                return wx$1.cloud.callFunction({
                    name: "getServerTime",
                    data: {}
                });
            }
            showNativeAd(type) {
                throw new Error("Method not implemented.");
            }
            reportNativeAdShow(type, adData) {
                throw new Error("Method not implemented.");
            }
            reportNativeAdClick(type, adData) {
                throw new Error("Method not implemented.");
            }
            onShow(cb) {
                wx$1.onShow(cb);
            }
            onHide(cb) {
                wx$1.onHide(cb);
            }
            offShow(cb) {
                wx$1.offShow(cb);
            }
            offHide(cb) {
                wx$1.offHide(cb);
            }
            getUserSignature() {
                return new Promise((resolve, reject) => {
                    wx$1.getUserInfo({
                        success: res => resolve(res.signature),
                        fail: reject
                    });
                });
            }
            getUserInfo() {
                return new Promise((resolve, reject) => wx$1.getUserInfo({
                    success: resolve,
                    fail: reject
                }));
            }
            getNickAvatar(modal) {
                if (modal) return Promise.resolve().then(() => {
                    return new Promise((resolve, reject) => wx$1.authorize({
                        scope: "scope.userInfo",
                        success: resolve,
                        fail: reject
                    }));
                }).then(() => {
                    return new Promise((resolve, reject) => wx$1.getUserInfo({
                        success: resolve,
                        fail: reject
                    }));
                }).then(res => {
                    return {
                        nick: res.userInfo.nickName,
                        avatar: res.userInfo.avatarUrl
                    };
                }); else return Promise.resolve().then(() => {
                    return new Promise((resolve, reject) => wx$1.getUserInfo({
                        success: resolve,
                        fail: reject
                    }));
                }).then(res => {
                    return {
                        nick: res.userInfo.nickName,
                        avatar: res.userInfo.avatarUrl
                    };
                });
            }
            share(title = "", imgUrl = "", query = "", desc = "") {
                return new Promise((resolve, reject) => {
                    console.log("share in: ");
                    this._shareOk = resolve;
                    this._shareCancel = reject;
                    let _q = {};
                    try { } catch (e) {
                        console.warn(e);
                        _q = {};
                    }
                    let info = {
                        title: "秋名山上行人稀，常有车手较高低！",
                        imageUrl: "",//https://czy.jiegames.com/jy-game/KartFight/shareIcon/shareIcon.jpg
                        query: ""
                    };
                    let idx = Math.floor(Math.random() * this.shareTitles.length);
                    let idx2 = Math.floor(Math.random() * this.shareImgs.length);
                    wx$1.shareAppMessage(info);
                    if (this.isIos()) {
                        this.shareLeave();
                        console.log("share leave");
                        setTimeout(() => this.shareReturn(), 350);
                    }
                });
            }
            showBannerAd() {
                this.showBanner = true;
                if (Laya.Browser.onWeiXin && !Laya.Browser.onQQMiniGame) {
                    let sys = wx$1.getSystemInfoSync();
                    this.bannerAd && this.bannerAd.destroy();
                    this.bannerAd = wx$1.createBannerAd({
                        adUnitId: "",
                        style: {
                            left: sys.screenWidth,
                            top: sys.screenHeight,
                            width: 0
                        }
                    });
                    let bH = sys.screenWidth * 200 / 720;
                    let dy = sys.screenHeight / sys.screenWidth > 1.9 ? 80 : 0;
                    dy = sys.screenWidth * dy / 720;
                    this.bannerAd.onResize(res => {
                        if (res) {
                            let w = Math.ceil(res.width * bH / res.height);
                            if (w != res.width) {
                                this.bannerAd.style.width = w;
                            }
                            this.bannerAd.style.top = sys.screenHeight - res.height - dy;
                            this.bannerAd.style.left = (sys.screenWidth - res.width) / 2;
                        }
                    });
                    this.bannerAd.style.width = 300;
                    this.bannerAd.onError(console.warn);
                    this.bannerAd.onLoad(() => this.showBanner && this.bannerAd.show().catch(console.warn));
                }
            }
            hideBannerAd() {
                this.showBanner = false;
                this.bannerAd && this.bannerAd.hide();
            }
            showBannerCustom(x, y) {
                this.showBanner = true;
                let wx = window["wx"];
                if (wx) {
                    let width = 300;
                    let sys = wx.getSystemInfoSync();
                    if (!this.bannerAd) {
                        this.bannerAd && this.bannerAd.destroy();
                        this.bannerAd = wx.createBannerAd({
                            adUnitId: "adunit-a27c71458e7b43d2",
                            style: {
                                top: 0,
                                left: 0,
                                width: width
                            }
                        });
                        this.bannerAd.onError(res => {
                            console.log("onError", res);
                        });
                        this.bannerAd.onLoad(() => {
                            this.setAdPos(sys.windowWidth * (x / 100) - width * .5, sys.windowHeight * ((100 - y) / 100) - this.bannerAd.style.realHeight, this.bannerAd);
                            this.showBanner && this.bannerAd.show().catch(res => {
                                console.log("showCatch1", res);
                            });
                        });
                    } else {
                        this.setAdPos(sys.windowWidth * (x / 100) - width * .5, sys.windowHeight * ((100 - y) / 100) - this.bannerAd.style.realHeight, this.bannerAd);
                        this.showBanner && this.bannerAd.show().catch(res => {
                            console.log("showCatch2", res);
                            this.bannerAd && this.bannerAd.destroy();
                            this.bannerAd = null;
                            this.showBannerCustom(x, y);
                        });
                    }
                }
            }
            setAdPos(x, y, bannerAd) {
                if (!bannerAd) return;
                bannerAd.style.left = x;
                bannerAd.style.top = y;
            }
            showInsertAd() {
                if (wx$1.createInterstitialAd) {
                    this.interstitialAd = wx$1.createInterstitialAd({
                        adUnitId: "adunit-a9fa00c216f93706"
                    });
                }
                if (this.interstitialAd) {
                    this.interstitialAd.show().catch(err => {
                        console.error(err);
                    });
                }
            }
            loadVideoAd(adId = "adunit-d5160554bd7bfd6c") {
                if (adId) {
                    this.video1 && this.video1.offError(console.warn);
                    this.video1 = wx$1.createRewardedVideoAd({
                        adUnitId: adId
                    });
                    this.video1 && this.video1.onError(console.warn);
                    return this.video1 ? this.video1.load() : Promise.reject("create ad fail");
                } else {
                    this.video1 && this.video1.offError(console.warn);
                    this.video1 = null;
                    return Promise.reject("empty adId");
                }
            }
            playVideoAd() {
                if (this.video1) {
                    this.video1 && this.video1.offClose(this.lastOnClose);
                    return new Promise((resolve, reject) => {
                        this.lastOnClose = (res => {
                            res && res.isEnded || res === undefined ? resolve() : reject();
                        });
                        this.video1.onClose(this.lastOnClose);
                        this.video1.show();
                    });
                } else {
                    return Promise.reject("no loaded video");
                }
            }
            playVideo(callback, errCallback, cancelCB = null, id = "") {
                this.loadVideoAd(id).then(() => {
                    this.playVideoAd().then(() => {
                        callback && callback();
                    }, () => {
                        cancelCB && cancelCB();
                        console.log("cancel video");
                    });
                }, () => {
                    errCallback && errCallback();
                });
            }
            showNative(dx, top) {
                let wx = window["wx"];
                this.isShowNative = true;
                if (wx) {
                    let sys = wx.getSystemInfoSync();
                    if (this.customAd) {
                        this.customAd.destroy();
                        this.customAd = null;
                    }
                    if (wx.createCustomAd) {
                        this.customAd = wx.createCustomAd({
                            adUnitId: "adunit-a9fa00c216f93706",
                            left: sys.windowWidth - dx,
                            top: top,
                            fixed: false
                        });
                        this.customAd.onLoad(() => {
                            if (this.isShowNative) this.customAd.show();
                        });
                    }
                }
            }
            hideNative() {
                this.isShowNative = false;
                if (this.customAd) {
                    this.customAd.hide();
                }
            }
            getStorageData(key) {
                return wx$1.getStorageSync(key);
            }
            saveStorageData(key, data) {
                wx$1.setStorage({
                    key: key,
                    data: data
                });
            }
            vibrateLong() {
                wx$1 & wx$1.vibrateLong();
            }
            vibrateShort() {
                wx$1 & wx$1.vibrateShort();
            }
            updateCloudStorage(keyName, value) {
                wx$1.setUserCloudStorage({
                    KVDataList: [{
                        key: keyName,
                        value: JSON.stringify(value)
                    }],
                    success: res => {
                        console.log("success", res);
                    },
                    fail: res => {
                        console.log("fail", res);
                    },
                    complete: res => {
                        console.log("complete", res);
                    }
                });
            }
            postMessagerToOpenData(msg) { }
            taskAd(leaveTime, okCb, failCb) {
                this._taskTime = leaveTime;
                this._isTask = true;
                this._taskOk = okCb;
                this._taskFail = failCb;
                this.onShow(() => {
                    this.taskReturn();
                });
            }
            taskReturn() {
                if (this._isTask) {
                    let now = Math.floor(new Date().getTime() / 1e3);
                    if (now - this._taskTime > 60) {
                        this._taskOk && this._taskOk();
                    } else {
                        this._taskFail && this._taskFail();
                    }
                    this._isTask = false;
                    this._taskOk = this._taskFail = null;
                }
            }
            loadSubpackage(pkgName) {
                return new Promise((resolve, reject) => {
                    wx$1.loadSubpackage({
                        name: pkgName,
                        success: resolve,
                        fail: reject
                    });
                });
            }
            navigateToMiniProgram(wxId) {
                wx$1.navigateToMiniProgram({
                    appId: wxId
                });
            }
            navigateToMiniProgramSDK(data, isFullPage = false) { }
        }
        const ShareDuration$1 = 5e3;
        const APP_ID = "wxeb9ca14da4c9d722";
        var ADID;
        (function (ADID) {
            ADID["_banner_"] = "adunit-60fdf5aadb7feade";
            ADID["_原生模板1x3左_"] = "adunit-11c6998eea30a884";
            ADID["_原生模板1x3右_"] = "adunit-673e232feb9df423";
            ADID["_原生模板1x1中_"] = "adunit-11898be64a63cb5a";
            ADID["_原生模板1x1左_"] = "adunit-563b013d85dbb6e7";
            ADID["_原生模板1x1右_"] = "adunit-43642c260a05fa91";
            ADID["_原生模板1x2_"] = "adunit-0076ba5e21332457";
        })(ADID || (ADID = {}));
        class WeChatPlatform1 {
            constructor() {
                this.shareLeaveAt = 0;
                this._shareOk = null;
                this._shareCancel = null;
                this._isTask = false;
                this._taskTime = 0;
                this._taskOk = null;
                this._taskFail = null;
                this.shareTitles = ["秋名山上行人稀，常有车手较高低！"];
                this.shareImgs = [""];//https://czy.jiegames.com/jy-game/KartFight/shareIcon/shareIcon.jpg
                this.bannerAd = null;
                this.showBanner = false;
                this.createCustomAdDatas = [{
                    CustomAdType: CustomAdType._签到界面_,
                    id: [ADID._原生模板1x2_, ADID._原生模板1x3右_]
                }, {
                    CustomAdType: CustomAdType._背包界面_,
                    id: [ADID._原生模板1x3右_]
                }, {
                    CustomAdType: CustomAdType._开局补给_,
                    id: [ADID._原生模板1x1右_]
                }, {
                    CustomAdType: CustomAdType._车库界面_,
                    id: [ADID._原生模板1x3左_, ADID._原生模板1x3右_]
                }, {
                    CustomAdType: CustomAdType._限时礼包_,
                    id: [ADID._原生模板1x3左_, ADID._原生模板1x3右_]
                }, {
                    CustomAdType: CustomAdType._抽奖界面_,
                    id: [ADID._原生模板1x1右_, ADID._原生模板1x1左_]
                }, {
                    CustomAdType: CustomAdType._次日登陆_,
                    id: [ADID._原生模板1x3左_, ADID._原生模板1x3右_]
                }, {
                    CustomAdType: CustomAdType._选择模式_,
                    id: [ADID._原生模板1x3右_]
                }, {
                    CustomAdType: CustomAdType._匹配界面_,
                    id: [ADID._原生模板1x1右_, ADID._原生模板1x1左_]
                }, {
                    CustomAdType: CustomAdType._结算界面_,
                    id: [ADID._原生模板1x3右_]
                }, {
                    CustomAdType: CustomAdType._多人道具_,
                    id: [ADID._原生模板1x3右_]
                }, {
                    CustomAdType: CustomAdType._多人竞速_,
                    id: [ADID._原生模板1x1中_]
                }, {
                    CustomAdType: CustomAdType._个人竞速_,
                    id: [ADID._原生模板1x1中_]
                }, {
                    CustomAdType: CustomAdType._战车强化_,
                    id: [ADID._原生模板1x3右_]
                }, {
                    CustomAdType: CustomAdType._盲盒_,
                    id: [ADID._原生模板1x3左_, ADID._原生模板1x3右_]
                }, {
                    CustomAdType: CustomAdType._盲盒选择_,
                    id: [ADID._原生模板1x3左_, ADID._原生模板1x3右_]
                }, {
                    CustomAdType: CustomAdType._在线奖励_,
                    id: [ADID._原生模板1x1右_]
                }, {
                    CustomAdType: CustomAdType._个性装饰_,
                    id: [ADID._原生模板1x1右_]
                }, {
                    CustomAdType: CustomAdType._结算段位_,
                    id: [ADID._原生模板1x3左_, ADID._原生模板1x3右_]
                }];
                this.CustomAds = [{
                    id: ADID._原生模板1x3左_,
                    ad: null
                }, {
                    id: ADID._原生模板1x3右_,
                    ad: null
                }, {
                    id: ADID._原生模板1x1中_,
                    ad: null
                }, {
                    id: ADID._原生模板1x1左_,
                    ad: null
                }, {
                    id: ADID._原生模板1x1右_,
                    ad: null
                }, {
                    id: ADID._原生模板1x2_,
                    ad: null
                }];
                this.interstitialAd = null;
                this.video1 = null;
                this.lastOnClose = null;
                this.systemInfo = wx$1.getSystemInfoSync();
                if (window["wx"]) {
                    let info = wx$1.getSystemInfoSync();
                    this.platform = info.platform;
                    console.warn("WeChatPlatform", info);
                }
                this.onHide(() => {
                    this.isAndroid() && this.shareLeave();
                });
                this.onShow(() => {
                    this.isAndroid() && this.shareReturn();
                    this.isAndroid() && this.taskReturn();
                });
                wx$1 && wx$1.showShareMenu({
                    withShareTicket: true
                });
                try {
                    this.shareTitles = [""];
                    this.shareImgs = [""];
                } catch (e) { }
                let idx = Math.floor(Math.random() * this.shareTitles.length);
                let idx2 = Math.floor(Math.random() * this.shareImgs.length);
                let self = this;
                wx$1.onShareAppMessage(() => {
                    return {
                        title: self.shareTitles[idx],
                        imageUrl: self.shareImgs[idx2]
                    };
                });
                this.CustomAds[0].ad = this.createCustomAd(this.CustomAds[0].id, 50, 50, CustomAdStyle._贴左);
                this.CustomAds[1].ad = this.createCustomAd(this.CustomAds[1].id, 50, 50, CustomAdStyle._贴右);
                this.CustomAds[2].ad = this.createCustomAd(this.CustomAds[2].id, 50, 50, CustomAdStyle._贴右);
                this.CustomAds[3].ad = this.createCustomAd(this.CustomAds[3].id, 50, 50, CustomAdStyle._贴左);
                this.CustomAds[4].ad = this.createCustomAd(this.CustomAds[4].id, 50, 50, CustomAdStyle._贴右);
                this.CustomAds[5].ad = this.createCustomAd(this.CustomAds[5].id, 50, 50, CustomAdStyle._贴左);
            }
            isIos() {
                return this.platform === "ios";
            }
            isAndroid() {
                return this.platform === "android";
            }
            shareLeave() {
                this.shareLeaveAt = new Date().getTime();
            }
            getSystemInfoSync() {
                return wx$1.getSystemInfoSync();
            }
            shareReturn() {
                console.log("share return");
                if (this.shareLeaveAt) {
                    let now = new Date().getTime();
                    if (now - this.shareLeaveAt > ShareDuration$1) {
                        this._shareOk && this._shareOk();
                    } else {
                        this._shareCancel && this._shareCancel();
                    }
                }
                this._shareOk = this._shareCancel = null;
                this.shareLeaveAt = 0;
            }
            showNativeAd(type) {
                throw new Error("Method not implemented.");
            }
            reportNativeAdShow(type, adData) {
                throw new Error("Method not implemented.");
            }
            reportNativeAdClick(type, adData) {
                throw new Error("Method not implemented.");
            }
            onShow(cb) {
                wx$1.onShow(cb);
            }
            onHide(cb) {
                wx$1.onHide(cb);
            }
            offShow(cb) {
                wx$1.offShow(cb);
            }
            offHide(cb) {
                wx$1.offHide(cb);
            }
            getUserSignature() {
                return new Promise((resolve, reject) => {
                    wx$1.getUserInfo({
                        success: res => resolve(res.signature),
                        fail: reject
                    });
                });
            }
            login() {
                return new Promise((resolve, reject) => {
                    wx$1.login({
                        success(res) {
                            if (res.code) {
                                resolve(res.code);
                            } else {
                                console.log("登录失败！" + res.errMsg);
                                reject(res.errMsg);
                            }
                        },
                        fail: reject
                    });
                });
            }
            getOpenId() {
                // return this.login().then(code => {
                //     let data = {
                //         appId: APP_ID,
                //         wxCode: code
                //     };
                //     return this.request("https://distribute.jiegames.com/api/wx/wxLogin", data, "POST");
                // }).then(res => {
                //     if (res.data) {
                //         console.log(res.data);
                //         if (res.data.code == 0) {
                //             if (res.data.data) {
                //                 this.openId = res.data.data.openId;
                //                 return res.data.data.openId;
                //             }
                //         }
                //     }
                //     return null;
                // });
                return null;
            }
            request(url, _data, _method) {
                return new Promise((resolve, reject) => {
                    wx$1.request({
                        url: url,
                        data: _data,
                        method: _method,
                        success: resolve,
                        fail: reject
                    });
                });
            }
            getUserInfo() {
                return new Promise((resolve, reject) => wx$1.getUserInfo({
                    success: resolve,
                    fail: reject
                }));
            }
            share(title = "", imgUrl = "", query = "", desc = "") {
                return new Promise((resolve, reject) => {
                    console.log("share in: ");
                    this._shareOk = resolve;
                    this._shareCancel = reject;
                    let _q = {};
                    try { } catch (e) {
                        console.warn(e);
                        _q = {};
                    }
                    let info = {
                        query: ""
                    };
                    let idx = Math.floor(Math.random() * this.shareTitles.length);
                    let idx2 = Math.floor(Math.random() * this.shareImgs.length);
                    info["title"] = this.shareTitles[0];
                    info["imageUrl"] = this.shareImgs[0];
                    wx$1.shareAppMessage(info);
                    if (this.isIos()) {
                        this.shareLeave();
                        console.log("share leave");
                        setTimeout(() => this.shareReturn(), 350);
                    }
                });
            }
            showBannerAd(isShow = true) {
                this.showBanner = true;
                if (Laya.Browser.onWeiXin && !Laya.Browser.onQQMiniGame) {
                    let sys = wx$1.getSystemInfoSync();
                    this.bannerAd && this.bannerAd.destroy();
                    this.bannerAd = wx$1.createBannerAd({
                        adUnitId: "adunit-1ae3e6501629d5db",
                        style: {
                            left: sys.screenWidth,
                            top: sys.screenHeight,
                            width: 0
                        }
                    });
                    let bH = sys.screenWidth * 200 / 720;
                    let dy = sys.screenHeight / sys.screenWidth > 1.9 ? 80 : 0;
                    dy = sys.screenWidth * dy / 720;
                    this.bannerAd.onResize(res => {
                        if (res) {
                            let w = Math.ceil(res.width * bH / res.height);
                            if (w != res.width) {
                                this.bannerAd.style.width = w;
                            }
                            if (isShow) this.bannerAd.style.top = sys.screenHeight - res.height;
                            this.bannerAd.style.left = (sys.screenWidth - res.width) / 2;
                        }
                    });
                    return new Promise((resolve, reject) => {
                        this.bannerAd.style.width = 300;
                        this.bannerAd.onError(console.warn);
                        this.bannerAd.onLoad(() => this.showBanner && this.bannerAd.show().then(() => {
                            resolve(this.bannerAd);
                        }).catch(() => {
                            reject(null);
                        }));
                    });
                }
            }
            showBannerAd_New(adid, bannerStyle, type, isShow = true) {
                this.showBanner = true;
                if (Laya.Browser.onWeiXin && !Laya.Browser.onQQMiniGame) {
                    let sys = wx$1.getSystemInfoSync();
                    this.bannerAd && this.bannerAd.destroy();
                    this.bannerAd = wx$1.createBannerAd({
                        adIntervals: 31,
                        adUnitId: adid,
                        style: {
                            left: bannerStyle.left,
                            top: 0,
                            width: bannerStyle.width
                        }
                    });
                    let bH = sys.screenWidth * 200 / 720;
                    let dy = sys.screenHeight / sys.screenWidth > 1.9 ? 80 : 0;
                    dy = sys.screenWidth * dy / 720;
                    this.bannerAd.onResize(res => {
                        console.log("修改了banner的尺寸:", res);
                        this.bannerAd.style.top = sys.screenHeight - res.height - bannerStyle.bottom;
                        switch (type) {
                            case BannerStyleType._左右居中_:
                                this.bannerAd.style.left = sys.screenWidth / 2 - res.width / 2;
                                break;

                            case BannerStyleType._居左_:
                                this.bannerAd.style.left = this.systemInfo.safeArea.left + bannerStyle.left;
                                break;

                            case BannerStyleType._居右_:
                                this.bannerAd.style.left = sys.screenWidth - res.width - bannerStyle.left;
                                break;

                            case BannerStyleType._顶部左右居中:
                                this.bannerAd.style.left = sys.screenWidth / 2 - res.width / 2;
                                this.bannerAd.style.top = 0;
                                break;

                            default:
                                break;
                        }
                    });
                    return new Promise((resolve, reject) => {
                        this.bannerAd.onError(console.warn);
                        this.bannerAd.onLoad(() => this.showBanner && this.bannerAd.show().then(() => {
                            resolve(this.bannerAd);
                        }).catch(() => {
                            reject(null);
                        }));
                    });
                }
            }
            showCreateCustomAd(UIType) {
                let adid;
                for (let i = 0; i < this.createCustomAdDatas.length; i++) {
                    if (this.createCustomAdDatas[i].CustomAdType == UIType) {
                        adid = this.createCustomAdDatas[i].id;
                        break;
                    }
                }
                for (let i = 0; i < this.CustomAds.length; i++) {
                    if (adid.indexOf(this.CustomAds[i].id) != -1) {
                        if (this.CustomAds[i].ad != null) {
                            this.CustomAds[i].ad.show();
                        }
                    } else {
                        if (this.CustomAds[i].ad != null) {
                            this.CustomAds[i].ad.hide();
                        }
                    }
                }
            }
            hideCreateCustomAd() {
                for (let i = 0; i < this.CustomAds.length; i++) {
                    if (this.CustomAds[i].ad != null) {
                        this.CustomAds[i].ad.hide();
                    }
                }
            }
            createCustomAd(adid, wordX, wordY, style = CustomAdStyle._任意) {
                let adUnitId = adid;
                let left = wordX * this.systemInfo.screenWidth / Laya.stage.width;
                let top = wordY * this.systemInfo.screenHeight / Laya.stage.height;
                const w = 68 * .8;
                const h = 106 * .8;
                let width;
                if (style == CustomAdStyle._贴右) {
                    left = this.systemInfo.screenWidth - w - wordX;
                } else if (style == CustomAdStyle._贴左) {
                    left = this.systemInfo.safeArea.left + wordX;
                } else if (style == CustomAdStyle._贴上) {
                    top = wordY;
                } else if (style == CustomAdStyle._贴下) {
                    top = this.systemInfo.screenHeight - h - wordY;
                } else if (style == CustomAdStyle._顶部左右居中) {
                    left = this.systemInfo.screenWidth / 2 - 360 * .8 / 2;
                    top = 0;
                } else if (style == CustomAdStyle._底部左右居中) {
                    left = 0;
                    top = this.systemInfo.screenHeight - 250;
                }
                let customAd = wx$1.createCustomAd({
                    adUnitId: adUnitId,
                    adIntervals: 31,
                    style: {
                        left: left,
                        top: top
                    }
                });
                return customAd;
            }
            hideBannerAd() {
                this.showBanner = false;
                if (this.bannerAd) {
                    this.bannerAd.hide();
                    this.bannerAd.destroy();
                }
            }
            showInsertAd(fun) {
                if (wx$1.createInterstitialAd) {
                    this.interstitialAd = wx$1.createInterstitialAd({
                        adUnitId: "adunit-e323ec3f73ec10a5"
                    });
                }
                if (this.interstitialAd) {
                    this.interstitialAd.show().catch(err => {
                        console.error("插屏广告展示失败:", err);
                        if (fun != null) fun();
                    });
                }
                this.interstitialAd.onClose(res => {
                    if (fun != null) fun();
                });
            }
            loadVideoAd(adId = "") {
                if (adId) {
                    this.video1 && this.video1.offError(console.warn);
                    this.video1 = wx$1.createRewardedVideoAd({
                        adUnitId: adId
                    });
                    this.video1 && this.video1.onError(console.warn);
                    return this.video1 ? this.video1.load() : Promise.reject("create ad fail");
                } else {
                    this.video1 && this.video1.offError(console.warn);
                    this.video1 = null;
                    return Promise.reject("empty adId");
                }
            }
            playVideoAd() {
                if (this.video1) {
                    this.video1 && this.video1.offClose(this.lastOnClose);
                    return new Promise((resolve, reject) => {
                        this.lastOnClose = (res => {
                            res && res.isEnded || res === undefined ? resolve() : reject();
                        });
                        this.video1.onClose(this.lastOnClose);
                        this.video1.show();
                    });
                } else {
                    return Promise.reject("no loaded video");
                }
            }
            playVideo(adID, callback, errCallback, cancelCb = null) {
                this.loadVideoAd(adID).then(() => {
                    this.playVideoAd().then(() => {
                        callback && callback();
                    }, () => {
                        cancelCb && cancelCb();
                        console.log("cancel video");
                    });
                }, () => {
                    errCallback && errCallback();
                });
            }
            getStorageData(key) {
                return wx$1.getStorageSync(key);
            }
            saveStorageData(key, data) {
                wx$1.setStorage({
                    key: key,
                    data: data
                });
            }
            vibrateLong() {
                wx$1 & wx$1.vibrateLong();
            }
            vibrateShort() {
                wx$1 & wx$1.vibrateShort();
            }
            updateCloudStorage(level) {
                wx$1.setUserCloudStorage({
                    KVDataList: [{
                        key: "level",
                        value: JSON.stringify(level)
                    }]
                });
            }
            taskAd(leaveTime, okCb, failCb) {
                this._taskTime = leaveTime;
                this._isTask = true;
                this._taskOk = okCb;
                this._taskFail = failCb;
                this.onShow(() => {
                    this.taskReturn();
                });
            }
            navigateToMiniProgram(appId) {
                wx$1.navigateToMiniProgram({
                    appId: appId,
                    envVersion: "release",
                    success(res) { }
                });
            }
            taskReturn() {
                if (this._isTask) {
                    let now = Math.floor(new Date().getTime() / 1e3);
                    if (now - this._taskTime > 60) {
                        this._taskOk && this._taskOk();
                    } else {
                        this._taskFail && this._taskFail();
                    }
                    this._isTask = false;
                    this._taskOk = this._taskFail = null;
                }
            }
            showToast(msg) {
                wx$1.showToast({
                    title: msg || "系统繁忙,请稍后重试!",
                    mask: true
                });
            }
        }
        var CustomAdStyle;
        (function (CustomAdStyle) {
            CustomAdStyle[CustomAdStyle["_贴左"] = 0] = "_贴左";
            CustomAdStyle[CustomAdStyle["_贴右"] = 1] = "_贴右";
            CustomAdStyle[CustomAdStyle["_贴上"] = 2] = "_贴上";
            CustomAdStyle[CustomAdStyle["_贴下"] = 3] = "_贴下";
            CustomAdStyle[CustomAdStyle["_顶部左右居中"] = 4] = "_顶部左右居中";
            CustomAdStyle[CustomAdStyle["_底部左右居中"] = 5] = "_底部左右居中";
            CustomAdStyle[CustomAdStyle["_任意"] = 6] = "_任意";
        })(CustomAdStyle || (CustomAdStyle = {}));
        var BannerStyleType;
        (function (BannerStyleType) {
            BannerStyleType[BannerStyleType["_顶部左右居中"] = 0] = "_顶部左右居中";
            BannerStyleType[BannerStyleType["_左右居中_"] = 1] = "_左右居中_";
            BannerStyleType[BannerStyleType["_居右_"] = 2] = "_居右_";
            BannerStyleType[BannerStyleType["_居左_"] = 3] = "_居左_";
        })(BannerStyleType || (BannerStyleType = {}));
        var CustomAdType;
        (function (CustomAdType) {
            CustomAdType[CustomAdType["_签到界面_"] = 0] = "_签到界面_";
            CustomAdType[CustomAdType["_背包界面_"] = 1] = "_背包界面_";
            CustomAdType[CustomAdType["_开局补给_"] = 2] = "_开局补给_";
            CustomAdType[CustomAdType["_车库界面_"] = 3] = "_车库界面_";
            CustomAdType[CustomAdType["_限时礼包_"] = 4] = "_限时礼包_";
            CustomAdType[CustomAdType["_抽奖界面_"] = 5] = "_抽奖界面_";
            CustomAdType[CustomAdType["_次日登陆_"] = 6] = "_次日登陆_";
            CustomAdType[CustomAdType["_选择模式_"] = 7] = "_选择模式_";
            CustomAdType[CustomAdType["_匹配界面_"] = 8] = "_匹配界面_";
            CustomAdType[CustomAdType["_结算界面_"] = 9] = "_结算界面_";
            CustomAdType[CustomAdType["_多人道具_"] = 10] = "_多人道具_";
            CustomAdType[CustomAdType["_多人竞速_"] = 11] = "_多人竞速_";
            CustomAdType[CustomAdType["_个人竞速_"] = 12] = "_个人竞速_";
            CustomAdType[CustomAdType["_战车强化_"] = 13] = "_战车强化_";
            CustomAdType[CustomAdType["_盲盒_"] = 14] = "_盲盒_";
            CustomAdType[CustomAdType["_盲盒选择_"] = 15] = "_盲盒选择_";
            CustomAdType[CustomAdType["_在线奖励_"] = 16] = "_在线奖励_";
            CustomAdType[CustomAdType["_个性装饰_"] = 17] = "_个性装饰_";
            CustomAdType[CustomAdType["_结算段位_"] = 18] = "_结算段位_";
        })(CustomAdType || (CustomAdType = {}));
        class CustomAdData { }
        class platform {
            constructor() { }
            static get Ins() {
                if (platform._ins == null) {
                    if (window["wx"]) {
                        platform._ins = new WeChatPlatform();
                    } else { }
                }
                return platform._ins;
            }
            static get Wx() {
                if (platform.ins1 == null) {
                    if (window["wx"]) {
                        platform.ins1 = new WeChatPlatform1();
                    }
                }
                return platform.ins1;
            }
        }
        class PickRoleUI extends ui.UIScenes.commonUI.PickRoleUI {
            constructor() {
                super();
                this.isOpen = false;
                this.currPlayerSex = 0;
                this.canCreateRole = false;
                this.rndNameCount = 0;
                this.currZiListIndex = 0;
                this.ziList = [];
                this.ziList1 = [];
                this.textCompentList = [];
                this.nameInput.editable = false;
                if (PlatformMgr.Ins._gameConfig.nameOpen) {
                    this.nameInput.editable = true;
                    this.nameInput.textField.on(Laya.Event.CHANGE, this, this.nameInputOnChange);
                }
                this.creatRoleBtn.on(Laya.Event.CLICK, this, this.creatRoleBtnClick);
                this.pickWomenBtn.on(Laya.Event.CLICK, this, this.pickWomenBtnClick, [false]);
                this.pickMenBtn.on(Laya.Event.CLICK, this, this.pickManBtnClick, [false]);
                this.rndBtn.on(Laya.Event.CLICK, this, this.rndName);
                this.lanhuo.on(Laya.Event.CLICK, this, this.startBtnlick);
                this.adapterUI();
            }
            onOpened() {
                PickRoleUI.logText = new Laya.Text();
                PickRoleUI.logText.size(Laya.stage.width, Laya.stage.height);
                PickRoleUI.logText.fontSize = 28;
                PickRoleUI.logText.color = "#000000";
                PickRoleUI.logText.mouseEnabled = false;
                PickRoleUI.logText.wordWrap = true;
                PickRoleUI.logText.text = "等待资源加载";
                PlatformMgr.Ins.canShowBanner = false;
                this.currPlayerSex = DataMgr.Ins.currPlayerSex;
                this.isOpen = true;
                this.nameInput.text = DataMgr.Ins.playerName;
                this.currPlayerSex == 0 ? this.pickManBtnClick(true) : this.pickWomenBtnClick(true);
                Laya.timer.loop(30, this, () => {
                    this.loadingImage.rotation += 2;
                });
                this.nameInput.text = DataMgr.Ins.playerName;
                if (PlatformMgr.Ins.platform == E_PLATFORM_TYPE.TT) PlatformMgr.Ins.initNativeAd(E_UI_TYPE.PICK_ROLE);
                this.refreshNativeItem();
                EventMgr.Ins.on(EventType.RES_LOAD_FINISHED, this, this.onResLoadFinished);
            }
            onResLoadFinished() {
                this.canCreateRole = true;
                console.log("资源加载完成");
                PickRoleUI.logText.text += "资源加载完成";
                if (this.loadingImage.visible) {
                    DataMgr.Ins.currPlayerSex = this.currPlayerSex;
                    DataMgr.Ins.useCarStage = DataMgr.Ins.carStage;
                    DataMgr.Ins.gameUseCar = DataMgr.Ins.currSelectCar;
                    GameMgr.Ins.enterGame(true, E_GAME_MODE.MULTIPLAYER_SPEED_GAME, -1, 1, true);
                    PlatformMgr.Ins.closeNativeAd();
                    this.isOpen = false;
                    DataMgr.Ins.isCreatRole = Date.now();
                    DataMgr.Ins.SavePlayerData();
                }
            }
            playOpenAni() { }
            playCloseAni() { }
            nameInputOnChange() {
                DataMgr.Ins.playerName = this.nameInput.text;
            }
            onClosed() {
                Laya.timer.clearAll(this);
                this.lanhuoAni.stop();
            }
            adapterUI() {
                this.scaleX = this.scaleY = GlobalScale$1.scale;
                this.width = Laya.stage.width / GlobalScale$1.scale;
                this.height = Laya.stage.height / GlobalScale$1.scale;
            }
            creatRoleBtnClick() {
                if (this.nameInput.text != "") {
                    DataMgr.Ins.currPlayerSex = this.currPlayerSex;
                    DataMgr.Ins.playerName = this.nameInput.text;
                    DataMgr.Ins.isCreatRole = Date.now();
                    DataMgr.Ins.SavePlayerData();
                    this.showLiHui();
                } else {
                    UIManager.Ins.getScene(E_UI_TYPE.LONGBLACKTIP).open(false, ["角色名不能为空。"]);
                }
            }
            pickManBtnClick(isInit) {
                if (this.currPlayerSex == 0 && !isInit) return;
                this.currPlayerSex = 0;
                this.nanDi.visible = false;
                this.nvDi.visible = true;
                this.nanGray.visible = false;
                this.nanJing.visible = false;
                this.nanGu.visible = true;
                this.nvGray.visible = true;
                this.nvJing.visible = true;
                this.nvGu.visible = false;
                this.nanLight1.visible = true;
                this.nvLight1.visible = false;
                this.nvLightA.stop();
                this.nvLight2.visible = false;
                this.nanLightA.play(0, false);
                this.nanLightA.offAll(null);
                this.nanLightA.on(Laya.Event.COMPLETE, this, () => {
                    this.nanLight2.visible = true;
                    this.nanLightB.play(0, true);
                });
                this.nvLightB.stop();
            }
            pickWomenBtnClick(isInit) {
                if (this.currPlayerSex == 1 && !isInit) return;
                this.currPlayerSex = 1;
                this.nanDi.visible = true;
                this.nvDi.visible = false;
                this.nanGray.visible = true;
                this.nanJing.visible = true;
                this.nanGu.visible = false;
                this.nvGray.visible = false;
                this.nvJing.visible = false;
                this.nvGu.visible = true;
                this.nanLight1.visible = false;
                this.nvLight1.visible = true;
                this.nanLight2.visible = false;
                this.nanLightA.stop();
                this.nvLightA.play(0, false);
                this.nvLightA.offAll(null);
                this.nvLightA.on(Laya.Event.COMPLETE, this, () => {
                    this.nvLight2.visible = true;
                    this.nvLightB.play(0, true);
                });
                this.nanLightB.stop();
            }
            rndName() {
                this.rndNameCount++;
                this.nameInput.text = CCfgMgr.Ins.cfgNpcInfo.getRndName();
                var count = this.rndNameCount.toString();
                if (this.rndNameCount > 10) count = "10+";
                if (this.rndNameCount > 20) count = "20+";
                if (this.rndNameCount > 30) count = "30+";
                if (this.rndNameCount > 50) count = "50+";
            }
            showLiHui() {
                this.lihuiParent.visible = true;
                this.lanhuo.visible = false;
                this.lihuiRole.skin = this.currPlayerSex == 0 ? "firstRes/pickRole/nan.png" : "firstRes/pickRole/nv.png";
                let name = this.nameInput.text;
                if (UsefulStuff.getStrLength(name) % 2 != 0) {
                    name += " ";
                }
                let str1 = "嗨，" + this.backKongGe(name) + "，欢迎来到卡丁车世界~";
                let str2 = this.backKongGe("全地形") + "赛道，超" + this.backKongGe("酷炫") + "赛车，等着你的到来！";
                let str3 = "让我们一起" + this.backKongGe("开启") + "你的" + this.backKongGe("超神") + "赛车手之路！";
                this.ziList = [str1, str2, str3];
                let str4 = this.backKongGe("嗨，") + name + this.backKongGe("，欢迎来到卡丁车世界~");
                let str5 = "全地形" + this.backKongGe("赛道，超") + "酷炫" + this.backKongGe("赛车，等着你的到来！");
                let str6 = this.backKongGe("让我们一起") + "开启" + this.backKongGe("你的") + "超神" + this.backKongGe("赛车手之路！");
                this.ziList1 = [str4, str5, str6];
                for (let i = 0; i < 3; i++) {
                    this.textCompentList.push(this.lihuiParent.getChildAt(i + 5).getChildAt(0));
                }
                if (this.width / this.height > 1.78) {
                    this.textCompentList[0].x -= (this.width - 1280) / 4;
                    this.lanhuo.x += (this.width - 1280) / 4;
                }
                this.initZi();
                this.daZiJi2();
            }
            backKongGe(str) {
                let str1 = "";
                let num = UsefulStuff.getStrLength(str);
                for (let i = 0; i < num; i++) {
                    str1 += " ";
                }
                return str1;
            }
            daZiJi() {
                Laya.Tween.to(this["kuai" + this.currZiListIndex], {
                    alpha: 1
                }, 500, null, Laya.Handler.create(this, () => {
                    this.lihuiParent.getChildAt(this.currZiListIndex + 5).visible = true;
                    let index = 0;
                    let index1 = 0;
                    Laya.timer.loop(100, this.textCompentList[this.currZiListIndex], () => {
                        if (this.ziList[this.currZiListIndex].charCodeAt(index) > 255) {
                            index++;
                        } else {
                            if (index + 1 < this.ziList[this.currZiListIndex].length) index += 2;
                        }
                        if (index1 < this.ziList1[this.currZiListIndex].length) if (this.ziList1[this.currZiListIndex].charCodeAt(index1) > 255) {
                            index1++;
                        } else {
                            if (index1 + 1 < this.ziList1[this.currZiListIndex].length) index1 += 2;
                        }
                        if (index >= this.ziList[this.currZiListIndex].length) {
                            Laya.timer.clearAll(this.textCompentList[this.currZiListIndex]);
                            this.currZiListIndex++;
                            if (this.currZiListIndex < 3) {
                                this.daZiJi();
                            } else {
                                Laya.Tween.to(this["kuai" + this.currZiListIndex], {
                                    alpha: 1
                                }, 500, null, Laya.Handler.create(this, () => {
                                    let lightIndex = 0;
                                    Laya.timer.loop(1e3, this.lightBox, () => {
                                        this.lightBox.getChildAt(lightIndex).visible = false;
                                        lightIndex++;
                                        if (lightIndex > 3) {
                                            Laya.timer.clearAll(this.lightBox);
                                        }
                                    });
                                    this.lanhuo.visible = true;
                                    this.lanhuoAni.play(0, true);
                                    Laya.Tween.to(this.lanhuo, {
                                        alpha: 1
                                    }, 500, null, Laya.Handler.create(this, () => { }));
                                }));
                            }
                        }
                    });
                }));
            }
            daZiJi2() {
                Laya.Tween.to(this["kuai" + this.currZiListIndex], {
                    alpha: 1
                }, 500, null, Laya.Handler.create(this, () => {
                    this.lihuiParent.getChildAt(this.currZiListIndex + 5).visible = true;
                    let index = 0;
                    Laya.timer.loop(100, this.textCompentList[this.currZiListIndex], () => {
                        let b = this.ziList[this.currZiListIndex];
                        let arr = b.slice(0, index);
                        let xx = arr.map(x => {
                            return `<span style="color:${x[1]};font-size:32px">${x[0]}</span>`;
                        }).join("");
                        this.textCompentList[this.currZiListIndex].innerHTML = `<div width="308">` + xx + `</div>`;
                        index++;
                        if (index > this.ziList[this.currZiListIndex].length) {
                            Laya.timer.clearAll(this.textCompentList[this.currZiListIndex]);
                            this.currZiListIndex++;
                            if (this.currZiListIndex < 3) {
                                this.daZiJi2();
                            } else {
                                Laya.Tween.to(this["kuai" + this.currZiListIndex], {
                                    alpha: 1
                                }, 500, null, Laya.Handler.create(this, () => {
                                    let lightIndex = 0;
                                    Laya.timer.loop(1e3, this.lightBox, () => {
                                        this.lightBox.getChildAt(lightIndex).visible = false;
                                        lightIndex++;
                                        if (lightIndex > 3) {
                                            Laya.timer.clearAll(this.lightBox);
                                        }
                                    });
                                    this.lanhuo.visible = true;
                                    this.lanhuoAni.play(0, true);
                                    Laya.Tween.to(this.lanhuo, {
                                        alpha: 1
                                    }, 500, null, Laya.Handler.create(this, () => { }));
                                }));
                            }
                        }
                    });
                }));
            }
            initZi() {
                let a = [];
                a.push(["嗨", "white"], ["，", "white"]);
                let name = this.nameInput.text;
                for (let i = 0; i < name.length; i++) {
                    a.push([name[i], "yellow"]);
                }
                a.push(["，", "white"], ["欢", "white"], ["迎", "white"], ["来", "white"], ["到", "white"], ["卡", "white"], ["丁", "white"], ["车", "white"], ["的", "white"], ["世", "white"], ["界", "white"], ["~", "white"]);
                let b = [["全", "yellow"], ["地", "yellow"], ["形", "yellow"], ["赛", "white"], ["道", "white"], ["，", "white"], ["超", "white"], ["炫", "yellow"], ["酷", "yellow"], ["赛", "white"], ["车", "white"], ["，", "white"], ["等", "white"], ["着", "white"], ["你", "white"], ["的", "white"], ["到", "white"], ["来", "white"], ["!", "white"]];
                let c = [["让", "white"], ["我", "white"], ["一", "white"], ["起", "white"], ["开", "white"], ["启", "white"], ["你", "white"], ["的", "white"], ["超", "yellow"], ["神", "yellow"], ["赛", "white"], ["车", "white"], ["手", "white"], ["之", "white"], ["路", "white"], ["!", "white"]];
                this.ziList = [a, b, c];
            }
            startBtnlick() {
                if (this.canCreateRole) {
                    console.log("点击开始资源加载完成");
                    PickRoleUI.logText.text += "点击开始资源加载完成";
                    console.log("数据:", DataMgr.Ins);
                    try {
                        PickRoleUI.logText.text += "\n--1";
                        DataMgr.Ins.currPlayerSex = this.currPlayerSex;
                        PickRoleUI.logText.text += "\n--2";
                        DataMgr.Ins.useCarStage = DataMgr.Ins.carStage;
                        PickRoleUI.logText.text += "\n--3";
                        DataMgr.Ins.gameUseCar = DataMgr.Ins.currSelectCar;
                        PickRoleUI.logText.text += "\n--4";
                        GameMgr.Ins.enterGame(true, E_GAME_MODE.MULTIPLAYER_SPEED_GAME, -1, 1, true);
                        PickRoleUI.logText.text += "\n--5";
                        PlatformMgr.Ins.closeNativeAd();
                        PickRoleUI.logText.text += "\n--6";
                        this.isOpen = false;
                        PickRoleUI.logText.text += "\n--7";
                        DataMgr.Ins.isCreatRole = Date.now();
                        PickRoleUI.logText.text += "\n--8";
                        DataMgr.Ins.SavePlayerData();
                        PickRoleUI.logText.text += "\n--9";
                        this.close();
                    } catch (error) {
                        PickRoleUI.logText.text += "报错:" + error;
                    }
                    if (this.isOpen) { }
                    this.isOpen = false;
                } else {
                    console.log("点击开始游戏,资源未加载完成");
                    PickRoleUI.logText.text += "点击开始游戏,资源未加载完成";
                    if (!this.loadingImage.visible) {
                        console.log("显示loadingImage");
                        PickRoleUI.logText.text += "显示loadingImage";
                        this.loadingImage.visible = true;
                    }
                }
            }
            refreshNativeItem() { }
        }
        class NpcClothInfo {
            constructor(_clothID, _wingCfg, _hairCfg, _hatCfg) {
                this.clothID = _clothID;
                this.wingCfg = _wingCfg;
                this.hairCfg = _hairCfg;
                this.hatCfg = _hatCfg;
            }
        }
        class NpcInfo {
            constructor(raceID, isGuide = false, _cupLevel = 1) {
                this.raceID = raceID;
                let ChaCfg;
                let WingCfg;
                let HatCfg;
                let HairCfg;
                this.cupLevel = _cupLevel;
                if (isGuide) {
                    this.carID = 6;
                    this.carLv = 1;
                    ChaCfg = CCfgMgr.Ins.cfgClothes.getItem(CCfgMgr.Ins.cfgGlobalPar.getItemValue(E_GLOBALPAR_NAME.GAME_INIT_CLOTHES_MEN));
                    HairCfg = CCfgMgr.Ins.cfgClothes.getItem(CCfgMgr.Ins.cfgGlobalPar.getItemValue(E_GLOBALPAR_NAME.GAME_INIT_HAIR_MEN));
                } else {
                    var _carID = 1;
                    if (_cupLevel < 2) {
                        _carID = UsefulStuff.rnd(1, 2);
                    } else if (_cupLevel < 3) {
                        _carID = UsefulStuff.rnd(1, 5);
                    } else if (_cupLevel < 4) {
                        _carID = UsefulStuff.rnd(1, 12);
                    } else if (_cupLevel < 5) {
                        _carID = UsefulStuff.rnd(3, 12);
                    } else if (_cupLevel < 6) {
                        _carID = UsefulStuff.rnd(6, 11);
                    } else {
                        _carID = UsefulStuff.rnd(8, 11);
                    }
                    this.carID = CCfgMgr.Ins.cfgRacing.getItem(_carID).assetId;
                    this.carLv = UsefulStuff.rnd(1, 3);
                    ChaCfg = CCfgMgr.Ins.cfgClothes.rndCloth();
                    WingCfg = CCfgMgr.Ins.cfgClothes.rndWing();
                    HairCfg = CCfgMgr.Ins.cfgClothes.rndHair();
                    HatCfg = CCfgMgr.Ins.cfgClothes.rndHat();
                }
                this.clothInfo = new NpcClothInfo(ChaCfg.ID, WingCfg, HairCfg, HatCfg);
            }
        }
        class RankInfo {
            constructor(_ChaID, _playerName, _isSelf, actorScript, _isFinish = true) {
                this.raceID = _ChaID;
                this.playerName = _playerName;
                this.isSelf = _isSelf;
                this.clothInfo = new NpcClothInfo(_ChaID, actorScript.m_wingCfg, actorScript.m_hairCfg, actorScript.m_hatCfg);
                this.finishTime = 0;
                this.isFinish = _isFinish;
            }
        }
        class RecordInfo {
            constructor(_finishTime, _carName, _carSkin, _carQua) {
                this.finishTime = _finishTime;
                this.carName = _carName;
                this.carSkin = _carSkin;
                this.carQua = _carQua;
            }
        }
        class GameMgr {
            constructor() {
                this.isGameStart = false;
                this.isGameOver = false;
                this.isGameReturnStartUI = false;
                this.inReady = false;
                this.isCountDown = false;
                this.curLevel = 1;
                this.curRankList = [];
                this.selfRank = 0;
                this.championID = 0;
                this.curKillNum = 0;
                this.flyGold = 0;
                this.maxCarSpeed = .5;
                this.curGameRank = 0;
                this.nameBoards = [];
                this.gameNpcs = [];
                this.racePosPool = [false, false, false, false];
                this.isGuideGame = true;
                this.isRankingGame = false;
                this.isGuideTurnLeft = true;
                this.isGuideThunder = true;
                this.isGuideStar = true;
                this.isGuideSkill = true;
                this.gameFrame = 0;
                this.gameLap = 0;
                this.gameCount = 0;
                this.gameMulSpeedCount = 0;
                this.gameMulPropCount = 0;
                this.gameSinSpeedCount = 0;
                this.gameCardArray = [];
                this.preScore = 0;
                this.preSelfRank = 1;
                this.isPause = false;
            }
            static get Ins() {
                return GameMgr._ins || (GameMgr._ins = new GameMgr());
            }
            get curGameModeStr() {
                switch (this.curGameMode) {
                    case E_GAME_MODE.NONE:
                        return "";

                    case E_GAME_MODE.MULTIPLAYER_PROP_GAME:
                        return "道具";

                    case E_GAME_MODE.MULTIPLAYER_SPEED_GAME:
                        return "竞速";

                    case E_GAME_MODE.SINGLE_SPEED_GAME:
                        return "极限";

                    default:
                        return "";
                }
            }
            initScene() {
                this.curLevel = DataMgr.Ins.currTrackId;
                if (this.isGuideGame) {
                    SceneMgr.Ins.hasBooster = false;
                    SceneMgr.Ins.hasWall = false;
                } else {
                    SceneMgr.Ins.hasBooster = true;
                    SceneMgr.Ins.hasWall = false;
                }
                SceneMgr.Ins.createScene();
                this.createSelfActor();
            }
            recreateSelfActor() {
                ActorMgr.Ins.changeSelfActor();
            }
            initGame() {
                for (let i = 0; i < this.gameNpcs.length; i++) {
                    this.createNpcActor(this.gameNpcs[i]);
                }
                for (let i = 0; i < 4; i++) {
                    if (this.nameBoards.length < 4) {
                        let nameBoard = new NpcNameUI();
                        this.nameBoards.push(nameBoard);
                        Laya.stage.addChildAt(nameBoard, 1);
                        nameBoard.visible = false;
                    }
                }
            }
            enterGame(isRanking = false, mode = E_GAME_MODE.MULTIPLAYER_PROP_GAME, lapNum = -1, npcLevel = 0, isGuideGame = false) {
                let pageId = DataMgr.Ins.currTrackId + "";
                DataMgr.Ins.currGameMode = mode;
                this.isRankingGame = isRanking;
                this.curGameMode = mode;
                this.isGuideGame = isGuideGame;
                let _mode = GameMgr.Ins.curGameModeStr;
                if (lapNum < 0) {
                    let tCfg = CCfgMgr.Ins.cfgTrack.getItem(DataMgr.Ins.currTrackId);
                    this.gameLap = tCfg.turnsNum - 1;
                } else {
                    this.gameLap = lapNum;
                }
                if (this.isGuideGame) this.selfRacePos = 1; else this.selfRacePos = UsefulStuff.rnd(0, 3);
                this.racePosPool[this.selfRacePos] = true;
                let preloadRes = [];
                if (mode != E_GAME_MODE.SINGLE_SPEED_GAME) {
                    for (let i = 0; i < 3; i++) {
                        let racePos = 0;
                        for (let j = 0; j < 4; j++) {
                            if (!this.racePosPool[j]) {
                                racePos = j;
                                this.racePosPool[j] = true;
                                break;
                            }
                        }
                        let level = 0;
                        if (npcLevel > 0) level = npcLevel; else level = DataMgr.Ins.getCurrRankLv();
                        let npc = new NpcInfo(racePos, this.isGuideGame, level);
                        let carRes = LoadMgr.Ins.unityResPath(E_UNITY_RES_PATH.CAR, "Car_" + npc.carID + "_" + npc.carLv + ".lh");
                        let clothCfg = CCfgMgr.Ins.cfgClothes.getItem(npc.clothInfo.clothID);
                        let chaRes = LoadMgr.Ins.unityResPath(E_UNITY_RES_PATH.CHA, "Cha_" + clothCfg.assetId + ".lh");
                        let hairRes = LoadMgr.Ins.unityResPath(E_UNITY_RES_PATH.CHA, "hair_" + npc.clothInfo.hairCfg.assetId + ".lh");
                        preloadRes.push(carRes);
                        preloadRes.push(chaRes);
                        preloadRes.push(hairRes);
                        if (npc.clothInfo.wingCfg) {
                            let wingRes = LoadMgr.Ins.unityResPath(E_UNITY_RES_PATH.CHA, "wing_" + npc.clothInfo.wingCfg.assetId + ".lh");
                            preloadRes.push(wingRes);
                        }
                        if (npc.clothInfo.hatCfg) {
                            let hatRes = LoadMgr.Ins.unityResPath(E_UNITY_RES_PATH.CHA, "hat_" + npc.clothInfo.hatCfg.assetId + ".lh");
                            preloadRes.push(hatRes);
                        }
                        this.gameNpcs.push(npc);
                    }
                }
                try {
                    let list = DataMgr.Ins.currPlayerSex == 0 ? DataMgr.Ins.currSelectMenClothesList : DataMgr.Ins.currSelectWomenClothesList;
                    let WingCfg = list[3] ? list[3].getBaseNature() : null;
                    let HairCfg = list[0] ? list[0].getBaseNature() : null;
                    let rndChaCfg = list[2] ? list[2].getBaseNature() : null;
                    let HatCfg = list[1] ? list[1].getBaseNature() : null;
                    preloadRes.push(LoadMgr.Ins.unityResPath(E_UNITY_RES_PATH.CAR, "Car_" + DataMgr.Ins.gameUseCar.cfg.assetId + "_" + DataMgr.Ins.useCarStage + ".lh"));
                    if (rndChaCfg) preloadRes.push(LoadMgr.Ins.unityResPath(E_UNITY_RES_PATH.CHA, "Cha_" + rndChaCfg.assetId.toString() + ".lh"));
                    if (WingCfg) preloadRes.push(LoadMgr.Ins.unityResPath(E_UNITY_RES_PATH.CHA, "wing_" + WingCfg.assetId.toString() + ".lh"));
                    if (HairCfg) preloadRes.push(LoadMgr.Ins.unityResPath(E_UNITY_RES_PATH.CHA, "hair_" + HairCfg.assetId.toString() + ".lh"));
                    if (HatCfg) preloadRes.push(LoadMgr.Ins.unityResPath(E_UNITY_RES_PATH.CHA, "hat_" + HatCfg.assetId.toString() + ".lh"));
                } catch (error) {
                    PickRoleUI.logText.text += "\n报错" + error;
                }
                if (!this.isGuideGame) {
                    if (this.isRankingGame) {
                        LoadMgr.Ins.loadLevel(DataMgr.Ins.currTrackId, Laya.Handler.create(this, this.loadComplete), null, preloadRes);
                    } else {
                        LoadMgr.Ins.loadLevelWithUI(DataMgr.Ins.currTrackId, Laya.Handler.create(this, this.loadComplete), preloadRes);
                    }
                } else {
                    this.loadComplete();
                }
            }
            startGame() {
                this.curRankList = [];
                this.achievementData = new Array(E_ACHIEVEMENT_TYPE.MAX);
                this.curKillNum = 0;
                this.flyGold = 0;
                this.gameFrame = 0;
                this.initGame();
                this.isGameOver = false;
                this.isGameStart = true;
                this.isGameReturnStartUI = true;
                this.isCountDown = false;
                this.inReady = true;
                let tCfg = CCfgMgr.Ins.cfgTrack.getItem(DataMgr.Ins.currTrackId);
                SoundMgr.Ins.playBgm(DataMgr.Ins.currGameMode);
                this.maxCarSpeed = .5;
                if (this.isGuideGame) {
                    if (DataMgr.Ins.guideData[E_GUIDE_TYPE.BATTLE_START]) {
                        UIManager.Ins.getScene(E_UI_TYPE.BATTLEUI).open(true);
                        this.battleStartGuide();
                    }
                } else {
                    UIManager.Ins.getScene(E_UI_TYPE.BATTLEUI).open(false);
                    this.gameReady();
                    switch (this.curGameMode) {
                        case E_GAME_MODE.NONE:
                            break;

                        case E_GAME_MODE.MULTIPLAYER_PROP_GAME:
                            break;

                        case E_GAME_MODE.MULTIPLAYER_SPEED_GAME:
                            break;

                        case E_GAME_MODE.SINGLE_SPEED_GAME:
                            break;

                        default:
                            break;
                    }
                }
            }
            gameReady() {
                if (DataMgr.IsNewGuiding()) this.gameCountDown(); else {
                    if (this.curGameMode == E_GAME_MODE.MULTIPLAYER_PROP_GAME) UIManager.Ins.getScene(E_UI_TYPE.GAMECARDUI).open(false); else this.gameCountDown();
                }
            }
            gameCountDown() {
                ActorMgr.Ins.ReadyAllScript();
                EventMgr.Ins.dispatch(EventType.BATTLE_COUNT_DOWN);
                Laya.timer.loop(17, this, this.gameUpdate, null, true, true);
                Laya.timer.once(4500, this, this.startRefresh);
                switch (this.curGameMode) {
                    case E_GAME_MODE.NONE:
                        break;

                    case E_GAME_MODE.MULTIPLAYER_PROP_GAME:
                        break;

                    case E_GAME_MODE.MULTIPLAYER_SPEED_GAME:
                        break;

                    case E_GAME_MODE.SINGLE_SPEED_GAME:
                        break;

                    default:
                        break;
                }
            }
            startRefresh() {
                this.gameStartTime = Date.now();
                this.inReady = false;
                EventMgr.Ins.dispatch(EventType.BATTLE_READY_GO);
                if (PlatformMgr.Ins.platform == E_PLATFORM_TYPE.TT) {
                    var ttp = platform.Ins;
                    ttp.startRecord();
                }
            }
            gameUpdate() {
                if (this.isPause) return;
                if (this.isCountDown && Date.now() > this.gameOverTime) {
                    this.isCountDown = false;
                    EventMgr.Ins.dispatch(EventType.RACE_FINISH);
                    this.gameOver();
                    return;
                }
                if (this.isGuideGame && DataMgr.Ins.guideData[E_GUIDE_TYPE.BATTLE_CURVE] && !GuideMgr.Ins.isGuiding) {
                    if (ActorMgr.Ins.m_selfScript.gameDis > 450) {
                        this.CurveGuide();
                    }
                }
                this.gameFrame++;
                EventMgr.Ins.dispatch(EventType.TIMEFIBER, this.gameFrame);
                let npcScriptList = ActorMgr.Ins.m_NpcScripts;
                let m_selfScript = ActorMgr.Ins.m_selfScript;
                let rankC = 1;
                let closestNpc;
                let closestDis = -1;
                let maxDis = m_selfScript.gameDis;
                let firstID = 0;
                let m_AllScripts = ActorMgr.Ins.m_AllScripts;
                m_AllScripts.sort(function (a, b) {
                    return b.gameDis - a.gameDis;
                });
                for (let i = 0; i < m_AllScripts.length; i++) {
                    let npc = m_AllScripts[i];
                    npc.rankNum = i + 1;
                    let dis = m_selfScript.gameDis - m_AllScripts[i].gameDis;
                    if (this.inReady) {
                        this.nameBoards[i].visible = true;
                        this.nameBoards[i].refreshPos(m_AllScripts[i]);
                    } else if (this.isGameOver) {
                        if (Math.abs(dis) < 20) {
                            this.nameBoards[i].visible = true;
                            this.nameBoards[i].refreshPos(m_AllScripts[i]);
                        } else {
                            this.nameBoards[i].visible = false;
                        }
                    } else {
                        this.nameBoards[i].visible = false;
                        if (npc.isSelf && i > 0) {
                            closestNpc = m_AllScripts[i - 1];
                        }
                    }
                    this.curGameRank = rankC;
                    for (let j = i + 1; j < m_AllScripts.length; j++) {
                        let npc1 = m_AllScripts[i];
                        let npc2 = m_AllScripts[j];
                        if (npc1.isFlying || npc2.isFlying) continue;
                        let dis = npc1.gameDis - npc2.gameDis;
                        if (this.isGameStart && !this.isGameOver) {
                            if (Math.abs(dis) < 1) {
                                let offsetDis = npc1.curOffset - npc2.curOffset;
                                if (Math.abs(offsetDis) < 1.6) {
                                    if (Math.abs(dis) < .75) {
                                        if (npc1.starBuff != npc2.starBuff) {
                                            if (npc1.starBuff) {
                                                npc2.beAttacked();
                                            } else {
                                                npc1.beAttacked();
                                            }
                                        } else {
                                            this.impactTwo(npc1, npc2);
                                        }
                                    } else {
                                        if (npc1.starBuff != npc2.starBuff) {
                                            if (npc1.starBuff) {
                                                npc2.beAttacked();
                                            } else {
                                                npc1.beAttacked();
                                            }
                                        } else {
                                            if (dis < 0) {
                                                this.impluseTwo(npc2, npc1);
                                            } else {
                                                this.impluseTwo(npc1, npc2);
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
                if (closestNpc) {
                    if (m_selfScript.isFlying) {
                        this.nameBoards[closestNpc.racePos].visible = false;
                    } else {
                        this.nameBoards[closestNpc.racePos].visible = true;
                        this.nameBoards[closestNpc.racePos].refreshPos(closestNpc);
                    }
                }
                this.championID = m_AllScripts[0].racePos;
            }
            impactTwo(npc1, npc2) {
                if (npc1.curOffset > npc2.curOffset) {
                    if (npc1.checkBuff(E_SKILL_BUFF.PHYISC_KING) == npc2.checkBuff(E_SKILL_BUFF.PHYISC_KING)) {
                        npc1.impactLeft();
                        npc2.impactRight();
                    } else {
                        npc1.checkBuff(E_SKILL_BUFF.PHYISC_KING) ? npc1.physicsKingDebuff() : npc1.impactLeft();
                        npc2.checkBuff(E_SKILL_BUFF.PHYISC_KING) ? npc2.physicsKingDebuff() : npc2.impactRight();
                    }
                } else {
                    if (npc1.checkBuff(E_SKILL_BUFF.PHYISC_KING) == npc2.checkBuff(E_SKILL_BUFF.PHYISC_KING)) {
                        npc1.impactRight();
                        npc2.impactLeft();
                    } else {
                        npc1.checkBuff(E_SKILL_BUFF.PHYISC_KING) ? npc1.physicsKingDebuff() : npc1.impactRight();
                        npc2.checkBuff(E_SKILL_BUFF.PHYISC_KING) ? npc2.physicsKingDebuff() : npc2.impactLeft();
                    }
                }
            }
            impluseTwo(impluseOne, downOne) {
                downOne.shiftDown();
                impluseOne.impulse(.2);
            }
            createSelfActor() {
                this.selfRoot = ActorMgr.Ins.createSelfRole();
                SceneMgr.Ins.addPlayer(this.selfRoot);
            }
            createNpcActor(_npcInfo) {
                let npcRoot = ActorMgr.Ins.createNpcActor(_npcInfo);
                SceneMgr.Ins.addPlayer(npcRoot);
            }
            playThunder(masterID) {
                let allPlayers = ActorMgr.Ins.m_AllScripts;
                for (let i = 0; i < allPlayers.length; i++) {
                    let npc = allPlayers[i];
                    if (npc.racePos != masterID) {
                        npc.beThundered();
                        if (masterID == 0) SceneMgr.Ins.battlePropFeature(npc.m_selfP, E_PROP_TYPE.THUNDER);
                    }
                }
                SoundMgr.Ins.lightning();
            }
            playGhost(rankNum) {
                let allPlayers = ActorMgr.Ins.m_AllScripts;
                if (rankNum > 1) {
                    allPlayers[rankNum - 2].beGhosted();
                    return allPlayers[rankNum - 2];
                } else {
                    allPlayers[rankNum].beGhosted();
                    return allPlayers[rankNum];
                }
            }
            playFaith(rankNum) {
                let allPlayers = ActorMgr.Ins.m_AllScripts;
                if (rankNum > 1) {
                    allPlayers[rankNum - 2].beFainted();
                    return allPlayers[rankNum - 2];
                } else {
                    allPlayers[rankNum].beFainted();
                    return allPlayers[rankNum];
                }
            }
            endGame() {
                this.racePosPool = [false, false, false, false];
                this.gameNpcs = [];
                Laya.timer.clear(this, this.gameUpdate);
                this.closeAllName();
                this.isGameStart = false;
                this.isGameOver = false;
                this.isCountDown = false;
                this.gameOverTime = null;
                this.gameStartTime = 0;
                SceneMgr.Ins.clearScene();
                ActorMgr.Ins.clearActor();
                UIManager.Ins.getScene(E_UI_TYPE.TRAINING_RESULT).open(true, this.isRankingGame);
                if (!this.isGuideGame) {
                    switch (this.curGameMode) {
                        case E_GAME_MODE.NONE:
                            break;

                        case E_GAME_MODE.MULTIPLAYER_PROP_GAME:
                            break;

                        case E_GAME_MODE.MULTIPLAYER_SPEED_GAME:
                            break;

                        case E_GAME_MODE.SINGLE_SPEED_GAME:
                            break;

                        default:
                            break;
                    }
                }
                DataMgr.Ins.refreshGuideData();
            }
            closeAllName() {
                for (let i = 0; i < this.nameBoards.length; i++) {
                    this.nameBoards[i].visible = false;
                }
            }
            loadComplete() {
                if (this.isRankingGame && !this.isGuideGame) {
                    EventMgr.Ins.dispatch(EventType.RANKING_LOAD_COMPLETE);
                } else {
                    this.initScene();
                    Laya.timer.frameOnce(1, this, this.startGame);
                }
            }
            matchShowComplete() {
                Laya.timer.once(2e3, this, this.preRenderOver);
                LoadMgr.Ins.loadTimeLoadingUI();
            }
            preRenderOver() {
                this.initScene();
                Laya.timer.frameOnce(1, this, this.startGame);
            }
            restartGame() { }
            quitGame() { }
            gameOver() {
                Advertisement.insertAdverV();
                if (this.isGameStart && !this.isGameOver) {
                    if (PlatformMgr.Ins.platform == E_PLATFORM_TYPE.TT) {
                        var ttp = platform.Ins;
                        ttp.stopRecord();
                    }
                    let pageId = DataMgr.Ins.currTrackId + "";
                    this.isGameOver = true;
                    this.preScore = DataMgr.Ins.rankScore;
                    this.preSelfRank = DataMgr.Ins.getCurrRankLv();
                    this.selfRank = 1;
                    for (let i = 0; i < ActorMgr.Ins.m_AllScripts.length; i++) {
                        let npc = ActorMgr.Ins.m_AllScripts[i];
                        if (!npc.isFinish) {
                            let rankInfo = new RankInfo(npc.chaID, npc.PlayerName, npc.isSelf, npc.m_ActorScript, false);
                            this.curRankList.push(rankInfo);
                        }
                    }
                    for (let i = 0; i < this.curRankList.length; i++) {
                        let player = this.curRankList[i];
                        if (player.isSelf) this.selfRank = i + 1;
                    }
                    if ((this.curGameMode == E_GAME_MODE.MULTIPLAYER_PROP_GAME || this.curGameMode == E_GAME_MODE.MULTIPLAYER_SPEED_GAME) && this.selfRank != 1) {
                        DataMgr.Ins.isRankFirst = false;
                    } else {
                        DataMgr.Ins.isRankFirst = true;
                    }
                    if (DataMgr.IsNewGuiding()) {
                        DataMgr.Ins.PushGuideRace(this.isRankingGame, this.curGameMode, this.selfRank);
                    } else {
                        DataMgr.Ins.PushCommonRace(this.isRankingGame, this.curGameMode, this.selfRank);
                    }
                    if (this.isRankingGame) this.rankLevelJieSuan(this.selfRank);
                    if (this.curGameMode == E_GAME_MODE.SINGLE_SPEED_GAME) this.checkStoryUnlock();
                    Laya.timer.once(4e3, this, this.endGame);
                    if (this.curGameMode == E_GAME_MODE.MULTIPLAYER_SPEED_GAME) DataMgr.Ins.mutlRaceTryCar = 0;
                }
            }
            rankLevelJieSuan(paiMing) {
                let currDuanwei = Math.max(1, DataMgr.Ins.getCurrRankLv());
                currDuanwei = Math.min(6, currDuanwei);
                let paiMingExpList = CCfgMgr.Ins.cfgRankInfo.getItem(currDuanwei)._cupRankExp;
                let score = paiMingExpList[paiMing - 1];
                if (paiMing == 1) {
                    DataMgr.Ins.lianWinTimes++;
                    if (DataMgr.Ins.lianWinTimes > 5) {
                        DataMgr.Ins.lianWinTimes = 5;
                    }
                    score += DataMgr.Ins.getLianWinScore();
                } else {
                    DataMgr.Ins.lianWinTimes = 0;
                }
                DataMgr.Ins.addRankScore(score);
                DataMgr.Ins.SavePlayerData();
            }
            pauseGame() {
                this.isPause = true;
                EventMgr.Ins.dispatch(EventType.BATTLE_RIGHT_UP);
                EventMgr.Ins.dispatch(EventType.BATTLE_LEFT_UP);
            }
            resumeGame() {
                this.isPause = false;
            }
            rndProp(addItemID, addItemChance, rankNum = 1, isSelf = false) {
                if (this.curGameMode == E_GAME_MODE.MULTIPLAYER_SPEED_GAME || this.curGameMode == E_GAME_MODE.SINGLE_SPEED_GAME) {
                    if (this.isGuideGame && DataMgr.Ins.guideData[E_GUIDE_TYPE.BATTLE_NOS] && isSelf) {
                        this.NOSGuide();
                    }
                    return E_PROP_TYPE.NOS;
                }
                let rndNum = CCfgMgr.Ins.cfgPropInfo.rndProp(addItemID, addItemChance, rankNum);
                let rndType = rndNum;
                return rndType;
            }
            noticeFinish(ChaID, playerName, isSelf, actorScript) {
                if (!this.isCountDown) {
                    this.isCountDown = true;
                    this.gameOverTime = Date.now() + 5e3;
                    EventMgr.Ins.dispatch(EventType.RACE_COOLDOWN);
                }
                if (DataMgr.Ins.guideData[E_GUIDE_TYPE.BATTLE_OVER]) {
                    Laya.timer.once(2e3, this, this.BattleOverGuide);
                }
                let rankInfo = new RankInfo(ChaID, playerName, isSelf, actorScript);
                let finishTime = Date.now() - this.gameStartTime;
                rankInfo.finishTime = finishTime;
                this.curRankList.push(rankInfo);
                if (isSelf) {
                    var needUpdate = DataMgr.Ins.updateRecord(this.curGameMode, finishTime, DataMgr.Ins.gameUseCar.id, DataMgr.Ins.useCarStage, DataMgr.Ins.gameUseCar.getQuality());
                    if (this.curGameMode == E_GAME_MODE.MULTIPLAYER_SPEED_GAME && (isWx() || isQQ()) && needUpdate) {
                        var trackID = DataMgr.Ins.currTrackId.toString();
                        var carInfo = DataMgr.Ins.gameUseCar;
                        var iconID = DataMgr.Ins.useCarStage - 1;
                        var carName = carInfo.cfg._Name;
                        var carSkin = "webRes/carIcon/" + carInfo.cfg._RacingIconName[iconID] + ".png";
                        var carQua = "uires/oneRace1/qulity_" + carInfo.getQuality() + ".png";
                        var ri = new RecordInfo(finishTime, carName, carSkin, carQua);
                    }
                    this.updateAchievementData(E_ACHIEVEMENT_TYPE.TRACKTIME, finishTime);
                    DataMgr.Ins.SavePlayerData();
                }
            }
            battleStartGuide() {
                this.pauseGame();
                GuideMgr.Ins.startGuide(E_GUIDE_TYPE.BATTLE_START, null, () => {
                    this.battleStartGuideCallback();
                });
            }
            battleStartGuideCallback() {
                UIManager.Ins.getScene(E_UI_TYPE.BATTLEUI).open(false);
                ActorMgr.Ins.ReadyAllScript();
                EventMgr.Ins.dispatch(EventType.BATTLE_COUNT_DOWN);
                Laya.timer.loop(17, this, this.gameUpdate, null, true, true);
                Laya.timer.once(4500, this, this.startRefresh);
                this.resumeGame();
            }
            turnLeftGuide() {
                this.pauseGame();
                GuideMgr.Ins.startGuide(E_GUIDE_TYPE.BATTLE_TURN_LEFT, null, () => {
                    this.turnLeftGuideCallback();
                });
            }
            turnLeftGuideCallback() {
                this.resumeGame();
            }
            finishTurnLeftGuide() {
                this.pauseGame();
                GuideMgr.Ins.startGuide(E_GUIDE_TYPE.BATTLE_FINISH_TURN_LEFT, null, () => {
                    this.finishTurnLeftGuideCallback();
                });
            }
            finishTurnLeftGuideCallback() {
                this.resumeGame();
                EventMgr.Ins.dispatch(EventType.DRIFTOVERMSG, 1);
                ActorMgr.Ins.m_selfScript.driftRush(1);
            }
            CurveGuide() {
                this.pauseGame();
                GuideMgr.Ins.startGuide(E_GUIDE_TYPE.BATTLE_CURVE, null, () => {
                    this.stopGuide();
                });
            }
            GoodGuide() {
                if (DataMgr.Ins.guideData[E_GUIDE_TYPE.BATTLE_GOOD]) {
                    this.pauseGame();
                    GuideMgr.Ins.startGuide(E_GUIDE_TYPE.BATTLE_GOOD, null, () => {
                        this.stopGuide();
                    });
                }
            }
            rushGuideCallback() {
                this.gameStartTime = Date.now();
                this.resumeGame();
            }
            stopGuide() {
                this.resumeGame();
            }
            rushGuide() {
                this.pauseGame();
                GuideMgr.Ins.startGuide(E_GUIDE_TYPE.BATTLE_RUSH, null, () => {
                    this.rushGuideCallback();
                });
            }
            NOSGuide() {
                this.pauseGame();
                GuideMgr.Ins.startGuide(E_GUIDE_TYPE.BATTLE_NOS, null, () => {
                    this.stopGuide();
                });
            }
            thunderGuide() {
                this.pauseGame();
                GuideMgr.Ins.startGuide(E_GUIDE_TYPE.BATTLE_GOOD, null, () => {
                    this.stopGuide();
                });
            }
            StarGuide() {
                this.pauseGame();
                GuideMgr.Ins.startGuide(E_GUIDE_TYPE.BATTLE_STAR, null, () => {
                    this.stopGuide();
                });
            }
            checkPropGuide(rndType) {
                switch (rndType) {
                    case E_PROP_TYPE.THUNDER:
                        this.propGuide(E_GUIDE_TYPE.BATTLE_GOOD);
                        break;

                    case E_PROP_TYPE.GHOST:
                        this.propGuide(E_GUIDE_TYPE.BATTLE_GHOST);
                        break;

                    case E_PROP_TYPE.STAR:
                        this.propGuide(E_GUIDE_TYPE.BATTLE_STAR);
                        break;

                    case E_PROP_TYPE.NOS:
                        break;

                    default:
                        break;
                }
            }
            propGuide(type) {
                if (DataMgr.Ins.guideData[type] && !this.isGameOver) {
                    this.pauseGame();
                    GuideMgr.Ins.startGuide(type, null, () => {
                        this.stopGuide();
                    });
                }
            }
            SkillGuide() {
                this.pauseGame();
                GuideMgr.Ins.startGuide(E_GUIDE_TYPE.BATTLE_SKILL, null, () => {
                    this.stopGuide();
                });
            }
            BattleOverGuide() {
                this.pauseGame();
                GuideMgr.Ins.startGuide(E_GUIDE_TYPE.BATTLE_OVER, null, () => {
                    this.stopGuide();
                });
            }
            getTrackLapNum() {
                if (this.isGuideGame) return 1; else return this.gameLap;
            }
            updateAchievementData(ach, value = 0) {
                if (!this.achievementData[ach]) this.achievementData[ach] = 0;
                if (value > 0) this.achievementData[ach] = value; else this.achievementData[ach]++;
            }
            checkStoryUnlock() {
                let cfg = CCfgMgr.Ins.cfgStoryInfo.getItem(DataMgr.Ins.currTrackId);
                if (cfg && cfg.targetID > 0) {
                    let targetCfg = CCfgMgr.Ins.cfgStoryInfo.getItem(cfg.targetID);
                    let unlockNeed1Suc = true;
                    let unlockNeed2Suc = true;
                    let unlockNeed3Suc = true;
                    for (let i = 0; i < targetCfg._unlockNeed1.length; i++) {
                        let type = targetCfg._unlockNeed1[i];
                        if (type > 0) {
                            if (!this.checkAchievementSuc(type, targetCfg._unlockValue1[i], this.achievementData[type])) unlockNeed1Suc = false;
                        }
                    }
                    for (let i = 0; i < targetCfg._unlockNeed2.length; i++) {
                        let type = targetCfg._unlockNeed2[i];
                        if (type > 0) {
                            if (!this.checkAchievementSuc(type, targetCfg._unlockValue2[i], this.achievementData[type])) unlockNeed2Suc = false;
                        }
                    }
                    for (let i = 0; i < targetCfg._unlockNeed3.length; i++) {
                        let type = targetCfg._unlockNeed3[i];
                        if (type > 0) {
                            if (!this.checkAchievementSuc(type, targetCfg._unlockValue3[i], this.achievementData[type])) unlockNeed3Suc = false;
                        }
                    }
                    DataMgr.Ins.updateStoryData(unlockNeed1Suc, unlockNeed2Suc, unlockNeed3Suc, targetCfg.ID);
                }
            }
            checkAchievementSuc(ach, target, value) {
                switch (ach) {
                    case E_ACHIEVEMENT_TYPE.None:
                        break;

                    case E_ACHIEVEMENT_TYPE.TRACKTIME:
                        return value / 1e3 <= target;

                    case E_ACHIEVEMENT_TYPE.NOSTIME:
                        return value >= target;

                    case E_ACHIEVEMENT_TYPE.EDGETIME:
                        return value <= target;

                    case E_ACHIEVEMENT_TYPE.PREFECTDRIFTTIME:
                        return value >= target;

                    case E_ACHIEVEMENT_TYPE.PREFECTSTARTRUSH:
                        return value >= target;

                    case E_ACHIEVEMENT_TYPE.FLYTIME:
                        return value >= target;

                    case E_ACHIEVEMENT_TYPE.MONSTERTIME:
                        return value >= target;

                    case E_ACHIEVEMENT_TYPE.CARLIMIT:
                        return DataMgr.Ins.gameUseCar.id == target;

                    case E_ACHIEVEMENT_TYPE.CLOTHLIMIT:
                        for (let i = 0; i < 4; i++) {
                            let cloth = DataMgr.Ins.getCurrSelectClothes(i);
                            if (cloth && cloth.id == target) return true;
                        }
                        return false;

                    case E_ACHIEVEMENT_TYPE.MAX:
                        break;

                    default:
                        break;
                }
            }
        }
        var E_UNLOCKCHA_TYPE;
        (function (E_UNLOCKCHA_TYPE) {
            E_UNLOCKCHA_TYPE[E_UNLOCKCHA_TYPE["INIT"] = 0] = "INIT";
            E_UNLOCKCHA_TYPE[E_UNLOCKCHA_TYPE["DIAMOND"] = 1] = "DIAMOND";
            E_UNLOCKCHA_TYPE[E_UNLOCKCHA_TYPE["GOLD"] = 2] = "GOLD";
            E_UNLOCKCHA_TYPE[E_UNLOCKCHA_TYPE["AD"] = 3] = "AD";
            E_UNLOCKCHA_TYPE[E_UNLOCKCHA_TYPE["SIGNIN"] = 4] = "SIGNIN";
            E_UNLOCKCHA_TYPE[E_UNLOCKCHA_TYPE["GIFT"] = 5] = "GIFT";
            E_UNLOCKCHA_TYPE[E_UNLOCKCHA_TYPE["LIMITCLOTHES"] = 6] = "LIMITCLOTHES";
            E_UNLOCKCHA_TYPE[E_UNLOCKCHA_TYPE["ZHUANPAN"] = 7] = "ZHUANPAN";
            E_UNLOCKCHA_TYPE[E_UNLOCKCHA_TYPE["LIMITGIFT"] = 8] = "LIMITGIFT";
        })(E_UNLOCKCHA_TYPE || (E_UNLOCKCHA_TYPE = {}));
        var E_UNLOCKCAR_TYPE;
        (function (E_UNLOCKCAR_TYPE) {
            E_UNLOCKCAR_TYPE[E_UNLOCKCAR_TYPE["SP"] = 1] = "SP";
            E_UNLOCKCAR_TYPE[E_UNLOCKCAR_TYPE["DIAMOND"] = 2] = "DIAMOND";
            E_UNLOCKCAR_TYPE[E_UNLOCKCAR_TYPE["SIGNIN"] = 3] = "SIGNIN";
            E_UNLOCKCAR_TYPE[E_UNLOCKCAR_TYPE["LEVELRWD"] = 4] = "LEVELRWD";
            E_UNLOCKCAR_TYPE[E_UNLOCKCAR_TYPE["ZHUANPAN"] = 5] = "ZHUANPAN";
            E_UNLOCKCAR_TYPE[E_UNLOCKCAR_TYPE["VIDEO"] = 6] = "VIDEO";
            E_UNLOCKCAR_TYPE[E_UNLOCKCAR_TYPE["GUIDE"] = 7] = "GUIDE";
        })(E_UNLOCKCAR_TYPE || (E_UNLOCKCAR_TYPE = {}));
        class HtGameScript extends Laya.Script {
            constructor() {
                super(...arguments);
                this.gameData = null;
                this.isInitData = false;
            }
            initData(data) {
                if (!data) return;
                this.isInitData = true;
                this.gameData = data;
                this.gamePic = this.owner.getChildByName("iconImg");
                this.nameLa = this.owner.getChildByName("nameLa");
                this.markLa = this.owner.getChildByName("markLa");
                this.owner.on(Laya.Event.CLICK, this, () => {
                    if (this.gameData) {
                        let jumpInfo = {
                            jumpKey: data.jumpKey,
                            mid: data.mid,
                            txt: data.txt,
                            iconUrl: data.iconUrl,
                            mark: data.mark,
                            query: data.query
                        };
                        PlatformMgr.Ins.navigateToMiniGame(jumpInfo);
                    }
                });
                this.refreshData();
            }
            refreshData() {
                this.gamePic.skin = this.gameData.iconUrl;
                this.nameLa.text = this.gameData.txt;
                this.markLa.text = this.gameData.mark;
            }
        }
        var E_REWARD_TYPE;
        (function (E_REWARD_TYPE) {
            E_REWARD_TYPE[E_REWARD_TYPE["REWARD_BASE"] = 1] = "REWARD_BASE";
            E_REWARD_TYPE[E_REWARD_TYPE["REWARD_CAR"] = 2] = "REWARD_CAR";
            E_REWARD_TYPE[E_REWARD_TYPE["REWARD_CLOTHES"] = 3] = "REWARD_CLOTHES";
        })(E_REWARD_TYPE || (E_REWARD_TYPE = {}));
        var E_REWARD_BASE_TYPE;
        (function (E_REWARD_BASE_TYPE) {
            E_REWARD_BASE_TYPE[E_REWARD_BASE_TYPE["GOLD"] = 1] = "GOLD";
            E_REWARD_BASE_TYPE[E_REWARD_BASE_TYPE["DIAMOND"] = 2] = "DIAMOND";
            E_REWARD_BASE_TYPE[E_REWARD_BASE_TYPE["CLOTHESTICKET"] = 3] = "CLOTHESTICKET";
        })(E_REWARD_BASE_TYPE || (E_REWARD_BASE_TYPE = {}));
        class BaseChest {
            constructor() {
                this.id = 0;
                this.haveTimestamp = 0;
                this.checkinAry = [];
            }
            init(id, haveTimestamp = 0) {
                this.id = id;
                this.haveTimestamp = haveTimestamp;
            }
            get cfg() {
                return CCfgMgr.Ins.cfgChest.getItem(this.id);
            }
            initCheckIn(cfgAry) {
                cfgAry.forEach(cell => {
                    this.checkinAry.push(CCfgMgr.Ins.cfgChest.getItem(cell));
                });
            }
            get checkinCfg() {
                return this.checkinAry;
            }
            getReward() {
                let baseList = [0, 0, 0];
                let carId = 0;
                let clothesId = 0;
                for (let i = 0; i < this.cfg._rewardType.length; i++) {
                    switch (this.cfg._rewardType[i]) {
                        case E_REWARD_TYPE.REWARD_BASE:
                            switch (this.cfg._rewardID[i]) {
                                case E_REWARD_BASE_TYPE.GOLD:
                                    baseList[0] = UsefulStuff.rnd(this.cfg._rewardNumMin[i], this.cfg._rewardNumMax[i]);
                                    break;

                                case E_REWARD_BASE_TYPE.DIAMOND:
                                    baseList[1] = UsefulStuff.rnd(this.cfg._rewardNumMin[i], this.cfg._rewardNumMax[i]);
                                    break;

                                case E_REWARD_BASE_TYPE.CLOTHESTICKET:
                                    baseList[2] = UsefulStuff.rnd(this.cfg._rewardNumMin[i], this.cfg._rewardNumMax[i]);
                                    break;
                            }
                            break;

                        case E_REWARD_TYPE.REWARD_CAR:
                            carId = this.cfg._rewardID[i];
                            break;

                        case E_REWARD_TYPE.REWARD_CLOTHES:
                            clothesId = this.cfg._rewardID[i];
                            break;
                    }
                }
                return [baseList, carId, clothesId];
            }
        }
        "use strict";
        function hasOwnProperty(obj, prop) {
            return Object.prototype.hasOwnProperty.call(obj, prop);
        }
        function decode(qs, sep, eq, options) {
            sep = sep || "&";
            eq = eq || "=";
            var obj = {};
            if (typeof qs !== "string" || qs.length === 0) {
                return obj;
            }
            var regexp = /\+/g;
            qs = qs.split(sep);
            var maxKeys = 1e3;
            if (options && typeof options.maxKeys === "number") {
                maxKeys = options.maxKeys;
            }
            var len = qs.length;
            if (maxKeys > 0 && len > maxKeys) {
                len = maxKeys;
            }
            for (var i = 0; i < len; ++i) {
                var x = qs[i].replace(regexp, "%20"), idx = x.indexOf(eq), kstr, vstr, k, v;
                if (idx >= 0) {
                    kstr = x.substr(0, idx);
                    vstr = x.substr(idx + 1);
                } else {
                    kstr = x;
                    vstr = "";
                }
                k = decodeURIComponent(kstr);
                v = decodeURIComponent(vstr);
                if (!hasOwnProperty(obj, k)) {
                    obj[k] = v;
                } else if (Array.isArray(obj[k])) {
                    obj[k].push(v);
                } else {
                    obj[k] = [obj[k], v];
                }
            }
            return obj;
        }
        "use strict";
        var stringifyPrimitive = function (v) {
            switch (typeof v) {
                case "string":
                    return v;

                case "boolean":
                    return v ? "true" : "false";

                case "number":
                    return isFinite(v) ? v : "";

                default:
                    return "";
            }
        };
        function encode(obj, sep, eq, name) {
            sep = sep || "&";
            eq = eq || "=";
            if (obj === null) {
                obj = undefined;
            }
            if (typeof obj === "object") {
                return Object.keys(obj).map(function (k) {
                    var ks = encodeURIComponent(stringifyPrimitive(k)) + eq;
                    if (Array.isArray(obj[k])) {
                        return obj[k].map(function (v) {
                            return ks + encodeURIComponent(stringifyPrimitive(v));
                        }).join(sep);
                    } else {
                        return ks + encodeURIComponent(stringifyPrimitive(obj[k]));
                    }
                }).filter(Boolean).join(sep);
            }
            if (!name) return "";
            return encodeURIComponent(stringifyPrimitive(name)) + eq + encodeURIComponent(stringifyPrimitive(obj));
        }
        const querystring = {
            encode: encode,
            decode: decode,
            stringify: encode,
            parse: decode
        };
        var byteToHex = [];
        for (var i = 0; i < 256; ++i) {
            byteToHex[i] = (i + 256).toString(16).substr(1);
        }
        function bytesToUuid(buf, offset) {
            var i = offset || 0;
            var bth = byteToHex;
            return [bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], "-", bth[buf[i++]], bth[buf[i++]], "-", bth[buf[i++]], bth[buf[i++]], "-", bth[buf[i++]], bth[buf[i++]], "-", bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], bth[buf[i++]]].join("");
        }
        function v4(options, buf, offset) {
            var i = buf && offset || 0;
            if (typeof options == "string") {
                buf = options === "binary" ? new Array(16) : null;
                options = null;
            }
            options = options || {};
            var rnds = new Array(16);
            for (let i = 0, r; i < 16; i++) {
                if ((i & 3) === 0) r = Math.random() * 4294967296;
                rnds[i] = r >>> ((i & 3) << 3) & 255;
            }
            rnds[6] = rnds[6] & 15 | 64;
            rnds[8] = rnds[8] & 63 | 128;
            if (buf) {
                for (var ii = 0; ii < 16; ++ii) {
                    buf[i + ii] = rnds[ii];
                }
            }
            return buf || bytesToUuid(rnds, 0);
        }
        class HttpMgr {
            constructor() {
                this.acId = "128";
                window["httpTest"] = this;
                this.userId = Laya.LocalStorage.getItem("_p_userId");
                if (!this.userId) {
                    Laya.LocalStorage.setItem("_p_userId", this.userId = v4(0, 0, 0));
                }
            }
            static get Ins() {
                return HttpMgr._ins || (HttpMgr._ins = new HttpMgr());
            }
            send(_url, data, _method) {
                return new Promise((resolve, reject) => {
                    let xhr = new Laya.HttpRequest();
                    xhr.http.timeout = 9e3;
                    xhr.once(Laya.Event.COMPLETE, null, x => {
                        if (x.code == "200") resolve(x); else reject(x);
                    });
                    xhr.once(Laya.Event.ERROR, null, reject);
                    xhr.send(_url, data, _method, "json");
                });
            }
            oppoSend(_url, data, _method) {
                var server = "";//https://openapi.jiegames.com/interactive/business/
                var param = {
                    acId: this.acId,
                    userId: this.userId
                };
                var userInfo = querystring.encode(param, null, null, null);
                let url = server + _url + userInfo;
                return new Promise((resolve, reject) => {
                    let xhr = new Laya.HttpRequest();
                    xhr.http.timeout = 9e3;
                    xhr.once(Laya.Event.COMPLETE, null, x => {
                        if (x.code == "200") resolve(x); else reject(x);
                    });
                    xhr.once(Laya.Event.ERROR, null, reject);
                    xhr.send(url, data, _method, "json");
                });
            }
            wxSend(_url, requestData, _method) {
                return new Promise((resolve, reject) => {
                    wx$1.request({
                        url: _url,
                        data: requestData,
                        method: _method,
                        success: res => {
                            resolve(res);
                        },
                        fail: res => {
                            reject(res);
                        }
                    });
                });
            }
            getActivityInfo() {
                return this.oppoSend("getActivityInfosForGame?", "", "get").then(x => {
                    console.log(x);
                    return x.data;
                });
            }
            getTicketsInfos() {
                return this.oppoSend("getUserActivityLotteryTicketsInfos?", "", "get").then(x => {
                    console.log(x);
                    return x.data;
                });
            }
            getLotteryResult() {
                return this.oppoSend("getLotteryResultForGame?", "", "get").then(x => {
                    console.log(x);
                    return x.data;
                });
            }
            setUserAddressInfo(userName, address, phone) {
                var data = {
                    userId: this.userId,
                    userName: userName,
                    address: address,
                    phone: phone
                };
                return this.oppoSend("setUserAddressInfo?", data, "post");
            }
            getUserAwardsPhoneIsNull() {
                return this.oppoSend("getUserAwardsPhoneIsNull?", "", "get").then(x => {
                    console.log(x);
                    return x.data;
                });
            }
            getWxAccessToken() {
                var url = "";//https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=wx353c4bcd8efc8d89&secret=0834d0979fc5b32777585eecf9033231
                return this.wxSend(url, "", "GET");
            }
            wxMsgSecCheck(msg) {
                if (this.wxAccessToken && this.wxAccessToken.data.expires_in + this.getWxAccessTokenTime < Date.now()) {
                    return this.sendWxMsgSecCheck(msg);
                } else {
                    return this.getWxAccessToken().then(x => {
                        this.wxAccessToken = x;
                        this.getWxAccessTokenTime = Date.now();
                        return this.sendWxMsgSecCheck(msg);
                    });
                }
            }
            sendWxMsgSecCheck(msg) {
                // var url = "https://api.weixin.qq.com/wxa/msg_sec_check?access_token=" + this.wxAccessToken.data.access_token;
                // var data = {
                //     content: msg
                // };
                // return this.wxSend(url, data, "POST");
            }
            wxLogin() {
                // var url = "https://distribute.jiegames.com/api/wx/wxLogin";
                // var data = {
                //     appId: "wx66cca9d17afc7df5",
                //     wxCode: "081Ifm3F1HHTV80fMb4F16Te3F1Ifm3T"
                // };
                // this.send(url, data, "POST").then(x => { });
            }
        }
        class ActivityInfo { }
        class TicketsInfo { }
        class ActivityProductInfo { }
        class LotteryResultInfo { }
        class UserAwardsPhone { }
        class AdConfigMgr {
            constructor() {
                this.data = null;
                this.var = "v113";
                window["Plat1"] = this;
            }
            static get Ins() {
                return AdConfigMgr._ins || (AdConfigMgr._ins = new AdConfigMgr());
            }
            getConfig() {
                // let url = "https://openapi.jiegames.com/SDKBase/getGameInitConfig?gameId=KartFight2&channelId=wx_mini";
                // this.request(url).then(res => {
                //     console.log("配置数据请求完成:", res);
                //     this.data = res;
                // }).catch(e => {
                //     console.log("配置数据请求失败:", e);
                // });
                this.data = { "isBelowBtn3": 0, "isBelowBtn4": 0, "isBelowBtn1": 0, "isBelowBtn2": 0, "isOpen1": 0, "isOpen3": 0, "isOpen2": 0, "isOpenThanks": 0, "v110": true, "v111": true, "btnDealy": 0, "isOpen4": 0, "isBelowBtn5": 0 };
            }
            request(url, _data = null, _method = "get") {
                return new Promise((resolve, reject) => {
                    let xhr = new Laya.HttpRequest();
                    xhr.http.timeout = 1e4;
                    xhr.once(Laya.Event.COMPLETE, null, resolve);
                    xhr.once(Laya.Event.ERROR, null, reject);
                    xhr.send(url, _data, _method, "json");
                });
            }
            get Switch_1() {
                if (this.data[this.var]) return this.data.btnDealy; else return 0;
            }
            get Switch_2() {
                if (this.data[this.var]) return this.data.isBelowBtn1; else return 0;
            }
            get Switch_3() {
                if (this.data[this.var]) return this.data.isBelowBtn2; else return 0;
            }
            get Switch_4() {
                if (this.data[this.var]) return this.data.isBelowBtn3; else return 0;
            }
            get Switch_5() {
                if (this.data[this.var]) return this.data.isBelowBtn4; else return 0;
            }
            get Switch_6() {
                if (this.data[this.var]) return this.data.isBelowBtn5; else return 0;
            }
            get Switch_7() {
                if (this.data[this.var]) return this.data.isOpen1; else return 0;
            }
            get Switch_8() {
                if (this.data[this.var]) return this.data.isOpen2; else return 0;
            }
            get Switch_9() {
                if (this.data[this.var]) return this.data.isOpen3; else return 0;
            }
            get Switch_10() {
                if (this.data[this.var]) return this.data.isOpen4; else return 0;
            }
            get Switch_11() {
                if (this.data[this.var]) return this.data.isOpenThanks; else return 0;
            }
        }
        class welcomeBackUI extends ui.UIScenes.wx.welcomeBackUI {
            constructor() {
                super();
                this.isVideoGet = true;
                this.scaleX = this.scaleY = GlobalScale$1.scale;
                this.width = Laya.stage.width / GlobalScale$1.scale;
                this.height = Laya.stage.height / GlobalScale$1.scale;
                this.isVideoBtn.on(Laya.Event.CLICK, this, this.isVideoBtnClick);
                this.getBtn.on(Laya.Event.CLICK, this, this.clickGet);
            }
            onOpened() {
                this.refresh();
                PrivateTracker_new.Ins.sendEvent(SDK_EVENT._老用户欢迎回来界面, {
                    "_老用户欢迎回来界面": "_老用户欢迎回来界面"
                });
            }
            refresh() {
                this.videoGetImage.visible = this.isVideoGet;
                this.getImage.visible = !this.isVideoGet;
                this.videoImage.visible = this.isVideoGet;
            }
            isVideoBtnClick() {
                if (this.isVideoGet) PrivateTracker_new.Ins.sendEvent(SDK_EVENT._欢迎回来界面玩家不勾选文字框, {
                    "_欢迎回来界面玩家不勾选文字框": "_欢迎回来界面玩家不勾选文字框"
                });
                this.isVideoGet = !this.isVideoGet;
                this.refresh();
            }
            clickGet() {
                let awardID;
                if (this.isVideoGet) awardID = 81; else awardID = 82;
                if (this.isVideoGet) {
                    //激励广告
                    showReward(() => {
                        this.getAward(awardID);
                    });

                } else this.getAward(awardID);
            }
            getAward(awardID) {
                UIManager.Ins.getScene(E_UI_TYPE.CGTLTGETUI).open(false, [awardID, null, 2, false, false, false, false, null, null]);
                this.close();
            }
            static getTime10() {
                Laya.timer.loop(200, this, welcomeBackUI.save);
                let t = Laya.LocalStorage.getItem(welcomeBackUI.saveKey);
                if (new Date().getTime() - parseInt(t) > 10 * 60 * 1e3 && parseInt(t) > 0) {
                    return true;
                } else {
                    return false;
                }
            }
            static save() {
                welcomeBackUI.time = new Date().getTime();
                Laya.LocalStorage.setItem(welcomeBackUI.saveKey, welcomeBackUI.time);
            }
        }
        welcomeBackUI.saveKey = "WxShareViewUI";
        var E_MapType;
        (function (E_MapType) {
            E_MapType[E_MapType["JAPAN"] = 1] = "JAPAN";
            E_MapType[E_MapType["PIRATE"] = 2] = "PIRATE";
            E_MapType[E_MapType["DESERT"] = 3] = "DESERT";
            E_MapType[E_MapType["GREEN"] = 4] = "GREEN";
            E_MapType[E_MapType["ICE"] = 5] = "ICE";
        })(E_MapType || (E_MapType = {}));
        var E_BtnType;
        (function (E_BtnType) {
            E_BtnType[E_BtnType["SCALE"] = 0] = "SCALE";
            E_BtnType[E_BtnType["COLOR"] = 1] = "COLOR";
            E_BtnType[E_BtnType["SKIN"] = 2] = "SKIN";
        })(E_BtnType || (E_BtnType = {}));
        class PassStartParme {
            constructor(isBagBack = false, isShowClothTip = false) {
                this.isBagBack = false;
                this.isShowClothTip = false;
                this.isBagBack = isBagBack;
                this.isShowClothTip = isShowClothTip;
            }
        }
        var ModeType;
        (function (ModeType) {
            ModeType[ModeType["_NULL_"] = 0] = "_NULL_";
            ModeType[ModeType["_单人_"] = 1] = "_单人_";
            ModeType[ModeType["_多人道具_"] = 2] = "_多人道具_";
            ModeType[ModeType["_多人竞速_"] = 3] = "_多人竞速_";
        })(ModeType || (ModeType = {}));
        class StartUI extends ui.UIScenes.commonUI.StartUI {
            constructor() {
                super();
                this.callBackFunc = null;
                this.isOpenPullUI = false;
                this.hasPullCheckIn = false;
                this.hasPullConstellation = false;
                this.hasPullLuckPan = true;
                this.isopenlimit = false;
                this.isOpening = false;
                this.giftRwdIdList = [19, 20, 21, 22, 23];
                this.isLoadCarFinish = false;
                this.isLoadChaFinish = false;
                this.giftTimeList = [30, 60, 180, 300, 600];
                this.LevelLogoAry = ["", "uires/rank/d_huangtong.png", "uires/rank/d_baiyin.png", "uires/rank/d_huangjin.png", "uires/rank/d_bojin.png", "uires/rank/d_zuanshi.png", "uires/rank/d_wangzhe.png"];
                this.LevelStarAry = [this.half_1, this.star_1, this.half_2, this.star_2, this.half_3, this.star_3, this.half_4, this.star_4, this.half_5, this.star_5];
                this.rewardInfoAry = [24, 25, 26, 27, 28, 29];
                this.rewardInfoString = ["英勇黄铜段位奖励", "不屈白银段位奖励", "荣耀黄金段位奖励", "华贵铂金段位奖励", "璀璨钻石段位奖励", "最强王者段位奖励"];
                this.lastX = 0;
                this.hasTouch = false;
                StartUI.gameModeType = ModeType._NULL_;
                this.profileBtn.on(Laya.Event.CLICK, this, this.settingBtnOnClick);
                this.touchBox.on(Laya.Event.MOUSE_DOWN, this, this.mouseDown);
                this.touchBox.on(Laya.Event.MOUSE_MOVE, this, this.mouseMove);
                this.touchBox.on(Laya.Event.MOUSE_OUT, this, this.mouseUp);
                this.touchBox.on(Laya.Event.MOUSE_UP, this, this.mouseUp);
                this.giftBtn.on(Laya.Event.CLICK, this, this.openGiftUI);
                this.garageBtn.on(Laya.Event.CLICK, this, this.openGarageUI);
                this.driverBtn.on(Laya.Event.CLICK, this, this.openDriverUI);
                this.checkInBtn.on(Laya.Event.CLICK, this, this.checkInBtnClick);
                this.limitGiftBtn.on(Laya.Event.CLICK, this, () => {
                    this.isopenlimit && UIManager.Ins.getScene(E_UI_TYPE.LIMITGIFT).open(false);
                });
                this.pullBtn.on(Laya.Event.CLICK, this, this.pullBtnClick);
                this.closePullBtn.on(Laya.Event.CLICK, this, this.closePullBtnClick);
                this.goldTipBtn.on(Laya.Event.CLICK, this, () => {
                    UIManager.Ins.getScene(E_UI_TYPE.VIDEO_COIN).open(false);
                });
                this.dmdTipBtn.on(Laya.Event.CLICK, this, () => {
                    UIManager.Ins.getScene(E_UI_TYPE.LUCKY_PAN).open(false);
                });
                this.xingZuoBtn.on(Laya.Event.CLICK, this, this.xingZuoBtnClick);
                this.matchBtn.on(Laya.Event.CLICK, this, this.matchBtnClick);
                this.rankRwdBtn.on(Laya.Event.CLICK, this, this.rankRwdBtnClick);
                this.rankRwdBtn.on(Laya.Event.MOUSE_DOWN, this, () => {
                    if (DataMgr.Ins.getRankReward <= 5) {
                        this.box_reward.visible = true;
                        this.refreshTBox();
                    }
                });
                this.rankRwdBtn.on(Laya.Event.MOUSE_UP, this, () => {
                    Laya.timer.clearAll(this.rankRwdBtn);
                    Laya.timer.once(1e3, this.rankRwdBtn, () => {
                        this.box_reward.visible = false;
                    });
                });
                this.rankRwdBtn.on(Laya.Event.MOUSE_OUT, this, () => {
                    Laya.timer.clearAll(this.rankRwdBtn);
                    Laya.timer.once(1e3, this.rankRwdBtn, () => {
                        this.box_reward.visible = false;
                    });
                });
                this.dailyTaskBtn.on(Laya.Event.CLICK, this, this.dailyTaskBtnClick);
                this.luckPanBtn.on(Laya.Event.CLICK, this, this.luckPanBtnClick);
                this.openTtTipBtn.on(Laya.Event.CLICK, this, () => {
                    UIManager.Ins.getScene(E_UI_TYPE.TTTIP).open(false);
                });
                this.openWxTipBtn.on(Laya.Event.CLICK, this, () => {
                    UIManager.Ins.getScene(E_UI_TYPE.WXSHARE).open(false);
                });
                this.openOppoZPBtn.on(Laya.Event.CLICK, this, () => {
                    console.log("请求开始");
                    HttpMgr.Ins.getActivityInfo().then(x => {
                        console.log("回调结束");
                        UIManager.Ins.getScene(E_UI_TYPE.DRAWPRICE).open(false, x);
                    });
                });
                this.scaleX = this.scaleY = GlobalScale$1.scale;
                this.width = Laya.stage.width / GlobalScale$1.scale;
                this.height = Laya.stage.height / GlobalScale$1.scale;
                Laya.SoundManager.autoStopMusic = false;
                DataMgr.Ins.VictoryDay = new Date().getDay();
                StartUI.Ins = this;
                this.giftBtn.addComponent(BtnScript).initBtn(E_BtnType.SCALE);
                this.garageBtn.addComponent(BtnScript).initBtn(E_BtnType.SCALE);
                this.driverBtn.addComponent(BtnScript).initBtn(E_BtnType.SCALE);
                this.checkInBtn.addComponent(BtnScript).initBtn(E_BtnType.SCALE);
                EventMgr.Ins.on(EventType.REFRESH_GOLD, this, this.refreshRes);
                EventMgr.Ins.on(EventType.REFRESH_DIAMON, this, this.refreshRes);
                EventMgr.Ins.on(EventType.REFRESH_CONSTELLATION, this, this.refreshRes);
                this.smallJianTouAni.on(Laya.Event.COMPLETE, this, () => {
                    this.smallJianTouAni.visible = false;
                });
                this.bannerCloseBtn.on(Laya.Event.CLICK, this, () => {
                    this.nativeItem.visible = false;
                });
                this.iconBannerImg.on(Laya.Event.CLICK, this, () => {
                    PlatformMgr.Ins.reportNativeAdClick();
                    this.nativeItem.visible = false;
                });
            }
            onAwake() {
                UIManager.Ins.getScene(E_UI_TYPE.CHECK_IN).open(false);
                if (welcomeBackUI.getTime10()) {
                    UIManager.Ins.getScene(E_UI_TYPE.welcomeBackUI).open(false);
                }
            }
            onOpened(parme = new PassStartParme()) {
                EventMgr.Ins.on(EventType.TYRCAREXPIRE, this, id => {
                    if (DataMgr.Ins.getCar(id).isLock) UIManager.Ins.getScene(E_UI_TYPE.CAREXPIRE).open(false, id);
                });
                PlatformMgr.Ins.hideBanner();
                PlatformMgr.Ins.canShowBanner = false;
                this.isOpening = true;
                this.isOpenPullUI = false;
                this.chestAni.play(0, true);
                this.refreshRes();
                this.checkIsOverDay();
                this.loadingImage.play(0, true);
                this.load3DScene();
                this.refreshFinishRaceNum();
                this.refreshRedTip();
                this.changeCheckIn();
                this.refreshProfile();
                this.refreshRankRwdBtnTip();
                this.refreshDailyTaskBtn();
                this.changeRankStar(DataMgr.Ins.getCurrStarNum());
                this.refreshLuckPanTip();
                if (DataMgr.Ins.guideData[E_GUIDE_TYPE.FIRST_START]) {
                    this.grayBtn(this.giftBtn, false);
                    this.grayBtn(this.driverBtn, false);
                    this.grayBtn(this.checkInBtn, false);
                    this.grayBtn(this.garageBtn, false);
                    this.hasPullCheckIn = true;
                    if (PlatformMgr.Ins.platform == E_PLATFORM_TYPE.QQ) {
                        UIManager.Ins.getScene(E_UI_TYPE.GUIDETRYCAR).open(false, 6);
                    } else {
                        this.unlockAni.visible = true;
                        this.unlockAni.openGarage.play(0, false);
                        UIManager.Ins.getScene(E_UI_TYPE.GUIDETRYCAR).open(false, 6);
                    }
                    DataMgr.Ins.guideData[E_GUIDE_TYPE.FIRST_START] = false;
                } else if (DataMgr.Ins.guideData[E_GUIDE_TYPE.UPGRADE_CAR] && DataMgr.Ins.level > 1) {
                    DataMgr.Ins.guideData[E_GUIDE_TYPE.UPGRADE_CAR] = false;
                    UIManager.Ins.getScene(E_UI_TYPE.CHECK_IN).open(false);
                    this.hasPullCheckIn = true;
                } else if (DataMgr.Ins.guideData[E_GUIDE_TYPE.START_PROP] && DataMgr.Ins.level > 2) {
                    DataMgr.Ins.guideData[E_GUIDE_TYPE.START_PROP] = false;
                    DataMgr.Ins.guideData[E_GUIDE_TYPE.MAX] = false;
                    UIManager.Ins.getScene(E_UI_TYPE.LUCKY_PAN).open(false);
                    this.hasPullLuckPan = true;
                    DataMgr.Ins.isLuckpanOpen = true;
                } else {
                    PlatformMgr.Ins.initOutput(E_UI_TYPE.STARTUI);
                }
                this.grayBtn(this.giftBtn, false);
                this.grayBtn(this.driverBtn, false);
                this.grayBtn(this.checkInBtn, false);
                this.grayBtn(this.garageBtn, false);
                this.refreshGiftChest();
                Laya.timer.loop(1e3, this, () => {
                    this.refreshGiftChest();
                });
                this.updateTask();
                this.isEmptyVictory();
                this.checkPopView(parme && parme.isBagBack);
                this.checkPopNextGift();
                this.grayBtn(this.luckPanBtn, DataMgr.Ins.level > 2);
                if (GameMgr.Ins.isGameReturnStartUI) {
                    GameMgr.Ins.isGameReturnStartUI = false;
                }
                this.playImage.skin = DataMgr.Ins.currPlayerSex == 0 ? "firstRes/pickRole/nan_dt.png" : "firstRes/pickRole/nv_dt.png";
                DataMgr.Ins.refreshGuideData();
                this.pullBtn.visible = isOppo() || isQQ();
                if (isQQ()) {
                    this.pullBtn.skin = "uires/qqRes/gengduohaowan.png";
                    this.pullBtn.width = 128;
                    this.pullBtn.height = 118;
                    this.pullBtn.y = 150;
                    this.pullBtn.left = 70;
                }
                this.yindaoAni.play(0, true);
                if (this.callBackFunc) {
                    this.callBackFunc();
                    this.callBackFunc = null;
                }
                this.refreshLimitGiftBtn();
                Laya.timer.loop(1e3, this, () => {
                    this.refreshLimitGiftBtn();
                });
                DataMgr.Ins.SavePlayerData();
                this.refreshNativeItem();
                this.openTtTipBtn.visible = false;
                if (PlatformMgr.Ins.platform == E_PLATFORM_TYPE.TT && !PlatformMgr.Ins.isIos) {
                    this.openTtTipBtn.visible = true;
                }
                this.openWxTipBtn.visible = false;
                if (PlatformMgr.Ins.platform == E_PLATFORM_TYPE.WX && PlatformMgr.Ins._gameConfig.isOpenShare && !PlatformMgr.Ins.isIos) {
                    this.openWxTipBtn.visible = true;
                }
                this.openOppoZPBtn.visible = PlatformMgr.Ins.platform == E_PLATFORM_TYPE.OPPO;
                this.smallJianTouAni.visible = DataMgr.Ins.isShowSmallJianAni;
                DataMgr.Ins.isShowSmallJianAni && this.smallJianTouAni.play(0, false);
                this.rank_star.visible = false;
                parme && parme.isShowClothTip && UIManager.Ins.getScene(E_UI_TYPE.LONGBLACKTIP).open(false, ["tips：当前为男性角色，可在背包中切换为女性"]);
                this.openXXXView();
            }
            openXXXView() {
                switch (StartUI.gameModeType) {
                    case ModeType._NULL_:
                        break;

                    case ModeType._单人_:
                        if (StartUI.isShowLIMITGIFT1) return;
                        StartUI.isShowLIMITGIFT1 = true;
                        let rewardIndex = 64;
                        let clothesId = CCfgMgr.Ins.cfgChest.getItem(rewardIndex)._rewardID[0];
                        if (!DataMgr.Ins.getClothes(clothesId).isLock) {
                            rewardIndex = 65;
                            clothesId = CCfgMgr.Ins.cfgChest.getItem(rewardIndex)._rewardID[0];
                            if (!DataMgr.Ins.getClothes(clothesId).isLock) {
                                rewardIndex = 71;
                            }
                        }
                        if (DataMgr.Ins.getClothes(clothesId).isLock) {
                            UIManager.Ins.getScene(E_UI_TYPE.REWARDHAT).open(false, rewardIndex);
                        }
                        break;

                    case ModeType._多人竞速_:
                        if (StartUI.isShowLIMITGIFT2) return;
                        StartUI.isShowLIMITGIFT2 = true;
                        UIManager.Ins.getScene(E_UI_TYPE.CAR_TRIAL).open(false, [E_GAME_MODE.MULTIPLAYER_SPEED_GAME, false]);
                        break;

                    case ModeType._多人道具_:
                        if (!StartUI.isShowLIMITGIFT) {
                            StartUI.isShowLIMITGIFT = true;
                            UIManager.Ins.getScene(E_UI_TYPE.LIMITGIFT).open(false);
                        }
                        break;

                    default:
                        break;
                }
            }
            checkPopNextGift() { }
            refreshLimitGiftBtn() {
                this.limitGiftBtn.visible = false;
                if (DataMgr.Ins.getCurrRankLv() > 1 && !DataMgr.Ins.LimitGiftInfo[DataMgr.Ins.currLimitSex]) {
                    let time = (new Date().getTime() - DataMgr.Ins.firstOpenTimeStamp) / 1e3;
                    this.limitDaijishi.text = UsefulStuff.formatMS2(600 - Math.floor(time));
                    if (time < 600) {
                        this.limitGiftBtn.visible = this.isopenlimit;
                    }
                }
            }
            settingBtnOnClick() {
                SoundMgr.Ins.Press();
                UIManager.Ins.addUiOnScene3D(E_UI_TYPE.PROFILE);
            }
            nameInputOnChange() { }
            refreshRes() {
                this.goldNum.value = DataMgr.Ins.gold.toString();
                this.diamonNum.value = DataMgr.Ins.diamon.toString();
            }
            openGiftUI() {
                let nowDay = new Date().getDate();
                let nowMonth = new Date().getMonth();
                if (nowMonth == DataMgr.Ins.currGiftMonth) {
                    if (nowDay == DataMgr.Ins.currGiftDay) {
                        if (DataMgr.Ins.giftStage >= 5) {
                            UIManager.Ins.getScene(E_UI_TYPE.LONGBLACKTIP).open(false, ["今日礼包已全部领完，请明日再来哟~"]);
                            return;
                        } else {
                            SoundMgr.Ins.Press();
                            UIManager.Ins.getScene(E_UI_TYPE.ONLINE_GIFT).open(false);
                        }
                        if (DataMgr.Ins.currGiftLastTime >= this.giftTimeList[DataMgr.Ins.giftStage]) { }
                    }
                }
            }
            openDailyMission() {
                SoundMgr.Ins.Press();
                if (DataMgr.Ins.dailyGamesNum >= CCfgMgr.Ins.cfgChest.getItem(2).unLockNeedNum && !DataMgr.Ins.isGetDailyMission) {
                    DataMgr.Ins.isGetDailyMission = true;
                    DataMgr.Ins.SavePlayerData();
                    UIManager.Ins.getScene(E_UI_TYPE.CGTLTGETUI).open(false, [2, -1]);
                } else { }
            }
            openGarageUI() {
                if (Math.random() * 100 < AdConfigMgr.Ins.Switch_8) {

                }
                SoundMgr.Ins.Press();
                if (this.garageBtn.skin == "uires/startUI/anniu_hui.png") {
                    UIManager.Ins.getScene(E_UI_TYPE.LONGBLACKTIP).open(false, ["新手引导后开启"]);
                } else {
                    SceneMgr.Ins.clearUIScene();
                    UIManager.Ins.getScene(E_UI_TYPE.GARAGEUI).open();
                }
            }
            openDriverUI() {
                if (Math.random() * 100 < AdConfigMgr.Ins.Switch_9) {
                    ;
                }
                SoundMgr.Ins.Press();
                SceneMgr.Ins.clearUIScene();
                UIManager.Ins.getScene(E_UI_TYPE.DRIVERUI).open();
            }
            xingZuoBtnClick() {
                SoundMgr.Ins.Press();
                UIManager.Ins.getScene(E_UI_TYPE.CONSTELLATION).open(false);
            }
            matchBtnClick() {
                PrivateTracker_new.Ins.sendEvent(SDK_EVENT._打开开始游戏界面, {
                    "_打开开始游戏界面": "_打开开始游戏界面"
                });
                SoundMgr.Ins.Press();
                SceneMgr.Ins.clearUIScene();
                DataMgr.Ins.gameUseCar = DataMgr.Ins.currSelectCar;
                DataMgr.Ins.useCarStage = DataMgr.Ins.carStage;
                UIManager.Ins.getScene(E_UI_TYPE.PICKMODE).open();
            }
            rankRwdBtnClick() {
                if (DataMgr.Ins.getRankReward > 5) {
                    UIManager.Ins.getScene(E_UI_TYPE.LONGBLACKTIP).open(false, ["段位奖励已经全部领取完毕~"]);
                } else {
                    if (DataMgr.Ins.getRankReward < DataMgr.Ins.getCurrRankLv()) {
                        PrivateTracker_new.Ins.sendEvent(SDK_EVENT._打开段位奖励界面, {
                            "_打开段位奖励界面": "_打开段位奖励界面"
                        });
                        UIManager.Ins.getScene(E_UI_TYPE.CGTLTGETUI).open(false, [this.rewardInfoAry[DataMgr.Ins.getRankReward], -1, 1, true, !isQQ() || PlatformMgr.Ins._gameConfig.isOpenVideoIcon, false, false, this.rewardInfoString[DataMgr.Ins.getRankReward], E_PAGE_VIDEOID.DUANWEURWD]);
                        DataMgr.Ins.getRankReward++;
                        DataMgr.Ins.SavePlayerData();
                    } else { }
                }
                this.refreshRankRwdBtnTip();
            }
            refreshRankRwdBtnTip() {
                if (DataMgr.Ins.getRankReward <= 5 && DataMgr.Ins.getRankReward < DataMgr.Ins.getCurrRankLv()) {
                    this.box_shine.visible = true;
                    this.box_close.visible = false;
                } else {
                    this.box_shine.visible = false;
                    this.box_close.visible = true;
                }
                if (DataMgr.Ins.getRankReward > 5) {
                    this.box_shine.visible = false;
                    this.box_close.visible = false;
                }
                this.box_open.visible = DataMgr.Ins.getRankReward > 5;
            }
            luckPanBtnClick() {
                SoundMgr.Ins.Press();
                if (this.luckPanBtn.skin == "uires/startUI/anniu_hui.png") {
                    UIManager.Ins.getScene(E_UI_TYPE.LONGBLACKTIP).open(false, ["白银段位后开启"]);
                } else {
                    DataMgr.Ins.clickPanToday();
                    UIManager.Ins.getScene(E_UI_TYPE.LUCKY_PAN).open(false);
                }
            }
            refreshLuckPanTip() {
                let tip = this.luckPanBtn.getChildAt(0);
                tip.visible = DataMgr.Ins.zhuanPanNum < 15;
            }
            dailyTaskBtnClick() {
                let stageList = CCfgMgr.Ins.cfgGlobalPar.getItemStr(E_GLOBALPAR_NAME.GAME_WINTIMES_STAGE);
                let rwdList = CCfgMgr.Ins.cfgGlobalPar.getItemStr(E_GLOBALPAR_NAME.GAME_WIN_RWD_ID);
                for (let i = 0; i < stageList.length; i++) {
                    if (DataMgr.Ins.winTimes >= stageList[i]) {
                        if (i < DataMgr.Ins.VictoryTimes.length && DataMgr.Ins.VictoryTimes[i].isGet == false) {
                            DataMgr.Ins.VictoryTimes[i].isGet = true;
                            if (i >= stageList.length - 1) UIManager.Ins.getScene(E_UI_TYPE.CGTLTGETUI).open(false, [rwdList[i], -1, 1, true, !isQQ() || PlatformMgr.Ins._gameConfig.isOpenVideoIcon, false, false, "", E_PAGE_VIDEOID.CHESTRWD]); else UIManager.Ins.getScene(E_UI_TYPE.CGTLTGETUI).open(false, [rwdList[i], -1, 1, true, !isQQ() || PlatformMgr.Ins._gameConfig.isOpenVideoIcon, false, true, "", E_PAGE_VIDEOID.CHESTRWD]);
                            DataMgr.Ins.SavePlayerData();
                            break;
                        }
                    }
                }
                this.refreshDailyTaskBtn();
            }
            refreshDailyTaskBtn() {
                PrivateTracker_new.Ins.sendEvent(SDK_EVENT._打开连胜界面, {
                    "_打开星座界面": "_打开连胜界面"
                });
                let tip = this.dailyTaskBtn.getChildAt(0);
                tip.visible = false;
                this.dailyJinduLa.visible = true;
                let stageList = CCfgMgr.Ins.cfgGlobalPar.getItemStr(E_GLOBALPAR_NAME.GAME_WINTIMES_STAGE);
                this.dailyJinduLa.text = DataMgr.Ins.winTimes + "/" + stageList[0];
                if (DataMgr.Ins.VictoryTimes.length > 0) {
                    for (var i = 0; i < DataMgr.Ins.VictoryTimes.length; i++) {
                        if (!DataMgr.Ins.VictoryTimes[i].isGet) {
                            tip.visible = true;
                            this.dailyJinduLa.text = DataMgr.Ins.winTimes + "/" + stageList[i];
                            break;
                        } else {
                            if (i + 1 < stageList.length) this.dailyJinduLa.text = DataMgr.Ins.winTimes + "/" + stageList[i + 1];
                        }
                    }
                    if (i >= stageList.length && DataMgr.Ins.winTimes >= stageList[stageList.length - 1]) {
                        this.dailyJinduLa.visible = false;
                    } else {
                        this.dailyJinduLa.visible = true;
                    }
                }
            }
            load3DScene() {
                this.isLoadCarFinish = false;
                this.isLoadChaFinish = false;
                this.loadingImage.visible = true;
                let podium = SceneMgr.Ins.createUIVFX("unity/podium/choosen_level_2.lh", this.goldNum.x, this.goldNum.y, 3.8, 35, this.parent3dRoot);
                podium.transform.rotationEuler = new Laya.Vector3(0, 180, 0);
                this.rotatePodium = podium.getChildAt(0).getChildAt(0).getChildAt(0);
                LoadMgr.Ins.loadAsset(() => {
                    this.loadCarScene(podium);
                }, [LoadMgr.Ins.unityResPath(E_UNITY_RES_PATH.CAR, "Car_" + DataMgr.Ins.getCurrSelectCar().cfg.assetId + "_" + DataMgr.Ins.carStage + ".lh")]);
                let list = DataMgr.Ins.currPlayerSex == 0 ? DataMgr.Ins.currSelectMenClothesList : DataMgr.Ins.currSelectWomenClothesList;
                var WingCfg = list[3] ? list[3].getBaseNature() : null;
                var HairCfg = list[0] ? list[0].getBaseNature() : null;
                var rndChaCfg = list[2] ? list[2].getBaseNature() : null;
                var HatCfg = list[1] ? list[1].getBaseNature() : null;
                let urlList = [];
                if (rndChaCfg) urlList.push(LoadMgr.Ins.unityResPath(E_UNITY_RES_PATH.CHA, "Cha_" + rndChaCfg.assetId.toString() + ".lh"));
                if (WingCfg) urlList.push(LoadMgr.Ins.unityResPath(E_UNITY_RES_PATH.CHA, "wing_" + WingCfg.assetId.toString() + ".lh"));
                if (HairCfg) urlList.push(LoadMgr.Ins.unityResPath(E_UNITY_RES_PATH.CHA, "hair_" + HairCfg.assetId.toString() + ".lh"));
                if (HatCfg) urlList.push(LoadMgr.Ins.unityResPath(E_UNITY_RES_PATH.CHA, "hat_" + HatCfg.assetId.toString() + ".lh"));
                LoadMgr.Ins.loadAsset(() => {
                    this.loadChaScene(podium);
                }, urlList);
            }
            loadCarScene(parent3d) {
                this.isLoadCarFinish = true;
                if (this.isLoadChaFinish) {
                    this.loadingImage.visible = false;
                }
                if (!this.isOpening) return;
                let car = null;
                car = SceneMgr.Ins.createUIVFX(LoadMgr.Ins.unityResPath(E_UNITY_RES_PATH.CAR, "Car_" + DataMgr.Ins.getCurrSelectCar().cfg.assetId + "_" + DataMgr.Ins.carStage + ".lh"), this.carPos.x, this.carPos.y, 3.8, 35);
                try {
                    parent3d.getChildAt(0).getChildAt(0).getChildAt(0).getChildAt(1).addChild(car);
                    car.getChildAt(0).getChildAt(5).getChildAt(0).active = false;
                    car.getChildAt(0).getChildAt(5).getChildAt(1).active = false;
                    car.getChildAt(0).getChildAt(5).getChildAt(2).active = false;
                    car.getChildAt(0).getChildAt(5).getChildAt(3).active = false;
                    car.getChildAt(0).getChildAt(5).getChildAt(4).active = false;
                    var flyRoot = car.getChildAt(0).getChildAt(6);
                    if (flyRoot) {
                        for (let i = 0; i < flyRoot.numChildren; i++) {
                            var ani = flyRoot.getChildAt(i).getComponent(Laya.Animator);
                            ani.play("fly_idle");
                        }
                    }
                } catch (e) {
                    console.error(e);
                }
            }
            loadChaScene(parent3d) {
                this.isLoadChaFinish = true;
                if (this.isLoadCarFinish) {
                    this.loadingImage.visible = false;
                }
                if (!this.isOpening) return;
                let list = DataMgr.Ins.currPlayerSex == 0 ? DataMgr.Ins.currSelectMenClothesList : DataMgr.Ins.currSelectWomenClothesList;
                let WingCfg = list[3] ? list[3].getBaseNature() : null;
                let HairCfg = list[0] ? list[0].getBaseNature() : null;
                let rndChaCfg = list[2] ? list[2].getBaseNature() : null;
                let HatCfg = list[1] ? list[1].getBaseNature() : null;
                let Cha = SceneMgr.Ins.createUIVFX(LoadMgr.Ins.unityResPath(E_UNITY_RES_PATH.CHA, "Cha_" + rndChaCfg.assetId.toString() + ".lh"), this.rolePos.x, this.rolePos.y, 3.2, 35);
                if (Cha) {
                    parent3d.getChildAt(0).getChildAt(0).getChildAt(0).getChildAt(0).addChild(Cha);
                    Cha.transform.rotationEuler = new Laya.Vector3(0, 10, 0);
                    var aSrc = Cha.addComponent(ActorScript);
                    aSrc.init(HatCfg, HairCfg, WingCfg);
                    if (rndChaCfg.sex) aSrc.playWomenChoose(); else aSrc.playMenChoose();
                }
            }
            timeChange(s) {
                s = Math.floor(s);
                let minutes = Math.round((s - 30) / 60) % 60;
                let seconds = s % 60;
                let strMiao = "0" + seconds;
                if (seconds >= 10) {
                    strMiao = seconds + "";
                }
                return "0" + minutes + ":" + strMiao;
            }
            refreshFinishRaceNum() {
                let day = new Date().getDate();
                let month = new Date().getMonth();
                let lastDay = DataMgr.Ins.lastSignDay;
                let lastMonth = DataMgr.Ins.lastSignMonth;
                if (lastMonth == month) {
                    if (lastDay == day) { } else {
                        DataMgr.Ins.lastSignMonth = month;
                        DataMgr.Ins.lastSignDay = day;
                        DataMgr.Ins.dailyGamesNum = 0;
                        DataMgr.Ins.SavePlayerData();
                    }
                } else {
                    DataMgr.Ins.lastSignMonth = month;
                    DataMgr.Ins.lastSignDay = day;
                    DataMgr.Ins.dailyGamesNum = 0;
                    DataMgr.Ins.SavePlayerData();
                }
                if (!DataMgr.Ins.isGetDailyMission && DataMgr.Ins.dailyGamesNum >= CCfgMgr.Ins.cfgChest.getItem(2).unLockNeedNum) { } else { }
            }
            onClosed() {
                Laya.timer.clearAll(this);
                Laya.timer.clearAll(this.rotatePodium);
                this.isOpening = false;
                this.closePullBtnClick();
                EventMgr.Ins.offAll(EventType.TYRCAREXPIRE);
                DataMgr.Ins.isShowBigJianAni = DataMgr.Ins.isShowSmallJianAni = false;
                PlatformMgr.Ins.closeOutput();

            }
            refreshRedTip() {
                this.redTip.visible = false;
                for (let i = 0; i < DataMgr.Ins.carList.length; i++) {
                    let car = DataMgr.Ins.carList[i];
                    if (car.isLock) {
                        if (car.cfg.unLockType == E_UNLOCKCAR_TYPE.DIAMOND) {
                            if (DataMgr.Ins.diamon >= car.cfg.unLockNeedPatch) {
                                this.redTip.visible = true;
                                break;
                            }
                        } else if (car.cfg.unLockType == E_UNLOCKCAR_TYPE.VIDEO || car.cfg.unLockType == E_UNLOCKCAR_TYPE.SIGNIN && car.currShengTryTime > 0) {
                            this.redTip.visible = true;
                            break;
                        }
                    } else {
                        if (car.lv >= car.cfg.maxLvl) { } else {
                            if (DataMgr.Ins.gold >= car.getLvUpGoldNeed()) {
                                this.redTip.visible = true;
                                break;
                            }
                        }
                    }
                }
                this.redTipCha.visible = false;
                for (let i = 0; i < DataMgr.Ins.clothesList.length; i++) {
                    let data = DataMgr.Ins.clothesList[i];
                    if (data.isLock) {
                        switch (data.getBaseNature().unLockType) {
                            case E_UNLOCKCHA_TYPE.DIAMOND:
                                if (DataMgr.Ins.diamon >= data.getBaseNature().unLockNeedNum) {
                                    this.redTipCha.visible = true;
                                }
                                break;

                            case E_UNLOCKCHA_TYPE.GOLD:
                                if (DataMgr.Ins.gold >= data.getBaseNature().unLockNeedNum) {
                                    this.redTipCha.visible = true;
                                }
                                break;

                            case E_UNLOCKCHA_TYPE.AD:
                                if (data.videoAdNum >= data.getBaseNature().unLockNeedNum) {
                                    this.redTipCha.visible = true;
                                }
                                break;
                        }
                    }
                }
            }
            changeCheckIn() {
                this.redPoint.visible = this.isCangetGift();
            }
            isCangetGift() {
                let nowYear = new Date().getFullYear();
                let nowMonth = new Date().getMonth() + 1;
                let nowDay = new Date().getDate();
                if (nowYear == DataMgr.Ins._CURRENT_YEAR) {
                    if (nowMonth == DataMgr.Ins._CURRENT_MONTH) {
                        if (nowDay != DataMgr.Ins._CURRENT_DAY) {
                            return true;
                        } else {
                            return false;
                        }
                    } else {
                        return true;
                    }
                } else {
                    return true;
                }
            }
            refreshGiftChest() {
                this.giftTime.visible = false;
                this.redTipGift.visible = false;
                let nowDay = new Date().getDate();
                let nowMonth = new Date().getMonth();
                if (nowMonth == DataMgr.Ins.currGiftMonth) {
                    if (nowDay == DataMgr.Ins.currGiftDay) {
                        if (DataMgr.Ins.giftStage > 4) {
                            this.giftBtn.visible = false;
                            return;
                        }
                        DataMgr.Ins.currGiftLastTime = (new Date().getTime() - DataMgr.Ins.loginStamp) / 1e3 + DataMgr.Ins.lasttime;
                        if (DataMgr.Ins.currGiftLastTime >= this.giftTimeList[DataMgr.Ins.giftStage]) {
                            DataMgr.Ins.currGiftLastTime = this.giftTimeList[DataMgr.Ins.giftStage];
                            if (DataMgr.Ins.giftStage > 4) {
                                this.giftBtn.visible = true;
                            } else {
                                this.redTipGift.visible = true;
                            }
                        } else {
                            this.giftTime.visible = true;
                        }
                    } else {
                        this.initToday(nowMonth, nowDay);
                    }
                } else {
                    this.initToday(nowMonth, nowDay);
                }
                this.giftTime.text = UsefulStuff.formatMS2(Math.floor(this.giftTimeList[DataMgr.Ins.giftStage] - DataMgr.Ins.currGiftLastTime));
            }
            initToday(nowMonth, nowDay) {
                DataMgr.Ins.currGiftMonth = nowMonth;
                DataMgr.Ins.currGiftDay = nowDay;
                DataMgr.Ins.currGiftLastTime = 0;
                DataMgr.Ins.lasttime = 0;
                DataMgr.Ins.isGetGiftChest = false;
                DataMgr.Ins.giftStage = 0;
                DataMgr.Ins.SavePlayerData();
                this.giftTime.visible = true;
            }
            refreshProfile() {
                this.playName.text = DataMgr.Ins.playerName;
                let levle = DataMgr.Ins.getCurrRankLv();
                if (levle > 6) levle = 6;
                if (levle < 1) levle = 1;
                let cfg = CCfgMgr.Ins.cfgRankInfo.getItem(levle);
                this.playLvTitle.text = cfg ? cfg._Name : "";
                this.lvImage.skin = this.LevelLogoAry[levle];
            }
            checkInBtnClick() {
                DataMgr.Ins.clickCheckInToday();
                UIManager.Ins.getScene(E_UI_TYPE.CHECK_IN).open(false);
            }
            refreshCheckBtn() {
                this.checkInBtn.visible = true;
                this.checkInBtn.getChildAt(0).visible = true;
                let nowYear = new Date().getFullYear();
                let nowMonth = new Date().getMonth() + 1;
                let nowDay = new Date().getDate();
                if (nowYear == DataMgr.Ins._CURRENT_YEAR) {
                    if (nowMonth == DataMgr.Ins._CURRENT_MONTH) {
                        if (nowDay != DataMgr.Ins._CURRENT_DAY) { } else {
                            this.checkInBtn.getChildAt(0).visible = false;
                        }
                    } else { }
                } else { }
            }
            isEmptyVictory() {
                let today = new Date().getDay();
                if (today != DataMgr.Ins.VictoryDay) {
                    DataMgr.Ins.VictoryTimes = [];
                    DataMgr.Ins.winTimes = 0;
                    DataMgr.Ins.VictoryDay = today;
                    DataMgr.Ins.SavePlayerData();
                }
            }
            updateTask() { }
            pullBtnClick() {
                if (isOppo()) {
                    if (!PlatformMgr.Ins.htBoxList) return;
                    this.htImage.visible = true;
                    this.pullBtn.visible = false;
                    if (!this.isOpenPullUI) {
                        this.htGameList.dataSource = PlatformMgr.Ins.htBoxList;
                        this.htGameList.repeatX = 3;
                        this.htGameList.renderHandler = new Laya.Handler(this, this.refreshHtGameListItem);
                        this.htGameList.refresh();
                    }
                    this.isOpenPullUI = true;
                } else if (isQQ()) {
                    var qq = platform.Ins;
                    qq.showAppBox();
                }
            }
            refreshHtGameListItem(cell, index) {
                let itemScript = cell.getComponent(HtGameScript);
                itemScript.initData(PlatformMgr.Ins.htBoxList[index][0]);
            }
            closePullBtnClick() {
                this.htImage.visible = false;
                this.pullBtn.visible = true;
            }
            checkPopView(isBagBack) {
                if (DataMgr.IsNewGuiding()) return;
                if (!this.hasPullCheckIn) {
                    if (this.OverAday()) {
                        var createDate = new Date();
                        createDate.setTime(DataMgr.Ins.isCreatRole);
                        if (createDate.setHours(0, 0, 0, 0) == new Date().setHours(0, 0, 0, 0)) UIManager.Ins.getScene(E_UI_TYPE.CHECK_IN).open(false);
                        this.hasPullCheckIn = true;
                        this.hasPullLuckPan = false;
                        return;
                    }
                }
                if (!this.hasPullLuckPan) {
                    if (DataMgr.Ins.isLuckpanOpen) {
                        UIManager.Ins.getScene(E_UI_TYPE.LUCKY_PAN).open(false);
                        this.hasPullLuckPan = true;
                        return;
                    }
                }
                if (DataMgr.Ins.getCurrRankLv() > 1 && !DataMgr.Ins.LimitGiftInfo[DataMgr.Ins.currLimitSex]) {
                    if (!DataMgr.Ins.hasOpenLimitGift) {
                        if (!DataMgr.Ins.guideData[E_GUIDE_TYPE.RANK_REWARD]) {
                            if (PlatformMgr.Ins.platform == E_PLATFORM_TYPE.WX) {
                                if (DataMgr.Ins.hasPlayGame) {
                                    this.isopenlimit && UIManager.Ins.getScene(E_UI_TYPE.LIMITGIFT).open(false);
                                    DataMgr.Ins.hasOpenLimitGift = true;
                                    DataMgr.Ins.SavePlayerData();
                                    return;
                                }
                            } else {
                                this.isopenlimit && UIManager.Ins.getScene(E_UI_TYPE.LIMITGIFT).open(false);
                                DataMgr.Ins.hasOpenLimitGift = true;
                                DataMgr.Ins.SavePlayerData();
                                return;
                            }
                        }
                    }
                }
                if (DataMgr.Ins.CarTrail || !DataMgr.IsNewGuiding()) {
                    let gailv = Math.random();
                    let rewardIndex = 64;
                    if (gailv > .3) {
                        rewardIndex = 65;
                    } else if (gailv > .6) {
                        rewardIndex = 71;
                    }
                    let clothesId = CCfgMgr.Ins.cfgChest.getItem(rewardIndex)._rewardID[0];
                    if (DataMgr.Ins.getClothes(clothesId).isLock && !DataMgr.Ins.guideData[E_GUIDE_TYPE.RANK_REWARD] && isBagBack) {
                        if (Math.random() < .6) UIManager.Ins.getScene(E_UI_TYPE.REWARDHAT).open(false, rewardIndex);
                    }
                    return;
                }
            }
            OverAday() {
                let nowYear = new Date().getFullYear();
                let nowMonth = new Date().getMonth() + 1;
                let nowDay = new Date().getDate();
                if (nowYear == DataMgr.Ins._CURRENT_YEAR) {
                    if (nowMonth == DataMgr.Ins._CURRENT_MONTH) {
                        if (nowDay != DataMgr.Ins._CURRENT_DAY) {
                            return true;
                        } else {
                            return false;
                        }
                    } else {
                        return true;
                    }
                } else {
                    return true;
                }
            }
            checkIsOverDay() {
                if (DataMgr.IsOveraDay()) {
                    DataMgr.Ins.updateGiftData();
                }
                EventMgr.Ins.dispatch("dailyTaskRefresh");
            }
            changeRankStar(star = 4) {
                console.log("当前星星数", star);
                if (star == 0) {
                    this.progress_mask.width = 1;
                } else if (star == 10) {
                    this.progress_mask.width = 239.5;
                } else {
                    this.progress_mask.width = 240 * (star / 10);
                }
                this.progress_curLabel.value = DataMgr.Ins.getCurrRankSelfScore()[0].toString();
                this.progress_allScore.value = DataMgr.Ins.getCurrRankSelfScore()[1].toString();
                this.LevelStarAry.forEach((index, idx) => {
                    index.visible = idx + 1 <= star ? true : false;
                });
                this.rank_logo.texture = Laya.Loader.getRes(this.LevelLogoAry[DataMgr.Ins.getCurrRankLv()]);
                let cfg = CCfgMgr.Ins.cfgRankInfo.getItem(DataMgr.Ins.getCurrRankLv());
                this.rank_title.text = cfg ? cfg._Name : "";
            }
            refreshTBox() {
                this.reward_1.visible = false;
                this.reward_2.visible = false;
                let index = this.rewardInfoAry[DataMgr.Ins.getRankReward];
                if (!index) return;
                this.reward_txt.text = this.rewardInfoString[DataMgr.Ins.getRankReward];
                let rewardType = CCfgMgr.Ins.cfgChest.getItem(index)._rewardType[0];
                let rewardId = CCfgMgr.Ins.cfgChest.getItem(index)._rewardID;
                if (!rewardId[rewardId.length - 1]) {
                    rewardId.pop();
                }
                if (rewardId.length > 2) rewardId.splice(0, 2);
                let rewardCount = CCfgMgr.Ins.cfgChest.getItem(index)._rewardNumMax;
                this[`reward_${rewardId.length}`].visible = true;
                let showRoot = this[`reward_${rewardId.length}`];
                console.log("reward_${rewardId.length}", `reward_${rewardId.length}`);
                for (var i = 0; i < showRoot.numChildren; i++) {
                    let iconObj;
                    if (rewardType != 2) {
                        iconObj = showRoot.getChildAt(i).getChildByName("icon");
                        iconObj.visible = true;
                    } else {
                        iconObj = showRoot.getChildAt(i).getChildByName("icon_car");
                        iconObj.visible = true;
                        showRoot.getChildAt(i).getChildByName("icon").visible = false;
                    }
                    iconObj.skin = this.getRewardIcon(rewardType, rewardId[i]);
                    showRoot.getChildAt(i).getChildByName("txt").text = `x${rewardCount[i]}`;
                }
            }
            getRewardIcon(type, id) {
                let iconUrl = "";
                if (type == E_REWARD_TYPE.REWARD_BASE) {
                    if (id == E_REWARD_BASE_TYPE.GOLD) {
                        iconUrl = "uires/rank/jinbi.png";
                    } else if (id == E_REWARD_BASE_TYPE.DIAMOND) {
                        iconUrl = "uires/rank/zs.png";
                    }
                } else if (type == E_REWARD_TYPE.REWARD_CAR) {
                    iconUrl = LoadMgr.Ins.WebResHttp + `carIcon/${CCfgMgr.Ins.cfgRacing.getItem(id)._RacingIconName[0]}.png`;
                } else if (type == E_REWARD_TYPE.REWARD_CLOTHES) { }
                return iconUrl;
            }
            mouseDown() {
                this.hasTouch = true;
                this.lastX = Laya.stage.mouseX;
                Laya.timer.clearAll(this.rotatePodium);
            }
            mouseMove() {
                if (!this.hasTouch) return;
                let offsetX = Laya.stage.mouseX - this.lastX;
                if (this.rotatePodium && this.rotatePodium.transform) {
                    this.rotatePodium.transform.localRotationEulerY += .5 * offsetX;
                    this.lastX = Laya.stage.mouseX;
                }
            }
            mouseUp() {
                this.hasTouch = false;
                if (this.rotatePodium && this.rotatePodium.transform) {
                    let y = this.rotatePodium.transform.localRotationEulerY;
                    y = (y % 360 + 360 + 180) % 360 - 180;
                    this.rotatePodium.transform.localRotationEulerY = y;
                    Laya.timer.frameLoop(1, this.rotatePodium, () => {
                        this.rotatePodium.transform.localRotationEulerY *= .95;
                        if (Math.abs(this.rotatePodium.transform.localRotationEulerY) < .001) {
                            Laya.timer.clearAll(this.rotatePodium);
                        }
                    });
                }
            }
            grayBtn(btn, isGray) {
                btn.skin = isGray ? "uires/startUI/anniu_hui.png" : "uires/startUI/anniudi.png";
            }
            refreshNativeItem() {
                this.nativeItem.visible = false;
                PlatformMgr.Ins.initNativeIconAd(data => {
                    this.nativeItem.visible = true;
                    let ad = data.adList;
                    if (ad[0].iconUrlList && ad[0].iconUrlList.length) {
                        this.iconBannerImg.skin = ad[0].iconUrlList[0];
                    }
                    PlatformMgr.Ins.reportNativeAdShow();
                });
            }
        }
        StartUI.isShowLIMITGIFT = false;
        StartUI.isShowLIMITGIFT1 = false;
        StartUI.isShowLIMITGIFT2 = false;
        class BaseRacing {
            constructor() {
                this.id = 0;
                this.isLock = true;
                this.lv = 1;
                this.currLvSU = 1;
                this.currLvMaxSpeed = 1;
                this.currLvN2OSU = 1;
                this.currShengTryTime = 0;
                this.currVideoTimes = 0;
                this.isOpenVideoBuy = false;
                this.maxHandleNature = 100;
                this.maxSU = 1;
                this.minSU = 5;
                this.maxSpeed = 250;
            }
            init(id, isLock, lv, currLvSU, currLvMaxSpeed, currLvN2OSU, currShengTryTime = 0, currVideoTimes = 0, isOpenVideoBuy = false) {
                this.id = id;
                this.isLock = isLock;
                this.lv = lv;
                this.currLvSU = currLvSU;
                this.currLvMaxSpeed = currLvMaxSpeed;
                this.currLvN2OSU = currLvN2OSU;
                this.currShengTryTime = currShengTryTime;
                this.currVideoTimes = currVideoTimes;
                if (currShengTryTime > 0) {
                    this.startTryCar(this.currShengTryTime);
                }
                this.isOpenVideoBuy = isOpenVideoBuy;
                this.cfg;
            }
            get cfg() {
                if (!this.m_cfg) {
                    this.m_cfg = CCfgMgr.Ins.cfgRacing.getItem(this.id);
                }
                return this.m_cfg;
            }
            get carName() {
                return this.cfg._Name;
            }
            getQualityParm() {
                switch (this.cfg.quality) {
                    case 0:
                        return CCfgMgr.Ins.cfgGlobalPar.getItemValue(E_GLOBALPAR_NAME.GAME_CAR_QUA_C) / 100;

                    case 1:
                        return CCfgMgr.Ins.cfgGlobalPar.getItemValue(E_GLOBALPAR_NAME.GAME_CAR_QUA_B) / 100;

                    case 2:
                        return CCfgMgr.Ins.cfgGlobalPar.getItemValue(E_GLOBALPAR_NAME.GAME_CAR_QUA_A) / 100;

                    case 3:
                        return CCfgMgr.Ins.cfgGlobalPar.getItemValue(E_GLOBALPAR_NAME.GAME_CAR_QUA_S) / 100;
                }
            }
            getNatureScore() {
                return (this.currLvSU - 1) * this.cfg.ReducePerLv * 100 + (this.currLvMaxSpeed - 1) * Math.ceil(this.cfg.MaxSpeedPerLv * 2) + this.cfg.baseNatureScore;
            }
            getLvUpGoldNeed() {
                return this.cfg.baseNeedGold + 80 * (this.cfg.quality + 1) * (this.lv - 1);
            }
            getLvUpPatchNeed() {
                if (this.isLock) return this.cfg.unLockNeedPatch; else return this.cfg.baseNeedPatch + 5 * (this.cfg.quality + 1) * (this.lv - 1);
            }
            getCurrN2OSU() {
                return 1;
            }
            getMaxN2OSU() {
                return 1;
            }
            getCurrMaxSpeed() {
                return this.cfg.baseSpeed + (this.currLvMaxSpeed - 1) * this.cfg.MaxSpeedPerLv;
            }
            getMaxSpeed() {
                return this.maxSpeed;
            }
            getCurrSU() {
                return this.cfg.baseTimes100 - (this.currLvSU - 1) * this.cfg.ReducePerLv;
            }
            getMaxSU() {
                return this.minSU;
            }
            lvUp(lv = 1) {
                this.lv += lv;
                this.currLvSU += lv;
                this.currLvMaxSpeed += lv;
                this.currLvN2OSU += lv;
            }
            startTryCar(time) {
                this.currShengTryTime = time;
                Laya.timer.loop(1e3, this, () => {
                    this.currShengTryTime--;
                    if (this.currShengTryTime <= 0) {
                        this.currShengTryTime = 0;
                        if (DataMgr.Ins.currSelectCar.id == this.id) {
                            DataMgr.Ins.setCurrSelectCar(CCfgMgr.Ins.cfgGlobalPar.getItemValue(E_GLOBALPAR_NAME.GAME_INIT_RACING_ID));
                        }
                        this.isOpenVideoBuy = true;
                        DataMgr.Ins.SavePlayerData();
                        EventMgr.Ins.dispatch(EventType.TYRCAREXPIRE, this.id);
                        StartUI.Ins && (StartUI.Ins.callBackFunc = (() => {
                            EventMgr.Ins.dispatch(EventType.TYRCAREXPIRE, this.id);
                        }));
                        Laya.timer.clearAll(this);
                    }
                });
            }
            setVideoTimes(times) {
                this.currVideoTimes += times;
                if (this.currVideoTimes >= this.cfg.unLockNeedPatch) {
                    this.currVideoTimes = this.cfg.unLockNeedPatch;
                    this.isLock = false;
                }
                DataMgr.Ins.SavePlayerData();
            }
            getSkillLv() {
                return Math.min(Math.max(1, Math.floor(this.lv / 10 + 1)), 3);
            }
            getMaxStage() {
                return Math.min(Math.max(1, Math.floor(this.lv / 5 + 1)), 3);
            }
            getQuality() {
                if (this.getNatureScore() < 600) {
                    return 0;
                } else if (this.getNatureScore() < 800) {
                    return 1;
                } else if (this.getNatureScore() < 1e3) {
                    return 2;
                } else {
                    return 3;
                }
            }
        }
        class BaseClothes {
            constructor() {
                this.id = 0;
                this.isLock = true;
                this.videoAdNum = 0;
                this.isWeared = false;
            }
            get name() {
                return this.getBaseNature()._Name;
            }
            init(id, isLock, videoAdNum = 0, isWeared = false) {
                this.id = id;
                this.isLock = isLock;
                this.videoAdNum = videoAdNum;
                this.isWeared = isWeared;
            }
            getBaseNature() {
                return CCfgMgr.Ins.cfgClothes.getItem(this.id);
            }
        }
        class RankingItem {
            constructor() { }
            initData(ID, PlayerName, useTime, carId, carSkinIndex, carPingJi) {
                this.ID = ID;
                this._PlayerName = PlayerName;
                this.useTime = useTime;
                this.carId = carId;
                this.carSkinIndex = carSkinIndex;
                this.carPingJi = carPingJi;
            }
        }
        var CLOTH_PART;
        (function (CLOTH_PART) {
            CLOTH_PART[CLOTH_PART["HAIR"] = 0] = "HAIR";
            CLOTH_PART[CLOTH_PART["HAT"] = 1] = "HAT";
            CLOTH_PART[CLOTH_PART["CLOTH"] = 2] = "CLOTH";
            CLOTH_PART[CLOTH_PART["WING"] = 3] = "WING";
        })(CLOTH_PART || (CLOTH_PART = {}));
        var E_RANK_TYPE;
        (function (E_RANK_TYPE) {
            E_RANK_TYPE[E_RANK_TYPE["_0_无名"] = 0] = "_0_无名";
            E_RANK_TYPE[E_RANK_TYPE["_1_黄铜"] = 1] = "_1_黄铜";
            E_RANK_TYPE[E_RANK_TYPE["_2_白银"] = 2] = "_2_白银";
            E_RANK_TYPE[E_RANK_TYPE["_3_黄金"] = 3] = "_3_黄金";
            E_RANK_TYPE[E_RANK_TYPE["_4_铂金"] = 4] = "_4_铂金";
            E_RANK_TYPE[E_RANK_TYPE["_5_钻石"] = 5] = "_5_钻石";
            E_RANK_TYPE[E_RANK_TYPE["_6_王者"] = 6] = "_6_王者";
            E_RANK_TYPE[E_RANK_TYPE["COUNT"] = 7] = "COUNT";
        })(E_RANK_TYPE || (E_RANK_TYPE = {}));
        const RANKS = [{
            t: E_RANK_TYPE._0_无名,
            name: "",
            starNeed: 0
        }, {
            t: E_RANK_TYPE._1_黄铜,
            name: "黄铜",
            starNeed: 10
        }, {
            t: E_RANK_TYPE._2_白银,
            name: "白银",
            starNeed: 10
        }, {
            t: E_RANK_TYPE._3_黄金,
            name: "黄金",
            starNeed: 10
        }, {
            t: E_RANK_TYPE._4_铂金,
            name: "铂金",
            starNeed: 10
        }, {
            t: E_RANK_TYPE._5_钻石,
            name: "钻石",
            starNeed: 10
        }, {
            t: E_RANK_TYPE._6_王者,
            name: "王者",
            starNeed: 10
        }, {
            t: E_RANK_TYPE.COUNT,
            name: "",
            starNeed: 0
        }];
        class StoryData {
            constructor(_storyID) {
                this.storyID = _storyID;
                this.needUnlock1 = false;
                this.needUnlock2 = false;
                this.needUnlock3 = false;
            }
            unlock() {
                this.needUnlock1 = true;
                this.needUnlock2 = true;
                this.needUnlock3 = true;
            }
            get isUnlock() {
                return this.needUnlock1 && this.needUnlock2 && this.needUnlock3;
            }
            get cfg() {
                return CCfgMgr.Ins.cfgStoryInfo.getItem(this.storyID);
            }
            get trackCfg() {
                return CCfgMgr.Ins.cfgTrack.getItem(this.storyID);
            }
        }
        class RecordsData {
            constructor(_trackID) {
                this.SpeedGameRecord = 0;
                this.PropGameRecord = 0;
                this.SingleGameRecord = 0;
                this.carId = 1;
                this.carStage = 2;
                this.carQulity = 2;
                this.ServerSpeedGameRecord = 0;
                this.ServerPropGameRecord = 0;
                this.ServerSingleGameRecord = 0;
                this.trackID = _trackID;
                var cfg = CCfgMgr.Ins.cfgTrack.getItem(_trackID);
                this.ServerSpeedGameRecord = cfg.serverRecord1;
                this.ServerPropGameRecord = cfg.serverRecord2;
                this.ServerSingleGameRecord = cfg.serverRecord3;
            }
        }
        const MIN_USER_SCORE = 0;
        const MAX_USER_SCORE = RANKS.map(x => x.starNeed).reduce((sum, x, i, arr) => sum + x);
        class DataMgr {
            constructor() {
                this.m_level = 0;
                this.m_gold = 2e3;
                this.m_diamon = 500;
                this.m_PatchNumList = [2e4, 2e4, 2e4, 2e4];
                this.chaLock = [false, true, true, true, true, true, true, true, true];
                this.carLock = [false, true, true, true, true, true, true, true, true];
                this.rewardCarLock = [true, true, true, true, true, true, true, true, true];
                this.carList = [];
                this.clothesList = [];
                this.useCarStage = 3;
                this.carStage = 1;
                this.currSelectMenClothesList = [null, null, null, null];
                this.currSelectWomenClothesList = [null, null, null, null];
                this.currPlayerSex = 0;
                this.isCreatRole = 0;
                this.isFirstPlayer = false;
                this.rewardPro = 0;
                this.CarID = 2;
                this.CarLv = 3;
                this.ChaID = 1;
                this.HairID = 1;
                this.WingID = 1;
                this.HatID = 1;
                this.playerName = "";
                this.BattleCameraRotatoX = -13.5;
                this.BattleCameraY = 3.4;
                this.BattleCameraZ = -7.4;
                this.BattleFov = 40;
                this.driveXRate = 2;
                this.flyXRate = 2;
                this.isSoundOpen = true;
                this.isShakeOpen = true;
                this.bgmVolume = 1;
                this.soundVolume = 1;
                this.currRaceChestList = [null, null, null];
                this.clgSceneType = 0;
                this.currTrackId = 1;
                this.currSceneType = 0;
                this.dailyGamesNum = 0;
                this.lastSignDay = 0;
                this.lastSignMonth = 0;
                this.isGetDailyMission = false;
                this.loginStamp = 0;
                this.currGiftDay = 0;
                this.currGiftMonth = 0;
                this.currGiftLastTime = 0;
                this.isGetGiftChest = false;
                this.giftStage = 0;
                this.firstOpenTimeStamp = 0;
                this.hasOpenLimitGift = false;
                this.LimitGiftInfo = [false, false];
                this.currLimitSex = 0;
                this.currHasTryCar = false;
                this.isOpenTryCarFirst = false;
                this.hasPlayGame = false;
                this.garageClickNum = 0;
                this.driveClickNum = 0;
                this.mapAllSerivesRankList = [];
                this.mapFriendRankList = [];
                this.starAnimList = [];
                this.wxFuLiList = [{
                    canGet: false,
                    isGet: false
                }, {
                    canGet: false,
                    isGet: false
                }, {
                    canGet: false,
                    isGet: false
                }, {
                    canGet: false,
                    isGet: false
                }];
                this.lasttime = 0;
                this.sceneRwdPatchTypeList = [];
                this.getRankReward = 1;
                this.RankLevel = {
                    rank: 1,
                    star: 2
                };
                this.rankScore = 0;
                this._CHECK_IN_DAY = 0;
                this._CURRENT_DAY = 0;
                this._CURRENT_MONTH = 0;
                this._CURRENT_YEAR = 0;
                this._REFRESH_GIFT_DAY = 0;
                this.currGameMode = E_GAME_MODE.MULTIPLAYER_SPEED_GAME;
                this.VictoryTimes = [];
                this.winTimes = 0;
                this.refreshDataByDay = {
                    clickPan: false,
                    clickCheckIn: false,
                    CoinTipTimes: 10,
                    enterGameDate: 0
                };
                this.GuideAllRacing = [];
                this.zhuanPanNum = 0;
                this.zhuanPanDay = 0;
                this.freeGoldNum = 0;
                this.freeGoldDay = 0;
                this.isLuckpanOpen = false;
                this.LuckyPanGetCar = {
                    bool: false,
                    date: 1
                };
                this.LuckyPanGetAll = {
                    car: {
                        isGet: false,
                        date: 1
                    },
                    cloth: {
                        isGet: false,
                        date: 1
                    },
                    hair: {
                        isGet: false,
                        date: 1
                    }
                };
                this.CommonAllRacing = [];
                this.VictoryDay = 0;
                this.currHtIndex = 0;
                this.ConstellationID = 0;
                this.currRaceBuff = 0;
                this.CarTrail = false;
                this.MapList = null;
                this.LockedMap = [1, 7, 12];
                this.storyDatas = [];
                this.recordsDatas = [];
                this.isRankFirst = true;
                this.iszhuanpanClg = false;
                this.driverToUIid = E_UI_TYPE.STARTUI;
                this.driverToUIMode = -1;
                this.panClickTotalTimes = 0;
                this.wxScene = 0;
                this.openNextGiftTime = 0;
                this.nowDayTime = 0;
                this.nowDayGameTimes = 0;
                this.allGameNums = 0;
                this.leiJiGameTimes = 0;
                this.currMapSelectIndex = 0;
                this.mutlRaceTryCar = 0;
                this.tempCarList = [];
                this.tempCurrSelectCarId = 1;
                this.tempCurrSelectCarStage = 1;
                this.tempClothesList = [];
                this.tempSelectMenClothesList = [];
                this.tempSelectWomenClothesList = [];
                this.tempRacingChestList = [];
                this.isShowBigJianAni = false;
                this.isShowSmallJianAni = false;
                this.lianWinTimes = 0;
                window["dataMgr"] = this;
                this.guideData = new Array();
                for (var i = 0; i <= E_GUIDE_TYPE.MAX; i++) {
                    this.guideData.push(true);
                }
            }
            get clothes() {
                return this.currPlayerSex ? this.currSelectWomenClothesList : this.currSelectMenClothesList;
            }
            get hair() {
                return this.clothes[CLOTH_PART.HAIR];
            }
            get hat() {
                return this.clothes[CLOTH_PART.HAT];
            }
            get cloth() {
                return this.clothes[CLOTH_PART.CLOTH];
            }
            get wing() {
                return this.clothes[CLOTH_PART.WING];
            }
            get sex() {
                return this.currPlayerSex ? "F" : "M";
            }
            get carName() {
                return this.currSelectCar && this.currSelectCar.carName || "unknown";
            }
            initRanking() {
                this.mapAllSerivesRankList = [];
                this.mapFriendRankList = [];
                for (let j = 0; j < 15; j++) {
                    let allSerivesRankList = [];
                    let allFriendRankList = [];
                    let record = this.getServerRecord(E_GAME_MODE.MULTIPLAYER_SPEED_GAME, j + 1);
                    let record1 = record;
                    for (let i = 0; i < 50; i++) {
                        record += UsefulStuff.rnd(100, 300);
                        let a = new RankingItem();
                        let carId = UsefulStuff.rnd(0, this.carList.length - 1) + 1;
                        a.initData(i + 1, CCfgMgr.Ins.cfgNpcInfo.getRndName(), record, carId, 2, 3);
                        allSerivesRankList.push(a);
                    }
                    for (let i = 0; i < 10; i++) {
                        record1 += UsefulStuff.rnd(100, 300);
                        let a = new RankingItem();
                        let carId = UsefulStuff.rnd(0, this.carList.length - 1) + 1;
                        a.initData(i + 1, CCfgMgr.Ins.cfgNpcInfo.getRndName(), record1, carId, 2, 3);
                        allFriendRankList.push(a);
                    }
                    this.mapAllSerivesRankList.push(allSerivesRankList);
                    this.mapFriendRankList.push(allFriendRankList);
                }
            }
            setLimitGiftSex() {
                let sex = Math.random() > .5 ? 0 : 1;
                if (!this.LimitGiftInfo[sex]) {
                    this.currLimitSex = sex;
                } else {
                    let otherSex = 0;
                    if (sex == 0) {
                        otherSex = 1;
                    }
                    if (!this.LimitGiftInfo[otherSex]) {
                        this.currLimitSex = otherSex;
                    }
                }
            }
            isHasLimitGift() {
                for (let i = 0; i < 2; i++) {
                    if (!this.LimitGiftInfo[i]) return true;
                }
                return false;
            }
            get winBoxFull() {
                let stageList = CCfgMgr.Ins.cfgGlobalPar.getItemStr(E_GLOBALPAR_NAME.GAME_WINTIMES_STAGE);
                return this.VictoryTimes.length >= stageList.length;
            }
            addMapSelectIndex() {
                this.currMapSelectIndex++;
                if (this.currMapSelectIndex >= DataMgr.Ins.storyDatas.length) {
                    this.currMapSelectIndex = 0;
                }
            }
            static get Ins() {
                if (this.m_DataMgr == null) this.m_DataMgr = new DataMgr();
                return this.m_DataMgr;
            }
            refreshGuideData() {
                this.realGuideData = new Array();
                for (var i = 0; i <= E_GUIDE_TYPE.MAX; i++) {
                    this.realGuideData.push(this.guideData[i]);
                }
            }
            rndClgSceneType() {
                this.clgSceneType = UsefulStuff.rnd(0, 2);
            }
            rndSceneRwdPatchType() {
                let chance = Math.random();
                if (chance < .45) {
                    return 0;
                } else if (chance < .8) {
                    return 1;
                } else {
                    return 2;
                }
            }
            setSceneRwdPatchTypeList() {
                this.sceneRwdPatchTypeList.push(this.rndSceneRwdPatchType());
                this.sceneRwdPatchTypeList.push(this.rndSceneRwdPatchType());
                this.sceneRwdPatchTypeList.push(this.rndSceneRwdPatchType());
                this.sceneRwdPatchTypeList.push(this.rndSceneRwdPatchType());
            }
            getSceneRwdPatchType(sceneType) {
                return this.sceneRwdPatchTypeList[sceneType];
            }
            initRecordDatas() {
                if (this.recordsDatas.length == 0) {
                    var trackList = CCfgMgr.Ins.cfgTrack.List;
                    this.recordsDatas = [];
                    for (var i = 0; i < trackList.length; i++) {
                        var cfg = trackList[i];
                        var rd = new RecordsData(cfg.ID);
                        this.recordsDatas.push(rd);
                    }
                }
            }
            initStoryData() {
                if (this.storyDatas.length == 0) {
                    var storyList = CCfgMgr.Ins.cfgStoryInfo.List;
                    for (var i = 0; i < storyList.length; i++) {
                        var sd = new StoryData(storyList[i].ID);
                        if (sd.cfg.mapID > 0) {
                            if (sd.storyID == 2 || sd.storyID == 4 || sd.storyID == 7 || sd.storyID == 12) {
                                sd.unlock();
                            }
                            this.storyDatas.push(sd);
                        }
                    }
                }
                this.sortStoryData();
            }
            sortStoryData() {
                this.storyDatas.sort(function (a, b) {
                    if (a.isUnlock == b.isUnlock) {
                        if (a.isUnlock) {
                            if (a.cfg.mapID > b.cfg.mapID) {
                                return 1;
                            } else if (b.cfg.mapID > a.cfg.mapID) {
                                return -1;
                            } else {
                                return a.cfg.ID > b.cfg.ID ? 1 : -1;
                            }
                        } else {
                            if (a.cfg.mapIndex > b.cfg.mapIndex) {
                                return 1;
                            } else if (b.cfg.mapIndex > a.cfg.mapIndex) {
                                return -1;
                            } else {
                                return a.cfg.mapID > b.cfg.mapID ? 1 : -1;
                            }
                        }
                    } else {
                        if (a.isUnlock) {
                            return -1;
                        } else {
                            return 1;
                        }
                    }
                });
            }
            updateStoryData(unlock1, unlock2, unlock3, trackID) {
                for (var i = 0; i < this.storyDatas.length; i++) {
                    if (this.storyDatas[i].storyID == trackID) {
                        if (!this.storyDatas[i].needUnlock1) this.storyDatas[i].needUnlock1 = unlock1;
                        if (!this.storyDatas[i].needUnlock2) this.storyDatas[i].needUnlock2 = unlock2;
                        if (!this.storyDatas[i].needUnlock3) this.storyDatas[i].needUnlock3 = unlock3;
                        if (this.storyDatas[i].isUnlock) this.sortStoryData();
                        break;
                    }
                }
            }
            initCarListData() {
                if (this.tempCarList.length <= 0) {
                    this.carList = [];
                    for (let i = 0; i < CCfgMgr.Ins.cfgRacing.List.length; i++) {
                        let car = new BaseRacing();
                        if (i + 1 == CCfgMgr.Ins.cfgGlobalPar.getItemValue(E_GLOBALPAR_NAME.GAME_INIT_RACING_ID)) car.init(i + 1, false, 1, 1, 1, 1); else car.init(i + 1, true, 1, 1, 1, 1);
                        if (car.cfg.unLockType == 0) {
                            car.isLock = false;
                        }
                        this.carList.push(car);
                    }
                    console.log("初始化车库了");
                    this.setCurrSelectCar(1);
                    this.carStage = 1;
                } else {
                    for (let i = 0; i < CCfgMgr.Ins.cfgRacing.List.length; i++) {
                        let car = new BaseRacing();
                        if (i < this.tempCarList.length) {
                            let data = this.tempCarList[i];
                            if (data) {
                                let isOpenVideoBuy = data.isOpenVideoBuy;
                                if (data.id == 7) {
                                    if (this._CHECK_IN_DAY >= 2 && data.currShengTryTime <= 0) {
                                        isOpenVideoBuy = true;
                                    }
                                }
                                if (i + 1 == CCfgMgr.Ins.cfgGlobalPar.getItemValue(E_GLOBALPAR_NAME.GAME_INIT_RACING_ID)) car.init(i + 1, false, data.lv, data.currLvSU, data.currLvMaxSpeed, data.currLvN2OSU); else car.init(data.id, data.isLock, data.lv, data.currLvSU, data.currLvMaxSpeed, data.currLvN2OSU, data.currShengTryTime, data.currVideoTimes, isOpenVideoBuy);
                            }
                        } else {
                            if (i + 1 == CCfgMgr.Ins.cfgGlobalPar.getItemValue(E_GLOBALPAR_NAME.GAME_INIT_RACING_ID)) car.init(i + 1, false, 1, 1, 1, 1); else car.init(i + 1, true, 1, 1, 1, 1);
                        }
                        this.carList.push(car);
                    }
                    console.log("加载车库了");
                    this.setCurrSelectCar(this.tempCurrSelectCarId);
                    this.carStage = this.tempCurrSelectCarStage;
                }
            }
            initClothesListData() {
                if (this.tempClothesList.length <= 0) {
                    for (let i = 0; i < CCfgMgr.Ins.cfgClothes.List.length; i++) {
                        let clothes = new BaseClothes();
                        if (CCfgMgr.Ins.cfgClothes.getItem(i + 1).unLockType == E_UNLOCKCHA_TYPE.INIT) clothes.init(i + 1, false); else clothes.init(i + 1, true);
                        this.clothesList.push(clothes);
                    }
                    this.currSelectMenClothesList[2] = this.getClothes(CCfgMgr.Ins.cfgGlobalPar.getItemValue(E_GLOBALPAR_NAME.GAME_INIT_CLOTHES_MEN));
                    this.currSelectMenClothesList[0] = this.getClothes(CCfgMgr.Ins.cfgGlobalPar.getItemValue(E_GLOBALPAR_NAME.GAME_INIT_HAIR_MEN));
                    this.currSelectWomenClothesList[2] = this.getClothes(CCfgMgr.Ins.cfgGlobalPar.getItemValue(E_GLOBALPAR_NAME.GAME_INIT_CLOTHES_WOMEN));
                    this.currSelectWomenClothesList[0] = this.getClothes(CCfgMgr.Ins.cfgGlobalPar.getItemValue(E_GLOBALPAR_NAME.GAME_INIT_HAIR_WOMEN));
                    console.log("初始化衣服了");
                } else {
                    for (let i = 0; i < CCfgMgr.Ins.cfgClothes.List.length; i++) {
                        let clothes = new BaseClothes();
                        if (i < this.tempClothesList.length) {
                            let data = this.tempClothesList[i];
                            if (data) {
                                if (CCfgMgr.Ins.cfgClothes.getItem(data.id).unLockType == E_UNLOCKCHA_TYPE.INIT) {
                                    if (typeof data.isWeared != "boolean") data.isWeared = false;
                                    clothes.init(data.id, false, data.videoAdNum, data.isWeared);
                                } else {
                                    if (typeof data.isWeared != "boolean") data.isWeared = false;
                                    clothes.init(data.id, data.isLock, data.videoAdNum, data.isWeared);
                                }
                            }
                        } else {
                            if (CCfgMgr.Ins.cfgClothes.getItem(i + 1).unLockType == E_UNLOCKCHA_TYPE.INIT) clothes.init(i + 1, false); else clothes.init(i + 1, true);
                        }
                        this.clothesList.push(clothes);
                    }
                    for (let i = 0; i < 4; i++) {
                        if (this.tempSelectMenClothesList[i]) this.currSelectMenClothesList[i] = this.getClothes(this.tempSelectMenClothesList[i].id); else this.currSelectMenClothesList[i] = null;
                        if (this.tempSelectWomenClothesList[i]) this.currSelectWomenClothesList[i] = this.getClothes(this.tempSelectWomenClothesList[i].id); else this.currSelectWomenClothesList[i] = null;
                    }
                    console.log("加载衣服了");
                }
            }
            initRacingChest() {
                if (this.tempRacingChestList.length <= 0) {
                    console.log("初始化宝箱了");
                } else {
                    for (let i = 0; i < 3; i++) {
                        let data = this.tempRacingChestList[i];
                        if (data) {
                            let chest = new BaseChest();
                            chest.init(data.id, data.haveTimestamp);
                            this.currRaceChestList[i] = chest;
                        } else {
                            this.currRaceChestList[i] = null;
                        }
                    }
                    console.log("加载宝箱了");
                }
            }
            setCurrSelectCar(id) {
                this.currSelectCar = this.getCar(id);
            }
            getCurrSelectCar() {
                return this.currSelectCar;
            }
            getCar(id) {
                return this.carList[id - 1];
            }
            unlockCar(id) {
                let car = this.getCar(id);
                if (car) {
                    car.isLock = false;
                    this.SavePlayerData();
                } else {
                    console.log("车id不存在", id);
                }
            }
            setCurrSelectClothes(id, part) {
                this.getClothes(id).isWeared = true;
                let sex = CCfgMgr.Ins.cfgClothes.getItem(id).sex;
                if (sex == 0) {
                    this.currSelectMenClothesList[part] = this.getClothes(id);
                } else if (sex == 1) {
                    this.currSelectWomenClothesList[part] = this.getClothes(id);
                } else {
                    if (this.currPlayerSex == 0) {
                        this.currSelectMenClothesList[part] = this.getClothes(id);
                    } else {
                        this.currSelectWomenClothesList[part] = this.getClothes(id);
                    }
                }
            }
            getCurrSelectClothes(part) {
                if (this.currPlayerSex == 0) {
                    return this.currSelectMenClothesList[part];
                } else {
                    return this.currSelectWomenClothesList[part];
                }
            }
            getClothes(id) {
                return this.clothesList[id - 1];
            }
            unlockClothes(id) {
                let cloth = this.getClothes(id);
                if (cloth) {
                    cloth.isLock = false;
                    this.SavePlayerData();
                } else {
                    console.log("衣服id不存在", id);
                }
            }
            addGold(value) {
                value = Math.floor(value);
                this.m_gold += value;
                EventMgr.Ins.dispatch(EventType.REFRESH_GOLD);
            }
            get gold() {
                return this.m_gold;
            }
            addDiamon(value) {
                value = Math.floor(value);
                this.m_diamon += value;
                EventMgr.Ins.dispatch(EventType.REFRESH_DIAMON);
            }
            get diamon() {
                return this.m_diamon;
            }
            addPatch(quilty, num) {
                if (quilty < 4) this.m_PatchNumList[quilty] += num;
            }
            getPatch(quilty) {
                if (quilty < 4) return this.m_PatchNumList[quilty]; else return 0;
            }
            addLevel(value = 1) {
                this.m_level += value;
                if (this.m_level > 1e5) this.m_level = 1e5;
                this.SavePlayerData();
            }
            get level() {
                return this.m_level;
            }
            getChaPrice() {
                var hasCount = 0;
                for (var i = 0; i < 9; i++) {
                    if (!this.chaLock[i]) hasCount++;
                }
                var price = 5e3 + hasCount * 1e3;
                return price;
            }
            getCarPrice() {
                var hasCount = 0;
                for (var i = 0; i < 9; i++) {
                    if (!this.carLock[i]) hasCount++;
                }
                var price = 1e4 + hasCount * 1e3;
                return price;
            }
            buyCha() {
                var ranPool = [];
                for (var i = 0; i < 9; i++) {
                    if (this.chaLock[i]) ranPool.push(i);
                }
                var rnd = UsefulStuff.rnd(0, ranPool.length - 1);
                var result = ranPool[rnd];
                this.chaLock[result] = false;
                return result + 1;
            }
            buyCar() {
                var ranPool = [];
                for (var i = 0; i < 9; i++) {
                    if (this.carLock[i]) ranPool.push(i);
                }
                var rnd = UsefulStuff.rnd(0, ranPool.length - 1);
                var result = ranPool[rnd];
                this.carLock[result] = false;
                return result + 1;
            }
            getCurRewardID() {
                var ID = -1;
                for (var i = 0; i < 9; i++) {
                    if (this.rewardCarLock[i]) {
                        ID = i;
                        break;
                    }
                }
                if (ID > 0 && this.rewardPro >= 100) this.rewardPro = 0;
                return ID;
            }
            SavePlayerData() {
                let gameData = {
                    data: {
                        m_level: this.m_level,
                        m_gold: this.m_gold,
                        m_diamon: this.m_diamon,
                        chaLock: this.chaLock,
                        carLock: this.carLock,
                        rewardCarLock: this.rewardCarLock,
                        rewardPro: this.rewardPro,
                        CarLv: this.CarLv,
                        CarID: this.CarID,
                        ChaID: this.ChaID,
                        playerName: this.playerName,
                        driveXRate: this.driveXRate,
                        flyXRate: this.flyXRate,
                        patchNumList: this.m_PatchNumList,
                        m_carList: this.carList,
                        m_SelectCarId: this.currSelectCar.id,
                        m_SelectCarStage: this.carStage,
                        m_ClothesList: this.clothesList,
                        m_playerSex: this.currPlayerSex,
                        m_SltMenClothList: this.currSelectMenClothesList,
                        m_SltWomenClothList: this.currSelectWomenClothesList,
                        m_tempRacingChestList: this.currRaceChestList,
                        m_dailyGamesNum: this.dailyGamesNum,
                        m_lastSignDay: this.lastSignDay,
                        m_lastSignMonth: this.lastSignMonth,
                        m_isGetDailyMission: this.isGetDailyMission,
                        m_currGiftDay: this.currGiftDay,
                        m_currGiftMonth: this.currGiftMonth,
                        m_currGiftLastTime: this.currGiftLastTime,
                        m_isGetGiftChest: this.isGetGiftChest,
                        m_giftStage: this.giftStage,
                        m_guideData: this.realGuideData,
                        m_checkDay: this._CHECK_IN_DAY,
                        m_currentDay: this._CURRENT_DAY,
                        m_currentMonth: this._CURRENT_MONTH,
                        m_currentYear: this._CURRENT_YEAR,
                        m_refreshGiftDate: this._REFRESH_GIFT_DAY,
                        m_getLevelReward: this.getRankReward,
                        m_victoryTimes: this.VictoryTimes,
                        m_winTimes: this.winTimes,
                        m_victoryday: this.VictoryDay,
                        m_zhuanPanDay: this.zhuanPanDay,
                        m_zhuanPanNum: this.zhuanPanNum,
                        m_newGuide: this.GuideAllRacing,
                        m_commonRace: this.CommonAllRacing,
                        m_refreshDataByDate: this.refreshDataByDay,
                        m_freeGoldDay: this.freeGoldDay,
                        m_freeGoldNum: this.freeGoldNum,
                        m_isLuckpanOpen: this.isLuckpanOpen,
                        m_isCreatRole: this.isCreatRole,
                        m_constellation: this.ConstellationID,
                        m_cartrail: this.CarTrail,
                        m_mapList: this.MapList,
                        m_lockedMap: this.LockedMap,
                        m_rankScore: this.rankScore,
                        m_LuckyPanGetCar: this.LuckyPanGetCar,
                        m_LuckyPanGetAll: this.LuckyPanGetAll,
                        m_storyDatas: this.storyDatas,
                        m_recordsDatas: this.recordsDatas,
                        m_panClickTotalTimes: this.panClickTotalTimes,
                        m_firstOpenTimeStamp: this.firstOpenTimeStamp,
                        m_hasOpenLimitGift: this.hasOpenLimitGift,
                        m_LimitGiftInfo: this.LimitGiftInfo,
                        m_currLimitSex: this.currLimitSex,
                        m_wxFuLiList: this.wxFuLiList,
                        m_mapAllSerivesRankList: this.mapAllSerivesRankList,
                        m_mapFriendRankList: this.mapFriendRankList,
                        m_lianWinTimes: this.lianWinTimes,
                        m_currMapSelectIndex: this.currMapSelectIndex,
                        m_nowDayTime: this.nowDayTime,
                        m_nowDayGameTimes: this.nowDayGameTimes,
                        m_openNextGiftTime: this.openNextGiftTime,
                        m_allGameNums: this.allGameNums
                    }
                };
                let dataJson = JSON.stringify(gameData);
                localStorage.setItem("kartFight0608", dataJson);
            }
            GetPlayerData(openid, cb) {
                let data = JSON.parse(Laya.LocalStorage.getItem("kartFight0608") || null);
                if (data && data.data) {
                    console.log(data.data);
                    this.m_level = data.data.m_level;
                    if (data.data.m_gold) this.m_gold = data.data.m_gold;
                    this.chaLock = data.data.chaLock;
                    this.carLock = data.data.carLock;
                    this.rewardCarLock = data.data.rewardCarLock;
                    this.rewardPro = data.data.rewardPro;
                    this.CarLv = data.data.CarLv;
                    this.CarID = data.data.CarID;
                    this.ChaID = data.data.ChaID;
                    if (data.data.playerName) this.playerName = data.data.playerName;
                    if (data.data.driveXRate) this.driveXRate = data.data.driveXRate;
                    if (data.data.flyXRate) this.flyXRate = data.data.flyXRate;
                    if (data.data.patchNumList) this.m_PatchNumList = data.data.patchNumList;
                    if (data.data.m_diamon) this.m_diamon = data.data.m_diamon;
                    if (data.data.m_carList) this.tempCarList = data.data.m_carList;
                    if (data.data.m_SelectCarId) this.tempCurrSelectCarId = data.data.m_SelectCarId;
                    if (data.data.m_SelectCarStage) this.tempCurrSelectCarStage = data.data.m_SelectCarStage;
                    if (data.data.m_ClothesList) this.tempClothesList = data.data.m_ClothesList;
                    if (data.data.m_playerSex) this.currPlayerSex = data.data.m_playerSex;
                    if (data.data.m_SltMenClothList) this.tempSelectMenClothesList = data.data.m_SltMenClothList;
                    if (data.data.m_SltWomenClothList) this.tempSelectWomenClothesList = data.data.m_SltWomenClothList;
                    if (data.data.m_tempRacingChestList) this.tempRacingChestList = data.data.m_tempRacingChestList;
                    if (data.data.m_dailyGamesNum) this.dailyGamesNum = data.data.m_dailyGamesNum;
                    if (data.data.m_lastSignDay) this.lastSignDay = data.data.m_lastSignDay;
                    if (data.data.m_lastSignMonth) this.lastSignMonth = data.data.m_lastSignMonth;
                    if (data.data.m_isGetDailyMission) this.isGetDailyMission = data.data.m_isGetDailyMission;
                    if (data.data.m_currGiftDay) this.currGiftDay = data.data.m_currGiftDay;
                    if (data.data.m_currGiftMonth) this.currGiftMonth = data.data.m_currGiftMonth;
                    if (data.data.m_currGiftLastTime) this.currGiftLastTime = data.data.m_currGiftLastTime;
                    if (data.data.m_isGetGiftChest) this.isGetGiftChest = data.data.m_isGetGiftChest;
                    if (data.data.m_giftStage) this.giftStage = data.data.m_giftStage;
                    if (data.data.m_guideData) {
                        this.guideData = data.data.m_guideData;
                        if (this.guideData.length > E_GUIDE_TYPE.MAX + 2) {
                            this.guideData = new Array();
                            for (var i = 0; i <= E_GUIDE_TYPE.MAX; i++) {
                                this.guideData.push(false);
                            }
                        }
                        this.refreshGuideData();
                    }
                    if (data.data.m_checkDay) this._CHECK_IN_DAY = data.data.m_checkDay;
                    if (data.data.m_currentDay) this._CURRENT_DAY = data.data.m_currentDay;
                    if (data.data.m_currentMonth) this._CURRENT_MONTH = data.data.m_currentMonth;
                    if (data.data.m_currentYear) this._CURRENT_YEAR = data.data.m_currentYear;
                    if (data.data.m_refreshGiftDate) this._REFRESH_GIFT_DAY = data.data.m_refreshGiftDate;
                    if (data.data.m_getLevelReward) this.getRankReward = data.data.m_getLevelReward;
                    if (data.data.m_rankScore) this.rankScore = data.data.m_rankScore;
                    if (data.data.m_RankLevel) this.rankScore += this.rankLvToScore(data.data.m_RankLevel);
                    if (data.data.m_victoryTimes) this.VictoryTimes = data.data.m_victoryTimes;
                    if (data.data.m_victoryday) this.VictoryDay = data.data.m_victoryday;
                    if (data.data.m_zhuanPanDay) this.zhuanPanDay = data.data.m_zhuanPanDay;
                    if (data.data.m_zhuanPanNum) this.zhuanPanNum = data.data.m_zhuanPanNum;
                    if (data.data.m_newGuide) this.GuideAllRacing = data.data.m_newGuide;
                    if (data.data.m_commonRace) this.CommonAllRacing = data.data.m_commonRace;
                    if (data.data.m_refreshDataByDate) this.refreshDataByDay = data.data.m_refreshDataByDate;
                    if (data.data.m_freeGoldDay) this.freeGoldDay = data.data.m_freeGoldDay;
                    if (data.data.m_freeGoldNum) this.freeGoldNum = data.data.m_freeGoldNum;
                    if (data.data.m_isLuckpanOpen) this.isLuckpanOpen = true;
                    if (data.data.m_isCreatRole) this.isCreatRole = data.data.m_isCreatRole;
                    if (data.data.m_constellation) {
                        this.ConstellationID = data.data.m_constellation;
                    }
                    if (data.data.m_cartrail) this.CarTrail = data.data.m_cartrail;
                    if (data.data.m_mapList) this.MapList = data.data.m_mapList;
                    if (data.data.m_storyDatas) {
                        var storyDatas = data.data.m_storyDatas;
                        this.storyDatas = [];
                        for (var i = 0; i < storyDatas.length; i++) {
                            var sd = new StoryData(storyDatas[i].storyID);
                            sd.needUnlock1 = storyDatas[i].needUnlock1;
                            sd.needUnlock2 = storyDatas[i].needUnlock2;
                            sd.needUnlock3 = storyDatas[i].needUnlock3;
                            this.storyDatas.push(sd);
                        }
                    }
                    if (data.data.m_recordsDatas) this.recordsDatas = data.data.m_recordsDatas;
                    if (data.data.m_winTimes) this.winTimes = data.data.m_winTimes;
                    if (data.data.m_LuckyPanGetCar) this.LuckyPanGetCar = data.data.m_LuckyPanGetCar;
                    if (data.data.m_LuckyPanGetAll) this.LuckyPanGetAll = data.data.m_LuckyPanGetAll;
                    if (data.data.m_panClickTotalTimes) this.panClickTotalTimes = data.data.m_panClickTotalTimes;
                    if (data.data.m_firstOpenTimeStamp) this.firstOpenTimeStamp = data.data.m_firstOpenTimeStamp;
                    if (data.data.m_hasOpenLimitGift) this.hasOpenLimitGift = data.data.m_hasOpenLimitGift;
                    if (data.data.m_LimitGiftInfo) this.LimitGiftInfo = data.data.m_LimitGiftInfo;
                    if (data.data.m_currLimitSex) this.currLimitSex = data.data.m_currLimitSex;
                    if (data.data.m_wxFuLiList) this.wxFuLiList = data.data.m_wxFuLiList;
                    if (data.data.m_mapFriendRankList) this.mapFriendRankList = data.data.m_mapFriendRankList;
                    if (data.data.m_mapAllSerivesRankList) this.mapAllSerivesRankList = data.data.m_mapAllSerivesRankList;
                    if (data.data.m_lianWinTimes) this.lianWinTimes = data.data.m_lianWinTimes;
                    if (data.data.m_currMapSelectIndex) this.currMapSelectIndex = data.data.m_currMapSelectIndex;
                    if (data.data.m_nowDayTime) this.nowDayTime = data.data.m_nowDayTime;
                    if (data.data.m_nowDayGameTimes) this.nowDayGameTimes = data.data.m_nowDayGameTimes;
                    if (data.data.m_openNextGiftTime) this.openNextGiftTime = data.data.m_openNextGiftTime;
                    if (data.data.m_allGameNums) this.allGameNums = data.data.m_allGameNums;
                } else {
                    this.m_gold = CCfgMgr.Ins.cfgGlobalPar.getItemValue(E_GLOBALPAR_NAME.GAME_INIT_GOLD);
                    this.m_diamon = CCfgMgr.Ins.cfgGlobalPar.getItemValue(E_GLOBALPAR_NAME.GAME_INIT_DIAMOND);
                    this.isCreatRole = 0;
                    this.rankScore = 0;
                }
                this.loadDataFunc();
                console.log("空的记录", this.mapAllSerivesRankList);
                if (this.mapAllSerivesRankList.length == 0) {
                    console.log("空的记录1");
                    this.initRanking();
                }
                cb && cb();
            }
            loadDataFunc() {
                DataMgr.Ins.initCarListData();
                DataMgr.Ins.initClothesListData();
                DataMgr.Ins.initRacingChest();
                this.initStoryData();
                this.initRecordDatas();
                let list = DataMgr.Ins.currPlayerSex == 0 ? DataMgr.Ins.currSelectMenClothesList : DataMgr.Ins.currSelectWomenClothesList;
                var WingCfg = list[3] ? list[3].getBaseNature() : null;
                var HairCfg = list[0] ? list[0].getBaseNature() : null;
                var rndChaCfg = list[2] ? list[2].getBaseNature() : null;
                var HatCfg = list[1] ? list[1].getBaseNature() : null;
                LoadMgr.Ins.assetResourceList.push(LoadMgr.Ins.unityResPath(E_UNITY_RES_PATH.CAR, "Car_" + DataMgr.Ins.getCurrSelectCar().cfg.assetId + "_" + DataMgr.Ins.carStage + ".lh"));
                if (rndChaCfg) LoadMgr.Ins.assetResourceList.push(LoadMgr.Ins.unityResPath(E_UNITY_RES_PATH.CHA, "Cha_" + rndChaCfg.assetId.toString() + ".lh"));
                if (WingCfg) LoadMgr.Ins.assetResourceList.push(LoadMgr.Ins.unityResPath(E_UNITY_RES_PATH.CHA, "wing_" + WingCfg.assetId.toString() + ".lh"));
                if (HairCfg) LoadMgr.Ins.assetResourceList.push(LoadMgr.Ins.unityResPath(E_UNITY_RES_PATH.CHA, "hair_" + HairCfg.assetId.toString() + ".lh"));
                if (HatCfg) LoadMgr.Ins.assetResourceList.push(LoadMgr.Ins.unityResPath(E_UNITY_RES_PATH.CHA, "hat_" + HatCfg.assetId.toString() + ".lh"));
            }
            addRankScore(score) {
                let currDuanwei = Math.max(1, DataMgr.Ins.getCurrRankLv());
                currDuanwei = Math.min(6, currDuanwei);
                let linjiescore = CCfgMgr.Ins.cfgRankInfo.getItem(currDuanwei).starExp * 5;
                this.isShowBigJianAni = false;
                let s1 = this.getCurrRankSelfScore()[0];
                if (s1 <= linjiescore && s1 + score > linjiescore) {
                    if (currDuanwei == 1) this.firstOpenTimeStamp = new Date().getTime();
                    if (currDuanwei != 6) {
                        this.isShowBigJianAni = true;
                        score = linjiescore - s1 + 1;
                    }
                }
                if (score > 0) {
                    this.isShowSmallJianAni = true;
                } else {
                    this.isShowSmallJianAni = false;
                }
                this.rankScore += score;
                if (this.rankScore < 0) this.rankScore = 0;
                if (this.getCurrRankLv() > currDuanwei) { }
            }
            getCurrRankLv() {
                let needScore = 0;
                for (let i = 1; i < 7; i++) {
                    needScore += CCfgMgr.Ins.cfgRankInfo.getItem(i).starExp * 5;
                    if (this.rankScore <= needScore) {
                        return i;
                    }
                    if (i == 6) {
                        return 6;
                    }
                }
            }
            getCurrRankSelfScore() {
                let currDuanwei = Math.max(1, DataMgr.Ins.getCurrRankLv());
                currDuanwei = Math.min(6, currDuanwei);
                let needScore = 0;
                for (let i = 1; i < currDuanwei; i++) {
                    needScore += CCfgMgr.Ins.cfgRankInfo.getItem(i).starExp * 5;
                }
                return [this.rankScore - needScore, CCfgMgr.Ins.cfgRankInfo.getItem(currDuanwei).starExp * 5];
            }
            getLianWinScore() {
                let currDuanwei = Math.max(1, DataMgr.Ins.getCurrRankLv());
                currDuanwei = Math.min(6, currDuanwei);
                let lianWinScoreList = CCfgMgr.Ins.cfgRankInfo.getItem(currDuanwei)._lianWinExp;
                return lianWinScoreList[this.lianWinTimes - 1];
            }
            getCurrStarNum() {
                let lv = 1;
                let zongScore = this.rankScore;
                for (let i = 1; i < 7; i++) {
                    lv = i;
                    if (i < 6 && zongScore > CCfgMgr.Ins.cfgRankInfo.getItem(i).starExp * 5) {
                        zongScore -= CCfgMgr.Ins.cfgRankInfo.getItem(i).starExp * 5;
                    } else {
                        break;
                    }
                }
                let starNum = Math.min(5, Math.floor(zongScore / CCfgMgr.Ins.cfgRankInfo.getItem(lv).starExp));
                return starNum * 2;
            }
            AddWinBox() {
                if (this.winBoxFull) return false;
                this.winTimes++;
                let stageList = CCfgMgr.Ins.cfgGlobalPar.getItemStr(E_GLOBALPAR_NAME.GAME_WINTIMES_STAGE);
                for (let i = 0; i < stageList.length; i++) {
                    if (this.winTimes == stageList[i]) {
                        this.VictoryTimes.push({
                            isGet: false
                        });
                        break;
                    }
                }
                this.SavePlayerData();
                return true;
            }
            gameLose() {
                this.VictoryTimes = [];
                this.SavePlayerData();
            }
            getUploadData() {
                let ret = {
                    rank: DataMgr.Ins.getCurrRankLv(),
                    coins: this.gold,
                    dias: this.diamon
                };
                this.currSelectCar && (ret["carMaxLv"] = this.currSelectCar.currLvSU);
                this.hat && (ret["hat"] = this.hat.name);
                this.hair && (ret["hair"] = this.hair.name);
                this.wing && (ret["wing"] = this.wing.name);
                this.cloth && (ret["cloth"] = this.cloth.name);
                return ret;
            }
            PushGuideRace(isRank, mode, rank = -1) {
                let obj = {
                    isRank: isRank,
                    mode: mode,
                    rank: rank
                };
                this.GuideAllRacing.push(obj);
                this.SavePlayerData();
            }
            PushCommonRace(isRank, mode, rank = -1) {
                let obj = {
                    isRank: isRank,
                    mode: mode,
                    rank: rank
                };
                this.CommonAllRacing.push(obj);
                this.SavePlayerData();
            }
            LessCoinTipTimes() {
                this.refreshDataByDay;
                this.refreshDataByDay.CoinTipTimes -= 1;
                this.SavePlayerData();
            }
            updateGiftData() {
                this._REFRESH_GIFT_DAY = new Date().getDate();
                this.CommonAllRacing = [];
                this.VictoryTimes = [];
                this.winTimes = 0;
                this.refreshDataByDay = {
                    clickPan: false,
                    clickCheckIn: false,
                    CoinTipTimes: 10,
                    enterGameDate: new Date().getDate()
                };
                this.SavePlayerData();
            }
            IsClickPanToday() {
                return this.refreshDataByDay.clickPan;
            }
            IsClickCheckInToday() {
                return this.refreshDataByDay.clickCheckIn;
            }
            clickPanToday() {
                this.refreshDataByDay.clickPan = true;
                this.SavePlayerData();
            }
            clickCheckInToday() {
                this.refreshDataByDay.clickCheckIn = true;
                this.SavePlayerData();
            }
            getCionTipTimes() {
                return this.refreshDataByDay.CoinTipTimes;
            }
            setEnterGameToday() {
                this.refreshDataByDay.enterGameDate = new Date().getDate();
                this.SavePlayerData();
            }
            IsEnteredGame() {
                return this.refreshDataByDay.enterGameDate == new Date().getDate();
            }
            getConstellationCfg() {
                if (this.ConstellationID > 0) {
                    var cfg = CCfgMgr.Ins.cfgConstellation.getItem(this.ConstellationID);
                    return cfg;
                }
                return null;
            }
            getConstellationBuff() {
                if (this.ConstellationID > 0) {
                    var cfg = CCfgMgr.Ins.cfgConstellation.getItem(this.ConstellationID);
                    if (cfg && cfg.BuffID) {
                        var buffCfg = CCfgMgr.Ins.cfgBuffInfo.getItem(cfg.BuffID);
                        return buffCfg;
                    }
                }
                return null;
            }
            calculateGoldBuff() {
                var cBuff = DataMgr.Ins.getConstellationBuff();
                if (cBuff) {
                    if (cBuff.buffType == E_BUFF_TYPE.GOLD_BUFF) {
                        console.log("cBuff.buffValue", cBuff.buffValue);
                        return cBuff.buffValue;
                    }
                }
                return 0;
            }
            getPersonalRecord(gameMode, trackID = 0) {
                if (trackID > 0) {
                    var rd = this.recordsDatas[trackID - 1];
                    var record = 0;
                    switch (gameMode) {
                        case E_GAME_MODE.NONE:
                            break;

                        case E_GAME_MODE.MULTIPLAYER_PROP_GAME:
                            record = rd.PropGameRecord;
                            break;

                        case E_GAME_MODE.MULTIPLAYER_SPEED_GAME:
                            record = rd.SpeedGameRecord;
                            break;

                        case E_GAME_MODE.SINGLE_SPEED_GAME:
                            record = rd.SingleGameRecord;
                            break;

                        default:
                            break;
                    }
                    return record > 0 ? UsefulStuff.formatMSS(record) : "??:??:??";
                } else {
                    var min = 0;
                    for (var i = 0; i < this.recordsDatas.length; i++) {
                        var rd = this.recordsDatas[i];
                        var record = 0;
                        switch (gameMode) {
                            case E_GAME_MODE.NONE:
                                break;

                            case E_GAME_MODE.MULTIPLAYER_PROP_GAME:
                                record = rd.PropGameRecord;
                                break;

                            case E_GAME_MODE.MULTIPLAYER_SPEED_GAME:
                                record = rd.SpeedGameRecord;
                                break;

                            case E_GAME_MODE.SINGLE_SPEED_GAME:
                                record = rd.SingleGameRecord;
                                break;

                            default:
                                break;
                        }
                        if (record <= 0) continue;
                        if (min > 0) {
                            if (record < min) min = record;
                        } else min = record;
                    }
                    return min > 0 ? UsefulStuff.formatMSS(min) : "??:??:??";
                }
            }
            getPersonalRecordNum(gameMode, trackID = 0) {
                if (trackID > 0) {
                    var rd = this.recordsDatas[trackID - 1];
                    var record = 0;
                    switch (gameMode) {
                        case E_GAME_MODE.NONE:
                            break;

                        case E_GAME_MODE.MULTIPLAYER_PROP_GAME:
                            record = rd.PropGameRecord;
                            break;

                        case E_GAME_MODE.MULTIPLAYER_SPEED_GAME:
                            record = rd.SpeedGameRecord;
                            break;

                        case E_GAME_MODE.SINGLE_SPEED_GAME:
                            record = rd.SingleGameRecord;
                            break;

                        default:
                            break;
                    }
                    return record;
                } else {
                    var min = 0;
                    for (var i = 0; i < this.recordsDatas.length; i++) {
                        var rd = this.recordsDatas[i];
                        var record = 0;
                        switch (gameMode) {
                            case E_GAME_MODE.NONE:
                                break;

                            case E_GAME_MODE.MULTIPLAYER_PROP_GAME:
                                record = rd.PropGameRecord;
                                break;

                            case E_GAME_MODE.MULTIPLAYER_SPEED_GAME:
                                record = rd.SpeedGameRecord;
                                break;

                            case E_GAME_MODE.SINGLE_SPEED_GAME:
                                record = rd.SingleGameRecord;
                                break;

                            default:
                                break;
                        }
                        if (record <= 0) continue;
                        if (min > 0) {
                            if (record < min) min = record;
                        } else min = record;
                    }
                    return min;
                }
            }
            getServerRecord(gameMode, trackID = 0) {
                if (trackID > 0) {
                    var rd = this.recordsDatas[trackID - 1];
                    var record = 0;
                    switch (gameMode) {
                        case E_GAME_MODE.NONE:
                            break;

                        case E_GAME_MODE.MULTIPLAYER_PROP_GAME:
                            record = rd.ServerPropGameRecord;
                            break;

                        case E_GAME_MODE.MULTIPLAYER_SPEED_GAME:
                            record = rd.ServerSpeedGameRecord;
                            break;

                        case E_GAME_MODE.SINGLE_SPEED_GAME:
                            record = rd.ServerSingleGameRecord;
                            break;

                        default:
                            break;
                    }
                    return record;
                } else {
                    var min = 0;
                    for (var i = 0; i < this.recordsDatas.length; i++) {
                        var rd = this.recordsDatas[i];
                        var record = 0;
                        switch (gameMode) {
                            case E_GAME_MODE.NONE:
                                break;

                            case E_GAME_MODE.MULTIPLAYER_PROP_GAME:
                                record = rd.ServerPropGameRecord;
                                break;

                            case E_GAME_MODE.MULTIPLAYER_SPEED_GAME:
                                record = rd.ServerSpeedGameRecord;
                                break;

                            case E_GAME_MODE.SINGLE_SPEED_GAME:
                                record = rd.ServerSingleGameRecord;
                                break;

                            default:
                                break;
                        }
                        if (min > 0) {
                            if (record < min) min = record;
                        } else min = record;
                    }
                    return min;
                }
            }
            updateRecord(gameMode, finishTime, carId, carStage, carQulity) {
                if (DataMgr.IsNewGuiding()) return false;
                var rd = this.recordsDatas[DataMgr.Ins.currTrackId - 1];
                switch (gameMode) {
                    case E_GAME_MODE.NONE:
                        break;

                    case E_GAME_MODE.MULTIPLAYER_PROP_GAME:
                        if (finishTime < rd.PropGameRecord || rd.PropGameRecord == 0) {
                            rd.PropGameRecord = finishTime;
                            if (rd.PropGameRecord < rd.ServerPropGameRecord) rd.ServerPropGameRecord = rd.PropGameRecord;
                        }
                        break;

                    case E_GAME_MODE.MULTIPLAYER_SPEED_GAME:
                        if (finishTime < rd.SpeedGameRecord || rd.SpeedGameRecord == 0) {
                            rd.SpeedGameRecord = finishTime;
                            rd.carId = carId;
                            rd.carStage = carStage;
                            rd.carQulity = carQulity;
                            if (rd.SpeedGameRecord < rd.ServerSpeedGameRecord) rd.ServerSpeedGameRecord = rd.SpeedGameRecord;
                            return true;
                        }
                        break;

                    case E_GAME_MODE.SINGLE_SPEED_GAME:
                        if (finishTime < rd.SingleGameRecord || rd.SingleGameRecord == 0) {
                            rd.SingleGameRecord = finishTime;
                            if (rd.SingleGameRecord < rd.ServerSingleGameRecord) rd.ServerSingleGameRecord = rd.SingleGameRecord;
                        }
                        break;

                    default:
                        break;
                }
                return false;
            }
            static IsNewGuiding() {
                return DataMgr.Ins.guideData[E_GUIDE_TYPE.MAX];
            }
            static IsOveraDay() {
                return new Date().getDate() != DataMgr.Ins._REFRESH_GIFT_DAY;
            }
            InitMapListData() {
                let arrs = CCfgMgr.Ins.cfgTrack.List;
                let test = Object.assign(arrs);
                DataMgr.Ins.MapList = [];
                test.forEach((cell, index) => {
                    DataMgr.Ins.MapList.push({
                        sceneType: cell.sceneType,
                        typeId: cell.typeId,
                        mapId: cell.ID,
                        isLock: this.LockedMap.indexOf(cell.ID) >= 0
                    });
                });
                this.SavePlayerData();
                return DataMgr.Ins.MapList;
            }
            lockNewMap() { }
            rankLvToScore(RankLevel) {
                let duanwei = RankLevel.rank;
                let starNum = RankLevel.star;
                let score = 0;
                for (let i = 1; i < duanwei + 1; i++) {
                    if (duanwei > i) {
                        score += CCfgMgr.Ins.cfgRankInfo.getItem(i).starExp * 5;
                    } else {
                        score += CCfgMgr.Ins.cfgRankInfo.getItem(i).starExp * starNum / 2;
                        break;
                    }
                }
                return score;
            }
            getRndTrack() {
                var sd = this.storyDatas;
                var rndMax = sd.length;
                for (var i = 0; i < sd.length; i++) {
                    if (!sd[i].isUnlock) {
                        rndMax = i;
                        break;
                    }
                }
                var rnd = UsefulStuff.rnd(0, rndMax - 1);
                return sd[rnd].storyID;
            }
        }
        class LoadingUI extends ui.LoadingUI {
            constructor() {
                super();
                this.openNum = 0;
                this.offsetX = 0;
            }
            onOpened() {
                PlatformMgr.Ins.canShowBanner = false;
                this.scaleX = this.scaleY = GlobalScale$1.scale;
                this.width = Laya.stage.width / GlobalScale$1.scale;
                this.height = Laya.stage.height / GlobalScale$1.scale;
                this.offsetX = (this.width - 1280) / 2;
                this.bg.x = (this.width - this.bg.width) / 2;
                this.bg1.x = (this.width - this.bg1.width) / 2;
                this.bg.skin = "loading/Loding-bg.jpg";
                this.bg.visible = this.openNum == 0;
                if (this.openNum == 0) {
                    PlatformMgr.Ins.reportData();
                    this.perLabel.visible = true;
                    this.healthTip.visible = true;
                    this.gameTip.visible = false;
                    this.clockTip.visible = false;
                    this.propDescRoot.visible = false;
                } else {
                    this.bg1.skin = "firstRes/Loding-bg2.jpg";
                    this.perLabel.visible = false;
                    this.healthTip.visible = false;
                    this.gameTip.visible = true;
                    this.clockTip.visible = true;
                    this.propDescRoot.visible = true;
                    this.doudong.play(0, true);
                    this.refreshTip();
                }
                this.proMask.width = 1;
                this.carImage.x = 0 + this.offsetX;
                this.openNum++;
            }
            setPro(value) {
                this.proMask.width = value * 993;
                this.carImage.x = value * 993 + 0 + this.offsetX;
                this.perLabel.text = Math.floor(value * 100) + "%";
                this.perLabel.visible = value < 1;
            }
            setProLabel(text) { }
            refreshTip() {
                this.gameTip.text = CCfgMgr.Ins.cfgTipStr.getRndTips();
                var propTip = [2, 3, 6, 7, 8, 9, 10];
                var rnd = UsefulStuff.rnd(0, 6);
                var cfg = CCfgMgr.Ins.cfgPropInfo.getItem(propTip[rnd]);
                if (cfg) {
                    this.decIcon.visible = true;
                    this.itemIcon.visible = true;
                    this.decTitle.visible = true;
                    this.decText.visible = true;
                    this.decIcon.skin = cfg._Icon.replace(".png", "_1.png");
                    this.itemIcon.skin = cfg._Icon;
                    var titleStr = cfg._Name + ":";
                    var decStr = "";
                    for (var i = 0; i < UsefulStuff.getStrLength(titleStr); i++) decStr += "  ";
                    decStr += cfg._Desc;
                    for (var i = 0; i < UsefulStuff.getStrLength(cfg._Desc); i++) titleStr += "  ";
                    this.decTitle.text = titleStr;
                    this.decText.text = decStr;
                } else {
                    this.decIcon.visible = false;
                    this.itemIcon.visible = false;
                    this.decTitle.visible = false;
                    this.decText.visible = false;
                }
            }
            fakePro(from, to, time) {
                this.proMask.width = from * 993;
                this.carImage.x = from * 993 + 0 + this.offsetX;
                Laya.Tween.to(this.proMask, {
                    width: to * 993,
                    update: Laya.Handler.create(this, () => {
                        this.perLabel.visible = true;
                        this.perLabel.text = Math.floor(this.proMask.width / 10) + "%";
                    }, null, false)
                }, time);
                Laya.Tween.to(this.carImage, {
                    x: to * 993 + 0 + this.offsetX
                }, time);
            }
            timePro(time = 2e3) {
                this.proMask.width = 1;
                this.carImage.x = 0 + this.offsetX;
                Laya.Tween.to(this.proMask, {
                    width: 993,
                    update: Laya.Handler.create(this, () => {
                        this.perLabel.visible = true;
                        this.perLabel.text = Math.floor(this.proMask.width / 10) + "%";
                    }, null, false)
                }, time);
                Laya.Tween.to(this.carImage, {
                    x: 993 + 0 + this.offsetX
                }, time, null, Laya.Handler.create(this, this.close));
            }
            onClosed() {
                this.proMask.width = 1;
                this.carImage.x = 0 + this.offsetX;
                if (this.openNum == 1) {
                    let day = new Date(DataMgr.Ins.firstOpenTimeStamp);
                    if (day.getDate() != new Date().getDate()) {
                        DataMgr.Ins.firstOpenTimeStamp = new Date().getTime();
                        DataMgr.Ins.hasOpenLimitGift = false;
                        DataMgr.Ins.setLimitGiftSex();
                    }
                    let day1 = new Date(DataMgr.Ins.nowDayTime);
                    if (day1.getDate() != new Date().getDate()) {
                        DataMgr.Ins.nowDayGameTimes = 0;
                        DataMgr.Ins.nowDayTime = new Date().getTime();
                    }
                    DataMgr.Ins.SavePlayerData();
                }
                EventMgr.Ins.dispatch(EventType.LOADING_CLOSE);
            }
        }
        class outputListTemp1 extends ui.UIScenes.advertisement.outputListTemp1UI {
            constructor() {
                super();
                this.jixian = 0;
                this.moveSpeed = 8e3;
                this.hangNum = 6;
                this.dataList = [];
                this.isToLeft = false;
                this.outputListTemp.on(Laya.Event.MOUSE_UP, this, this.mouseUp);
                this.outputListTemp.on(Laya.Event.MOUSE_OUT, this, this.mouseUp);
            }
            initAdData(data, width, height) {
                this.dataList = data;
                this.bg.width = width;
                this.bg.height = height;
                this.outputListTemp.width = width;
                this.outputListTemp.height = height;
                this.hangNum = Math.ceil(this.outputListTemp.height / 153);
                this.outputListTemp.dataSource = data;
                this.outputListTemp.repeatX = 1;
                this.outputListTemp.renderHandler = new Laya.Handler(this, this.refreshList);
                this.outputListTemp.mouseHandler = new Laya.Handler(this, this.clickItem);
                this.outputListTemp.refresh();
                this.jixian = Math.ceil((this.outputListTemp.dataSource.length / 2 - this.hangNum) * this.outputListTemp.repeatX + this.outputListTemp.repeatX);
                this.outputListTemp.tweenTo(this.jixian, 0, Laya.Handler.create(this, () => {
                    Laya.timer.once(200, this, () => {
                        this.moveToLeft();
                    });
                }));
            }
            refreshList(cell, index) {
                let icon = cell.getChildByName("icon");
                let name = cell.getChildByName("title");
                icon.skin = this.dataList[index].app_icon;
                name.text = this.dataList[index].app_title;
            }
            moveToLeft(time = 8e3) {
                this.isToLeft = true;
                this.outputListTemp.tweenTo(-this.outputListTemp.repeatX, time, Laya.Handler.create(this, () => {
                    this.moveToRight();
                }));
            }
            moveToRight(time = 8e3) {
                this.isToLeft = false;
                this.outputListTemp.tweenTo(this.jixian, time, Laya.Handler.create(this, () => {
                    this.moveToLeft();
                }));
            }
            mouseUp() {
                if (this.isToLeft) this.moveToLeft(Math.abs(this.outputListTemp.startIndex + this.outputListTemp.repeatX) * this.moveSpeed / this.jixian); else this.moveToRight(Math.abs(this.outputListTemp.startIndex - this.jixian) * this.moveSpeed / this.jixian);
            }
            clickItem(e, index) { }
        }
        class outputListTemp2 extends ui.UIScenes.advertisement.outputListTemp2UI {
            constructor() {
                super();
                this.jixian = 0;
                this.moveSpeed = 8e3;
                this.hangNum = 6;
                this.dataList = [];
                this.isToLeft = false;
                this.outputListTemp.on(Laya.Event.MOUSE_UP, this, this.mouseUp);
                this.outputListTemp.on(Laya.Event.MOUSE_OUT, this, this.mouseUp);
            }
            initAdData(data, width, height) {
                this.dataList = data;
                this.bg.width = width;
                this.bg.height = height;
                this.outputListTemp.width = width;
                this.outputListTemp.height = height;
                this.hangNum = Math.ceil(this.outputListTemp.width / 128);
                this.outputListTemp.dataSource = data;
                this.outputListTemp.repeatY = 1;
                this.outputListTemp.renderHandler = new Laya.Handler(this, this.refreshList);
                this.outputListTemp.mouseHandler = new Laya.Handler(this, this.clickItem);
                this.outputListTemp.refresh();
                this.jixian = Math.ceil((this.outputListTemp.dataSource.length / 2 - this.hangNum) * this.outputListTemp.repeatY + this.outputListTemp.repeatY);
                this.outputListTemp.tweenTo(this.jixian, 0, Laya.Handler.create(this, () => {
                    Laya.timer.once(200, this, () => {
                        this.moveToLeft();
                    });
                }));
            }
            refreshList(cell, index) {
                let icon = cell.getChildByName("icon");
                icon.skin = this.dataList[index].app_icon;
            }
            moveToLeft(time = 8e3) {
                this.isToLeft = true;
                this.outputListTemp.tweenTo(-this.outputListTemp.repeatY, time, Laya.Handler.create(this, () => {
                    this.moveToRight();
                }));
            }
            moveToRight(time = 8e3) {
                this.isToLeft = false;
                this.outputListTemp.tweenTo(this.jixian, time, Laya.Handler.create(this, () => {
                    this.moveToLeft();
                }));
            }
            mouseUp() {
                if (this.isToLeft) this.moveToLeft(Math.abs(this.outputListTemp.startIndex + this.outputListTemp.repeatY) * this.moveSpeed / this.jixian); else this.moveToRight(Math.abs(this.outputListTemp.startIndex - this.jixian) * this.moveSpeed / this.jixian);
            }
            clickItem(e, index) { }
        }
        class outputSingleTemp1 extends ui.UIScenes.advertisement.outputSingleTemp1UI {
            constructor() {
                super();
            }
            initAdData(data) { }
            refreshData(data) { }
        }
        class CheckItemScript extends Laya.Script {
            get bg() {
                return this.item_bg;
            }
            get day() {
                return this.item_day;
            }
            get img() {
                return this.item_img;
            }
            get name() {
                return this.item_name;
            }
            get mask() {
                return this.item_mask;
            }
            get liuGuang() {
                return this.item_LiuGuang;
            }
            get ani() {
                return this.item_ani;
            }
        }
        class checkinViewUI extends ui.UIScenes.checkin.CheckInViewUI {
            constructor() {
                super(...arguments);
                this.currChest = null;
                this.isFirstShow = false;
                this.jsonIndex = [[12, 56], [13, 57], [14, 58], [15, 59], [16, 60], [17, 61], [18, 62]];
                this.checkInList = [this.day_1, this.day_2, this.day_3, this.day_4, this.day_5, this.day_6, this.day_7];
                this.isShowAd = false;
            }
            onAwake() {
                this.scaleX = this.scaleY = GlobalScale$1.scale;
                this.width = Laya.stage.width / GlobalScale$1.scale;
                this.height = Laya.stage.height / GlobalScale$1.scale;
                this.clickBtn.on(Laya.Event.CLICK, this, this.clickBtnHandler, [DataMgr.Ins._CHECK_IN_DAY != 0]);
                this.closeBtn.on(Laya.Event.CLICK, this, this.closeBtnHandler);
                this.txtBtn.on(Laya.Event.CLICK, this, this.clickBtnHandler, [false]);
                PrivateTracker_new.Ins.sendEvent(SDK_EVENT._签到界面, {
                    "_签到界面": "_签到界面"
                });
            }
            onOpened(state = false) {
                PlatformMgr.Ins.canShowBanner = true;
                if (state != undefined) this.isFirstShow = state;
                let chest = new BaseChest();
                chest.initCheckIn([12, 13, 14, 15, 16, 17, 18]);
                this.currChest = chest;
                this.PopPage();
                if (DataMgr.Ins._CHECK_IN_DAY == 0) {
                    this.isFirstShow = true;
                } else {
                    this.isFirstShow = false;
                }
                if (DataMgr.Ins._CHECK_IN_DAY == 7 && this.OverAday()) {
                    DataMgr.Ins._CHECK_IN_DAY = 0;
                    this.isFirstShow = false;
                    DataMgr.Ins.SavePlayerData();
                }
                this.ani1.play(0, true);
                this.refreshUI();
                this.playDaySevenDayAni();
                this.redDot.visible = StartUI.Ins.isCangetGift();
                this.initAd();
                this.img_double.x = 135;

                let banner;
                let left = 80;
                let bottom = 0;
                let width = 300;

                this.closeBtn.visible = false;
                this.txtBtn.visible = false;
                Laya.timer.once(AdConfigMgr.Ins.Switch_1, this, () => {
                    this.closeBtn.visible = true;
                    this.txtBtn.visible = true;
                });
            }
            initAd() {
                PlatformMgr.Ins.initNativeAd(E_UI_TYPE.CHECK_IN);
                PlatformMgr.Ins.showWxNative(E_UI_TYPE.CHECK_IN);
                PlatformMgr.Ins.initOutput(E_UI_TYPE.CHECK_IN);
            }
            PopPage() {
                this.pop.scaleX = .9;
                this.pop.scaleY = .9;
                Laya.Tween.to(this.pop, {
                    scaleX: 1,
                    scaleY: 1
                }, 20, Laya.Ease.linearInOut);
            }
            onClosed() {
                PlatformMgr.Ins.hideWxNative();
                let isover = this.OverAday();
                console.log("瞧一瞧问题", new Date(DataMgr.Ins.openNextGiftTime).getDate() != new Date().getDate(), DataMgr.Ins._CHECK_IN_DAY, !isover);
                if (DataMgr.Ins._CHECK_IN_DAY == 1 && !isover) {
                    UIManager.Ins.getScene(E_UI_TYPE.NEXTGIFT).open(false);
                    DataMgr.Ins.openNextGiftTime = new Date().getTime();
                } else {
                    if (UIManager.Ins.getScene(E_UI_TYPE.STARTUI).parent) PlatformMgr.Ins.initOutput(E_UI_TYPE.STARTUI);
                }

            }
            onEnable() { }
            onDisable() { }
            refreshUI() {
                let info = this.currChest.checkinCfg;
                this.checkInList.forEach((cell, index) => {
                    let type = CCfgMgr.Ins.cfgChest.getItem(this.jsonIndex[index][0])._rewardType[0] == E_REWARD_TYPE.REWARD_BASE ? true : false;
                    let imgUrl = "";
                    if (index <= 5 && (index == 0 || index == 1 || index == 2 || index == 4)) {
                        imgUrl = "uires/checkin/diertian2_xuanzhong.png";
                    } else {
                        if (index <= 5) {
                            imgUrl = "uires/checkin/diyitian.png";
                        } else {
                            imgUrl = "uires/checkin/diqitian.png";
                        }
                    }
                    cell.getComponent(CheckItemScript).bg.texture = Laya.Loader.getRes(imgUrl);
                    cell.getComponent(CheckItemScript).day.text = `第${index + 1}天`;
                    cell.getComponent(CheckItemScript).img.skin = this.getRewardMsg(2, info[index]);
                    cell.getComponent(CheckItemScript).name.text = this.getRewardMsg(1, info[index]);
                    cell.getComponent(CheckItemScript).mask.visible = DataMgr.Ins._CHECK_IN_DAY >= index + 1 ? true : false;
                    cell.getComponent(CheckItemScript).ani.visible = DataMgr.Ins._CHECK_IN_DAY >= index + 1 ? false : true;
                    if (index == DataMgr.Ins._CHECK_IN_DAY) {
                        this.checkInList[index].getComponent(CheckItemScript).liuGuang.visible = DataMgr.Ins._CHECK_IN_DAY >= index + 1 ? false : true;
                    } else {
                        this.checkInList[index].getComponent(CheckItemScript).liuGuang.visible = false;
                    }
                });
                this.txtBtn.visible = DataMgr.Ins._CHECK_IN_DAY != 0;
                this.clickBtn.y = DataMgr.Ins._CHECK_IN_DAY == 0 || !this.OverAday() ? 441 : 414;
                if (this.isFirstShow) {
                    this.img_double.visible = false;
                    this.img_got.visible = false;
                    this.img_get.skin = "uires/checkin/dianjilingqu.png";
                    this.img_video.visible = false;
                    this.txtBtn.visible = false;
                    this.isFirstShow = false;
                    this.isShowAd = false;
                    console.log("给我刷新");
                    return;
                }
                this.img_video.visible = true;
                this.txtBtn.visible = true;
                this.clickBtn.disabled = false;
                let type;
                if (this.OverAday()) {
                    type = this.getGetRewardType(info);
                    switch (type) {
                        case E_REWARD_TYPE.REWARD_BASE:
                            this.img_get.visible = false;
                            this.img_double.visible = true;
                            this.img_double.skin = "uires/checkin/shuangbeihuode.png";
                            this.img_got.visible = false;
                            this.img_txt.visible = true;
                            this.img_txt.skin = "uires/checkin/putonglingqu.png";
                            this.isShowAd = true;
                            break;

                        case E_REWARD_TYPE.REWARD_CAR:
                            this.img_get.visible = false;
                            this.img_got.visible = false;
                            this.img_double.visible = true;
                            this.img_double.skin = "uires/checkin/teshulingqu.png";
                            this.img_txt.visible = true;
                            this.img_txt.skin = "uires/checkin/putonglingqu.png";
                            this.isShowAd = true;
                            break;

                        case E_REWARD_TYPE.REWARD_CLOTHES:
                            this.img_get.visible = false;
                            this.img_got.visible = false;
                            this.img_double.visible = true;
                            this.img_double.skin = "uires/checkin/teshulingqu.png";
                            this.img_txt.visible = true;
                            this.img_txt.skin = "uires/checkin/putonglingqu.png";
                            this.isShowAd = true;
                            break;
                    }
                } else {
                    type = this.getGotRewardType(info);
                    switch (type) {
                        case E_REWARD_TYPE.REWARD_BASE:
                            this.img_get.visible = false;
                            this.img_double.visible = false;
                            this.img_got.skin = "uires/checkin/yilingqu2.png";
                            this.img_got.visible = true;
                            this.img_video.visible = false;
                            this.img_txt.visible = false;
                            this.isShowAd = false;
                            this.clickBtn.disabled = true;
                            break;

                        case E_REWARD_TYPE.REWARD_CAR:
                            this.img_get.visible = false;
                            this.img_double.visible = false;
                            this.img_got.skin = "uires/checkin/yilingqu2.png";
                            this.img_got.visible = true;
                            this.img_txt.visible = false;
                            this.img_video.visible = false;
                            this.isShowAd = false;
                            break;

                        case E_REWARD_TYPE.REWARD_CLOTHES:
                            this.img_get.visible = false;
                            this.img_double.visible = false;
                            this.img_got.skin = "uires/checkin/yilingqu2.png";
                            this.img_got.visible = true;
                            this.img_txt.visible = false;
                            this.img_video.visible = false;
                            this.isShowAd = false;
                            break;
                    }
                }
            }
            playDaySevenDayAni() {
                this.day_7._aniCar.ani1.play(0, true);
            }
            getGetRewardType(info) {
                let index = DataMgr.Ins._CHECK_IN_DAY;
                let type = info[index]._rewardType[0];
                return type;
            }
            getGotRewardType(info) {
                let index = Math.max(0, Math.min(5, DataMgr.Ins._CHECK_IN_DAY - 1));
                let type = info[index]._rewardType[0];
                return type;
            }
            getRewardMsg(rewardType, info) {
                let Id = info._rewardID[0];
                let type = info._rewardType[0];
                let count = info._rewardNumMax[0];
                let rewardMsg = "";
                switch (type) {
                    case E_REWARD_TYPE.REWARD_BASE:
                        switch (Id) {
                            case E_REWARD_BASE_TYPE.GOLD:
                                break;

                            case E_REWARD_BASE_TYPE.DIAMOND:
                                if (rewardType == 1) {
                                    rewardMsg = `${count}钻石`;
                                }
                                if (rewardType == 2) {
                                    rewardMsg = this.getDiamondType(count);
                                }
                                break;

                            case E_REWARD_BASE_TYPE.CLOTHESTICKET:
                                break;
                        }
                        break;

                    case E_REWARD_TYPE.REWARD_CAR:
                        if (rewardType == 1) {
                            rewardMsg = CCfgMgr.Ins.cfgRacing.getItem(Id)._Name;
                        }
                        if (rewardType == 2) {
                            let index1 = CCfgMgr.Ins.cfgRacing.getItem(Id);
                            let index = CCfgMgr.Ins.cfgRacing.getItem(Id)._RacingIconName[0];
                            rewardMsg = LoadMgr.Ins.WebResHttp + `carIcon/${index}.png`;
                        }
                        break;

                    case E_REWARD_TYPE.REWARD_CLOTHES:
                        if (rewardType == 1) {
                            rewardMsg = CCfgMgr.Ins.cfgClothes.getItem(Id)._Name;
                        }
                        if (rewardType == 2) {
                            let index = CCfgMgr.Ins.cfgClothes.getItem(Id).picId;
                            rewardMsg = LoadMgr.Ins.WebResHttp + `clothesIcon/clothes_${index}.png`;
                        }
                        break;
                }
                return rewardMsg;
            }
            getDiamondType(count) {
                let index;
                if (count <= 50) {
                    index = `uires/checkin/z1.png`;
                } else if (count > 50 && count < 100) {
                    index = `uires/checkin/z2.png`;
                } else if (count >= 100 && count < 200) {
                    index = `uires/checkin/z3.png`;
                } else if (count >= 200 && count < 500) {
                    index = `uires/checkin/z4.png`;
                } else if (count >= 500) {
                    index = `uires/checkin/z5.png`;
                }
                return index;
            }
            isOverDay() {
                let nowYear = new Date().getFullYear();
                let nowMonth = new Date().getMonth() + 1;
                let nowDay = new Date().getDate();
                if (nowYear == DataMgr.Ins._CURRENT_YEAR) {
                    if (nowMonth == DataMgr.Ins._CURRENT_MONTH) {
                        if (nowDay != DataMgr.Ins._CURRENT_DAY) {
                            DataMgr.Ins._CURRENT_YEAR = nowYear;
                            DataMgr.Ins._CURRENT_MONTH = nowMonth;
                            DataMgr.Ins._CURRENT_DAY = nowDay;
                            return true;
                        } else {
                            return false;
                        }
                    } else {
                        DataMgr.Ins._CURRENT_DAY = nowDay;
                        DataMgr.Ins._CURRENT_MONTH = nowMonth;
                        DataMgr.Ins._CURRENT_YEAR = nowYear;
                        return true;
                    }
                } else {
                    DataMgr.Ins._CURRENT_YEAR = nowYear;
                    DataMgr.Ins._CURRENT_MONTH = nowMonth;
                    DataMgr.Ins._CURRENT_DAY = nowDay;
                    return true;
                }
            }
            clickBtnHandler(bool) {
                let isOver = this.OverAday();
                if (PlatformMgr.Ins.platform == E_PLATFORM_TYPE.TT && !bool) PlatformMgr.Ins.showInsert();
                setTimeout(() => {
                    if (isOver) {
                        if (bool) {
                            //激励广告
                            showReward(() => {
                                UIManager.Ins.getScene(E_UI_TYPE.CGTLTGETUI).open(false, [this.jsonIndex[DataMgr.Ins._CHECK_IN_DAY][1], -1, 1, false, false, false]);
                                DataMgr.Ins._CHECK_IN_DAY++;
                                DataMgr.Ins._CURRENT_DAY = new Date().getDate();
                                DataMgr.Ins._CURRENT_MONTH = new Date().getMonth() + 1;
                                DataMgr.Ins._CURRENT_YEAR = new Date().getFullYear();
                                DataMgr.Ins.SavePlayerData();
                                StartUI.Ins && StartUI.Ins.changeCheckIn();
                                this.refreshUI();
                            });

                        } else {
                            UIManager.Ins.getScene(E_UI_TYPE.CGTLTGETUI).open(false, [this.jsonIndex[DataMgr.Ins._CHECK_IN_DAY][0], -1, 1, false, false, false]);
                            DataMgr.Ins._CHECK_IN_DAY++;
                            DataMgr.Ins._CURRENT_DAY = new Date().getDate();
                            DataMgr.Ins._CURRENT_MONTH = new Date().getMonth() + 1;
                            DataMgr.Ins._CURRENT_YEAR = new Date().getFullYear();
                            DataMgr.Ins.SavePlayerData();
                            StartUI.Ins && StartUI.Ins.changeCheckIn();
                            this.refreshUI();
                        }
                    } else {
                        let type = this.getGotRewardType(this.currChest.checkinCfg);
                        switch (type) {
                            case E_REWARD_TYPE.REWARD_BASE:
                                UIManager.Ins.getScene(E_UI_TYPE.LONGBLACKTIP).open(false, ["今天的奖励已经领取过,明天再来哟~"]);
                                break;

                            case E_REWARD_TYPE.REWARD_CAR:
                                UIManager.Ins.getScene(E_UI_TYPE.LONGBLACKTIP).open(false, ["今天的奖励已经领取过,明天再来哟~"]);
                                break;

                            case E_REWARD_TYPE.REWARD_CLOTHES:
                                UIManager.Ins.getScene(E_UI_TYPE.LONGBLACKTIP).open(false, ["今天的奖励已经领取过,明天再来哟~"]);
                                break;
                        }
                    }
                    this.redDot.visible = StartUI.Ins.isCangetGift();
                }, 0);
            }
            OverAday() {
                let nowYear = new Date().getFullYear();
                let nowMonth = new Date().getMonth() + 1;
                let nowDay = new Date().getDate();
                if (nowYear == DataMgr.Ins._CURRENT_YEAR) {
                    if (nowMonth == DataMgr.Ins._CURRENT_MONTH) {
                        if (nowDay != DataMgr.Ins._CURRENT_DAY) {
                            return true;
                        } else {
                            return false;
                        }
                    } else {
                        return true;
                    }
                } else {
                    return true;
                }
            }
            closeBtnHandler() {
                SoundMgr.Ins.Press();
                console.log('closeqiandao---------');
                this.close();
                if (!DataMgr.IsNewGuiding()) {
                    UIManager.Ins.getScene(E_UI_TYPE.STARTUI).checkPopView(false);
                }
                if (DataMgr.IsNewGuiding() && DataMgr.Ins.guideData[E_GUIDE_TYPE.FIRST_START]) { }
            }
        }
        class AddDeskTopUI extends ui.UIScenes.commonUI.AddDeskTopUI {
            constructor() {
                super();
                this.openNum = 0;
                this.callbackFunc = null;
                this.scaleX = this.scaleY = GlobalScale$1.scale;
                this.width = Laya.stage.width / GlobalScale$1.scale;
                this.height = Laya.stage.height / GlobalScale$1.scale;
                this.addBtn.on(Laya.Event.CLICK, this, this.addBtnClick);
                this.closeBtn.on(Laya.Event.CLICK, this, this.closeBtnClick);
            }
            onOpened(cb) {
                this.callbackFunc = cb;
            }
            addBtnClick() {
                SoundMgr.Ins.Press();
                PlatformMgr.Ins.installIcon(() => {
                    Laya.timer.once(200, this, () => {
                        this.close();
                        PlatformMgr.Ins.hasDesktopIcon(null, this.callbackFunc());
                    });
                });
            }
            closeBtnClick() {
                SoundMgr.Ins.Press();
                this.close();
            }
            onClosed() { }
        }
        class LongPressTipUI extends ui.UIScenes.commonUI.LongPressTipUI {
            constructor() {
                super();
                this.scaleX = this.scaleY = GlobalScale$1.scale;
                this.width = Laya.stage.width / GlobalScale$1.scale;
                this.height = Laya.stage.height / GlobalScale$1.scale;
                LongPressTipUI.Ins = this;
            }
            onOpened(list) {
                this.tipImage.x = list[0];
                this.tipImage.y = list[1] + 20;
                this.tipLabel.text = list[2];
                this.tipImage.height = this.tipLabel.height + 10;
                this.tipImage.y = this.tipImage.y > this.height * .5 ? list[1] - this.tipImage.height - 100 : list[1] + this.tipImage.height + 100;
            }
            closeSelf() {
                this.close();
            }
            onClosed() {
                Laya.timer.clearAll(this);
            }
        }
        class TipScript extends Laya.Script {
            constructor() {
                super();
                this.m_desc = "";
                this.pressTime = 600;
            }
            setDesc(desc, pressTime = 600) {
                this.m_desc = desc;
                this.pressTime = pressTime;
            }
            clearDesc() {
                this.m_desc = "";
            }
            onAwake() {
                this.m_owner = this.owner;
            }
            onEnable() {
                this.owner.on(Laya.Event.MOUSE_DOWN, this, this.downBtn);
                this.owner.on(Laya.Event.MOUSE_UP, this, this.upBtn);
                this.owner.on(Laya.Event.MOUSE_OUT, this, this.upBtn);
            }
            onDisable() {
                this.owner.off(Laya.Event.MOUSE_DOWN, this, this.downBtn);
                this.owner.off(Laya.Event.MOUSE_UP, this, this.upBtn);
                this.owner.off(Laya.Event.MOUSE_OUT, this, this.upBtn);
            }
            downBtn() {
                if (this.m_desc) Laya.timer.once(this.pressTime, this, () => {
                    UIManager.Ins.getScene(E_UI_TYPE.LONG_PRESS_TIP).open(false, [Laya.stage.mouseX / GlobalScale$1.scale, Laya.stage.mouseY / GlobalScale$1.scale, this.m_desc]);
                });
            }
            upBtn() {
                Laya.timer.clearAll(this);
                LongPressTipUI.Ins && LongPressTipUI.Ins.closeSelf();
            }
        }
        class BattleUI extends ui.UIScenes.commonUI.BattleUI {
            constructor() {
                super();
                this.curRank = 0;
                this.warningTime = 0;
                this.timeFiber = 0;
                this.rndTime = 0;
                this.curSkinID = 0;
                this.guideOut = false;
                this.PCLeft = false;
                this.PCRight = false;
                this.propSkinList = ["uires/battle/banana.png", "uires/battle/faint.png", "uires/battle/ghost.png", "uires/battle/nos.png", "uires/battle/rockety.png", "uires/battle/shandian.png", "uires/battle/shield.png", "uires/battle/star.png", "uires/battle/thunder.png", "uires/battle/rocketr.png"];
                this.initPos = new Laya.Vector2(0, 0);
                this.leftBtn.on(Laya.Event.MOUSE_DOWN, this, this.leftBtnOnDown);
                this.contorlArea.on(Laya.Event.MOUSE_DOWN, this, this.contorlAreaOnDown);
                this.contorlArea.on(Laya.Event.MOUSE_UP, this, this.contorlAreaOnUp);
                this.contorlArea.on(Laya.Event.MOUSE_OVER, this, this.contorlAreaOnOver);
                this.touchBox.on(Laya.Event.MOUSE_UP, this, this.contorlAreaOnUp);
                this.touchBox.on(Laya.Event.MOUSE_OUT, this, this.contorlAreaOnUp);
                this.driftBtn.on(Laya.Event.MOUSE_DOWN, this, this.driftBtnTouch);
                this.driftBtn.on(Laya.Event.MOUSE_UP, this, this.driftBtnUnTouch);
                this.driftBtn.on(Laya.Event.MOUSE_OUT, this, this.driftBtnUnTouch);
                this.prop1Btn.on(Laya.Event.CLICK, this, this.prop1BtnOnClick);
                this.prop2Btn.on(Laya.Event.CLICK, this, this.prop2BtnOnClick);
                this.LBBtn.on(Laya.Event.CLICK, this, this.LBBtnOnClick);
                this.startRushBtn.on(Laya.Event.CLICK, this, this.startRushBtnOnClick);
                this.startRushAni.on(Laya.Event.COMPLETE, this, this.startRushAniComplete);
                this.startRushAni.addLabel("max", 36);
                this.startRushAni.on(Laya.Event.LABEL, this, this.startRushAniMax);
                this.bannerCloseBtn.on(Laya.Event.CLICK, this, () => {
                    this.nativeItem.visible = false;
                });
            }
            onAwake() { }
            onOpened() {

                let banner;
                let left = 0;
                let bottom = 0;
                let width = 300;


                PlatformMgr.Ins.canShowBanner = false;
                this.scaleX = this.scaleY = GlobalScale$1.scale;
                this.width = Laya.stage.width / GlobalScale$1.scale;
                this.height = Laya.stage.height / GlobalScale$1.scale;
                this.block.height = Laya.stage.height / GlobalScale$1.scale;
                this.block.width = Laya.stage.width / GlobalScale$1.scale;
                this.winEffectUI.x = (Laya.stage.width - 1280) / 2;
                this.featureArea.visible = false;
                this.isGameFinish = false;
                this.isLBOpen = false;
                this.winEffectUI.visible = false;
                this.warning.visible = false;
                SceneMgr.Ins.offTouchEvent();
                EventMgr.Ins.on(EventType.TIMEFIBER, this, this.update);
                EventMgr.Ins.on(EventType.GETPROPMSG, this, this.onGetPropMsg);
                EventMgr.Ins.on(EventType.RACE_SECEND, this, this.onRaceSecendMsg);
                EventMgr.Ins.on(EventType.RACE_LAST, this, this.onRaceLastMsg);
                EventMgr.Ins.on(EventType.RACE_RANK, this, this.onRaceRankMsg);
                EventMgr.Ins.on(EventType.RACE_FINISH, this, this.onRaceFinishMsg);
                EventMgr.Ins.on(EventType.RACE_COOLDOWN, this, this.onRaceCoolDownMsg);
                EventMgr.Ins.on(EventType.BATTLE_PROP_FEATURE, this, this.onBattleFeatureMsg);
                EventMgr.Ins.on(EventType.BATTLE_PROP_FEATURE_CLOSE, this, this.onBattleFeatureCloseMsg);
                EventMgr.Ins.on(EventType.SHOWSKILLMSG, this, this.onBattleShowSkillMsg);
                EventMgr.Ins.on(EventType.HOLDSKILLMSG, this, this.onBattleHoldSkillMsg);
                EventMgr.Ins.on(EventType.STOPSKILLMSG, this, this.onBattleStopSkillMsg);
                EventMgr.Ins.on(EventType.BUFFTIPMSG, this, this.onBuffTipMsg);
                EventMgr.Ins.on(EventType.CLOSEBUFFTIPMSG, this, this.onCloseBuffTipMsg);
                EventMgr.Ins.on(EventType.DRIFTOVERMSG, this, this.onDriftOverMsg);
                EventMgr.Ins.on(EventType.START_ROCKET_WARNING, this, this.onStartRocketWarning);
                EventMgr.Ins.on(EventType.BATTLE_COUNT_DOWN, this, this.onCountDownMsg);
                if (PlatformMgr.Ins.platform == E_PLATFORM_TYPE.WEB) {
                    Laya.stage.on(Laya.Event.KEY_DOWN, this, this.PCKeyDown);
                    Laya.stage.on(Laya.Event.KEY_UP, this, this.PCKeyUp);
                }
                this.readyImg.visible = false;
                this.propIcon1.visible = false;
                this.propIcon2.visible = false;
                this.prop1Btn.mouseEnabled = false;
                this.prop2Btn.mouseEnabled = false;
                this.startTime = 0;
                this.curRank = 0;
                this.timeCount.value = "00:00:00";
                this.speedLabel.value = "000";
                this.lapInfo.text = "1/" + (GameMgr.Ins.gameLap + 1).toString() + "圈";
                this.setLBPro(0);
                this.miniMap.initMap();
                this.meterBGAni.play(0, true);
                this.proEffect.play(0, true);
                this.closeLBBtn();
                this.startRushBtn.visible = false;
                this.skillAniRoot.visible = false;
                this.startRushTip.visible = false;
                this.buffTipRoot.visible = false;
                this.leftBtn.visible = false;
                this.rightBtn.visible = false;
                this.m_tipScript1 = this.prop1Btn.addComponent(TipScript);
                this.m_tipScript2 = this.prop2Btn.addComponent(TipScript);
                this.ttRecord.visible = PlatformMgr.Ins.platform == E_PLATFORM_TYPE.TT;
                this.startIntervalPropAnim();
                this.refreshNativeItem();
                PlatformMgr.Ins.initNativeAd(E_UI_TYPE.BATTLEUI);
            }
            onTouchDown() {
                EventMgr.Ins.dispatch(EventType.BATTLETOUCHDOWN);
            }
            onTouchUp() {
                EventMgr.Ins.dispatch(EventType.BATTLETOUCHUP);
            }
            onClosed() {
                EventMgr.Ins.off(EventType.TIMEFIBER, this, this.update);
                EventMgr.Ins.off(EventType.GETPROPMSG, this, this.onGetPropMsg);
                EventMgr.Ins.off(EventType.RACE_SECEND, this, this.onRaceSecendMsg);
                EventMgr.Ins.off(EventType.RACE_LAST, this, this.onRaceLastMsg);
                EventMgr.Ins.off(EventType.RACE_RANK, this, this.onRaceRankMsg);
                EventMgr.Ins.off(EventType.RACE_FINISH, this, this.onRaceFinishMsg);
                EventMgr.Ins.off(EventType.BATTLE_PROP_FEATURE, this, this.onBattleFeatureMsg);
                EventMgr.Ins.off(EventType.BATTLE_PROP_FEATURE_CLOSE, this, this.onBattleFeatureCloseMsg);
                EventMgr.Ins.off(EventType.SHOWSKILLMSG, this, this.onBattleShowSkillMsg);
                EventMgr.Ins.off(EventType.HOLDSKILLMSG, this, this.onBattleHoldSkillMsg);
                EventMgr.Ins.off(EventType.STOPSKILLMSG, this, this.onBattleStopSkillMsg);
                EventMgr.Ins.off(EventType.BUFFTIPMSG, this, this.onBuffTipMsg);
                EventMgr.Ins.off(EventType.CLOSEBUFFTIPMSG, this, this.onCloseBuffTipMsg);
                EventMgr.Ins.off(EventType.DRIFTOVERMSG, this, this.onDriftOverMsg);
                EventMgr.Ins.off(EventType.START_ROCKET_WARNING, this, this.onStartRocketWarning);
                EventMgr.Ins.off(EventType.BATTLE_COUNT_DOWN, this, this.onCountDownMsg);
                this.stopIntervalPropAnim();
                if (PlatformMgr.Ins.platform == E_PLATFORM_TYPE.WEB) {
                    Laya.stage.off(Laya.Event.KEY_DOWN, this, this.PCKeyDown);
                    Laya.stage.off(Laya.Event.KEY_UP, this, this.PCKeyUp);
                }
                PlatformMgr.Ins.closeNativeAd();

            }
            update(startFrame) {
                var ss = ActorMgr.Ins.m_selfScript;
                if (!this.isGameFinish) {
                    if (GameMgr.Ins.gameStartTime && GameMgr.Ins.gameStartTime > 0) this.timeCount.value = UsefulStuff.formatMSS(Date.now() - GameMgr.Ins.gameStartTime); else this.timeCount.value = "00:00:00";
                    var lap = ss.m_curLap + 1;
                    this.lapInfo.text = lap + "/" + (GameMgr.Ins.gameLap + 1).toString() + "圈";
                    if (this.curRank != ss.rankNum) {
                        if (this.curRank != 0) {
                            this.playRankAni(this.curRank, ss.rankNum);
                        } else {
                            this.setRank(ss.rankNum);
                        }
                    }
                    this.curRank = ss.rankNum;
                    this.setLBPro(ss.LBPro);
                } else {
                    var lap = ss.m_curLap;
                    this.lapInfo.text = lap + "/" + (GameMgr.Ins.gameLap + 1).toString() + "圈";
                }
                var skinID = Math.floor(ss.curSpeed / ss.maxCarSpeed * 10);
                var skinRes = "uires/battle/SpeedShow_B_0" + skinID + ".png";
                if (skinID < 10) {
                    this.curSkinID = skinID;
                    this.meterLeft.skin = skinRes;
                    this.meterRight.skin = skinRes;
                } else {
                    this.curSkinID += .49;
                    if (this.curSkinID > 42) this.curSkinID = 10;
                    if (this.curSkinID < 10) this.curSkinID = 10;
                    skinRes = "uires/battle/SpeedShow_B_" + Math.floor(this.curSkinID) + ".png";
                    this.meterLeft.skin = skinRes;
                    this.meterRight.skin = skinRes;
                }
                var speed = Math.floor(ss.curSpeed / ss.maxCarSpeed * ss.carCfg.getCurrMaxSpeed());
                if (speed > 0 && Date.now() >= this.timeFiber) {
                    this.rndTime = UsefulStuff.rnd(-2, 2);
                    this.timeFiber = Date.now() + 500;
                }
                speed += this.rndTime;
                this.speedLabel.value = UsefulStuff.PrefixZero(speed, 3);
                if (ss.driftCorner) {
                    if (ss.isEdgeSlow) {
                        this.driftBtn.gray = false;
                    } else {
                        this.driftBtn.gray = true;
                    }
                } else {
                    this.driftBtn.gray = true;
                }
                var value = (this.contorlWheel.x - 140) / 100;
                if (value > 1) value = 1;
                if (value < -1) value = -1;
                if (this.warningTime > 0) this.warningTime--; else this.onStopRocketWarning();
                EventMgr.Ins.dispatch(EventType.BATTLE_CONTORL, value);
                if (PlatformMgr.Ins.platform == E_PLATFORM_TYPE.WEB && Math.abs(value) < .1) {
                    this.PCKeyUpdate();
                }
            }
            rndSkinBtnOnClick() {
                DataMgr.Ins.CarID = UsefulStuff.rnd(1, 4);
                DataMgr.Ins.CarLv = UsefulStuff.rnd(1, 3);
                DataMgr.Ins.WingID = UsefulStuff.rnd(0, 4);
                DataMgr.Ins.HairID = UsefulStuff.rnd(1, 6);
                DataMgr.Ins.ChaID = UsefulStuff.rnd(1, 6);
                DataMgr.Ins.HatID = UsefulStuff.rnd(0, 5);
                ActorMgr.Ins.changeSelfActor();
            }
            nextLevelBtnOnClick() {
                GameMgr.Ins.endGame();
            }
            leftBtnOnDown(touch) {
                this.curTouchId = -100;
                this.isDown = true;
                var wheelPos = this.contorlArea.globalToLocal(new Laya.Point(Laya.stage.mouseX, Laya.stage.mouseY), false);
                this.wheelRevertTween && Laya.Tween.clear(this.wheelRevertTween);
                this.contorlWheel.pos(wheelPos.x - 75, 26);
                this.originPiont = wheelPos;
                this.touchBox.on(Laya.Event.MOUSE_MOVE, this, this.contorlAreaOnMove);
                this.contorlArea.on(Laya.Event.MOUSE_MOVE, this, this.contorlAreaOnMove);
            }
            rightBtnOnDown(touch) {
                EventMgr.Ins.dispatch(EventType.BATTLE_RIGHT_DOWN);
            }
            leftBtnOnUp() {
                EventMgr.Ins.dispatch(EventType.BATTLE_LEFT_UP);
            }
            rightBtnOnUp() {
                EventMgr.Ins.dispatch(EventType.BATTLE_RIGHT_UP);
            }
            leftBtnOnOut() {
                EventMgr.Ins.dispatch(EventType.BATTLE_LEFT_UP);
            }
            rightBtnOnOut() {
                EventMgr.Ins.dispatch(EventType.BATTLE_RIGHT_UP);
            }
            leftBtnOnOver() {
                EventMgr.Ins.dispatch(EventType.BATTLE_LEFT_DOWN);
            }
            rightBtnOnOver() {
                EventMgr.Ins.dispatch(EventType.BATTLE_RIGHT_DOWN);
            }
            touchBoxOnUp(touch) {
                if (touch.touchId == this.leftTouchID) {
                    EventMgr.Ins.dispatch(EventType.BATTLE_LEFT_UP);
                    this.leftTouchID = null;
                }
                if (touch.touchId == this.rightTouchID) {
                    EventMgr.Ins.dispatch(EventType.BATTLE_RIGHT_UP);
                    this.rightTouchID = null;
                }
            }
            contorlAreaOnDown(e) {
                this.curTouchId = e.touchId;
                this.isDown = true;
                var wheelPos = this.contorlArea.globalToLocal(new Laya.Point(Laya.stage.mouseX, Laya.stage.mouseY), false);
                this.wheelRevertTween && Laya.Tween.clear(this.wheelRevertTween);
                this.contorlWheel.pos(wheelPos.x - 75, 26);
                this.originPiont = wheelPos;
                this.touchBox.on(Laya.Event.MOUSE_MOVE, this, this.contorlAreaOnMove);
                this.contorlArea.on(Laya.Event.MOUSE_MOVE, this, this.contorlAreaOnMove);
            }
            contorlAreaOnUp(e) {
                if (e.touchId != this.curTouchId && this.curTouchId != -100) return;
                this.isDown = false;
                this.wheelRevertTween = Laya.Tween.to(this.contorlWheel, {
                    x: 140
                }, 200);
                EventMgr.Ins.dispatch(EventType.BATTLE_CONTORL, 0);
                this.touchBox.off(Laya.Event.MOUSE_MOVE, this, this.contorlAreaOnMove);
                this.contorlArea.off(Laya.Event.MOUSE_MOVE, this, this.contorlAreaOnMove);
            }
            contorlAreaOnOut(e) {
                if (GuideMgr.Ins.isGuiding) {
                    if (e.touchId != this.curTouchId && this.curTouchId != -100) return;
                    Laya.Tween.to(this.contorlWheel, {
                        x: 140
                    }, 500);
                    this.originPiont.x = 140;
                }
            }
            contorlAreaOnOver(e) {
                this.curTouchId = e.touchId;
                this.isDown = true;
                var wheelPos = this.contorlArea.globalToLocal(new Laya.Point(Laya.stage.mouseX, Laya.stage.mouseY), false);
                this.wheelRevertTween && Laya.Tween.clear(this.wheelRevertTween);
                this.contorlWheel.pos(wheelPos.x - 75, 26);
                this.originPiont = wheelPos;
                this.touchBox.on(Laya.Event.MOUSE_MOVE, this, this.contorlAreaOnMove);
                this.contorlArea.on(Laya.Event.MOUSE_MOVE, this, this.contorlAreaOnMove);
            }
            contorlAreaOnMove(e) {
                if (e && e.touchId != this.curTouchId && this.curTouchId != -100) return;
                var locationPos = this.contorlArea.globalToLocal(new Laya.Point(Laya.stage.mouseX, Laya.stage.mouseY), false);
                this.contorlDeltaX = locationPos.x - this.originPiont.x;
                if (this.contorlWheel.x + this.contorlDeltaX > 340) this.contorlWheel.x = 340; else if (this.contorlWheel.x + this.contorlDeltaX < -60) this.contorlWheel.x = -60; else this.contorlWheel.x += this.contorlDeltaX;
                this.originPiont = locationPos;
            }
            PCKeyDown(e) {
                if (e["keyCode"] == Laya.Keyboard.A) {
                    this.PCLeft = true;
                }
                if (e["keyCode"] == Laya.Keyboard.D) {
                    this.PCRight = true;
                }
                if (e["keyCode"] == Laya.Keyboard.G) {
                    ActorMgr.Ins.m_selfScript.daddy();
                }
                if (e["keyCode"] == Laya.Keyboard.SPACE) {
                    this.LBBtnOnClick();
                }
                if (e["keyCode"] == Laya.Keyboard.SHIFT) {
                    this.driftBtnTouch();
                }
            }
            PCKeyUpdate() {
                if (this.PCLeft == this.PCRight) EventMgr.Ins.dispatch(EventType.BATTLE_CONTORL, 0); else {
                    if (this.PCLeft) EventMgr.Ins.dispatch(EventType.BATTLE_CONTORL, -1); else EventMgr.Ins.dispatch(EventType.BATTLE_CONTORL, 1);
                }
            }
            PCKeyUp(e) {
                if (e["keyCode"] == Laya.Keyboard.A) {
                    this.PCLeft = false;
                }
                if (e["keyCode"] == Laya.Keyboard.D) {
                    this.PCRight = false;
                }
                if (e["keyCode"] == Laya.Keyboard.SHIFT) {
                    this.driftBtnUnTouch();
                }
            }
            ReadyAni() {
                this.readyImg.visible = false;
                Laya.timer.once(1e3, this, this.changeReadyImg, [4], false);
                Laya.timer.once(2e3, this, this.changeReadyImg, [3], false);
                Laya.timer.once(3e3, this, this.changeReadyImg, [2], false);
                Laya.timer.once(4e3, this, this.changeReadyImg, [1], false);
                Laya.timer.once(4500, this, this.changeReadyImg, [0], false);
            }
            FinishAni() {
                this.readyImg.visible = false;
                Laya.timer.once(50, this, this.changeFinishImg, [5], false);
                Laya.timer.once(1e3, this, this.changeFinishImg, [4], false);
                Laya.timer.once(2e3, this, this.changeFinishImg, [3], false);
                Laya.timer.once(3e3, this, this.changeFinishImg, [2], false);
                Laya.timer.once(4e3, this, this.changeFinishImg, [1], false);
                Laya.timer.once(5e3, this, this.changeFinishImg, [0], false);
            }
            changeReadyImg(leftTime) {
                if (leftTime == 4) {
                    SoundMgr.Ins.CountDown();
                    this.readyImg.visible = true;
                    this.readyImg.skin = "uires/common/s3.png";
                    this.countDownAni.play(0, false);
                }
                if (leftTime == 3) {
                    this.readyImg.skin = "uires/common/s2.png";
                    this.countDownAni.play(0, false);
                }
                if (leftTime == 2) {
                    this.readyImg.skin = "uires/common/s1.png";
                    this.countDownAni.play(0, false);
                }
                if (leftTime == 1) {
                    this.readyImg.skin = "uires/common/GO.png";
                    this.countDownAni.play(0, false);
                    this.startRushBtn.visible = true;
                    this.startRushAni.play(0, false);
                }
                if (leftTime == 0) {
                    this.readyImg.visible = false;
                    this.startTime = Date.now();
                    this.prop1Btn.mouseEnabled = true;
                    this.prop2Btn.mouseEnabled = true;
                }
            }
            changeFinishImg(leftTime) {
                if (leftTime > 0) {
                    this.readyImg.visible = true;
                    this.readyImg.skin = "uires/battle/ds" + leftTime.toString() + ".png";
                    this.countDownAni.play(0, false);
                } else {
                    this.readyImg.visible = false;
                }
            }
            onGetPropMsg() {
                var selfScript = ActorMgr.Ins.m_selfScript;
                if (selfScript.PropItem1 != E_PROP_TYPE.NONE) {
                    var cfg = CCfgMgr.Ins.cfgPropInfo.getItem(selfScript.PropItem1);
                    this.propIcon1.skin = cfg._Icon;
                    if (!this.propIcon1.visible) this.playGetPropAnim(1);
                    this.propIcon1.visible = true;
                    this.m_tipScript1.setDesc(cfg._Desc);
                } else {
                    this.propIcon1.visible = false;
                }
                if (selfScript.PropItem2 != E_PROP_TYPE.NONE) {
                    var cfg = CCfgMgr.Ins.cfgPropInfo.getItem(selfScript.PropItem2);
                    this.propIcon2.skin = cfg._Icon;
                    if (!this.propIcon2.visible) this.playGetPropAnim(2);
                    this.propIcon2.visible = true;
                    this.m_tipScript2.setDesc(cfg._Desc);
                } else {
                    this.propIcon2.visible = false;
                }
            }
            onRaceSecendMsg() {
                this.tipIcon.skin = "uires/battle/di2.png";
                this.tipShow.play(0, false);
            }
            onRaceLastMsg() {
                this.tipIcon.skin = "uires/battle/zuihou.png";
                this.tipShow.play(0, false);
            }
            onRaceRankMsg() {
                this.isGameFinish = true;
                var rank = ActorMgr.Ins.m_selfScript.rankNum;
                this.tipIcon.skin = "uires/battle/pm" + rank.toString() + ".png";
                this.tipShow.play(0, false);
                Laya.timer.once(1e3, this, this.playWinEffect, [rank]);
            }
            onRaceFinishMsg() {
                if (this.isGameFinish) {
                    this.tipIcon.skin = "uires/battle/youxijieshu.png";
                } else {
                    this.tipIcon.skin = "uires/battle/weiwancheng.png";
                    Laya.timer.once(1e3, this, this.playWinEffect, [5]);
                }
                this.tipShow.play(0, false);
            }
            playWinEffect(rank) {
                var winEffectUI = this.winEffectUI;
                winEffectUI.visible = true;
                winEffectUI.changeWord(rank);
                winEffectUI.aniWin.play(0, false);
            }
            onBattleFeatureMsg(prop) {
                this.featureAni.play(0, false);
                this.featureArea.visible = true;
                var cfg = CCfgMgr.Ins.cfgPropInfo.getItem(prop);
                if (cfg) {
                    this.propText.skin = cfg._TextRes;
                    this.propIcon.skin = cfg._Icon;
                    this.showPropAni.play(0, false);
                }
            }
            onBattleFeatureCloseMsg() {
                this.featureArea.visible = false;
            }
            onBattleShowSkillMsg(cfg) {
                this.skillIcon.skin = LoadMgr.Ins.WebResHttp + "skillIcon/" + cfg._SkillIconName + ".png";
                this.skillName.text = cfg._Name;
                this.skillAniRoot.visible = true;
                this.showSkillAni.play(0, false);
            }
            onBattleHoldSkillMsg(cfg) {
                this.skillIcon.skin = LoadMgr.Ins.WebResHttp + "skillIcon/" + cfg._SkillIconName + ".png";
                this.skillName.text = cfg._Name;
                this.skillAniRoot.visible = true;
            }
            onBattleStopSkillMsg(cfg) {
                this.skillAniRoot.visible = false;
            }
            onRaceCoolDownMsg() {
                this.FinishAni();
            }
            onBuffTipMsg(prop) {
                this.buffTipAni.play();
                this.buffTipRoot.visible = true;
                this.setBuffTip(prop);
            }
            setBuffTip(prop) {
                this.buffTipType = prop;
                var buffTipRes = "";
                var buffTipBg = "";
                switch (prop) {
                    case E_PROP_TYPE.NONE:
                        break;

                    case E_PROP_TYPE.ROCKET_LINE:
                        break;

                    case E_PROP_TYPE.ROCKET_FOLLOW:
                        break;

                    case E_PROP_TYPE.ROCKET_FIRST:
                        break;

                    case E_PROP_TYPE.BANANA:
                        break;

                    case E_PROP_TYPE.BOMB:
                        break;

                    case E_PROP_TYPE.THUNDER:
                        break;

                    case E_PROP_TYPE.GHOST:
                        buffTipRes = "uires/battle/caozuofanxiang.png";
                        buffTipBg = "uires/battle/daojutishizidi_h.png";
                        break;

                    case E_PROP_TYPE.FAITH:
                        buffTipRes = "uires/battle/xuanyunjiansu.png";
                        buffTipBg = "uires/battle/daojutishizidi_h.png";
                        break;

                    case E_PROP_TYPE.SHIELD:
                        buffTipRes = "uires/battle/hudunchixu.png";
                        buffTipBg = "uires/battle/daojutishizidi.png";
                        break;

                    case E_PROP_TYPE.STAR:
                        buffTipRes = "uires/battle/wudichixu.png";
                        buffTipBg = "uires/battle/daojutishizidi.png";
                        break;

                    case E_PROP_TYPE.NOS:
                        break;

                    default:
                        break;
                }
                this.buffTipIcon.skin = buffTipRes;
                this.buffTipRoot.skin = buffTipBg;
            }
            onCloseBuffTipMsg(prop) {
                if (prop == this.buffTipType) {
                    this.buffTipRoot.visible = false;
                    this.buffTipAni.stop();
                }
            }
            onStartRocketWarning() {
                this.warningTime = 10;
                if (this.warning.visible) {
                    return;
                }
                this.warning.visible = true;
                this.warning.play(15, true);
            }
            onCountDownMsg() {
                this.ReadyAni();
            }
            onStopRocketWarning() {
                this.warning.visible = false;
            }
            onDriftOverMsg(score) {
                if (score < 0) {
                    return;
                }
                var skinRes = "";
                var passScore = .85;
                var buffCfg = DataMgr.Ins.getConstellationBuff();
                if (buffCfg) {
                    if (buffCfg.buffType == E_BUFF_TYPE.DRIFT_SCORE_BUFF) passScore -= buffCfg.buffValue / 100;
                }
                if (score < .5) {
                    skinRes = "uires/battle/Font_Normal.png";
                } else if (score < passScore) {
                    skinRes = "uires/battle/Font_Good.png";
                } else {
                    skinRes = "uires/battle/Font_Perfect.png";
                }
                this.startRushTip.visible = true;
                this.startRushTip.mainTex.skin = skinRes;
                this.startRushTip.ani1.play(0, false);
            }
            driftBtnTouch() {
                EventMgr.Ins.dispatch(EventType.START_DRIFT);
            }
            driftBtnUnTouch() {
                EventMgr.Ins.dispatch(EventType.STOP_DRIFT);
            }
            prop1BtnOnClick() {
                var selfScript = ActorMgr.Ins.m_selfScript;
                if (selfScript.PropItem1 != E_PROP_TYPE.NONE) {
                    this.propIcon1.visible = false;
                    this.m_tipScript1.clearDesc();
                    EventMgr.Ins.dispatch(EventType.USEPROP1MSG);
                }
            }
            prop2BtnOnClick() {
                var selfScript = ActorMgr.Ins.m_selfScript;
                if (selfScript.PropItem2 != E_PROP_TYPE.NONE) {
                    this.propIcon2.visible = false;
                    this.m_tipScript2.clearDesc();
                    EventMgr.Ins.dispatch(EventType.USEPROP2MSG);
                }
            }
            LBBtnOnClick() {
                EventMgr.Ins.dispatch(EventType.USELB);
            }
            startRushBtnOnClick() {
                if (this.startRushAni.index >= 26) {
                    var rushScore = this.startRushAni.index;
                    var buffCfg = DataMgr.Ins.getConstellationBuff();
                    if (buffCfg) {
                        if (buffCfg.buffType == E_BUFF_TYPE.RUSH_BUFF) {
                            if (rushScore > 36 - buffCfg.buffValue / 2 && rushScore < 40 + buffCfg.buffValue / 2) {
                                rushScore = 38;
                            }
                        }
                    }
                    if (rushScore >= 36 && rushScore <= 40) {
                        this.startRushTip.visible = true;
                        this.startRushTip.mainTex.skin = "uires/battle/Font_Perfect.png";
                        this.startRushTip.ani1.play(0, false);
                    } else {
                        this.startRushTip.visible = true;
                        this.startRushTip.mainTex.skin = "uires/battle/Font_Normal.png";
                        this.startRushTip.ani1.play(0, false);
                    }
                    EventMgr.Ins.dispatch(EventType.STARTRUSH, rushScore);
                    this.startRushBtn.visible = false;
                }
            }
            startRushAniComplete() {
                this.startRushBtn.visible = false;
            }
            startRushAniMax() {
                if (GameMgr.Ins.isGuideGame) {
                    GameMgr.Ins.rushGuide();
                    this.startRushAni.stop();
                }
            }
            setLBPro(value) {
                if (value > 0) {
                    this.LBWhiteMask.width = 308 * value * .01;
                    if (this.LBWhiteMask.width > this.LBSkillMask.width + 5) {
                        var add = Math.floor((this.LBWhiteMask.width - this.LBSkillMask.width) / 10);
                        this.LBSkillMask.width += add < 1 ? 1 : add;
                    } else this.LBSkillMask.width = 308 * value * .01;
                    this.proEffect.x = 308 * value * .01;
                    this.proEffectMask.x = -308 * value * .01;
                } else {
                    this.LBWhiteMask.width = 1;
                    this.LBSkillMask.width = 1;
                    this.proEffect.x = 0;
                    this.proEffectMask.x = 0;
                }
                if (value >= 100) this.openLBBtn(); else this.closeLBBtn();
            }
            openLBBtn() {
                if (!this.isLBOpen) {
                    this.LBLightAni.visible = true;
                    this.LBLightAni.play(0, false);
                    this.lbProFull.visible = true;
                    this.lbProFull.play(0, false);
                    this.lbProFull.on(Laya.Event.COMPLETE, this, () => {
                        this.lbProFull.play(15, true);
                    });
                    this.LBBtn.gray = false;
                    this.LBBtn.mouseEnabled = true;
                    this.isLBOpen = true;
                }
            }
            closeLBBtn() {
                this.LBBtn.gray = true;
                this.LBBtn.mouseEnabled = false;
                this.lbProFull.visible = false;
                this.LBLightAni.visible = false;
                this.isLBOpen = false;
            }
            playRankAni(from, to) {
                this.toRank.visible = true;
                this.fromRank.visible = true;
                this.ranklight.visible = true;
                this.fromRank.skin = "uires/battle/rank" + from.toString() + ".png";
                this.toRank.skin = "uires/battle/rank" + to.toString() + ".png";
                this.ranklight.skin = "uires/battle/rank" + to.toString() + "W.png";
                this.rankChangeAni.play(0, false);
            }
            setRank(to) {
                this.toRank.visible = true;
                this.fromRank.visible = false;
                this.ranklight.visible = false;
                this.toRank.skin = "uires/battle/rank" + to.toString() + ".png";
            }
            getRndPropAnim() {
                Laya.timer.clearAll(this);
                let time = 0;
                this.rndPropImg.visible = true;
                this.rndPropImg.pos(this.initPos.x, this.initPos.y);
                Laya.timer.loop(200, this, () => {
                    time += 200;
                    let rndIndex = Math.floor(9 * Math.random() * 2 * Math.random()) % 7;
                    this.rndPropImg.skin = this.propSkinList[rndIndex];
                    this.rndPropImg.scale(1.2, 1.2);
                    var selfScript = ActorMgr.Ins.m_selfScript;
                    if (time >= 1600) {
                        var cfg = CCfgMgr.Ins.cfgPropInfo.getItem(selfScript.PropItem1);
                        this.rndPropImg.skin = cfg._Icon;
                    }
                    Laya.Tween.to(this.rndPropImg, {
                        scaleX: 1.5,
                        scaleY: 1.5
                    }, 180, null, Laya.Handler.create(this, () => {
                        if (time >= 1600) {
                            Laya.timer.clearAll(this);
                            Laya.Tween.to(this.rndPropImg, {
                                x: this.prop1Btn.x,
                                y: this.prop1Btn.y,
                                scaleX: 1,
                                scaleY: 1
                            }, 400, null, Laya.Handler.create(this, () => {
                                Laya.timer.once(100, this, () => {
                                    this.rndPropImg.visible = false;
                                    this.getprop();
                                });
                            }));
                        }
                    }));
                });
            }
            getprop() {
                var selfScript = ActorMgr.Ins.m_selfScript;
                if (selfScript.PropItem1 != E_PROP_TYPE.NONE) {
                    this.propIcon1.visible = true;
                    var cfg = CCfgMgr.Ins.cfgPropInfo.getItem(selfScript.PropItem1);
                    this.propIcon1.skin = cfg._Icon;
                    this.m_tipScript1.setDesc(cfg._Desc);
                } else {
                    this.propIcon1.visible = false;
                }
                if (selfScript.PropItem2 != E_PROP_TYPE.NONE) {
                    this.propIcon2.visible = true;
                    var cfg = CCfgMgr.Ins.cfgPropInfo.getItem(selfScript.PropItem2);
                    this.propIcon2.skin = cfg._Icon;
                    this.m_tipScript2.setDesc(cfg._Desc);
                } else {
                    this.propIcon2.visible = false;
                }
            }
            playGetPropAnim(index) {
                this.stopIntervalPropAnim();
                let propIcon = index == 1 ? this.propIcon1 : this.propIcon2;
                let prop_mask = index == 1 ? this.prop1_mask : this.prop2_mask;
                let whiteBg = index == 1 ? this.whiteBg1 : this.whiteBg2;
                Laya.Tween.to(propIcon, {
                    scaleX: 1.5,
                    scaleY: 1.5
                }, 160, null, Laya.Handler.create(this, () => {
                    Laya.Tween.to(propIcon, {
                        scaleX: 1,
                        scaleY: 1
                    }, 160, null, Laya.Handler.create(this, () => {
                        this.startIntervalPropAnim();
                    }));
                }));
                prop_mask.skin = propIcon.skin;
                whiteBg.visible = true;
                Laya.Tween.to(prop_mask, {
                    scaleX: 1.5,
                    scaleY: 1.5
                }, 160, null, Laya.Handler.create(this, () => {
                    Laya.Tween.to(prop_mask, {
                        scaleX: 1,
                        scaleY: 1
                    }, 160, null, Laya.Handler.create(this, () => {
                        whiteBg.visible = false;
                    }));
                }));
            }
            PlayIntervalPropAnim(item) {
                Laya.Tween.to(item, {
                    scaleX: .9
                }, 240, null, Laya.Handler.create(this, () => {
                    Laya.Tween.to(item, {
                        scaleX: 1
                    }, 240, null, Laya.Handler.create(this, () => { }));
                }));
                Laya.Tween.to(item, {
                    scaleY: 1.2
                }, 120, null, Laya.Handler.create(this, () => {
                    Laya.Tween.to(item, {
                        scaleY: 1
                    }, 120, null, Laya.Handler.create(this, () => {
                        Laya.Tween.to(item, {
                            scaleY: 1.15
                        }, 160, null, Laya.Handler.create(this, () => {
                            Laya.Tween.to(item, {
                                scaleY: 1
                            }, 120, null, Laya.Handler.create(this, () => { }));
                        }));
                    }));
                }));
            }
            startIntervalPropAnim() {
                Laya.timer.loop(3e3, this.prop1Btn, () => {
                    var selfScript = ActorMgr.Ins.m_selfScript;
                    if (selfScript.PropItem1 != E_PROP_TYPE.NONE) {
                        this.PlayIntervalPropAnim(this.propIcon1);
                    }
                    if (selfScript.PropItem2 != E_PROP_TYPE.NONE) {
                        this.PlayIntervalPropAnim(this.propIcon2);
                    }
                });
            }
            stopIntervalPropAnim() {
                Laya.timer.clearAll(this.prop1Btn);
            }
            refreshNativeItem() {
                this.nativeItem.visible = false;
                PlatformMgr.Ins.initNativeIconAd(data => {
                    this.nativeItem.visible = true;
                    let ad = data.adList;
                    if (ad[0].iconUrlList && ad[0].iconUrlList.length) {
                        this.iconBannerImg.skin = ad[0].iconUrlList[0];
                    }
                });
            }
        }
        class MiniMapUI extends ui.UIScenes.commonUI.MiniMapUI {
            constructor() {
                super();
            }
            onOpened() { }
            initMap() {
                var levelID = DataMgr.Ins.currTrackId;
                this.mapBg.skin = LoadMgr.Ins.WebResHttp + "minimap/level" + levelID.toString() + ".png";
                var cfg = CCfgMgr.Ins.cfgTrack.getItem(levelID);
                this.mapWidth = cfg.mapWidth;
                this.mapHeight = cfg.mapHeight;
                this.zeroX = cfg.zeroX;
                this.zeroY = cfg.zeroY;
                this.p0.visible = false;
                this.p1.visible = false;
                this.p2.visible = false;
                this.p3.visible = false;
                Laya.timer.frameLoop(2, this, this.renderMap);
            }
            renderMap() {
                var actorList = ActorMgr.Ins.m_AllScripts;
                for (var i = 0; i < actorList.length; i++) {
                    var npc = actorList[i];
                    var pos = npc.m_sprite3D.transform.position;
                    var mapX = (this.zeroX - pos.x) / this.mapWidth * this.mapBg.width - 11.5;
                    var mapY = (this.zeroY - pos.z) / this.mapHeight * this.mapBg.height - 12.5;
                    var pIcon = this["p" + i.toString()];
                    if (pIcon) {
                        pIcon.visible = true;
                        pIcon.skin = "uires/battle/ditu_hong.png";
                        pIcon.pos(mapX, mapY);
                        pIcon.zOrder = 1;
                        if (npc.isSelf) {
                            pIcon.skin = "uires/battle/ditu_huang.png";
                            pIcon.zOrder = 2;
                            var bgX = -mapX + 76;
                            var bgY = -mapY + 75;
                            if (bgX > 14) bgX = 14;
                            if (bgY > 15) bgY = 15;
                            if (bgX < 166 - this.mapBg.width) bgX = 166 - this.mapBg.width;
                            if (bgY < 165 - this.mapBg.height) bgY = 165 - this.mapBg.height;
                            this.mapBg.pos(bgX, bgY);
                        }
                    }
                }
            }
            onClosed() {
                Laya.timer.clearAll(this);
            }
        }
        var E_WINEFFECT_WORD;
        (function (E_WINEFFECT_WORD) {
            E_WINEFFECT_WORD[E_WINEFFECT_WORD["YJJC"] = 1] = "YJJC";
            E_WINEFFECT_WORD[E_WINEFFECT_WORD["JSXF"] = 2] = "JSXF";
            E_WINEFFECT_WORD[E_WINEFFECT_WORD["FCDC"] = 3] = "FCDC";
            E_WINEFFECT_WORD[E_WINEFFECT_WORD["JYCQ"] = 4] = "JYCQ";
            E_WINEFFECT_WORD[E_WINEFFECT_WORD["ZJZL"] = 5] = "ZJZL";
        })(E_WINEFFECT_WORD || (E_WINEFFECT_WORD = {}));
        class WinEffectUI extends ui.UIScenes.commonUI.winEffectUI {
            onOpened() {
                this.x = (Laya.stage.width - 1280) / 2;
            }
            changeWord(word) {
                for (var i = 0; i < this.numChildren; i++) {
                    var wordSprite = this.getChildAt(i);
                    var len = wordSprite.skin.length;
                    var wordID = wordSprite.skin[len - 8];
                    wordSprite.skin = wordSprite.skin.replace(wordID, word.toString());
                }
            }
        }
        const ZOOM_RATIO = .96;
        class WarningScript extends Laya.Script {
            constructor() {
                super(...arguments);
                this.tmp2 = new Laya.Vector3();
                this.tmp3 = new Laya.Vector4();
            }
            onUpdate() {
                var Sc = ActorMgr.Ins.m_selfScript;
                if (Sc) {
                    this.tmp2.x = Sc.m_selfP.transform.position.x;
                    this.tmp2.y = Sc.m_selfP.transform.position.y;
                    this.tmp2.z = Sc.m_selfP.transform.position.z;
                    var mCamera = Sc.mCamera;
                    var fov = Sc.mCamera.fieldOfView;
                    var warning = this.owner;
                    warning.x = this.tmp3.x;
                    warning.y = this.tmp3.y;
                    warning.scaleX = (100 - fov) / 40 * .5 + .5;
                    warning.scaleY = (100 - fov) / 40 * .5 + .5;
                    mCamera.worldToViewportPoint(this.tmp2, this.tmp3);
                }
            }
        }
        class CarExpireUI extends ui.UIScenes.commonUI.CarExpireUI {
            constructor() {
                super();
                this.carId = 0;
                this.scaleX = this.scaleY = GlobalScale$1.scale;
                this.width = Laya.stage.width / GlobalScale$1.scale;
                this.height = Laya.stage.height / GlobalScale$1.scale;
                this.closeBtn.on(Laya.Event.CLICK, this, this.closeBtnClick);
                this.videoBtn.on(Laya.Event.CLICK, this, this.videoBtnClick);
            }
            onAwake() { }
            onOpened(carId) {
                let banner;
                let left = 50;
                let bottom = 0;
                let width = 300;

                this.carId = carId;
                let skin = CCfgMgr.Ins.cfgRacing.getItem(carId)._RacingIconName[0];
                this.img_car.skin = LoadMgr.Ins.WebResHttp + `carIcon/${skin}.png`;
                if (PlatformMgr.Ins.platform == E_PLATFORM_TYPE.TT) PlatformMgr.Ins.initNativeAd(E_UI_TYPE.CAREXPIRE);
            }
            videoBtnClick() {
                //激励广告
                showReward(() => {
                    let car = DataMgr.Ins.getCar(this.carId);
                    if (car.isLock) {
                        if (car.isOpenVideoBuy) {
                            car.isLock = false;
                            DataMgr.Ins.setCurrSelectCar(this.carId);
                        }
                    }
                    this.close();
                });

            }
            closeBtnClick() {
                SoundMgr.Ins.Press();
                PlatformMgr.Ins.closeNativeAd();
                this.close();
            }
            onClosed() {

            }
        }
        class ClothesBoxScript extends Laya.Script {
            constructor() {
                super();
                this.isInitData = false;
            }
            initData(data) {
                this.currClothesData = data;
                this.isInitData = true;
                this.hairName = this.owner.getChildByName("hairName");
                this.buyNum = this.owner.getChildByName("buyNum");
                this.hairPic = this.owner.getChildByName("hairPic");
                this.iconList = this.owner.getChildByName("iconList");
                this.previewBtn = this.owner.getChildByName("previewBtn");
                this.duiHaoImage = this.owner.getChildByName("duiHaoImage");
                this.selectImag = this.owner.getChildByName("selectImag");
                this.buyNumDi = this.owner.getChildByName("bunNumDi");
                this.hasImage = this.owner.getChildByName("hasImage");
                this.canBuyImage = this.owner.getChildByName("canBuyImage");
                this.redTip = this.owner.getChildByName("redTip");
                this.previewBtn.on(Laya.Event.CLICK, this, this.previewBtnClick);
                this.refreshData(data);
            }
            refreshData(data) {
                this.currClothesData = data;
                this.hairName.text = data.getBaseNature()._Name;
                this.canBuyImage.visible = false;
                if (data.isLock) {
                    this.buyNumDi.skin = "uires/role2/landi.png";
                    let currType = data.getBaseNature().unLockType;
                    let str = "";
                    let num = data.getBaseNature().unLockNeedNum;
                    if (currType == E_UNLOCKCHA_TYPE.AD) {
                        str = "X";
                        num = data.getBaseNature().unLockNeedNum - data.videoAdNum;
                    }
                    if (currType == E_UNLOCKCHA_TYPE.SIGNIN) {
                        this.buyNumDi.skin = "uires/role2/zidi.png";
                        this.buyNum.text = "";
                    } else if (currType == E_UNLOCKCHA_TYPE.GIFT) {
                        this.buyNumDi.skin = "uires/role2/zidi.png";
                        this.buyNum.text = "";
                    } else if (currType == E_UNLOCKCHA_TYPE.LIMITCLOTHES) {
                        this.buyNumDi.skin = "uires/role2/zidi.png";
                        this.buyNum.text = "";
                    } else if (currType == E_UNLOCKCHA_TYPE.ZHUANPAN) {
                        this.buyNumDi.skin = "uires/role2/zidi.png";
                        this.buyNum.text = "";
                    } else if (currType == E_UNLOCKCHA_TYPE.LIMITGIFT) {
                        this.buyNumDi.skin = "uires/role2/zidi.png";
                        this.buyNum.text = "";
                    } else {
                        this.buyNum.text = str + num;
                    }
                    this.iconList.visible = true;
                    this.refreshIconList(data);
                    this.buyNumDi.visible = true;
                    this.buyNum.visible = true;
                    this.hasImage.visible = false;
                    switch (this.currClothesData.getBaseNature().unLockType) {
                        case E_UNLOCKCHA_TYPE.DIAMOND:
                            if (DataMgr.Ins.diamon >= this.currClothesData.getBaseNature().unLockNeedNum) {
                                this.canBuyImage.visible = true;
                            }
                            break;

                        case E_UNLOCKCHA_TYPE.GOLD:
                            if (DataMgr.Ins.gold >= this.currClothesData.getBaseNature().unLockNeedNum) {
                                this.canBuyImage.visible = true;
                            }
                            break;
                    }
                } else {
                    this.buyNumDi.visible = false;
                    this.buyNum.visible = false;
                    this.iconList.visible = false;
                    this.hasImage.visible = true;
                    if ((this.currClothesData.getBaseNature().unLockType == E_UNLOCKCHA_TYPE.SIGNIN || this.currClothesData.getBaseNature().unLockType == E_UNLOCKCHA_TYPE.GIFT) && !this.currClothesData.isWeared) {
                        this.redTip.visible = true;
                    } else {
                        this.redTip.visible = false;
                    }
                }
                if (DataMgr.Ins.getCurrSelectClothes(data.getBaseNature().part) && DataMgr.Ins.getCurrSelectClothes(data.getBaseNature().part).id == data.id) {
                    this.duiHaoImage.visible = true;
                } else {
                    this.duiHaoImage.visible = false;
                }
                this.hairPic.skin = LoadMgr.Ins.WebResHttp + "clothesIcon/clothes_" + data.getBaseNature().picId + ".png";
                let list = DataMgr.Ins.currPlayerSex == 0 ? Driver2UI.Ins.currPreViewMenClothList : Driver2UI.Ins.currPreViewWomenClothList;
                if (list[data.getBaseNature().part] && list[data.getBaseNature().part].id == data.id) {
                    this.selectImag.visible = true;
                    this.previewBtn.skin = "uires/role2/xuanzhongdi.png";
                    Driver2UI.Ins.currClothesData = this.currClothesData;
                    Driver2UI.Ins.refreshBuyBtn();
                } else {
                    this.selectImag.visible = false;
                    this.previewBtn.skin = "uires/garage2/chedikuang.png";
                }
            }
            refreshIconList(data) {
                for (let i = 0; i < 8; i++) {
                    this.iconList.getChildAt(i).visible = false;
                }
                this.iconList.getChildAt(data.getBaseNature().unLockType - 1).visible = true;
            }
            buyHair() {
                if (!this.currClothesData.getBaseNature()) return;
                let price = this.currClothesData.getBaseNature().unLockNeedNum;
                switch (this.currClothesData.getBaseNature().unLockType) {
                    case E_UNLOCKCHA_TYPE.DIAMOND:
                        if (DataMgr.Ins.diamon >= price) {
                            this.currClothesData.isLock = false;
                            DataMgr.Ins.addDiamon(-price);
                            DataMgr.Ins.SavePlayerData();
                        }
                        break;

                    case E_UNLOCKCHA_TYPE.GOLD:
                        if (DataMgr.Ins.gold >= price) {
                            this.currClothesData.isLock = false;
                            DataMgr.Ins.addGold(-price);
                            DataMgr.Ins.SavePlayerData();
                        }
                        break;

                    case E_UNLOCKCHA_TYPE.AD:
                        this.currClothesData.videoAdNum++;
                        if (this.currClothesData.videoAdNum >= price) {
                            this.currClothesData.isLock = false;
                        }
                        DataMgr.Ins.SavePlayerData();
                        break;
                }
                Driver2UI.Ins.goldLa.value = DataMgr.Ins.gold.toFixed(0);
                Driver2UI.Ins.diamonLa.value = DataMgr.Ins.diamon.toFixed(0);
                this.refreshData(this.currClothesData);
            }
            useHair() {
                for (let part = DataMgr.Ins.getCurrSelectClothes(this.currClothesData.getBaseNature().part); part; part = null) {
                    if (part.id == this.currClothesData.id) return;
                }
                DataMgr.Ins.setCurrSelectClothes(this.currClothesData.id, this.currClothesData.getBaseNature().part);
                DataMgr.Ins.SavePlayerData();
                Driver2UI.Ins.clothesList.refresh();
                Driver2UI.Ins.load3DScene();
            }
            previewBtnClick() {
                SoundMgr.Ins.Press();
                if (PlatformMgr.Ins.platform == E_PLATFORM_TYPE.TT) {
                    DataMgr.Ins.driveClickNum++;
                    if (DataMgr.Ins.driveClickNum >= PlatformMgr.Ins._gameConfig.popInsertChaClickNum) {
                        DataMgr.Ins.driveClickNum = 0;
                        PlatformMgr.Ins.showInsert();
                    }
                }
                let oldId = Driver2UI.Ins.getPreViewCloth(this.currClothesData.getBaseNature().part) ? Driver2UI.Ins.getPreViewCloth(this.currClothesData.getBaseNature().part).id : 0;
                Driver2UI.Ins.setPreViewClothList(this.currClothesData);
                Driver2UI.Ins.currClothesData = this.currClothesData;
                Driver2UI.Ins.refreshBuyBtn();
                if (!this.currClothesData.isLock) {
                    DataMgr.Ins.getClothes(this.currClothesData.id).isWeared = true;
                    if (!DataMgr.Ins.getCurrSelectClothes(this.currClothesData.getBaseNature().part) || DataMgr.Ins.getCurrSelectClothes(this.currClothesData.getBaseNature().part).id != this.currClothesData.id) {
                        DataMgr.Ins.setCurrSelectClothes(this.currClothesData.id, this.currClothesData.getBaseNature().part);
                        DataMgr.Ins.SavePlayerData();
                    }
                }
                if (oldId == 0 || oldId != this.currClothesData.id) {
                    Driver2UI.Ins.load3DScene();
                }
                Driver2UI.Ins.clothesList.refresh();
            }
        }
        class Driver2UI extends ui.UIScenes.commonUI.Driver2UI {
            constructor() {
                super();
                this.partBtnList = [];
                this.currSelectTypeId = 0;
                this.initPart = 0;
                this.currClothesList = [];
                this.isOpening = false;
                this.lastX = 0;
                this.currPreViewMenClothList = [null, null, null, null];
                this.currPreViewWomenClothList = [null, null, null, null];
                EventMgr.Ins.on(EventType.HTICONHIDE, this, () => {
                    this.htItem.visible = false;
                });
                EventMgr.Ins.on(EventType.REFRESH_GOLD, this, this.refreshRes);
                EventMgr.Ins.on(EventType.REFRESH_DIAMON, this, this.refreshRes);
                this.hairBtn.on(Laya.Event.CLICK, this, () => {
                    this.changePartBtnClick(0);
                });
                this.hatBtn.on(Laya.Event.CLICK, this, () => {
                    this.changePartBtnClick(1);
                });
                this.clothesBtn.on(Laya.Event.CLICK, this, () => {
                    this.changePartBtnClick(2);
                });
                this.wingBtn.on(Laya.Event.CLICK, this, () => {
                    this.changePartBtnClick(3);
                });
                this.backBtn.on(Laya.Event.CLICK, this, this.backBtnOnClick);
                this.changeManBtn.on(Laya.Event.CLICK, this, () => {
                    this.changeSex(0);
                });
                this.changeWomanBtn.on(Laya.Event.CLICK, this, () => {
                    this.changeSex(1);
                });
                this.buyBtn.on(Laya.Event.CLICK, this, this.buyBtnClick);
                this.takeoffBtn.on(Laya.Event.CLICK, this, this.takeoffBtnClick);
                this.touchBox.on(Laya.Event.MOUSE_DOWN, this, this.mouseDown);
                this.touchBox.on(Laya.Event.MOUSE_MOVE, this, this.mouseMove);
                this.touchBox.on(Laya.Event.MOUSE_OUT, this, this.mouseUp);
                this.touchBox.on(Laya.Event.MOUSE_UP, this, this.mouseUp);
                this.goldTipBtn.on(Laya.Event.CLICK, this, () => {
                    UIManager.Ins.getScene(E_UI_TYPE.VIDEO_COIN).open(false);
                });
                this.dmdTipBtn.on(Laya.Event.CLICK, this, () => {
                    UIManager.Ins.getScene(E_UI_TYPE.LUCKY_PAN).open(false);
                });
                this.scaleX = this.scaleY = GlobalScale$1.scale;
                this.width = Laya.stage.width / GlobalScale$1.scale;
                this.height = Laya.stage.height / GlobalScale$1.scale;
                this.partBtnList.push(this.hairBtn);
                this.partBtnList.push(this.hatBtn);
                this.partBtnList.push(this.clothesBtn);
                this.partBtnList.push(this.wingBtn);
                Driver2UI.Ins = this;
                if (this.width / this.height > 1.78) {
                    this.zongBox.x = (this.width - 1280) / 2;
                    this.bg.x = 0;
                    this.chaPosBox.x += (this.width - 1280) / 2;
                    this.dipan.x += (this.width - 1280) / 2;
                } else {
                    this.zongBox.x = 0;
                    this.bg.x = -160;
                }
                this.buyBtn.addComponent(BtnScript).initBtn(E_BtnType.SCALE);
            }
            onAwake() { }
            onOpened(part) {
                PlatformMgr.Ins.canShowBanner = true;
                this.isOpening = true;
                this.loadingImage.play(0, true);
                this.scaleX = this.scaleY = GlobalScale$1.scale;
                this.width = Laya.stage.width / GlobalScale$1.scale;
                this.height = Laya.stage.height / GlobalScale$1.scale;
                this.clothesList.renderHandler = new Laya.Handler(this, this.updateClothesList);
                if (part != undefined) this.initPart = part; else this.initPart = 0;
                this.changePartBtnClick(1);
                this.buyBtn.visible = false;
                this.playOpenAni();
                this.goldLa.value = DataMgr.Ins.gold.toFixed(0);
                this.diamonLa.value = DataMgr.Ins.diamon.toFixed(0);
                for (let i = 0; i < 4; i++) {
                    this.currPreViewMenClothList[i] = DataMgr.Ins.currSelectMenClothesList[i];
                    this.currPreViewWomenClothList[i] = DataMgr.Ins.currSelectWomenClothesList[i];
                }
                this.load3DScene();
                this.refreshRedTipCar();
                this.htItem.visible = true;
                this.refreshHtItem();
                Laya.timer.loop(2e3, this, () => {
                    if (PlatformMgr.Ins.htBoxIconList && PlatformMgr.Ins.htBoxIconList[0] && PlatformMgr.Ins.htBoxIconList[0][DataMgr.Ins.currHtIndex]) {
                        DataMgr.Ins.currHtIndex++;
                        if (DataMgr.Ins.currHtIndex >= PlatformMgr.Ins.htBoxIconList[0].length) {
                            DataMgr.Ins.currHtIndex = 0;
                        }
                        this.refreshHtItem();
                    }
                });
                PlatformMgr.Ins.initNativeAd(E_UI_TYPE.DRIVERUI);

                let banner;
                let left = 0;
                let bottom = 0;
                let width = 300;

                PrivateTracker_new.Ins.sendEvent(SDK_EVENT._打开背包界面, {
                    "_打开背包界面": "_打开背包界面"
                });
            }
            onClosed() {
                Laya.timer.clearAll(this);
                Laya.Tween.clearAll(this);
                this.isOpening = false;
                PlatformMgr.Ins.closeNativeAd();


            }
            refreshRes() {
                this.goldLa.value = DataMgr.Ins.gold.toFixed(0);
                this.diamonLa.value = DataMgr.Ins.diamon.toFixed(0);
            }
            playOpenAni() {
                this.leftBgMask.height = 46;
                for (let i = 0; i < 4; i++) {
                    this.partBtnList[i].scale(0, 0);
                }
                Laya.Tween.to(this.leftBgMask, {
                    height: 588
                }, 350, null, Laya.Handler.create(this, () => { }));
                Laya.timer.once(60, this, () => {
                    for (let i = 0; i < 4; i++) {
                        Laya.timer.once(80 * i, this, () => {
                            Laya.Tween.to(this.partBtnList[i], {
                                scaleX: 1,
                                scaleY: 1
                            }, 200, null, Laya.Handler.create(this, () => { }));
                        });
                    }
                });
            }
            playCloseAni() { }
            changePartBtnClick(index) {
                SoundMgr.Ins.Press();
                let list = [];
                for (let i = 0; i < DataMgr.Ins.clothesList.length; i++) {
                    let baseNature = DataMgr.Ins.clothesList[i].getBaseNature();
                    if (baseNature.part == index && (baseNature.sex == DataMgr.Ins.currPlayerSex || baseNature.sex == 2)) {
                        list.push(DataMgr.Ins.clothesList[i]);
                    }
                }
                this.currClothesList = list;
                this.clothesList.dataSource = this.currClothesList;
                this.clothesList.repeatX = 2;
                this.clothesList.refresh();
                this.clothesList.tweenTo(0, 0);
                for (let i = 0; i < this.partBtnList.length; i++) {
                    if (i == index) {
                        this.partBtnList[i].getChildAt(0).visible = true;
                        this.partBtnList[i].getChildAt(1).visible = false;
                    } else {
                        this.partBtnList[i].getChildAt(0).visible = false;
                        this.partBtnList[i].getChildAt(1).visible = true;
                    }
                }
                this.currSelectTypeId = index;
                this.refreshChangeSexBtn();
            }
            refreshUI() { }
            backBtnOnClick() {
                SoundMgr.Ins.Press();
                this.close();
                SceneMgr.Ins.clearUIScene();
                if (DataMgr.Ins.driverToUIid == E_UI_TYPE.MULTIRACE) UIManager.Ins.getScene(DataMgr.Ins.driverToUIid).open(true, DataMgr.Ins.driverToUIMode); else UIManager.Ins.getScene(DataMgr.Ins.driverToUIid).open(true, new PassStartParme(true, false));
                DataMgr.Ins.driverToUIid = E_UI_TYPE.STARTUI;
            }
            useBtnOnClick() { }
            settingBtnOnClick() {
                SoundMgr.Ins.Press();
                Laya.stage.addChild(UIManager.Ins.getScene(E_UI_TYPE.PROFILE));
            }
            garageBtnOnClick() {
                SoundMgr.Ins.Press();
                SceneMgr.Ins.clearUIScene();
                UIManager.Ins.getScene(E_UI_TYPE.GARAGEUI).open();
            }
            updateClothesList(item, idx) {
                let data = this.currClothesList[idx];
                let script = item.getComponent(ClothesBoxScript);
                if (script.isInitData) {
                    script.refreshData(data);
                } else {
                    script.initData(data);
                }
            }
            changeSex(index) {
                DataMgr.Ins.currPlayerSex = index;
                DataMgr.Ins.SavePlayerData();
                this.changePartBtnClick(this.currSelectTypeId);
                this.load3DScene();
            }
            refreshChangeSexBtn() {
                if (DataMgr.Ins.currPlayerSex == 0) {
                    this.changeWomanBtn.alpha = .5;
                    this.changeManBtn.alpha = 1;
                    this.changeWomanBtn.scale(1, 1);
                    this.changeManBtn.scale(1.2, 1.2);
                } else {
                    this.changeManBtn.alpha = .5;
                    this.changeWomanBtn.alpha = 1;
                    this.changeManBtn.scale(1, 1);
                    this.changeWomanBtn.scale(1.2, 1.2);
                }
            }
            load3DScene() {
                this.loadingImage.visible = true;
                let list = DataMgr.Ins.currPlayerSex == 0 ? this.currPreViewMenClothList : this.currPreViewWomenClothList;
                var WingCfg = list[3] ? list[3].getBaseNature() : null;
                var HairCfg = list[0] ? list[0].getBaseNature() : null;
                var rndChaCfg = list[2] ? list[2].getBaseNature() : null;
                var HatCfg = list[1] ? list[1].getBaseNature() : null;
                let urlList = [];
                if (rndChaCfg) urlList.push(LoadMgr.Ins.unityResPath(E_UNITY_RES_PATH.CHA, "Cha_" + rndChaCfg.assetId.toString() + ".lh"));
                if (WingCfg) urlList.push(LoadMgr.Ins.unityResPath(E_UNITY_RES_PATH.CHA, "wing_" + WingCfg.assetId.toString() + ".lh"));
                if (HairCfg) urlList.push(LoadMgr.Ins.unityResPath(E_UNITY_RES_PATH.CHA, "hair_" + HairCfg.assetId.toString() + ".lh"));
                if (HatCfg) urlList.push(LoadMgr.Ins.unityResPath(E_UNITY_RES_PATH.CHA, "hat_" + HatCfg.assetId.toString() + ".lh"));
                LoadMgr.Ins.loadAsset(() => {
                    this.load3DScene1(rndChaCfg, HatCfg, HairCfg, WingCfg);
                }, urlList);
            }
            load3DScene1(rndChaCfg, HatCfg, HairCfg, WingCfg) {
                let list1 = [HairCfg, HatCfg, rndChaCfg, WingCfg];
                let list = DataMgr.Ins.currPlayerSex == 0 ? this.currPreViewMenClothList : this.currPreViewWomenClothList;
                for (let i = 0; i < 4; i++) {
                    if (list1[i] == list[i] || list[i] && list[i].getBaseNature() == list1[i]) { } else {
                        return;
                    }
                }
                if (!this.isOpening) return;
                if (this.currCarModel) {
                    this.currCarModel.destroy();
                }
                this.loadingImage.visible = false;
                var url = LoadMgr.Ins.unityResPath(E_UNITY_RES_PATH.CHA, "Cha_" + rndChaCfg.assetId.toString() + ".lh");
                var Cha = SceneMgr.Ins.createUIVFX(url, this.chaPosBox.x, this.chaPosBox.y, 3.2, 60, this.driverParent);
                if (!Cha) return;
                if (Laya.stage.width / Laya.stage.height > 1.78) Cha.transform.rotationEuler = new Laya.Vector3(0, 15, 0); else Cha.transform.rotationEuler = new Laya.Vector3(0, 10, 0);
                this.currCarModel = Cha;
                this.currCarModel.transform.position = new Laya.Vector3(-1.02, -1.07, -3.2);
                this.currCarRotation = this.currCarModel.transform.rotationEuler;
                var as = Cha.addComponent(ActorScript);
                as.init(HatCfg, HairCfg, WingCfg);
                if (rndChaCfg.sex == 1) as.playWomenChoose(); else as.playMenChoose();
            }
            mouseDown() {
                this.lastX = Laya.stage.mouseX;
            }
            mouseMove() {
                let offsetX = Laya.stage.mouseX - this.lastX;
                if (this.currCarModel) {
                    this.currCarModel.transform.rotate(new Laya.Vector3(0, .5 * offsetX, 0), false, false);
                    this.lastX = Laya.stage.mouseX;
                }
            }
            mouseUp() { }
            buyBtnClick() {
                SoundMgr.Ins.lvUpAndBuyBtn();
                switch (this.currClothesData.getBaseNature().unLockType) {
                    case E_UNLOCKCHA_TYPE.DIAMOND:
                        if (DataMgr.Ins.diamon >= this.currClothesData.getBaseNature().unLockNeedNum) {
                            this.currClothesData.isLock = false;
                            DataMgr.Ins.addDiamon(-this.currClothesData.getBaseNature().unLockNeedNum);
                            DataMgr.Ins.SavePlayerData();
                        } else {
                            UIManager.Ins.getScene(E_UI_TYPE.LUCKY_PAN).open(false);
                        }
                        break;

                    case E_UNLOCKCHA_TYPE.GOLD:
                        if (DataMgr.Ins.gold >= this.currClothesData.getBaseNature().unLockNeedNum) {
                            this.currClothesData.isLock = false;
                            DataMgr.Ins.addGold(-this.currClothesData.getBaseNature().unLockNeedNum);
                            DataMgr.Ins.SavePlayerData();
                        } else {
                            if (DataMgr.Ins.getCionTipTimes() > 0) {
                                UIManager.Ins.getScene(E_UI_TYPE.VIDEO_COIN).open(false);
                            } else {
                                UIManager.Ins.getScene(E_UI_TYPE.LONGBLACKTIP).open(false);
                            }
                        }
                        break;

                    case E_UNLOCKCHA_TYPE.AD:
                        //激励广告
                        showReward(() => {
                            this.currClothesData.videoAdNum++;
                            if (this.currClothesData.videoAdNum >= this.currClothesData.getBaseNature().unLockNeedNum) {
                                this.currClothesData.isLock = false;
                            }
                            DataMgr.Ins.SavePlayerData();
                            this.goldLa.value = DataMgr.Ins.gold.toFixed(0);
                            this.diamonLa.value = DataMgr.Ins.diamon.toFixed(0);
                            if (!this.currClothesData.isLock) {
                                if (!DataMgr.Ins.getCurrSelectClothes(this.currClothesData.getBaseNature().part) || DataMgr.Ins.getCurrSelectClothes(this.currClothesData.getBaseNature().part).id != this.currClothesData.id) {
                                    DataMgr.Ins.setCurrSelectClothes(this.currClothesData.id, this.currClothesData.getBaseNature().part);
                                    DataMgr.Ins.SavePlayerData();
                                }
                            }
                            this.clothesList.refresh();
                            this.refreshBuyBtn();
                        });

                        break;

                    case E_UNLOCKCHA_TYPE.SIGNIN:
                        UIManager.Ins.getScene(E_UI_TYPE.CHECK_IN).open(false);
                        return;

                    case E_UNLOCKCHA_TYPE.GIFT:
                        if (DataMgr.Ins.giftStage >= 5) {
                            UIManager.Ins.getScene(E_UI_TYPE.LONGBLACKTIP).open(false, ["今日礼包已全部领完，请明日再来哟~"]);
                        } else {
                            UIManager.Ins.getScene(E_UI_TYPE.ONLINE_GIFT).open(false);
                        }
                        return;

                    case E_UNLOCKCHA_TYPE.LIMITCLOTHES:
                        if (CCfgMgr.Ins.cfgChest.getItem(64)._rewardID[0] == this.currClothesData.id) {
                            UIManager.Ins.getScene(E_UI_TYPE.REWARDHAT).open(false, 64);
                        } else if (CCfgMgr.Ins.cfgChest.getItem(65)._rewardID[0] == this.currClothesData.id) {
                            UIManager.Ins.getScene(E_UI_TYPE.REWARDHAT).open(false, 65);
                        } else {
                            UIManager.Ins.getScene(E_UI_TYPE.REWARDHAT).open(false, 71);
                        }
                        return;

                    case E_UNLOCKCHA_TYPE.ZHUANPAN:
                        UIManager.Ins.getScene(E_UI_TYPE.LUCKY_PAN).open(false);
                        return;

                    case E_UNLOCKCHA_TYPE.LIMITGIFT:
                        UIManager.Ins.getScene(E_UI_TYPE.LIMITGIFT).open(false);
                        return;
                }
                this.goldLa.value = DataMgr.Ins.gold.toFixed(0);
                this.diamonLa.value = DataMgr.Ins.diamon.toFixed(0);
                if (!this.currClothesData.isLock) {
                    if (!DataMgr.Ins.getCurrSelectClothes(this.currClothesData.getBaseNature().part) || DataMgr.Ins.getCurrSelectClothes(this.currClothesData.getBaseNature().part).id != this.currClothesData.id) {
                        DataMgr.Ins.setCurrSelectClothes(this.currClothesData.id, this.currClothesData.getBaseNature().part);
                        DataMgr.Ins.SavePlayerData();
                    }
                }
                this.clothesList.refresh();
                this.refreshBuyBtn();
            }
            refreshBuyBtn() {
                if (!this.currClothesData) return;
                this.takeoffBtn.visible = false;
                this.buyBtn.visible = false;
                if (this.currClothesData.isLock) {
                    for (let i = 0; i < 3; i++) {
                        this.iconList.getChildAt(i).visible = false;
                    }
                    for (let i = 0; i < 5; i++) {
                        this.buyBtn.getChildAt(i).visible = false;
                    }
                    let currType = this.currClothesData.getBaseNature().unLockType;
                    let str = "";
                    let num = this.currClothesData.getBaseNature().unLockNeedNum;
                    if (currType == E_UNLOCKCHA_TYPE.AD) {
                        this.buyBtn.getChildAt(0).visible = true;
                        str = "X";
                        num = this.currClothesData.getBaseNature().unLockNeedNum - this.currClothesData.videoAdNum;
                    }
                    if (currType == E_UNLOCKCHA_TYPE.SIGNIN) {
                        this.buyBtn.getChildAt(1).visible = true;
                    } else if (currType == E_UNLOCKCHA_TYPE.GIFT) {
                        this.buyBtn.getChildAt(2).visible = true;
                    } else if (currType == E_UNLOCKCHA_TYPE.LIMITCLOTHES) {
                        this.buyBtn.getChildAt(3).visible = true;
                    } else if (currType == E_UNLOCKCHA_TYPE.ZHUANPAN) {
                        this.buyBtn.getChildAt(4).visible = true;
                    } else if (currType == E_UNLOCKCHA_TYPE.LIMITGIFT) {
                        this.buyBtn.getChildAt(3).visible = true;
                    } else {
                        this.buyBtn.getChildAt(0).visible = true;
                        this.buyNeedDiamon.text = str + num;
                        this.iconList.getChildAt(this.currClothesData.getBaseNature().unLockType - 1).visible = true;
                    }
                    this.buyBtn.visible = true;
                } else {
                    if (this.currClothesData.getBaseNature().part == 1 || this.currClothesData.getBaseNature().part == 3) {
                        if (DataMgr.Ins.getCurrSelectClothes(this.currClothesData.getBaseNature().part) && DataMgr.Ins.getCurrSelectClothes(this.currClothesData.getBaseNature().part).id == this.currClothesData.id) this.takeoffBtn.visible = true;
                    }
                }
                this.redTip.visible = false;
                this.buyBtn.gray = false;
                switch (this.currClothesData.getBaseNature().unLockType) {
                    case E_UNLOCKCHA_TYPE.DIAMOND:
                        if (DataMgr.Ins.diamon >= this.currClothesData.getBaseNature().unLockNeedNum) {
                            this.redTip.visible = true;
                        } else {
                            this.buyBtn.gray = true;
                        }
                        break;

                    case E_UNLOCKCHA_TYPE.GOLD:
                        if (DataMgr.Ins.gold >= this.currClothesData.getBaseNature().unLockNeedNum) {
                            this.redTip.visible = false;
                        } else {
                            this.buyBtn.gray = true;
                        }
                        break;

                    case E_UNLOCKCHA_TYPE.AD:
                        if (this.currClothesData.videoAdNum >= this.currClothesData.getBaseNature().unLockNeedNum) {
                            this.redTip.visible = true;
                        }
                        break;
                }
            }
            setPreViewClothList(data) {
                if (DataMgr.Ins.currPlayerSex == 0) this.currPreViewMenClothList[data.getBaseNature().part] = data; else this.currPreViewWomenClothList[data.getBaseNature().part] = data;
            }
            getPreViewCloth(part) {
                if (DataMgr.Ins.currPlayerSex == 0) return this.currPreViewMenClothList[part]; else return this.currPreViewWomenClothList[part];
            }
            takeoffPreViewCloth(part) {
                if (DataMgr.Ins.currPlayerSex == 0) {
                    this.currPreViewMenClothList[part] = null;
                    DataMgr.Ins.currSelectMenClothesList[part] = null;
                } else {
                    this.currPreViewWomenClothList[part] = null;
                    DataMgr.Ins.currSelectWomenClothesList[part] = null;
                }
                this.changePartBtnClick(this.currSelectTypeId);
                this.refreshBuyBtn();
                this.load3DScene();
            }
            refreshRedTipCar() {
                for (let i = 0; i < DataMgr.Ins.carList.length; i++) {
                    let car = DataMgr.Ins.carList[i];
                    if (car.isLock) {
                        if (car.cfg.unLockType == E_UNLOCKCAR_TYPE.SP) {
                            if (DataMgr.Ins.getPatch(car.cfg.quality) >= car.cfg.unLockNeedPatch) {
                                break;
                            }
                        } else if (car.cfg.unLockType == E_UNLOCKCAR_TYPE.DIAMOND) {
                            if (DataMgr.Ins.diamon >= car.cfg.unLockNeedPatch) {
                                break;
                            }
                        }
                    } else {
                        if (car.lv >= car.cfg.maxLvl) { } else {
                            if (DataMgr.Ins.gold >= car.getLvUpGoldNeed()) {
                                break;
                            }
                        }
                    }
                }
            }
            refreshHtItem() {
                if (PlatformMgr.Ins.htBoxIconList && PlatformMgr.Ins.htBoxIconList[0] && PlatformMgr.Ins.htBoxIconList[0][DataMgr.Ins.currHtIndex]) {
                    let itemScript = this.htItem.getComponent(HtGameScript);
                    itemScript.initData(PlatformMgr.Ins.htBoxIconList[0][DataMgr.Ins.currHtIndex]);
                } else {
                    this.htItem.visible = false;
                }
            }
            takeoffBtnClick() {
                if (!this.currClothesData) return;
                this.takeoffPreViewCloth(this.currClothesData.getBaseNature().part);
            }
        }
        var E_RWDIMAGELIST_TYPE;
        (function (E_RWDIMAGELIST_TYPE) {
            E_RWDIMAGELIST_TYPE[E_RWDIMAGELIST_TYPE["SKINURL"] = 0] = "SKINURL";
            E_RWDIMAGELIST_TYPE[E_RWDIMAGELIST_TYPE["DESC"] = 1] = "DESC";
            E_RWDIMAGELIST_TYPE[E_RWDIMAGELIST_TYPE["ISCLOTHES"] = 2] = "ISCLOTHES";
            E_RWDIMAGELIST_TYPE[E_RWDIMAGELIST_TYPE["ISBASE"] = 3] = "ISBASE";
        })(E_RWDIMAGELIST_TYPE || (E_RWDIMAGELIST_TYPE = {}));
        class CgtltGetUI extends ui.UIScenes.commonUI.CgtltGetUI {
            constructor() {
                super();
                this.backUiId = -1;
                this.rwdNum = 1;
                this.isFanbeiTip = false;
                this.isHaveClothes = false;
                this.isHaveCar = false;
                this.getCarId = 0;
                this.currRwdListParent = [];
                this.AdId = E_PAGE_VIDEOID.GAMEOVER;
                this.isGetAd = true;
                this.isShowBox = false;
                this.rewardList = [];
                this.carIdList = [];
                this.toDriverPart = 0;
                this.getClothesId = 0;
                this.defineBtn.on(Laya.Event.CLICK, this, this.defineBtnClick);
                this.doubleGetBtn.on(Laya.Event.CLICK, this, this.doubleGetBtnClick);
                this.closeBtn.on(Laya.Event.CLICK, this, this.closeSelf);
                this.wxComGetBtn.on(Laya.Event.CLICK, this, this.closeSelf);
                this.haoDeBtn.on(Laya.Event.CLICK, this, this.closeSelf);
                this.yongJiuGetBtn.on(Laya.Event.CLICK, this, this.yongJiuGetBtnClick);
                this.shareVideoBtn.on(Laya.Event.CLICK, this, this.shareVideoBtnOnClick);
                this.shareFriendBtn.on(Laya.Event.CLICK, this, this.shareFriendBtnOnClick);
                this.moreGameBtn.on(Laya.Event.CLICK, this, this.moreGameBtnOnClick);
                this.shareBtn.on(Laya.Event.CLICK, this, this.shareBtnClick);
                this.scaleX = this.scaleY = GlobalScale$1.scale;
                this.width = Laya.stage.width / GlobalScale$1.scale;
                this.height = Laya.stage.height / GlobalScale$1.scale;
                this.noCar.width = Laya.stage.width / GlobalScale$1.scale;
                this.bannerCloseBtn.on(Laya.Event.CLICK, this, () => {
                    this.nativeItem.visible = false;
                });
                this.iconBannerImg.on(Laya.Event.CLICK, this, () => {
                    PlatformMgr.Ins.reportNativeAdClick();
                    this.nativeItem.visible = false;
                });
            }
            onAwake() { }
            onOpened(list) {

                let banner;
                let left = 80;
                let bottom = 0;
                let width = 300;

                PlatformMgr.Ins.canShowBanner = true;
                this.shareVideoBtn.visible = PlatformMgr.Ins.platform == E_PLATFORM_TYPE.TT && platform.Ins.recorderPath;
                this.refreshNativeItem();
                this.title.text = "";
                this.isHaveCar = false;
                this.getCarId = 0;
                this.isHaveClothes = false;
                this.closeBtn.visible = false;
                this.defineBtn.visible = false;
                this.closeBtn.visible = true;
                let chestList = [];
                if (list[0] != undefined) {
                    if (list[0] instanceof Array) {
                        let rewIdList = list[0];
                        for (let i = 0; i < rewIdList.length; i++) {
                            let chest = new BaseChest();
                            chest.init(rewIdList[i]);
                            chestList.push(chest);
                        }
                    } else {
                        let chest = new BaseChest();
                        chest.init(list[0]);
                        chestList.push(chest);
                    }
                }
                if (list[1] != undefined) this.backUiId = list[1];
                if (list[2] != undefined) this.rwdNum = list[2];
                if (list[3] != undefined) this.doubleGetBtn.visible = list[3];
                if (list[3] != undefined) this.defineBtn.visible = !list[3];
                this.AdId = list[8] != undefined ? list[8] : E_PAGE_VIDEOID.GAMEOVER;
                this.doubleGetBtn.getChildAt(0).visible = this.isGetAd;
                this.doubleGetBtn.getChildAt(1).visible = !this.isGetAd;
                this.isShowBox = false;
                if (list[5] != undefined) this.isShowBox = list[5];
                this.isFanbeiTip = false;
                if (list[6] != undefined) this.isFanbeiTip = list[6];
                if (list[7] != undefined) this.title.text = list[7];
                this.fanbeiTip.visible = this.isFanbeiTip;
                this.currChestList = chestList;
                console.log("chestList", chestList);
                this.currRwdListParent = [];
                for (let i = 0; i < this.currChestList.length; i++) {
                    let rwdList = this.currChestList[i].getReward();
                    this.currRwdListParent.push(rwdList);
                }
                this.initAd();
                this.getReward(false);
                this.refreshUI();
                this.rwdTimesLa.text = UsefulStuff.numToChinese(this.rwdNum + 1) + "倍领取";
                this.noVideoTimesLa.text = UsefulStuff.numToChinese(this.rwdNum + 1) + "倍领取";
                this.closeBtn.visible = false;
                Laya.timer.once(AdConfigMgr.Ins.Switch_1, this, () => {
                    this.closeBtn.visible = true;
                });
            }
            initAd() { }
            hideAd() {
                PlatformMgr.Ins.hideBanner();
                PlatformMgr.Ins.closeNativeAd();
                PlatformMgr.Ins.hideWxNative();
            }
            playOpenAni() { }
            playCloseAni() { }
            refreshUI1() {
                this.imageList.visible = false;
                let rwdList = this.currChest.getReward();
                if (!rwdList) return;
                this.rewardList = [];
                let baseList = rwdList[E_REWARD_TYPE.REWARD_BASE - 1];
                let carId = rwdList[E_REWARD_TYPE.REWARD_CAR - 1];
                let clotheId = rwdList[E_REWARD_TYPE.REWARD_CLOTHES - 1];
                let gold = baseList[E_REWARD_BASE_TYPE.GOLD - 1];
                let diamond = baseList[E_REWARD_BASE_TYPE.DIAMOND - 1];
                let sticket = baseList[E_REWARD_BASE_TYPE.CLOTHESTICKET - 1];
                let list = [gold, diamond, sticket, carId, clotheId];
                let skinUrl = "";
                let desc = "";
                let isClothes = false;
                let isBase = true;
                for (let i = 0; i < list.length; i++) {
                    isClothes = false;
                    isBase = true;
                    if (list[i] > 0) {
                        switch (i) {
                            case 0:
                                skinUrl = "uires/common/jinbi.png";
                                desc = "x" + list[i];
                                break;

                            case 1:
                                skinUrl = "uires/common/zs.png";
                                desc = "x" + list[i];
                                break;

                            case 2:
                                skinUrl = "uires/garage/cp_0.png";
                                desc = "x" + list[i];
                                break;

                            case 3:
                                skinUrl = LoadMgr.Ins.WebResHttp + "carIcon/" + DataMgr.Ins.getCar(list[i]).cfg._RacingIconName[0] + ".png";
                                desc = DataMgr.Ins.getCar(list[i]).cfg._Name + " x1";
                                isBase = false;
                                break;

                            case 4:
                                skinUrl = LoadMgr.Ins.WebResHttp + "clothesIcon/clothes_" + DataMgr.Ins.getClothes(list[i]).getBaseNature().picId + ".png";
                                desc = DataMgr.Ins.getClothes(list[i]).getBaseNature()._Name + " x1";
                                isClothes = true;
                                isBase = false;
                                break;
                        }
                        this.rewardList.push([skinUrl, desc, isClothes, isBase, false]);
                    }
                }
                if (this.isShowBox) {
                    this.rewardList.push(["uires/Voppo/box/gaoj.png", "高级宝箱x1", false, true, true]);
                }
                this.bgAnim.removeLabel(null);
                this.bgAnim.offAll(null);
                this.bgAnim.addLabel("over", 25);
                this.bgAnim.on(Laya.Event.LABEL, this, () => {
                    this.imageList.visible = true;
                    this.imageList.dataSource = this.rewardList;
                    this.imageList.repeatY = 1;
                    this.imageList.width = 182 + (this.rewardList.length - 1) * 204;
                    this.imageList.refresh();
                });
                this.bgAnim.play(0, false);
            }
            refreshUI() {
                if (!this.currChestList) return;
                this.carIdList = [];
                this.imageList.visible = false;
                this.rewardList = [];
                let baseList = null;
                let carIdList = [];
                let clotheIdList = [];
                let gold = 0;
                let diamond = 0;
                let sticket = 0;
                for (let i = 0; i < this.currRwdListParent.length; i++) {
                    let rwdList = this.currRwdListParent[i];
                    baseList = rwdList[E_REWARD_TYPE.REWARD_BASE - 1];
                    carIdList.push(rwdList[E_REWARD_TYPE.REWARD_CAR - 1]);
                    clotheIdList.push(rwdList[E_REWARD_TYPE.REWARD_CLOTHES - 1]);
                    gold += parseInt(baseList[E_REWARD_BASE_TYPE.GOLD - 1]);
                    diamond += parseInt(baseList[E_REWARD_BASE_TYPE.DIAMOND - 1]);
                    sticket += parseInt(baseList[E_REWARD_BASE_TYPE.CLOTHESTICKET - 1]);
                }
                gold = Math.floor(gold * (1 + DataMgr.Ins.calculateGoldBuff() + DataMgr.Ins.currRaceBuff));
                diamond = Math.floor(diamond * (1 + DataMgr.Ins.currRaceBuff));
                let list = [gold, diamond, sticket, carIdList, clotheIdList];
                console.log("list", list);
                let skinUrl = "";
                let desc = "";
                let isClothes = false;
                let isBase = true;
                for (let i = 0; i < list.length; i++) {
                    isClothes = false;
                    isBase = true;
                    switch (i) {
                        case 0:
                            if (list[i] > 0) {
                                skinUrl = "uires/common/jinbi.png";
                                desc = "x" + list[i];
                                this.rewardList.push([skinUrl, desc, isClothes, isBase, false]);
                            }
                            break;

                        case 1:
                            if (list[i] > 0) {
                                skinUrl = "uires/common/zs.png";
                                desc = "x" + list[i];
                                this.rewardList.push([skinUrl, desc, isClothes, isBase, false]);
                            }
                            break;

                        case 2:
                            skinUrl = "uires/garage/cp_0.png";
                            desc = "x" + list[i];
                            break;

                        case 3:
                            let carList = list[i];
                            for (let j = 0; j < carList.length; j++) {
                                let carId = carList[j];
                                if (carId > 0) {
                                    this.carIdList.push(carId);
                                    this.isHaveCar = true;
                                    this.getCarId = carId;
                                    skinUrl = LoadMgr.Ins.WebResHttp + "carIcon/" + DataMgr.Ins.getCar(carId).cfg._RacingIconName[0] + ".png";
                                    desc = DataMgr.Ins.getCar(carId).cfg._Name + " x1";
                                    isBase = false;
                                    this.rewardList.push([skinUrl, desc, isClothes, isBase, false]);
                                }
                            }
                            break;

                        case 4:
                            let clothesIdList = list[i];
                            for (let j = 0; j < clothesIdList.length; j++) {
                                let clothesId = clothesIdList[j];
                                if (clothesId > 0) {
                                    this.isHaveClothes = true;
                                    this.getClothesId = clothesId;
                                    this.toDriverPart = DataMgr.Ins.getClothes(clothesId).getBaseNature().part;
                                    skinUrl = LoadMgr.Ins.WebResHttp + "clothesIcon/clothes_" + DataMgr.Ins.getClothes(clothesId).getBaseNature().picId + ".png";
                                    desc = DataMgr.Ins.getClothes(clothesId).getBaseNature()._Name + " x1";
                                    isClothes = true;
                                    isBase = false;
                                    this.rewardList.push([skinUrl, desc, isClothes, isBase, false]);
                                }
                            }
                            break;
                    }
                }
                if (this.isHaveCar || this.isHaveClothes) {
                    this.defineBtn.getChildAt(0).visible = false;
                    this.defineBtn.getChildAt(1).visible = PlatformMgr.Ins.platform == E_PLATFORM_TYPE.WX;
                    this.defineBtn.getChildAt(2).visible = PlatformMgr.Ins.platform != E_PLATFORM_TYPE.WX;
                } else {
                    this.defineBtn.getChildAt(0).visible = true;
                    this.defineBtn.getChildAt(1).visible = false;
                    this.defineBtn.getChildAt(2).visible = false;
                }
                this.imageList.renderHandler = new Laya.Handler(this, this.updateImageItem);
                this.bgAnim.removeLabel(null);
                this.bgAnim.offAll(null);
                this.bgAnim.addLabel("over", 25);
                this.bgAnim.on(Laya.Event.LABEL, this, () => {
                    this.imageList.visible = true;
                    this.imageList.dataSource = this.rewardList;
                    this.imageList.repeatY = 1;
                    this.imageList.width = 182 + (this.rewardList.length - 1) * 204;
                    this.imageList.refresh();
                });
                this.bgAnim.play(0, false);
            }
            getReward(isClick) {
                this.noCar.visible = true;
                this.haveCar.visible = false;
                console.log("增加的钻石数量1");
                for (let i = 0; i < this.currRwdListParent.length; i++) {
                    let rwdList = this.currRwdListParent[i];
                    if (!rwdList) return;
                    let baseList = rwdList[E_REWARD_TYPE.REWARD_BASE - 1];
                    let carId = rwdList[E_REWARD_TYPE.REWARD_CAR - 1];
                    let clotheId = rwdList[E_REWARD_TYPE.REWARD_CLOTHES - 1];
                    let gold = baseList[E_REWARD_BASE_TYPE.GOLD - 1];
                    let diamond = baseList[E_REWARD_BASE_TYPE.DIAMOND - 1];
                    let sticket = baseList[E_REWARD_BASE_TYPE.CLOTHESTICKET - 1];
                    DataMgr.Ins.addGold(gold * (1 + DataMgr.Ins.currRaceBuff + DataMgr.Ins.calculateGoldBuff()));
                    DataMgr.Ins.addDiamon(diamond * (1 + DataMgr.Ins.currRaceBuff));
                    console.log("增加的钻石数量", diamond * (1 + DataMgr.Ins.currRaceBuff));
                    if (carId > 0) {
                        let car = DataMgr.Ins.getCar(carId);
                        if (car.cfg.unLockType == E_UNLOCKCAR_TYPE.SIGNIN) {
                            car.startTryCar(CCfgMgr.Ins.cfgGlobalPar.getItemValue(E_GLOBALPAR_NAME.GAME_CAR_TRYTIME));
                            this.noCar.visible = false;
                            this.haveCar.visible = true;
                        } else {
                            DataMgr.Ins.unlockCar(carId);
                            UIManager.Ins.getScene(E_UI_TYPE.CGTLTGETUICarUP5).open(false, carId);
                        }
                        this.doubleGetBtn.visible = false;
                        this.shareVideoBtn.visible = false;
                    }
                    if (clotheId > 0) {
                        DataMgr.Ins.unlockClothes(clotheId);
                        this.doubleGetBtn.visible = false;
                        this.shareVideoBtn.visible = false;
                        if (Driver2UI.Ins) {
                            Driver2UI.Ins.clothesList.refresh();
                            Driver2UI.Ins.refreshBuyBtn();
                        }
                    }
                }
                DataMgr.Ins.SavePlayerData();
                if (isClick) {
                    this.closeSelf();
                }
            }
            getChineseGrade(index) {
                switch (index) {
                    case 0:
                        return "C";

                    case 1:
                        return "B";

                    case 2:
                        return "A";

                    case 3:
                        return "S";
                }
            }
            defineBtnClick() {
                SoundMgr.Ins.Coin();
                if (this.isHaveCar) {
                    //转盘分享改视频
                    // if (PlatformMgr.Ins.platform == E_PLATFORM_TYPE.WX && Date.now() < 0) {
                    this.xuanYaoFunc();
                    // } else {
                    SceneMgr.Ins.clearUIScene();
                    DataMgr.Ins.setCurrSelectCar(this.getCarId);
                    UIManager.Ins.getScene(E_UI_TYPE.STARTUI).open();
                    // }
                } else if (this.isHaveClothes) {
                    //转盘分享改视频
                    // if (PlatformMgr.Ins.platform == E_PLATFORM_TYPE.WX && Date.now() < 0) {
                    this.xuanYaoFunc();
                    // } else {
                    SceneMgr.Ins.clearUIScene();
                    let sex = CCfgMgr.Ins.cfgClothes.getItem(this.getClothesId).sex;
                    DataMgr.Ins.setCurrSelectClothes(this.getClothesId, this.toDriverPart);
                    UIManager.Ins.getScene(E_UI_TYPE.STARTUI).open(true, new PassStartParme(false, sex != 2 && sex != DataMgr.Ins.currPlayerSex));
                    // }
                } else {
                    if (this.backUiId >= 0) {
                        if (this.backUiId == E_UI_TYPE.PICK_ROLE || this.backUiId == E_UI_TYPE.ONERACE || this.backUiId == E_UI_TYPE.PICKMODE || this.backUiId == E_UI_TYPE.MULTIRACE || this.backUiId == E_UI_TYPE.RANK_RESULT_UI || this.backUiId == E_UI_TYPE.STARTUI) {
                            SceneMgr.Ins.clearUIScene();
                        }
                        this.close();
                        UIManager.Ins.getScene(this.backUiId).open();
                    } else {
                        this.close();
                        PlatformMgr.Ins.closeNativeAd();
                    }
                }
            }
            xuanYaoFunc() {
                // platform.Ins.share().then(() => {
                showReward(() => {
                    // console.log("分享成功啦");
                    this.close();
                    PlatformMgr.Ins.closeNativeAd();
                    let num = UsefulStuff.rnd(10, 50);
                    DataMgr.Ins.addDiamon(num);
                    UIManager.Ins.getScene(E_UI_TYPE.LONGBLACKTIP).open(false, ["恭喜获得" + num + "钻石"]);
                });

                // });
            }
            closeSelf() {
                SoundMgr.Ins.Coin();
                if (this.backUiId >= 0) {
                    if (this.backUiId == E_UI_TYPE.PICK_ROLE || this.backUiId == E_UI_TYPE.ONERACE || this.backUiId == E_UI_TYPE.PICKMODE || this.backUiId == E_UI_TYPE.MULTIRACE || this.backUiId == E_UI_TYPE.RANK_RESULT_UI || this.backUiId == E_UI_TYPE.STARTUI) {
                        SceneMgr.Ins.clearUIScene();
                    }
                    UIManager.Ins.getScene(this.backUiId).open();
                } else {
                    this.close();
                    PlatformMgr.Ins.closeNativeAd();
                }
            }
            onClosed() {
                Laya.timer.clearAll(this);
                DataMgr.Ins.iszhuanpanClg = false;
                this.hideAd();

            }
            updateImageItem(item, idx) {
                if (idx >= this.rewardList.length || this.rewardList[idx].length <= E_RWDIMAGELIST_TYPE.ISCLOTHES) return;
                let anim = item.getChildAt(0);
                let image1 = item.getChildAt(1);
                let label1 = item.getChildAt(2);
                let anim1 = item.getChildAt(3);
                let anim2 = item.getChildAt(4);
                let tip = item.getChildAt(5);
                let daojishi = item.getChildAt(6);
                daojishi.text = "";
                if (!this.rewardList[idx][E_RWDIMAGELIST_TYPE.ISCLOTHES] && !this.rewardList[idx][E_RWDIMAGELIST_TYPE.ISBASE]) {
                    if (this.carIdList.length > 0 && DataMgr.Ins.getCar(this.carIdList[0]).cfg.unLockType == E_UNLOCKCAR_TYPE.SIGNIN) {
                        daojishi.text = UsefulStuff.formatMS2(CCfgMgr.Ins.cfgGlobalPar.getItemValue(E_GLOBALPAR_NAME.GAME_CAR_TRYTIME));
                    }
                }
                anim2.visible = false;
                if (this.rewardList[idx][E_RWDIMAGELIST_TYPE.ISCLOTHES]) image1.scale(-1.2, 1.2); else image1.scale(-1, 1);
                image1.skin = this.rewardList[idx][E_RWDIMAGELIST_TYPE.SKINURL];
                tip.visible = this.rewardList[idx][4];
                Laya.timer.frameLoop(2, image1, () => {
                    image1.scaleX += .4;
                    if (this.rewardList[idx][E_RWDIMAGELIST_TYPE.ISCLOTHES]) {
                        if (image1.scaleX >= 1.2) {
                            Laya.timer.clearAll(image1);
                            anim2.visible = true;
                            anim2.play(0, true);
                        }
                    } else {
                        if (image1.scaleX >= 1) {
                            Laya.timer.clearAll(image1);
                            if (!this.rewardList[idx][E_RWDIMAGELIST_TYPE.ISBASE]) {
                                anim2.visible = true;
                                anim2.play(0, true);
                            }
                        }
                    }
                });
                anim.play(0, false);
                anim1.play(0, false);
                label1.text = this.rewardList[idx][E_RWDIMAGELIST_TYPE.DESC];
            }
            doubleGetBtnClick() {
                // var cb = () => {
                //     this.getVideoReward();
                // };
                // if (this.isGetAd) {
                //     //激励广告
                //     this.getVideoReward();
                // } else this.getVideoReward();
                // console.log("当前所用视频id", this.AdId);
                showReward(() => {
                    this.getVideoReward();
                });
            }
            getVideoReward() {
                if (this.rwdNum == 1) {
                    this.getReward(true);
                } else if (this.rwdNum > 1) {
                    for (let i = 0; i < this.rwdNum - 1; i++) {
                        this.getReward(false);
                    }
                    this.getReward(true);
                }
                let num = this.rwdNum + 1;
                UIManager.Ins.getScene(E_UI_TYPE.LONGBLACKTIP).open(false, ["恭喜拿到" + num + "倍奖励"]);
            }
            yongJiuGetBtnClick() {

                if (this.carIdList.length > 0) {
                    DataMgr.Ins.unlockCar(this.carIdList[0]);
                    DataMgr.Ins.getCar(this.carIdList[0]).currShengTryTime = 0;
                    this.close();
                    PlatformMgr.Ins.closeNativeAd();
                }
            }
            shareVideoBtnOnClick() {
                if (PlatformMgr.Ins.platform == E_PLATFORM_TYPE.TT) platform.Ins.shareVideo(() => {
                    DataMgr.Ins.addGold(500);
                    UIManager.Ins.getScene(E_UI_TYPE.LONGBLACKTIP).open(false, ["分享成功，获得500金币"]);
                    this.shareVideoBtn.visible = false;
                    this.doubleGetBtn.centerX = 0;
                });
            }
            moreGameBtnOnClick() {
                if (isQQ()) platform.Ins.showAppBox();
            }
            shareBtnClick() {
                PrivateTracker_new.Ins.sendEvent(SDK_EVENT._段位奖励界面点击分享邀请, {
                    "_段位奖励界面点击分享邀请": "_段位奖励界面点击分享邀请"
                });
                if (Laya.Browser.onMiniGame) {
                    UIManager.Ins.getScene(E_UI_TYPE.WXSHARE_NEW).open(false);
                    this.close();
                }
            }
            refreshNativeItem() {
                this.nativeItem.visible = false;
                PlatformMgr.Ins.initNativeIconAd1(data => {
                    this.nativeItem.visible = true;
                    let ad = data.adList;
                    if (ad[0].iconUrlList && ad[0].iconUrlList.length) {
                        this.iconBannerImg.skin = ad[0].iconUrlList[0];
                    } else if (ad[0].imgUrlList && ad[0].imgUrlList.length) {
                        this.iconBannerImg.skin = ad[0].imgUrlList[0];
                    }
                    PlatformMgr.Ins.reportNativeAdShow();
                });
            }
            shareFriendBtnOnClick() {
                platform.Ins.share().then(() => {
                    console.log("分享成功啦");
                    if (this.rwdNum == 1) {
                        this.getReward(true);
                    } else if (this.rwdNum > 1) {
                        for (let i = 0; i < this.rwdNum - 1; i++) {
                            this.getReward(false);
                        }
                        this.getReward(true);
                    }
                });
            }
        }
        class CgtltGetCarUp5UI extends ui.UIScenes.commonUI.CgtltGetCarUp5UI {
            constructor() {
                super();
                this.currCarId = 0;
                this.videoBtn.on(Laya.Event.CLICK, this, this.defineBtnClick);
                this.noBtn.on(Laya.Event.CLICK, this, this.closeSelf);
                this.closeBtn.on(Laya.Event.CLICK, this, this.closeSelf);
                this.scaleX = this.scaleY = GlobalScale$1.scale;
                this.width = Laya.stage.width / GlobalScale$1.scale;
                this.height = Laya.stage.height / GlobalScale$1.scale;
                this.zongBox.centerX = 0;
            }
            onOpened(carId) {
                PlatformMgr.Ins.canShowBanner = true;
                this.currCarId = carId;
                this.videoBtn.visible = false;
                this.noBtn.visible = false;
                this.closeBtn.visible = false;
                Laya.timer.once(2e3, this, () => {
                    this.videoBtn.visible = true;
                    this.closeBtn.visible = true;
                });
                this.refreshUI();
                var cfg = PlatformMgr.Ins._gameConfig;
                if (cfg.lianShengWuJiBanner && cfg.lianShengWuJiBanner.videoBtnCenterX != null) this.videoBtn.centerX = cfg.lianShengWuJiBanner.videoBtnCenterX;
                if (cfg.lianShengWuJiBanner && cfg.lianShengWuJiBanner.noBtnCenterX != null) this.noBtn.centerX = cfg.lianShengWuJiBanner.noBtnCenterX;
                PlatformMgr.Ins.initNativeAd(E_UI_TYPE.CGTLTGETUICarUP5);

                let banner;
                let left = 80;
                let bottom = 0;
                let width = 300;

                this.closeBtn.visible = false;
                Laya.timer.once(AdConfigMgr.Ins.Switch_1, this, () => {
                    this.closeBtn.visible = true;
                });
            }
            onAwake() { }
            playOpenAni() { }
            playCloseAni() { }
            refreshUI() {
                this.bgAnim.play(0, false);
                this.carIcon.skin = LoadMgr.Ins.WebResHttp + "carIcon/" + DataMgr.Ins.getCar(this.currCarId).cfg._RacingIconName[0] + ".png";
                this.carName.text = DataMgr.Ins.getCar(this.currCarId).cfg._Name;
            }
            defineBtnClick() {
                SoundMgr.Ins.Coin();
                //激励广告
                showReward(() => {
                    this.close();
                    PlatformMgr.Ins.closeNativeAd();
                    DataMgr.Ins.getCar(this.currCarId).lvUp(5);
                });

            }
            closeSelf() {
                SoundMgr.Ins.Coin();
                this.close();
                PlatformMgr.Ins.closeNativeAd();
            }
            onClosed() {
                Laya.timer.clearAll(this);
                PlatformMgr.Ins.closeNativeAd();

            }
        }
        class GameCardUI extends ui.UIScenes.commonUI.GameCardUI {
            constructor() {
                super();
                this.itemIndexList = [];
                this.firstClickIndex = 0;
                this.isHasClick = false;
                this.selectID = 1;
                this.isRandomAniPlaying = false;
                this.propCardBtn.on(Laya.Event.CLICK, this, this.propCardBtnOnClick);
                this.closeBtn.on(Laya.Event.CLICK, this, this.closeBtnOnClick);
                this.giveUpBtn.on(Laya.Event.CLICK, this, this.closeBtnOnClick);
                for (var i = 0; i < 4; i++) {
                    this["propRoot" + (i + 1).toString()].on(Laya.Event.CLICK, this, this.propCardSelect, [i + 1]);
                }
            }
            onAwake() { }
            onOpened() {
                this.isHasClick = false;
                this.width = Laya.stage.width;
                this.height = Laya.stage.height;
                var CardArray = CCfgMgr.Ins.cfgPropInfo.rndCardLevel(GameMgr.Ins.curGameMode != E_GAME_MODE.MULTIPLAYER_PROP_GAME);
                this.CardArray = CardArray;
                this.propRoot1.gray = false;
                this.propRoot2.gray = false;
                this.propRoot3.gray = false;
                this.propRoot4.gray = false;
                for (var i = 0; i < 4; i++) {
                    this["propRoot" + (i + 1).toString()].mouseEnabled = false;
                }
                if (GameMgr.Ins.curGameMode == E_GAME_MODE.MULTIPLAYER_PROP_GAME) {
                    this.propCardBtn.visible = true;
                    this.changeBtn(false);
                    this.closeBtn.visible = false;
                    this.giveUpBtn.visible = false;
                } else {
                    this.changeBtn(true);
                    this.propCardBtn.visible = true;
                    if (PlatformMgr.Ins._gameConfig.tryCarwuchu != 0 && PlatformMgr.Ins.iswuchuTimeOpen) {
                        this.closeBtn.visible = false;
                        this.giveUpBtn.visible = false;
                    } else {
                        this.closeBtn.visible = true;
                        this.giveUpBtn.visible = false;
                    }
                }
                this.initPropInfo();
                this.hideSelect();
                EventMgr.Ins.on(EventType.LOADING_CLOSE, this, this.btnDelay);
                this.btnDelay();
                PlatformMgr.Ins.initNativeAd(E_UI_TYPE.GAMECARDUI);

                let banner;
                let left = 50;
                let bottom = 0;
                let width = 300;

                this.closeBtn.visible = false;
                Laya.timer.once(AdConfigMgr.Ins.Switch_1, this, () => {
                    this.closeBtn.visible = true;
                });
            }
            propCardBtnOnClick() {
                if (GameMgr.Ins.curGameMode == E_GAME_MODE.MULTIPLAYER_PROP_GAME) {
                    if (this.isHasClick) {
                        //激励广告
                        showReward(() => {
                            var selectArray = [];
                            for (let i = 0; i < this.itemIndexList.length; i++) {
                                selectArray.push(this.CardArray[this.itemIndexList[i]]);
                            }
                            for (var i = 0; i < this.CardArray.length; i++) {
                                var isContain = false;
                                for (var j = 0; j < this.itemIndexList.length; j++) {
                                    if (i == this.itemIndexList[j]) {
                                        isContain = true;
                                    }
                                }
                                if (!isContain) selectArray.push(this.CardArray[i]);
                            }
                            EventMgr.Ins.dispatch(EventType.USEPROPCARD, selectArray);
                            GameMgr.Ins.gameCountDown();
                            this.close();
                        });

                    } else {
                        if (!this.isRandomAniPlaying) {
                            var rndCount = UsefulStuff.rnd(10, 15);
                            this.playRandomAni(rndCount);
                        }
                    }
                } else {
                    // PlatformMgr.Ins.showVideo(1, () => {
                    // console.log("PlatforMgr showVideo");
                    showReward(() => {

                        EventMgr.Ins.dispatch(EventType.USEPROPCARD, [E_PROP_TYPE.NOS, E_PROP_TYPE.NOS]);
                        GameMgr.Ins.gameCountDown();
                        this.close();
                    });
                    // }, E_PAGE_VIDEOID.SPEEDBUJI);
                }
            }
            changeBtn(isVideo) {
                if (isVideo) {
                    this.propCardInfo.skin = "uires/online/woquandouyao.png";
                    this.propCardInfo.centerX = 20;
                } else {
                    this.propCardInfo.skin = "uires/online/mianfeibu.png";
                    this.propCardInfo.centerX = 0;
                }
                this.videoIcon.visible = isVideo;
            }
            closeBtnOnClick() {
                if (GameMgr.Ins.curGameMode == E_GAME_MODE.MULTIPLAYER_PROP_GAME) {
                    var selectArray = [];
                    if (this.itemIndexList.length <= 0) {
                        selectArray = [0];
                    } else {
                        for (let i = 0; i < this.itemIndexList.length; i++) {
                            selectArray.push(this.CardArray[this.itemIndexList[i]]);
                        }
                    }
                    EventMgr.Ins.dispatch(EventType.USEPROPCARD, selectArray);
                }
                GameMgr.Ins.gameCountDown();
                this.close();
                PlatformMgr.Ins.closeNativeAd();
            }
            playRandomAni(randomCount) {
                if (randomCount <= 0) {
                    var target = this["propSelect" + this.selectID.toString()];
                    Laya.Tween.to(target, {
                        scaleX: 1.3,
                        scaleY: 1.3,
                        alpha: 0
                    }, 500);
                    this.propCardSelect(this.selectID);
                    this.changeBtn(true);
                    this.isRandomAniPlaying = false;
                    var cfg = CCfgMgr.Ins.cfgPropInfo.getItem(this.CardArray[this.selectID - 1]);
                    UIManager.Ins.getScene(E_UI_TYPE.LONGBLACKTIP).open(false, ["恭喜获得" + cfg._Name + "!"]);
                    return;
                }
                this.isRandomAniPlaying = true;
                var time = 20 * (16 - randomCount);
                Laya.timer.once(time, this, this.playRandomAni, [randomCount - 1], true);
                this.selectID++;
                if (this.selectID > 4) this.selectID = 1;
                this.updateSelect();
            }
            updateSelect() {
                this.propSelect1.visible = false;
                this.propSelect2.visible = false;
                this.propSelect3.visible = false;
                this.propSelect4.visible = false;
                this["propSelect" + this.selectID.toString()].visible = true;
            }
            propCardSelect(selectID) {
                if (GameMgr.Ins.curGameMode != E_GAME_MODE.MULTIPLAYER_PROP_GAME) return;
                if (!this.isHasClick) {
                    this.firstClickIndex = selectID - 1;
                    this.isHasClick = true;
                    this.itemIndexList.push(selectID - 1);
                    this["propRoot" + selectID.toString()].gray = true;
                    this.propCardBtn.visible = true;
                    if (PlatformMgr.Ins._gameConfig.tryCarwuchu != 0 && PlatformMgr.Ins.iswuchuTimeOpen) {
                        this.closeBtn.visible = false;
                        this.giveUpBtn.visible = false;
                        Laya.timer.once(PlatformMgr.Ins._gameConfig.xiaoziDelay, this, () => {
                            this.giveUpBtn.visible = true;
                        });
                    } else {
                        this.closeBtn.visible = true;
                        this.giveUpBtn.visible = false;
                    }
                    for (var i = 0; i < 4; i++) {
                        this["propRoot" + (i + 1).toString()].mouseEnabled = true;
                    }
                } else {
                    // PlatformMgr.Ins.showVideo(1, () => {
                    // console.log("PlatforMgr showVideo");
                    showReward(() => {

                        this["propRoot" + selectID.toString()].gray = true;
                        this.propCardBtn.visible = true;
                        if (PlatformMgr.Ins._gameConfig.tryCarwuchu != 0 && PlatformMgr.Ins.iswuchuTimeOpen) {
                            this.closeBtn.visible = false;
                            this.giveUpBtn.visible = false;
                            Laya.timer.once(PlatformMgr.Ins._gameConfig.xiaoziDelay, this, () => {
                                this.giveUpBtn.visible = true;
                            });
                        } else {
                            this.closeBtn.visible = true;
                            this.giveUpBtn.visible = false;
                        }
                        var cfg = CCfgMgr.Ins.cfgPropInfo.getItem(this.CardArray[selectID - 1]);
                        UIManager.Ins.getScene(E_UI_TYPE.LONGBLACKTIP).open(false, ["恭喜获得" + cfg._Name + "!"]);
                        this.itemIndexList.push(selectID - 1);
                        this.refreshVideoIcon();
                    });
                    // }, E_PAGE_VIDEOID.ITEMBUJI);
                }
                this.refreshVideoIcon();
            }
            refreshVideoIcon() {
                if (GameMgr.Ins.curGameMode == E_GAME_MODE.MULTIPLAYER_PROP_GAME) {
                    for (let i = 0; i < 4; i++) {
                        this["propRoot" + (i + 1).toString()].getChildAt(4).visible = this.firstClickIndex != i;
                    }
                }
            }
            initPropInfo() {
                var len = this.CardArray.length;
                if (len > 2) {
                    this.propRoot1.visible = true;
                    this.propRoot4.visible = true;
                } else {
                    this.propRoot1.visible = false;
                    this.propRoot4.visible = false;
                }
                for (var i = 0; i < len; i++) {
                    var cfg = CCfgMgr.Ins.cfgPropInfo.getItem(this.CardArray[i]);
                    if (len > 2) {
                        var propName = this["propName" + (i + 1).toString()];
                        var propQua = this["propQua" + (i + 1).toString()];
                        var propQuaBg = this["propQuaBg" + (i + 1).toString()];
                        this["rndProp" + (i + 1).toString()].skin = cfg._Icon;
                        propName.text = cfg._Name;
                        propQua.text = this.getQuaStr(cfg.cardLevel);
                        propQuaBg.skin = "uires/online/card" + cfg.cardLevel + ".png";
                    } else {
                        var propName = this["propName" + (i + 2).toString()];
                        var propQua = this["propQua" + (i + 2).toString()];
                        var propQuaBg = this["propQuaBg" + (i + 2).toString()];
                        this["rndProp" + (i + 2).toString()].skin = cfg._Icon;
                        propName.text = cfg._Name;
                        propQua.text = this.getQuaStr(cfg.cardLevel);
                        propQuaBg.skin = "uires/online/card" + cfg.cardLevel + ".png";
                    }
                }
            }
            hideSelect() {
                this.propSelect1.visible = false;
                this.propSelect2.visible = false;
                this.propSelect3.visible = false;
                this.propSelect4.visible = false;
                for (let i = 0; i < 4; i++) {
                    this["propRoot" + (i + 1).toString()].getChildAt(4).visible = false;
                }
            }
            getQuaStr(Qua) {
                if (Qua == 0) return "";
                if (Qua == 1) return "B级";
                if (Qua == 2) return "A级";
                if (Qua == 3) return "S级";
            }
            btnDelay() {
                if (GameMgr.Ins.curGameMode != E_GAME_MODE.MULTIPLAYER_PROP_GAME) if (PlatformMgr.Ins._gameConfig.tryCarwuchu != 0 && PlatformMgr.Ins.iswuchuTimeOpen) Laya.timer.once(PlatformMgr.Ins._gameConfig.xiaoziDelay, this, () => {
                    this.giveUpBtn.visible = true;
                });
            }
            onClosed() {
                Laya.timer.clearAll(this);
                EventMgr.Ins.offAllCaller(this);
                PlatformMgr.Ins.closeNativeAd();


            }
        }
        class Garage2UI extends ui.UIScenes.commonUI.Garage2UI {
            constructor() {
                super();
                this.currCarStage = 1;
                this.sortCarIdList = [];
                this.backId = E_UI_TYPE.STARTUI;
                this.gameMode = -1;
                this.currCarIdListIndex = 0;
                this.lastX = 0;
                this.hasTouch = false;
                this.isOpening = false;
                this.rndTime = 400;
                EventMgr.Ins.on(EventType.HTICONHIDE, this, () => {
                    this.htItem.visible = false;
                });
                EventMgr.Ins.on(EventType.REFRESH_GOLD, this, this.refreshRes);
                EventMgr.Ins.on(EventType.REFRESH_DIAMON, this, this.refreshRes);
                this.lvUpBtn.on(Laya.Event.CLICK, this, this.lvUpBtnOnClick);
                this.tryCarBtn.on(Laya.Event.CLICK, this, this.tryCarBtnClick);
                this.useCarBtn.on(Laya.Event.CLICK, this, this.useCarBtnClick);
                this.LeftBtn.on(Laya.Event.CLICK, this, this.leftBtnOnClick);
                this.rightBtn.on(Laya.Event.CLICK, this, this.rightBtnOnClick);
                this.backBtn.on(Laya.Event.CLICK, this, this.backBtnOnClick);
                this.touchBox.on(Laya.Event.MOUSE_DOWN, this, this.mouseDown);
                this.touchBox.on(Laya.Event.MOUSE_MOVE, this, this.mouseMove);
                this.touchBox.on(Laya.Event.MOUSE_OUT, this, this.mouseUp);
                this.touchBox.on(Laya.Event.MOUSE_UP, this, this.mouseUp);
                this.goldTipBtn.on(Laya.Event.CLICK, this, () => {
                    UIManager.Ins.getScene(E_UI_TYPE.VIDEO_COIN).open(false);
                });
                this.dmdTipBtn.on(Laya.Event.CLICK, this, () => {
                    UIManager.Ins.getScene(E_UI_TYPE.LUCKY_PAN).open(false);
                });
                this.firstCarBtn.on(Laya.Event.CLICK, this, this.carSkinClick, [1]);
                this.secondCarBtn.on(Laya.Event.CLICK, this, this.carSkinClick, [2]);
                this.thirdCarBtn.on(Laya.Event.CLICK, this, this.carSkinClick, [3]);
                this.scaleX = this.scaleY = GlobalScale$1.scale;
                this.width = Laya.stage.width / GlobalScale$1.scale;
                this.height = Laya.stage.height / GlobalScale$1.scale;
                this.rightBox.x += (this.width - 1280) / 4;
                Garage2UI.Ins = this;
                this.lvUpBtn.addComponent(BtnScript).initBtn(E_BtnType.SCALE);
                this.useCarBtn.addComponent(BtnScript).initBtn(E_BtnType.SCALE);
            }
            onAwake() {

                let banner;
                let left = 80;
                let bottom = 0;
                let width = 300;

                PrivateTracker_new.Ins.sendEvent(SDK_EVENT._打开车库界面, {
                    "_打开车库界面": "_打开车库界面"
                });
            }
            onOpened(list) {

                let banner;
                let left = 80;
                let bottom = 0;
                let width = 300;

                PrivateTracker_new.Ins.sendEvent(SDK_EVENT._打开车库界面, {
                    "_打开车库界面": "_打开车库界面"
                });
                this.loadingImage.play(0, true);
                this.initUIData(list);
                this.refreshUI();
                this.htItem.visible = true;
                this.refreshHtItem();
                PlatformMgr.Ins.initNativeAd(E_UI_TYPE.GARAGEUI);
                Laya.timer.loop(2e3, this, () => {
                    if (PlatformMgr.Ins.htBoxIconList && PlatformMgr.Ins.htBoxIconList[0] && PlatformMgr.Ins.htBoxIconList[0][DataMgr.Ins.currHtIndex]) {
                        DataMgr.Ins.currHtIndex++;
                        if (DataMgr.Ins.currHtIndex >= PlatformMgr.Ins.htBoxIconList[0].length) {
                            DataMgr.Ins.currHtIndex = 0;
                        }
                        this.refreshHtItem();
                    }
                });
                Laya.timer.loop(1e3, this.tryDaojishi, () => {
                    this.refreshCarDaojishi();
                });
            }
            initUIData(list) {
                EventMgr.Ins.on(EventType.TYRCAREXPIRE, this, () => {
                    this.refreshUI();
                });
                PlatformMgr.Ins.canShowBanner = true;
                this.isOpening = true;
                if (list != undefined) {
                    this.backId = list[0];
                    this.gameMode = list[1];
                } else {
                    this.backId = E_UI_TYPE.STARTUI;
                }
                this.currCarIdListIndex = 0;
                this.sortCarIdList = this.sortRacing();
                this.currShowcar = DataMgr.Ins.getCar(this.sortCarIdList[this.currCarIdListIndex]);
                this.currCarStage = DataMgr.Ins.carStage;
                this.LeftBtn.visible = false;
                this.rightBtn.visible = true;
                this.initNatureSliderAnim();
                this.playNatureScoreAni();
                this.load3DScene(this.currShowcar.cfg.assetId, this.currCarStage);
            }
            refreshRes() {
                this.goldLa.value = DataMgr.Ins.gold.toFixed(0);
                this.diamonLa.value = DataMgr.Ins.diamon.toFixed(0);
            }
            load3DScene(assetId, lv) {
                this.node3D = SceneMgr.Ins.createUIVFX("unity/podium/level_newgarage.lh", this.goldTipBtn.x, this.goldTipBtn.y, 3.8, 35, this.carParent);
                this.node3D.transform.rotationEuler = new Laya.Vector3(0, 180, 0);
                this.rotatePodium = this.node3D.getChildAt(0).getChildAt(0).getChildAt(0);
                this.loadCarScene(assetId, lv);
            }
            loadCarScene(assetId, lv) {
                if (this.currCarModel) {
                    this.currCarModel.destroy();
                    SceneMgr.Ins.clearLvUpEffect();
                }
                this.loadingImage.visible = true;
                LoadMgr.Ins.loadAsset(() => {
                    this.loadCarScene1(assetId, lv);
                }, [LoadMgr.Ins.unityResPath(E_UNITY_RES_PATH.CAR, "Car_" + assetId + "_" + lv + ".lh")]);
            }
            loadCarScene1(assetId, lv) {
                if (assetId != this.currShowcar.cfg.assetId || this.currCarStage != lv || !this.isOpening) return;
                if (this.currCarModel) {
                    this.currCarModel.destroy();
                    SceneMgr.Ins.clearLvUpEffect();
                }
                this.loadingImage.visible = false;
                var url = LoadMgr.Ins.unityResPath(E_UNITY_RES_PATH.CAR, "Car_" + assetId + "_" + lv + ".lh");
                this.currCarModel = SceneMgr.Ins.createUIVFX(url, this.goldTipBtn.x, this.goldTipBtn.y, 3.2, 35);
                SceneMgr.Ins.creatLvUpEffect(this.currCarModel);
                this.node3D.getChildAt(0).getChildAt(0).getChildAt(0).getChildAt(0).addChild(this.currCarModel);
                this.currCarModel && (this.currCarModel.getChildAt(0).getChildAt(5).getChildAt(0).active = false);
                this.currCarModel && (this.currCarModel.getChildAt(0).getChildAt(5).getChildAt(1).active = false);
                this.currCarModel && (this.currCarModel.getChildAt(0).getChildAt(5).getChildAt(2).active = false);
                this.currCarModel && (this.currCarModel.getChildAt(0).getChildAt(5).getChildAt(3).active = false);
                this.currCarModel && (this.currCarModel.getChildAt(0).getChildAt(5).getChildAt(4).active = false);
                var flyRoot = this.currCarModel.getChildAt(0).getChildAt(6);
                if (flyRoot) {
                    for (let i = 0; i < flyRoot.numChildren; i++) {
                        var ani = flyRoot.getChildAt(i).getComponent(Laya.Animator);
                        ani.play("fly_start");
                    }
                }
                this.rotatePodium.transform.localRotationEulerY = 0;
            }
            playOpenAni() { }
            playCloseAni() { }
            refreshUI() {
                this.racingName.text = this.currShowcar.cfg._Name;
                if (!this.currShowcar) return;
                if (this.currShowcar.cfg.carType == 0) {
                    this.carTypeTag.skin = "uires/garageNew/daoju.png";
                    this.chengDi.skin = "uires/garageNew/cheng.png";
                } else {
                    this.carTypeTag.skin = "uires/garageNew/jingsu.png";
                    this.chengDi.skin = "uires/garageNew/lan.png";
                }
                if (this.currShowcar.cfg._Name.length < 4) {
                    this.fitName.x = 215;
                } else if (this.currShowcar.cfg._Name.length < 5) {
                    this.fitName.x = 247;
                } else {
                    this.fitName.x = 279;
                }
                this.racingLv.text = "Lv" + this.currShowcar.lv.toFixed(0);
                this.qulityImg.skin = "uires/oneRace1/qulity_" + this.currShowcar.getQuality() + ".png";
                this.drivingCarImg.visible = this.currShowcar.id == DataMgr.Ins.currSelectCar.id && this.currCarStage == DataMgr.Ins.carStage;
                this.natureScore.value = this.currShowcar.getNatureScore() + "分";
                this.refreshLvBtn();
                this.refreshUseCarBtn();
                this.refreshRes();
                this.refreshSkill();
                this.refreshLockPic();
                this.refreshSelectBox();
                this.refreshDuihaoImage();
                this.refreshCarDaojishi();
            }
            refreshCarDaojishi() {
                if (!this.currShowcar) return;
                this.tryDaojishi.visible = false;
                if (this.currShowcar.isLock) {
                    if (this.currShowcar.currShengTryTime > 0) {
                        this.tryDaojishi.text = UsefulStuff.formatMS2(this.currShowcar.currShengTryTime);
                        this.tryDaojishi.visible = true;
                    }
                }
            }
            sliderAnimPlay(a, initNum, num, time = 10) {
                let symbol = 1;
                if (initNum > num) {
                    symbol = -1;
                }
                let perAddNum = num / 20;
                a.width = initNum;
                Laya.timer.loop(time, a, () => {
                    a.width += perAddNum * symbol;
                    if (symbol > 0) {
                        if (a.width >= num) {
                            a.width = num;
                            Laya.timer.clearAll(a);
                            this.maxSpeedAnim.visible = false;
                            this.handleNatureAnim.visible = false;
                            this.SUAnim.visible = false;
                        }
                    } else {
                        if (a.width <= num) {
                            a.width = num;
                            Laya.timer.clearAll(a);
                            this.maxSpeedAnim.visible = false;
                            this.handleNatureAnim.visible = false;
                            this.SUAnim.visible = false;
                        }
                    }
                });
            }
            initNatureSliderAnim() {
                this.sliderAnimPlay(this.maxSpeedSlider, .01, this.maxSpeedSlider.parent.width * this.currShowcar.getCurrMaxSpeed() / this.currShowcar.getMaxSpeed());
                this.sliderAnimPlay(this.SUSlider, .01, this.SUSlider.parent.width * (this.currShowcar.getMaxSU() - this.currShowcar.getCurrSU()) / this.currShowcar.getMaxSU());
                this.sliderAnimPlay(this.handleNatureSlider, .01, this.handleNatureSlider.parent.width * this.currShowcar.cfg.handleNature / 100);
            }
            refreshSliderAnim(isLv = false) {
                this.sliderAnimPlay(this.maxSpeedSlider, this.maxSpeedSlider.width, this.maxSpeedSlider.parent.width * this.currShowcar.getCurrMaxSpeed() / this.currShowcar.getMaxSpeed());
                this.sliderAnimPlay(this.SUSlider, this.SUSlider.width, this.SUSlider.parent.width * (this.currShowcar.getMaxSU() - this.currShowcar.getCurrSU()) / this.currShowcar.getMaxSU());
                this.sliderAnimPlay(this.handleNatureSlider, this.handleNatureSlider.width, this.handleNatureSlider.parent.width * this.currShowcar.cfg.handleNature / 100);
            }
            getQuiltyDiImage(index) {
                switch (index) {
                    case 0:
                        return "uires/garage/C-tip.png";

                    case 1:
                        return "uires/garage/B-tip.png";

                    case 2:
                        return "uires/garage/A-tip.png";

                    case 3:
                        return "uires/garage/S-tip.png";
                }
            }
            backBtnOnClick() {
                SoundMgr.Ins.Press();
                this.close();
                Laya.timer.clearAll(this);
                SceneMgr.Ins.clearUIScene();
                SceneMgr.Ins.clearLvUpEffect();
                if (DataMgr.IsNewGuiding() && PlatformMgr.Ins.isQQ) {
                    UIManager.Ins.getScene(E_UI_TYPE.PICKMODE).open(true, this.gameMode);
                    return;
                }
                if (this.backId == E_UI_TYPE.MULTIRACE) UIManager.Ins.getScene(this.backId).open(true, this.gameMode); else UIManager.Ins.getScene(this.backId).open();
            }
            lvUpBtnOnClick() {
                SoundMgr.Ins.lvUpAndBuyBtn();
                if (PlatformMgr.Ins.platform == E_PLATFORM_TYPE.TT) {
                    DataMgr.Ins.garageClickNum++;
                    if (DataMgr.Ins.garageClickNum >= PlatformMgr.Ins._gameConfig.popInsertCarClickNum) {
                        DataMgr.Ins.garageClickNum = 0;
                        PlatformMgr.Ins.showInsert();
                    }
                }
                if (this.currShowcar.lv >= this.currShowcar.cfg.maxLvl || this.currShowcar.isLock) {
                    if (this.currShowcar.isLock) UIManager.Ins.getScene(E_UI_TYPE.LONGBLACKTIP).open(false, ["请先解锁车辆呦~"]);
                    return;
                } else {
                    if (DataMgr.Ins.gold >= this.currShowcar.getLvUpGoldNeed()) {
                        SceneMgr.Ins.playLvUpEffect();
                        DataMgr.Ins.addGold(-this.currShowcar.getLvUpGoldNeed());
                        this.currShowcar.lvUp();
                        if (this.currShowcar.lv == 5 || this.currShowcar.lv == 10) {
                            this.currOpenCar = this.currShowcar;
                            let stage = this.currShowcar.getMaxStage();
                            DataMgr.Ins.carStage = stage;
                            this.currCarStage = stage;
                            UIManager.Ins.addUiOnScene3D(E_UI_TYPE.GETCARUI);
                        }
                        this.playNatureScoreAni();
                        DataMgr.Ins.SavePlayerData();
                        this.refreshSliderAnim(true);
                        if (Math.random() < PlatformMgr.Ins._gameConfig.garageInsertChance / 100) {
                            PlatformMgr.Ins.initNativeInsert(16, null, null);
                        }
                    } else {
                        if (DataMgr.Ins.getCionTipTimes() > 0) {
                            UIManager.Ins.getScene(E_UI_TYPE.VIDEO_COIN).open(false);
                        } else {
                            UIManager.Ins.getScene(E_UI_TYPE.LONGBLACKTIP).open(false);
                        }
                    }
                }
                this.refreshUI();
            }
            carSkinClick(id) {
                SoundMgr.Ins.Press();
                let oldCarStage = this.currCarStage;
                this.currCarStage = id;
                this.refreshUI();
                if (oldCarStage != this.currCarStage) this.loadCarScene(this.currShowcar.cfg.assetId, id);
            }
            useCarBtnClick() {
                SoundMgr.Ins.lvUpAndBuyBtn();
                if (this.currShowcar.isLock) {
                    if (this.currShowcar.cfg.unLockType == E_UNLOCKCAR_TYPE.DIAMOND) {
                        if (DataMgr.Ins.diamon >= this.currShowcar.cfg.unLockNeedPatch) {
                            DataMgr.Ins.addDiamon(-this.currShowcar.cfg.unLockNeedPatch);
                            this.currShowcar.isLock = false;
                            this.currOpenCar = this.currShowcar;
                            DataMgr.Ins.setCurrSelectCar(this.currShowcar.id);
                            DataMgr.Ins.carStage = 1;
                            UIManager.Ins.addUiOnScene3D(E_UI_TYPE.GETCARUI);
                            DataMgr.Ins.SavePlayerData();
                        } else {
                            UIManager.Ins.getScene(E_UI_TYPE.LUCKY_PAN).open(false);
                        }
                    } else if (this.currShowcar.cfg.unLockType == E_UNLOCKCAR_TYPE.SIGNIN) {
                        if (this.currShowcar.isOpenVideoBuy) {
                            //激励广告
                            showReward(() => {
                                this.currShowcar.isLock = false;
                                this.currOpenCar = this.currShowcar;
                                DataMgr.Ins.setCurrSelectCar(this.currShowcar.id);
                                DataMgr.Ins.carStage = 1;
                                UIManager.Ins.addUiOnScene3D(E_UI_TYPE.GETCARUI);
                                DataMgr.Ins.SavePlayerData();
                                this.refreshUI();
                            });

                        } else {
                            UIManager.Ins.getScene(E_UI_TYPE.CHECK_IN).open(false);
                        }
                    } else if (this.currShowcar.cfg.unLockType == E_UNLOCKCAR_TYPE.LEVELRWD) {
                        UIManager.Ins.getScene(E_UI_TYPE.LONGBLACKTIP).open(false, ["暂无资格"]);
                    } else if (this.currShowcar.cfg.unLockType == E_UNLOCKCAR_TYPE.ZHUANPAN) {
                        UIManager.Ins.getScene(E_UI_TYPE.LUCKY_PAN).open(false);
                    } else if (this.currShowcar.cfg.unLockType == E_UNLOCKCAR_TYPE.VIDEO) {
                        //激励广告
                        showReward(() => {
                            this.currShowcar.currVideoTimes++;
                            if (this.currShowcar.currVideoTimes >= this.currShowcar.cfg.unLockNeedPatch) {
                                this.currShowcar.currVideoTimes = this.currShowcar.cfg.unLockNeedPatch;
                                this.currShowcar.isLock = false;
                                this.currOpenCar = this.currShowcar;
                                DataMgr.Ins.setCurrSelectCar(this.currShowcar.id);
                                DataMgr.Ins.carStage = 1;
                                UIManager.Ins.addUiOnScene3D(E_UI_TYPE.GETCARUI);
                                DataMgr.Ins.SavePlayerData();
                            }
                            this.refreshUI();
                        });

                    }
                } else {
                    if (this.currShowcar.id == DataMgr.Ins.getCurrSelectCar().id && this.currCarStage == DataMgr.Ins.carStage) return;
                    if (this.currCarStage != 1) {
                        if (this.currCarStage == 2) {
                            if (this.currShowcar.lv < 5) {
                                UIManager.Ins.getScene(E_UI_TYPE.LONGBLACKTIP).open(false, ["升级至5级可驾驶"]);
                                return;
                            }
                        }
                        if (this.currCarStage == 3) {
                            if (this.currShowcar.lv < 10) {
                                UIManager.Ins.getScene(E_UI_TYPE.LONGBLACKTIP).open(false, ["升级至10级可驾驶"]);
                                return;
                            }
                        }
                    }
                    DataMgr.Ins.setCurrSelectCar(this.currShowcar.id);
                    DataMgr.Ins.carStage = this.currCarStage;
                }
                this.refreshUI();
            }
            settingBtnOnClick() {
                SoundMgr.Ins.Press();
                UIManager.Ins.addUiOnScene3D(E_UI_TYPE.PROFILE);
            }
            driverBtnOnClick() {
                SoundMgr.Ins.Press();
                SceneMgr.Ins.clearUIScene();
                SceneMgr.Ins.clearLvUpEffect();
                UIManager.Ins.getScene(E_UI_TYPE.DRIVERUI).open();
            }
            leftBtnOnClick() {
                SoundMgr.Ins.Press();
                if (this.currCarIdListIndex > 0) {
                    this.currCarIdListIndex--;
                    let racingId = this.sortCarIdList[this.currCarIdListIndex];
                    if (this.currCarIdListIndex <= 0) {
                        this.LeftBtn.visible = false;
                    }
                    this.currShowcar = DataMgr.Ins.getCar(racingId);
                    this.currCarStage = DataMgr.Ins.carStage;
                    if (this.currShowcar.id != DataMgr.Ins.getCurrSelectCar().id) {
                        this.currCarStage = 1;
                    }
                    this.refreshUI();
                    this.refreshSliderAnim();
                    this.loadCarScene(this.currShowcar.cfg.assetId, this.currCarStage);
                    this.rightBtn.visible = true;
                    this.playNatureScoreAni();
                }
            }
            rightBtnOnClick() {
                SoundMgr.Ins.Press();
                if (this.currCarIdListIndex < this.sortCarIdList.length - 1) {
                    this.currCarIdListIndex++;
                    let racingId = this.sortCarIdList[this.currCarIdListIndex];
                    if (this.currCarIdListIndex == this.sortCarIdList.length - 1) {
                        this.rightBtn.visible = false;
                    }
                    this.currShowcar = DataMgr.Ins.getCar(racingId);
                    this.currCarStage = DataMgr.Ins.carStage;
                    if (this.currShowcar.id != DataMgr.Ins.getCurrSelectCar().id) {
                        this.currCarStage = 1;
                    }
                    this.refreshUI();
                    this.refreshSliderAnim();
                    this.loadCarScene(this.currShowcar.cfg.assetId, this.currCarStage);
                    this.LeftBtn.visible = true;
                    this.playNatureScoreAni();
                }
            }
            refreshLvBtn() {
                this.lvUpBtn.gray = false;
                this.refreshLvUpRedPointTip(true);
                this.lvUpBtn.getChildAt(0).visible = false;
                this.lvUpBtn.getChildAt(1).visible = false;
                if (this.currShowcar.isLock) {
                    this.lvUpBtn.gray = true;
                    this.lvUpBtn.getChildAt(1).visible = true;
                    this.shengJiLa.text = "升级";
                    this.refreshLvUpRedPointTip(false);
                } else {
                    if (this.currShowcar.lv >= this.currShowcar.cfg.maxLvl) {
                        this.refreshLvUpRedPointTip(false);
                        this.lvUpBtn.getChildAt(1).visible = true;
                        this.shengJiLa.text = "Max";
                    } else {
                        this.lvUpBtn.getChildAt(0).visible = true;
                        this.upNeedMoney.text = Math.floor(this.currShowcar.getLvUpGoldNeed()).toString();
                        if (DataMgr.Ins.gold < this.currShowcar.getLvUpGoldNeed()) {
                            this.refreshLvUpRedPointTip(false);
                        }
                    }
                }
            }
            refreshUseCarBtn() {
                for (let i = 0; i < 7; i++) {
                    this.useCarBtn.getChildAt(i).visible = false;
                }
                this.refreshLockRedPointTip(false);
                this.useCarBtn.visible = false;
                this.tryCarBtn.visible = false;
                if (this.currShowcar.isLock) {
                    this.useCarBtn.gray = false;
                    if (this.currShowcar.cfg.unLockType == E_UNLOCKCAR_TYPE.SIGNIN && this.currShowcar.currShengTryTime > 0) {
                        this.tryCarBtn.visible = true;
                        this.tryCarBtn.gray = this.currCarStage > 1;
                        if (DataMgr.Ins.currSelectCar.id == this.currShowcar.id) {
                            this.tryCarBtn.getChildAt(0).text = "试用中";
                        } else {
                            this.tryCarBtn.getChildAt(0).text = "试用";
                        }
                    } else {
                        this.useCarBtn.visible = true;
                        if (this.currShowcar.cfg.unLockType == E_UNLOCKCAR_TYPE.SP) {
                            this.useCarBtn.getChildAt(0).visible = true;
                        } else if (this.currShowcar.cfg.unLockType == E_UNLOCKCAR_TYPE.DIAMOND) {
                            this.useCarBtn.getChildAt(1).visible = true;
                            this.diamonNeedNum.text = this.currShowcar.cfg.unLockNeedPatch.toFixed(0);
                            if (DataMgr.Ins.diamon >= this.currShowcar.cfg.unLockNeedPatch) {
                                this.refreshLockRedPointTip(true);
                            }
                        } else if (this.currShowcar.cfg.unLockType == E_UNLOCKCAR_TYPE.SIGNIN) {
                            if (this.currShowcar.isOpenVideoBuy) {
                                this.useCarBtn.getChildAt(4).visible = true;
                                this.videoNum.text = "x1";
                            } else {
                                this.useCarBtn.getChildAt(3).visible = true;
                            }
                        } else if (this.currShowcar.cfg.unLockType == E_UNLOCKCAR_TYPE.LEVELRWD) {
                            this.useCarBtn.getChildAt(2).visible = true;
                        } else if (this.currShowcar.cfg.unLockType == E_UNLOCKCAR_TYPE.GUIDE) {
                            this.useCarBtn.getChildAt(0).visible = true;
                        } else if (this.currShowcar.cfg.unLockType == E_UNLOCKCAR_TYPE.ZHUANPAN) {
                            this.useCarBtn.getChildAt(5).visible = true;
                        } else if (this.currShowcar.cfg.unLockType == E_UNLOCKCAR_TYPE.VIDEO) {
                            this.useCarBtn.getChildAt(4).visible = true;
                            this.refreshLockRedPointTip(true);
                            this.videoNum.text = "x" + (this.currShowcar.cfg.unLockNeedPatch - this.currShowcar.currVideoTimes);
                        }
                    }
                    this.carStateImage.skin = "uires/garageNew/weihuode.png";
                } else {
                    this.useCarBtn.visible = true;
                    this.useCarBtn.getChildAt(6).visible = true;
                    this.useCarBtn.gray = this.currShowcar.lv < (this.currCarStage - 1) * 5;
                    this.useCarBtn.getChildAt(6).getChildAt(0).text = this.currShowcar.id == DataMgr.Ins.currSelectCar.id && this.currCarStage == DataMgr.Ins.carStage ? "驾驶中" : "驾驶";
                    this.carStateImage.skin = "uires/garageNew/yongjiu.png";
                }
            }
            tryCarBtnClick() {
                if (!this.currShowcar) return;
                if (this.currShowcar.getMaxStage() < this.currCarStage) return;
                if (this.currShowcar.currShengTryTime > 0) {
                    this.currCarStage = 1;
                    DataMgr.Ins.setCurrSelectCar(this.currShowcar.id);
                    DataMgr.Ins.carStage = this.currCarStage;
                    DataMgr.Ins.SavePlayerData();
                    this.refreshUI();
                } else {
                    this.refreshUI();
                }
            }
            mouseDown() {
                this.hasTouch = true;
                this.lastX = Laya.stage.mouseX;
                Laya.timer.clearAll(this.rotatePodium);
            }
            mouseMove() {
                if (!this.hasTouch) return;
                let offsetX = Laya.stage.mouseX - this.lastX;
                if (this.rotatePodium && this.rotatePodium.transform) {
                    this.rotatePodium.transform.localRotationEulerY += .5 * offsetX;
                    this.lastX = Laya.stage.mouseX;
                }
            }
            mouseUp() {
                this.hasTouch = false;
                if (this.rotatePodium && this.rotatePodium.transform) {
                    let y = this.rotatePodium.transform.localRotationEulerY;
                    y = (y % 360 + 360 + 180) % 360 - 180;
                    this.rotatePodium.transform.localRotationEulerY = y;
                    Laya.timer.frameLoop(1, this.rotatePodium, () => {
                        this.rotatePodium.transform.localRotationEulerY *= .95;
                        if (Math.abs(this.rotatePodium.transform.localRotationEulerY) < .001) {
                            Laya.timer.clearAll(this.rotatePodium);
                        }
                    });
                }
            }
            refreshSelectBox() {
                this.firstCarBtn.getChildAt(0).skin = this.secondCarBtn.getChildAt(0).skin = this.thirdCarBtn.getChildAt(0).skin = "uires/garageNew/saichekuang2.png";
                this.firstCarBtn.scale(.8, .8);
                this.secondCarBtn.scale(.8, .8);
                this.thirdCarBtn.scale(.8, .8);
                switch (this.currCarStage) {
                    case 1:
                        this.firstCarBtn.getChildAt(0).skin = "uires/garageNew/saichekuang.png";
                        this.firstCarBtn.scale(1, 1);
                        break;

                    case 2:
                        this.secondCarBtn.getChildAt(0).skin = "uires/garageNew/saichekuang.png";
                        this.secondCarBtn.scale(1, 1);
                        break;

                    case 3:
                        this.thirdCarBtn.getChildAt(0).skin = "uires/garageNew/saichekuang.png";
                        this.thirdCarBtn.scale(1, 1);
                        break;
                }
            }
            refreshSkill() {
                let skillId = this.currShowcar.cfg._SkillId[this.currShowcar.getSkillLv() - 1];
                let iconName = CCfgMgr.Ins.cfgSkillInfo.getItem(skillId)._SkillIconName;
                this.skillIcon.skin = LoadMgr.Ins.WebResHttp + "skillIcon/" + iconName + ".png";
                this.skillDesc.text = CCfgMgr.Ins.cfgSkillInfo.getItem(skillId)._Desc;
                this.skillName.text = CCfgMgr.Ins.cfgSkillInfo.getItem(skillId)._Name;
            }
            refreshLockPic() {
                this.firstLvLock.skin = LoadMgr.Ins.WebResHttp + "carIcon/" + this.currShowcar.cfg._RacingIconName[0] + ".png";
                this.secondLvLock.skin = LoadMgr.Ins.WebResHttp + "carIcon/" + this.currShowcar.cfg._RacingIconName[1] + ".png";
                this.thirdLvLock.skin = LoadMgr.Ins.WebResHttp + "carIcon/" + this.currShowcar.cfg._RacingIconName[2] + ".png";
                this.firstCarBtn.getChildAt(1).visible = true;
                this.secondCarBtn.getChildAt(1).visible = true;
                this.thirdCarBtn.getChildAt(1).visible = true;
                if (this.currShowcar.isLock) {
                    if (this.currShowcar.currShengTryTime > 0) {
                        this.firstCarBtn.getChildAt(1).visible = false;
                    }
                } else {
                    if (this.currShowcar.lv < 5) {
                        this.firstCarBtn.getChildAt(1).visible = false;
                    } else if (this.currShowcar.lv < 10) {
                        this.firstCarBtn.getChildAt(1).visible = false;
                        this.secondCarBtn.getChildAt(1).visible = false;
                    } else {
                        this.firstCarBtn.getChildAt(1).visible = false;
                        this.secondCarBtn.getChildAt(1).visible = false;
                        this.thirdCarBtn.getChildAt(1).visible = false;
                    }
                }
            }
            refreshDuihaoImage() {
                this.firstCarBtn.getChildAt(2).visible = false;
                this.secondCarBtn.getChildAt(2).visible = false;
                this.thirdCarBtn.getChildAt(2).visible = false;
                if (this.currShowcar.id == DataMgr.Ins.getCurrSelectCar().id) {
                    switch (DataMgr.Ins.carStage) {
                        case 1:
                            this.tryImg.skin = this.currShowcar.isLock ? "uires/garageNew/shiyong22.png" : "uires/garageNew/shiyong23.png";
                            this.firstCarBtn.getChildAt(2).visible = true;
                            break;

                        case 2:
                            this.secondCarBtn.getChildAt(2).visible = true;
                            break;

                        case 3:
                            this.thirdCarBtn.getChildAt(2).visible = true;
                            break;
                    }
                }
            }
            sortRacing() {
                let lockList = [];
                let unLockList = [];
                for (let i = 0; i < DataMgr.Ins.carList.length; i++) {
                    let carData = DataMgr.Ins.carList[i];
                    if (carData.isLock) {
                        lockList.push(DataMgr.Ins.carList[i].id);
                    } else {
                        if (DataMgr.Ins.carList[i].id != DataMgr.Ins.getCurrSelectCar().id) unLockList.push(DataMgr.Ins.carList[i].id);
                    }
                }
                lockList = this.idSort(lockList);
                unLockList = this.idSort(unLockList);
                var c = unLockList.concat(lockList);
                c = [DataMgr.Ins.getCurrSelectCar().id].concat(c);
                return c;
            }
            idSort(list) {
                for (var i = 0; i < list.length; i++) {
                    for (var j = i; j < list.length; j++) {
                        if (DataMgr.Ins.getCar(list[i]).getQuality() > DataMgr.Ins.getCar(list[j]).getQuality()) {
                            let maxStr = list[j];
                            list[j] = list[i];
                            list[i] = maxStr;
                        } else if (DataMgr.Ins.getCar(list[i]).getQuality() == DataMgr.Ins.getCar(list[j]).getQuality()) {
                            if (DataMgr.Ins.getCar(list[i]).getNatureScore() > DataMgr.Ins.getCar(list[j]).getNatureScore()) {
                                let maxStr = list[j];
                                list[j] = list[i];
                                list[i] = maxStr;
                            }
                        }
                    }
                }
                return list;
            }
            onClosed() {
                Laya.timer.clearAll(this);
                Laya.timer.clearAll(this.maxSpeedSlider);
                Laya.timer.clearAll(this.SUSlider);
                Laya.timer.clearAll(this.handleNatureSlider);
                PlatformMgr.Ins.hideBanner();
                Laya.timer.clearAll(this.natureScore);
                EventMgr.Ins.offAll(EventType.TYRCAREXPIRE);
                this.isOpening = false;
                PlatformMgr.Ins.closeNativeAd();


            }
            refreshLvUpRedPointTip(isShow) {
                this.redTip.visible = isShow;
            }
            refreshLockRedPointTip(isShow) {
                this.lockRedTip.visible = isShow;
            }
            refreshHtItem() {
                if (PlatformMgr.Ins.htBoxIconList && PlatformMgr.Ins.htBoxIconList[0] && PlatformMgr.Ins.htBoxIconList[0][DataMgr.Ins.currHtIndex]) {
                    let itemScript = this.htItem.getComponent(HtGameScript);
                    itemScript.initData(PlatformMgr.Ins.htBoxIconList[0][DataMgr.Ins.currHtIndex]);
                } else {
                    this.htItem.visible = false;
                }
            }
            playNatureScoreAni() {
                if (!this.currShowcar) {
                    return;
                }
                let length = this.currShowcar.getNatureScore().toString().length;
                Laya.timer.clearAll(this.natureScore);
                let time = 0;
                if (length >= 4) {
                    this.natureScore.value = UsefulStuff.rnd(0, 9) + "" + UsefulStuff.rnd(0, 9) + "" + UsefulStuff.rnd(0, 9) + "" + UsefulStuff.rnd(0, 9) + "分";
                    Laya.timer.loop(40, this.natureScore, () => {
                        time += 40;
                        console.log(time);
                        this.natureScore.value = UsefulStuff.rnd(0, 9) + "" + UsefulStuff.rnd(0, 9) + "" + UsefulStuff.rnd(0, 9) + "" + UsefulStuff.rnd(0, 9) + "分";
                        if (time >= this.rndTime) {
                            this.natureScore.value = this.currShowcar.getNatureScore() + "分";
                            this.ani1.play(0, false);
                            Laya.timer.clearAll(this.natureScore);
                        }
                    });
                } else {
                    this.natureScore.value = UsefulStuff.rnd(0, 9) + "" + UsefulStuff.rnd(0, 9) + "" + UsefulStuff.rnd(0, 9) + "分";
                    Laya.timer.loop(40, this.natureScore, () => {
                        time += 40;
                        this.natureScore.value = UsefulStuff.rnd(0, 9) + "" + UsefulStuff.rnd(0, 9) + "" + UsefulStuff.rnd(0, 9) + "分";
                        if (time >= this.rndTime) {
                            this.natureScore.value = this.currShowcar.getNatureScore() + "分";
                            this.ani1.play(0, false);
                            Laya.timer.clearAll(this.natureScore);
                        }
                    });
                }
            }
        }
        class GetCarUI extends ui.UIScenes.commonUI.GetCarUI {
            constructor() {
                super();
                this.closeBtn.on(Laya.Event.CLICK, this, this.closeBtnOnClick);
                this.scaleX = this.scaleY = GlobalScale$1.scale;
                this.width = Laya.stage.width / GlobalScale$1.scale;
                this.height = Laya.stage.height / GlobalScale$1.scale;
                this.centerImage.x += (Laya.stage.width - 1280) / 2;
            }
            onOpened() { }
            playOpenAni() { }
            playCloseAni() { }
            onEnable() {
                if (Garage2UI.Ins) this.refreshUI(Garage2UI.Ins.currOpenCar);
                Laya.timer.loop(30, this, () => {
                    this.loadingImage.rotation += 2;
                });
                PlatformMgr.Ins.closeNativeAd();
            }
            refreshUI(data) {
                this.racingName.text = data.cfg._Name;
                this.racingLv.text = "LV." + data.lv;
                let stage = data.getMaxStage();
                this.createUIScene();
                this.loadCarScene(data.cfg.assetId, stage);
            }
            closeBtnOnClick() {
                SoundMgr.Ins.Press();
                Laya.timer.clearAll(this);
                this.UIScene.destroy();
                this.UIScene = null;
                this.removeSelf();
                Garage2UI.Ins.loadCarScene(Garage2UI.Ins.currShowcar.cfg.assetId, Garage2UI.Ins.currCarStage);
            }
            loadCarScene(assetId, lv) {
                let url = LoadMgr.Ins.cdnHttp;
                LoadMgr.Ins.loadAsset(() => {
                    this.loadCarScene1(assetId, lv);
                }, [LoadMgr.Ins.unityResPath(E_UNITY_RES_PATH.CAR, "Car_" + assetId + "_" + lv + ".lh")]);
                this.loadingImage.visible = true;
            }
            loadCarScene1(assetId, lv) {
                if (!this.UIScene) return;
                var url = LoadMgr.Ins.unityResPath(E_UNITY_RES_PATH.CAR, "Car_" + assetId + "_" + lv + ".lh");
                let currCarModel = this.createUIVFX(url, this.carPosBox.x, this.carPosBox.y, 3.2, 32);
                currCarModel && (currCarModel.getChildAt(0).getChildAt(5).active = false);
                currCarModel && (currCarModel.transform.localPosition = new Laya.Vector3(0, -.4, -7));
                currCarModel && (currCarModel.transform.rotationEuler = new Laya.Vector3(20, -45, -5));
                this.loadingImage.visible = false;
            }
            createUIScene() {
                this.UIScene = new Laya.Scene3D();
                this.UIScene.ambientColor = new Laya.Vector3(1, 1, 1);
                this.UICamera = new Laya.Camera();
                let light = Laya.Sprite3D.instantiate(Laya.loader.getRes("unity/level/Conventional/uiscene.ls").getChildAt(0));
                let UILight = new Laya.DirectionLight();
                UILight.transform.rotate(new Laya.Vector3(30, 0, 0), false);
                window["uilight"] = UILight;
                this.UIScene.addChild(this.UICamera);
                this.UIScene.addChild(UILight);
                this.UIScene.addChild(light);
                this.UICamera.clearFlag = 2;
                Laya.stage.addChild(this.UIScene);
            }
            createUIVFX(skinUrl, x, y, dis, FOV) {
                var VFXModel = Laya.loader.getRes(skinUrl);
                if (VFXModel) {
                    var VFX = Laya.Sprite3D.instantiate(VFXModel);
                    this.UICamera.addChild(VFX);
                    this.UICamera.viewport.width = this.width;
                    this.UICamera.viewport.height = this.height;
                    this.UICamera.fieldOfView = FOV;
                    return VFX;
                }
                return null;
            }
        }
        var E_GUIDE_EVENT;
        (function (E_GUIDE_EVENT) {
            E_GUIDE_EVENT[E_GUIDE_EVENT["NONE"] = 0] = "NONE";
            E_GUIDE_EVENT[E_GUIDE_EVENT["CLICK"] = 1] = "CLICK";
            E_GUIDE_EVENT[E_GUIDE_EVENT["DOWN"] = 2] = "DOWN";
            E_GUIDE_EVENT[E_GUIDE_EVENT["DOWNTIME"] = 3] = "DOWNTIME";
            E_GUIDE_EVENT[E_GUIDE_EVENT["BOXCLICK"] = 4] = "BOXCLICK";
            E_GUIDE_EVENT[E_GUIDE_EVENT["UP"] = 5] = "UP";
        })(E_GUIDE_EVENT || (E_GUIDE_EVENT = {}));
        class GuideUI extends ui.UIScenes.commonUI.GuideUI {
            constructor() {
                super();
                this.clickGuide.on(Laya.Event.CLICK, this, this.clickGuideOnClick);
                this.clickGuide.on(Laya.Event.MOUSE_DOWN, this, this.clickGuideOnDown);
                this.clickGuide.on(Laya.Event.MOUSE_UP, this, this.clickGuideOnUp);
                this.bgBox.on(Laya.Event.CLICK, this, this.bgBoxOnClick);
            }
            onAwake() {
                this.scaleX = this.scaleY = GlobalScale$1.scale;
                this.width = Laya.stage.width / GlobalScale$1.scale;
                this.height = Laya.stage.height / GlobalScale$1.scale;
                this.bgBox.width = Laya.stage.width / GlobalScale$1.scale;
                this.bgBox.height = Laya.stage.height / GlobalScale$1.scale;
            }
            onOpened() { }
            playGuide(cfg, target) {
                if (cfg) {
                    this.cfg = cfg;
                    this.guideWindow.height = 150;
                    this.guideWindow.width = 400;
                    this.guideDetail.height = 100;
                    this.guideDetail.width = 350;
                    if (cfg.TextSizeY > 0) {
                        this.guideWindow.height = 150 + cfg.TextSizeY;
                        this.guideDetail.height = 150 + cfg.TextSizeY;
                    }
                    if (cfg.TextSizeX > 0) {
                        this.guideWindow.width = 400 + cfg.TextSizeX;
                        this.guideDetail.width = 350 + cfg.TextSizeX;
                    }
                    if (target) {
                        let s = GlobalScale$1.scale;
                        this.clickGuide.visible = true;
                        this.blockMask.visible = true;
                        this.line.visible = true;
                        var point = target.localToGlobal(new Laya.Point(0, 0));
                        this.clickGuide.pos((point.x + cfg.OffsetX) / s + target.width / 2, (point.y + cfg.OffsetY) / s + target.height / 2);
                        this.blockMask.pos((point.x + cfg.OffsetX) / s + target.width / 2, (point.y + cfg.OffsetY) / s + target.height / 2);
                        if (cfg.changeObj > 0) {
                            var cir = this.blockMask["_graphics"]._cmds[0];
                            var rect = this.blockMask["_graphics"]._cmds[1];
                            cir.radius = 0;
                            rect.width = target.getSelfBounds().width;
                            rect.height = target.getSelfBounds().height;
                            rect.x = -(target.getSelfBounds().width - 200) / 2;
                            rect.y = -(target.getSelfBounds().height - 200) / 2;
                            this.cirAni.visible = false;
                            this.rectAni.visible = true;
                            this.rectAni.width = target.getSelfBounds().width + 25;
                            this.rectAni.height = target.getSelfBounds().height + 25;
                        } else {
                            var cir = this.blockMask["_graphics"]._cmds[0];
                            var rect = this.blockMask["_graphics"]._cmds[1];
                            cir.radius = 60;
                            rect.width = 0;
                            rect.height = 0;
                            this.cirAni.visible = true;
                            this.rectAni.visible = false;
                        }
                        this.guideWindow.x = this.clickGuide.x > this.width * .5 ? this.clickGuide.x - 550 - cfg.TextSizeX + cfg.TextOffsetX : this.clickGuide.x + 150 + cfg.TextSizeX + cfg.TextOffsetX;
                        this.guideWindow.y = this.clickGuide.y > this.height * .5 ? this.clickGuide.y - 200 - cfg.TextSizeY + cfg.TextOffsetY : this.clickGuide.y + 100 + cfg.TextSizeY + cfg.TextOffsetY;
                        var disX = this.guideWindow.x > this.clickGuide.x ? this.guideWindow.x - this.clickGuide.x : this.clickGuide.x - this.guideWindow.x - this.guideWindow.width;
                        var disY = this.guideWindow.y > this.clickGuide.y ? this.guideWindow.y - this.clickGuide.y + this.guideWindow.height * .5 : this.clickGuide.y - this.guideWindow.y - this.guideWindow.height * .5;
                        this.line.width = disX;
                        this.line.height = disY;
                        this.line.scaleX = this.guideWindow.x > this.clickGuide.x ? 1 : -1;
                        this.line.scaleY = this.guideWindow.y > this.clickGuide.y ? -1 : 1;
                        this.line.x = this.guideWindow.x > this.clickGuide.x ? -disX : this.guideWindow.width + disX;
                        this.line.y = this.guideWindow.height * .5;
                        this.blockMask.blendMode = "destination-out";
                        this.guideTarget = target;
                    } else {
                        this.clickGuide.visible = false;
                        this.blockMask.visible = false;
                        this.line.visible = false;
                        this.guideWindow.x = (this.width - this.guideWindow.width) / 2;
                        this.guideWindow.y = (this.height - this.guideWindow.height) / 2;
                    }
                    this.guideGirl.visible = cfg.showGirl == 1;
                    this.guideGirl.x = this.guideWindow.x > this.clickGuide.x ? 700 + cfg.TextSizeX : 0;
                    this.guideDetail.text = cfg._detail;
                    this.guideDetail.fontSize = cfg.fontSize;
                }
            }
            clickGuideOnClick() {
                if (this.cfg && this.cfg.EventType == E_GUIDE_EVENT.CLICK) {
                    if (this.cfg.isEvent) {
                        this.guideTarget.event(Laya.Event.CLICK, new Laya.Event());
                        GuideMgr.Ins.nextStep();
                    } else {
                        GuideMgr.Ins.nextStep();
                    }
                } else if (this.cfg && this.cfg.EventType == E_GUIDE_EVENT.BOXCLICK) {
                    GuideMgr.Ins.nextStep();
                }
            }
            bgBoxOnClick() {
                if (this.cfg && this.cfg.EventType == E_GUIDE_EVENT.BOXCLICK) {
                    GuideMgr.Ins.nextStep();
                }
            }
            clickGuideOnDown() {
                if (this.cfg) {
                    if (this.cfg.EventType == E_GUIDE_EVENT.DOWN) {
                        if (this.cfg.isEvent) {
                            this.guideTarget.event(Laya.Event.MOUSE_DOWN);
                        }
                        GuideMgr.Ins.nextStep();
                    } else if (this.cfg.EventType == E_GUIDE_EVENT.DOWNTIME) {
                        if (this.cfg.isEvent) {
                            this.guideTarget.event(Laya.Event.MOUSE_DOWN);
                        }
                        this.isTargetDown = true;
                        Laya.timer.once(600, this, this.CheckDownTime);
                    }
                }
            }
            clickGuideOnUp() {
                if (this.cfg && this.cfg.EventType == E_GUIDE_EVENT.DOWNTIME) {
                    if (this.cfg.isEvent) {
                        this.guideTarget.event(Laya.Event.MOUSE_UP);
                    }
                    this.isTargetDown = false;
                    Laya.timer.clear(this, this.CheckDownTime);
                }
                if (this.cfg && this.cfg.EventType == E_GUIDE_EVENT.UP) {
                    if (this.cfg.isEvent) {
                        this.guideTarget.event(Laya.Event.MOUSE_UP);
                    }
                    GuideMgr.Ins.nextStep();
                }
            }
            CheckDownTime() {
                if (this.cfg && this.cfg.EventType == E_GUIDE_EVENT.DOWNTIME) {
                    if (this.isTargetDown) {
                        GuideMgr.Ins.nextStep();
                    }
                }
            }
        }
        class LianWinUI extends ui.UIScenes.commonUI.LianWinUI {
            constructor() {
                super();
                this.adapterUI();
            }
            onOpened() { }
            playOpenAni() { }
            playCloseAni() { }
            adapterUI() {
                this.scaleX = this.scaleY = GlobalScale$1.scale;
                this.width = Laya.stage.width / GlobalScale$1.scale;
                this.height = Laya.stage.height / GlobalScale$1.scale;
            }
            refreshNum(num) {
                this.winNum.skin = "uires/rankresult/font_" + num + ".png";
            }
            playWinAni() {
                this.ani1.play(0, false);
                this.winAni.play(0, false);
            }
        }
        class LimitGiftUI extends ui.UIScenes.commonUI.LimitGiftUI {
            constructor() {
                super();
                this.openNum = 0;
                this.callbackFunc = null;
                this.currSex = 0;
                this.scaleX = this.scaleY = GlobalScale$1.scale;
                this.width = Laya.stage.width / GlobalScale$1.scale;
                this.height = Laya.stage.height / GlobalScale$1.scale;
                this.closeBtn.on(Laya.Event.CLICK, this, this.closeBtnClick);
                this.giveUpBtn.on(Laya.Event.CLICK, this, this.closeBtnClick);
                this.videoBtn.on(Laya.Event.CLICK, this, this.videoBtnClick);
            }
            onAwake() { }
            onOpened() {
                this.currSex = DataMgr.Ins.currLimitSex;
                this.refreshUI();
                Laya.timer.loop(1e3, this, () => {
                    this.refreshTime();
                });
                PlatformMgr.Ins.initNativeAd(E_UI_TYPE.LIMITGIFT);
                if (PlatformMgr.Ins._gameConfig.tryCarwuchu != 0 && PlatformMgr.Ins.iswuchuTimeOpen) {
                    this.closeBtn.visible = false;
                    this.giveUpBtn.visible = true;
                } else {
                    this.closeBtn.visible = true;
                    this.giveUpBtn.visible = false;
                }
                this.giveUpBtn.visible = false;
                Laya.timer.once(PlatformMgr.Ins._gameConfig.xiaoziDelay, this, () => {
                    this.giveUpBtn.visible = !this.closeBtn.visible;
                });

                let banner;
                let left = 0;
                let bottom = 0;
                let width = 300;

                this.closeBtn.visible = false;
                Laya.timer.once(AdConfigMgr.Ins.Switch_1, this, () => {
                    this.closeBtn.visible = true;
                });
                PrivateTracker_new.Ins.sendEvent(SDK_EVENT._限时礼包界面, {
                    "_限时礼包界面": "_限时礼包界面"
                });
            }
            refreshUI() {
                this.quanshenImg.skin = "uires/xianshigift/" + this.currSex + "_0.png";
                this.headImg.skin = "uires/xianshigift/" + this.currSex + "_1.png";
                this.body1Img.skin = "uires/xianshigift/" + this.currSex + "_2.png";
                this.body2Img.skin = "uires/xianshigift/" + this.currSex + "_3.png";
                this.refreshTime();
            }
            refreshTime() {
                let time = 600 - (new Date().getTime() - DataMgr.Ins.firstOpenTimeStamp) / 1e3;
                if (time < 0) {
                    time = 0;
                }
                this.overTime.text = UsefulStuff.formatMS2(Math.floor(time)) + "今日活动结束";
            }
            videoBtnClick() {
                //激励广告
                showReward(() => {
                    let clothList = [];
                    if (this.currSex == 0) {
                        clothList = CCfgMgr.Ins.cfgGlobalPar.getItemStr(E_GLOBALPAR_NAME.GAME_LIMITGIFT_MAN);
                    } else {
                        clothList = CCfgMgr.Ins.cfgGlobalPar.getItemStr(E_GLOBALPAR_NAME.GAME_LIMITGIFT_WOMAN);
                    }
                    for (let i = 0; i < clothList.length; i++) {
                        DataMgr.Ins.unlockClothes(clothList[i]);
                    }
                    UIManager.Ins.getScene(E_UI_TYPE.LONGBLACKTIP).open(false, ["礼包领取成功,可以去背包界面穿戴哟~"]);
                    DataMgr.Ins.LimitGiftInfo[this.currSex] = true;
                    DataMgr.Ins.SavePlayerData();
                    StartUI.Ins && StartUI.Ins.refreshLimitGiftBtn();
                    this.close();
                    PlatformMgr.Ins.closeNativeAd();
                });

            }
            closeBtnClick() {
                SoundMgr.Ins.Press();
                this.close();
                PlatformMgr.Ins.closeNativeAd();
            }
            onClosed() {
                Laya.timer.clearAll(this);


            }
        }
        class LongBlackTipUI extends ui.UIScenes.commonUI.LongBlackTipUI {
            constructor() {
                super();
                this.scaleX = this.scaleY = GlobalScale$1.scale;
                this.width = Laya.stage.width / GlobalScale$1.scale;
                this.height = Laya.stage.height / GlobalScale$1.scale;
            }
            onOpened(par) {
                if (par) {
                    this.txt.text = par;
                } else {
                    this.txt.text = "金币不足";
                }
                Laya.timer.clearAll(this);
                Laya.timer.once(1500, this, () => {
                    this.close();
                });
            }
            onClosed() {
                Laya.timer.clearAll(this);
            }
        }
        class OppoBannerViewUI extends ui.UIScenes.commonUI.OppoBannerUI {
            constructor() {
                super();
                this.adPoint = 1;
                this.delayTime = 0;
                this.zOrder = 1001;
                console.log(" == showBanner == constructor == ");
                this.scaleX = this.scaleY = GlobalScale$1.scale;
                this.width = Laya.stage.width / GlobalScale$1.scale;
                this.height = Laya.stage.height / GlobalScale$1.scale;
                OppoBannerViewUI.Ins = this;
                EventMgr.Ins.on(EventType.HIDENATIVE, this, () => {
                    this.closeThis();
                });
            }
            onAwake() {
                console.log(" == showBanner == onAwake == ");
                this.closeBtn.on(Laya.Event.CLICK, this, this.closeThis);
                this.clickBtn.on(Laya.Event.CLICK, this, this.clickNativeInsert);
            }
            onOpened(list) {
                console.log(" == OppoBannerAdView == onOpened == ");
                this.zongImag.x = list[0] + (this.width - 1280) / 2;
                this.zongImag.height = this.icon.width = this.icon.height = this.clickBtn.height = list[1];
                this.meiziIcon.width = this.meiziIcon.height = this.diantaIcon.width = this.diantaIcon.height = list[1] - 10;
                this.diantaIcon.visible = list[2] >= 400;
                this.zongImag.width = this.clickBtn.width = list[2];
                this.adPoint = list[3];
                this.delayTime = list[4];
                this.closeBtn.visible = false;
                Laya.timer.once(this.delayTime, this, () => {
                    this.closeBtn.visible = true;
                });
                this.refreshUI();
            }
            refreshUI() {
                console.log("  ########## showBanner ##########   ", PlatformMgr.Ins.nativeData);
                this.desc.text = PlatformMgr.Ins.nativeData[0].desc;
                this.title.text = PlatformMgr.Ins.nativeData[0].title;
                if (PlatformMgr.Ins.platform == E_PLATFORM_TYPE.OPPO) {
                    if (PlatformMgr.Ins.nativeData[0].iconUrlList && PlatformMgr.Ins.nativeData[0].iconUrlList.length > 0) {
                        this.icon.skin = PlatformMgr.Ins.nativeData[0].iconUrlList[0];
                    } else if (PlatformMgr.Ins.nativeData[0].imgUrlList && PlatformMgr.Ins.nativeData[0].imgUrlList.length > 0) {
                        this.icon.skin = PlatformMgr.Ins.nativeData[0].imgUrlList[0];
                    }
                } else if (PlatformMgr.Ins.platform == E_PLATFORM_TYPE.VIVO) {
                    if (PlatformMgr.Ins.nativeData[0].imgUrlList && PlatformMgr.Ins.nativeData[0].imgUrlList.length) {
                        this.icon.skin = PlatformMgr.Ins.nativeData[0].imgUrlList[0];
                    }
                }
                PlatformMgr.Ins.reportNativeAdShow();
                EventMgr.Ins.dispatch(EventType.HTICONHIDE);
            }
            closeThis() {
                Laya.timer.clearAll(this);
                this.close();
            }
            clickNativeInsert() {
                PlatformMgr.Ins.reportNativeAdClick();
                this.closeThis();
            }
        }
        class PickModeUI extends ui.UIScenes.commonUI.PickModeUI {
            constructor() {
                super();
                this.scaleX = this.scaleY = GlobalScale$1.scale;
                this.width = Laya.stage.width / GlobalScale$1.scale;
                this.height = Laya.stage.height / GlobalScale$1.scale;
                this.backBtn.on(Laya.Event.CLICK, this, this.backBtnClick);
                this.multiRaceBtn.on(Laya.Event.CLICK, this, this.multiRaceBtnClick);
                this.multiItemBtn.on(Laya.Event.CLICK, this, this.multiItemBtnClick);
                this.oneRaceBtn.on(Laya.Event.CLICK, this, this.oneRaceBtnClick);
                this.bannerCloseBtn.on(Laya.Event.CLICK, this, () => {
                    this.nativeItem.visible = false;
                });
                this.iconBannerImg.on(Laya.Event.CLICK, this, () => {
                    PlatformMgr.Ins.reportNativeIconClick();
                    this.nativeItem.visible = false;
                });
            }
            onAwake() { }
            onOpened() {


                let banner;
                let left = 0;
                let bottom = 0;
                let width = 300;

            }
            multiRaceBtnClick() {
                SoundMgr.Ins.Press();
                UIManager.Ins.getScene(E_UI_TYPE.MULTIRACE).open();
            }
            oneRaceBtnClick() {
                SoundMgr.Ins.Press();
                UIManager.Ins.getScene(E_UI_TYPE.ONERACE).open();
            }
            multiItemBtnClick() {
                SoundMgr.Ins.Press();
                UIManager.Ins.getScene(E_UI_TYPE.MULTIITEM).open();
            }
            backBtnClick() {
                SoundMgr.Ins.Press();
                UIManager.Ins.getScene(E_UI_TYPE.STARTUI).open();
            }
            onClosed() {
                PlatformMgr.Ins.closeNativeAd();


            }
            refreshNativeItem() {
                this.nativeItem.visible = false;
                PlatformMgr.Ins.initNativeIconAd(data => {
                    this.nativeItem.visible = true;
                    let ad = data.adList;
                    if (ad[0].iconUrlList && ad[0].iconUrlList.length) {
                        this.iconBannerImg.skin = ad[0].iconUrlList[0];
                    }
                    PlatformMgr.Ins.reportNativeIconShow();
                });
            }
        }
        class ProfileUI extends ui.UIScenes.commonUI.ProfileUI {
            constructor() {
                super();
                this.closeBtn.on(Laya.Event.CLICK, this, this.closeBtnOnClick);
                this.bgmBtn.on(Laya.Event.CLICK, this, this.bgmBtnClick);
                this.soundBtn.on(Laya.Event.CLICK, this, this.soundBtnClick);
                this.setBtn.on(Laya.Event.CLICK, this, this.setBtnClick);
                this.profileBtn.on(Laya.Event.CLICK, this, this.profileBtnClick);
                this.nameInput.textField.on(Laya.Event.CHANGE, this, this.nameInputOnChange);
                if (window["wx"]) {
                    let penIcon = this.lvImage.getChildAt(0);
                    penIcon instanceof Laya.Image && (penIcon.visible = false);
                    this.nameInput.editable = false;
                }
                this.playImage.on(Laya.Event.CLICK, this, this.avatarClick);
                this.adapterUI();
            }
            onAwake() {
                this.avatarClick();
            }
            onOpened() {

                let banner;
                let left = 0;
                let bottom = 0;
                let width = 300;

                PrivateTracker_new.Ins.sendEvent(SDK_EVENT._打开设置界面, {
                    "_打开设置界面": "_打开设置界面"
                });
            }
            playOpenAni() { }
            playCloseAni() { }
            onEnable() {
                this.nameInput.text = DataMgr.Ins.playerName;
                this.setBtnClick();
                this.refreshSetting();
                Laya.timer.frameLoop(2, this, () => {
                    DataMgr.Ins.bgmVolume = this.bgmSlider.value / 100;
                    DataMgr.Ins.soundVolume = this.soundSlider.value / 100;
                    Laya.SoundManager.setMusicVolume(this.bgmSlider.value / 100);
                    Laya.SoundManager.musicMuted = this.bgmSlider.value < .1;
                    if (this.bgmSlider.value <= 0) {
                        this.closeBlock(this.bgmMoveBlock, true);
                    } else {
                        this.openBlock(this.bgmMoveBlock, true);
                    }
                    if (this.soundSlider.value <= 0) {
                        this.closeBlock(this.soundMoveBlock, true);
                    } else {
                        this.openBlock(this.soundMoveBlock, true);
                    }
                });
                if (PlatformMgr.Ins.platform == E_PLATFORM_TYPE.TT) PlatformMgr.Ins.initNativeAd(E_UI_TYPE.PROFILE);
                EventMgr.Ins.on(EventType.USER_INFO_BTN_CLICKED, this, this.avatarClick);
            }
            onDisable() {
                EventMgr.Ins.off(EventType.USER_INFO_BTN_CLICKED, this, this.avatarClick);
                PlatformMgr.Ins.closeNativeAd();
            }
            nameInputOnChange() {
                DataMgr.Ins.playerName = this.nameInput.text;
            }
            refreshSetting() {
                this.bgmSlider.value = DataMgr.Ins.bgmVolume * 100;
                this.soundSlider.value = DataMgr.Ins.soundVolume * 100;
                if (DataMgr.Ins.bgmVolume <= 0) {
                    this.closeBlock(this.bgmMoveBlock, true);
                } else {
                    this.openBlock(this.bgmMoveBlock, true);
                }
                if (DataMgr.Ins.soundVolume <= 0) {
                    this.closeBlock(this.soundMoveBlock, true);
                } else {
                    this.openBlock(this.soundMoveBlock, true);
                }
                Laya.SoundManager.setMusicVolume(this.bgmSlider.value / 100);
            }
            refreshProfile() { }
            closeBtnOnClick() {

                SoundMgr.Ins.Press();
                Laya.timer.clearAll(this);
                this.removeSelf();
                UIManager.Ins.getScene(E_UI_TYPE.STARTUI).playName.text = DataMgr.Ins.playerName;
            }
            onClosed() {

            }
            adapterUI() {
                this.scaleX = this.scaleY = GlobalScale$1.scale;
                this.width = Laya.stage.width / GlobalScale$1.scale;
                this.height = Laya.stage.height / GlobalScale$1.scale;
                this.setCenterPart.x += (this.width - 1280) / 2;
                this.profileCenterPart.x += (this.width - 1280) / 2;
            }
            openSetPart() {
                this.setCenterPart.visible = true;
                this.profileCenterPart.visible = false;
                this.refreshSetting();
            }
            openProfilePart() {
                this.setCenterPart.visible = false;
                this.profileCenterPart.visible = true;
                this.refreshSetting();
            }
            openBlock(block, isshunjian) {
                block.getChildAt(0).skin = "uires/dataAndSet/kaihei.png";
                if (isshunjian) {
                    block.x = 90;
                } else {
                    Laya.Tween.to(block, {
                        x: 90
                    }, 300, null, Laya.Handler.create(this, () => { }));
                }
            }
            closeBlock(block, isshunjian) {
                block.getChildAt(0).skin = "uires/dataAndSet/guanhei.png";
                if (isshunjian) {
                    block.x = 0;
                } else {
                    Laya.Tween.to(block, {
                        x: 0
                    }, 300, null, Laya.Handler.create(this, () => { }));
                }
            }
            bgmBtnClick() {
                SoundMgr.Ins.Press();
                if (DataMgr.Ins.bgmVolume <= 0) {
                    DataMgr.Ins.bgmVolume = .5;
                } else {
                    DataMgr.Ins.bgmVolume = 0;
                }
                this.refreshSetting();
            }
            soundBtnClick() {
                SoundMgr.Ins.Press();
                if (DataMgr.Ins.soundVolume <= 0) {
                    DataMgr.Ins.soundVolume = .5;
                } else {
                    DataMgr.Ins.soundVolume = 0;
                }
                this.refreshSetting();
            }
            setBtnClick() {
                SoundMgr.Ins.Press();
                this.setBtn.skin = "uires/dataAndSet/xuzhong_di.png";
                this.profileBtn.skin = "uires/dataAndSet/wei_di.png";
                this.openSetPart();
            }
            profileBtnClick() {
                SoundMgr.Ins.Press();
                this.profileBtn.skin = "uires/dataAndSet/xuzhong_di.png";
                this.setBtn.skin = "uires/dataAndSet/wei_di.png";
                this.openProfilePart();
            }
            avatarClick() {
                SoundMgr.Ins.Press();
            }
        }
        class UserInfoBtn extends Laya.Script {
            get btn() {
                if (this._btn) {
                    return this._btn;
                }
                if (PlatformMgr.Ins.platform == E_PLATFORM_TYPE.TT) {
                    let wx = window["wx"];
                    let info = wx.getSystemInfoSync();
                    let rect = this.getScreenRect();
                    let scale = this.getOnwerScale();
                    this._btn = wx.createUserInfoButton({
                        type: "text",
                        text: "",
                        style: {
                            left: rect.x / Laya.stage.width * info.screenWidth,
                            top: rect.y / Laya.stage.height * info.screenHeight,
                            width: rect.width / Laya.stage.width * info.screenWidth * scale.scaleX,
                            height: rect.height / Laya.stage.height * info.screenHeight * scale.scaleY,
                            lineHeight: 40
                        }
                    });
                    this._btn.onTap(res => {
                        if (res && res.userInfo) {
                            EventMgr.Ins.dispatch(EventType.USER_INFO_BTN_CLICKED);
                        }
                    });
                }
                return this._btn;
            }
            getScreenRect() {
                let sp = this.owner;
                let leftTop = sp.localToGlobal(new Laya.Point(0, 0));
                let ret = new Laya.Rectangle();
                [ret.x, ret.y, ret.width, ret.height] = [leftTop.x, leftTop.y, sp.width, sp.height];
                return ret;
            }
            getOnwerScale() {
                let sp = this.owner;
                return {
                    scaleX: sp.scaleX,
                    scaleY: sp.scaleY
                };
            }
            onEnable() { }
            onDisable() { }
        }
        class TraningResultItem extends Laya.Script {
            get img() {
                return this.list_logo;
            }
            get name() {
                return this.list_name;
            }
            get time() {
                return this.list_time;
            }
        }
        var E_RACE_TYPE;
        (function (E_RACE_TYPE) {
            E_RACE_TYPE[E_RACE_TYPE["TRAIN"] = 0] = "TRAIN";
            E_RACE_TYPE[E_RACE_TYPE["RANK"] = 1] = "RANK";
        })(E_RACE_TYPE || (E_RACE_TYPE = {}));
        class TrainingResultViewUI extends ui.UIScenes.commonUI.TrainingResultViewUI {
            constructor() {
                super(...arguments);
                this.selfNum = 2;
                this.raceType = E_RACE_TYPE.TRAIN;
                this.currPlayInfo = null;
                this.TrainingLevelImgAry = ["uires/trainingresult/paiweisai.png", "uires/trainingresult/xunlianchang_chuji.png", "uires/trainingresult/xunlianchang_zhongji.png", "uires/trainingresult/xunlianchang_gaoji.png"];
                this.listImgAry = ["", "uires/trainingresult/m1.png", "uires/trainingresult/m2.png", "uires/trainingresult/m3.png", "uires/trainingresult/m4.png"];
                this.LevelChampion = [30, 31, 32, 33, 34, 35];
                this.LevelLose = [36, 37, 38, 39, 40, 41];
                this.dataSource = [{
                    name: "123",
                    time: "123",
                    data: "人物3d信息"
                }, {
                    name: "123",
                    time: "123",
                    data: "人物3d信息"
                }, {
                    name: "123",
                    time: "123",
                    data: "人物3d信息"
                }, {
                    name: "123",
                    time: "123",
                    data: "人物3d信息"
                }];
                this.disList = [3.2, 3.5, 3.8, 5];
            }
            onAwake() {
                window["train"] = this;
                this.scaleX = this.scaleY = GlobalScale$1.scale;
                this.width = Laya.stage.width / GlobalScale$1.scale;
                this.height = Laya.stage.height / GlobalScale$1.scale;
                this.continueBtn.on(Laya.Event.CLICK, this, this.continueBtnClick);
            }
            onOpened(isrank) {
                PlatformMgr.Ins.canShowBanner = true;
                DataMgr.Ins.nowDayGameTimes++;
                if (PlatformMgr.Ins.platform == E_PLATFORM_TYPE.TT) {
                    if (platform.Ins.recorderPath) UIManager.Ins.getScene(E_UI_TYPE.RECORD).open(false);
                }
                Laya.SoundManager.stopMusic();
                this.raceType = isrank ? E_RACE_TYPE.RANK : E_RACE_TYPE.TRAIN;
                this.continueBtn.visible = false;
                for (let i = 0; i < GameMgr.Ins.curRankList.length; i++) {
                    let data = GameMgr.Ins.curRankList[i];
                    if (data.isSelf) {
                        this.currPlayInfo = data;
                        this.selfNum = i + 1;
                        if (data.isFinish) {
                            if (DataMgr.Ins.currGameMode == E_GAME_MODE.MULTIPLAYER_SPEED_GAME) {
                                DataMgr.Ins.addMapSelectIndex();
                            }
                            DataMgr.Ins.dailyGamesNum++;
                            DataMgr.Ins.SavePlayerData();
                        }
                    }
                    this.dataSource[i].name = data.playerName;
                    this.dataSource[i].time = data.isFinish ? UsefulStuff.formatMSS(data.finishTime) : "未完成";
                }
                if (this.selfNum >= 3) {
                    SoundMgr.Ins.losePodium();
                } else {
                    SoundMgr.Ins.winPodium();
                }
                this.hideAllAni2();
                this.refreshAllPlayerData();
                this.showRotateOneByOne();
                this.updateTrainingLevel();
                this.loadPlat3DScene();
                this.initAd();
                DataMgr.Ins.hasPlayGame = true;
                DataMgr.Ins.allGameNums++;
                DataMgr.Ins.leiJiGameTimes++;
                DataMgr.Ins.SavePlayerData();

                let banner;
                let left = 0;
                let bottom = 0;
                let width = 300;

                switch (StartUI.gameModeType) {
                    case ModeType._单人_:
                        PrivateTracker_new.Ins.sendEvent(SDK_EVENT._个人竞速排名界面, {
                            "_个人竞速排名界面": "_个人竞速排名界面"
                        });
                        break;

                    case ModeType._多人竞速_:
                        PrivateTracker_new.Ins.sendEvent(SDK_EVENT._多人竞速排名界面, {
                            "_多人竞速排名界面": "_多人竞速排名界面"
                        });
                        break;

                    case ModeType._多人道具_:
                        PrivateTracker_new.Ins.sendEvent(SDK_EVENT._多人道具排名界面, {
                            "_多人道具排名界面": "_多人道具排名界面"
                        });
                        break;

                    default:
                        break;
                }
            }
            initAd() {
                if (PlatformMgr.Ins.platform == E_PLATFORM_TYPE.VIVO) {
                    PlatformMgr.Ins.initNativeInsert(13, null, () => {
                        PlatformMgr.Ins.initNativeAd(E_UI_TYPE.TRAINING_RESULT);
                    });
                } else if (PlatformMgr.Ins.platform == E_PLATFORM_TYPE.OPPO) {
                    Laya.timer.once(1e3, this, () => {
                        PlatformMgr.Ins.initNativeAd(E_UI_TYPE.TRAINING_RESULT);
                    });
                } else if (PlatformMgr.Ins.platform == E_PLATFORM_TYPE.TT) {
                    if (!DataMgr.Ins.guideData[E_GUIDE_TYPE.BATTLE_START]) {
                        Laya.timer.once(1e3, this, () => {
                            PlatformMgr.Ins.showInsert(E_UI_TYPE.TRAINING_RESULT);
                        });
                    } else {
                        Laya.timer.once(1e3, this, () => {
                            PlatformMgr.Ins.initNativeAd(E_UI_TYPE.TRAINING_RESULT);
                        });
                    }
                } else if (PlatformMgr.Ins.platform == E_PLATFORM_TYPE.WX) {
                    PlatformMgr.Ins.initNativeAd(E_UI_TYPE.TRAINING_RESULT);
                }
            }
            onClosed() {
                PlatformMgr.Ins.closeNativeAd();


            }
            onEnable() { }
            updateTrainingLevel() {
                if (DataMgr.Ins.currGameMode == E_GAME_MODE.MULTIPLAYER_PROP_GAME) this.trainingLevel.skin = "uires/MultiRace/duorendaoju.png"; else if (DataMgr.Ins.currGameMode == E_GAME_MODE.MULTIPLAYER_SPEED_GAME) {
                    this.trainingLevel.skin = "uires/MultiRace/duoren.png";
                } else {
                    this.trainingLevel.skin = "uires/oneRace/geren.png";
                }
            }
            hideAllAni2() {
                for (var index = 1; index < 5; index++) {
                    this[`ani_${index}_2`].visible = false;
                }
            }
            continueBtnClick() {
                switch (StartUI.gameModeType) {
                    case ModeType._单人_:
                        PrivateTracker_new.Ins.sendEvent(SDK_EVENT._完成个人竞速获取奖励界面, {
                            "_完成个人竞速获取奖励界面": "_完成个人竞速获取奖励界面"
                        });
                        break;

                    case ModeType._多人竞速_:
                        PrivateTracker_new.Ins.sendEvent(SDK_EVENT._完成多人竞速获取奖励界面, {
                            "_完成多人竞速获取奖励界面": "_完成多人竞速获取奖励界面"
                        });
                        break;

                    case ModeType._多人道具_:
                        PrivateTracker_new.Ins.sendEvent(SDK_EVENT._完成多人道具获取奖励界面, {
                            "_完成多人道具获取奖励界面": "_完成多人道具获取奖励界面"
                        });
                        break;

                    default:
                        break;
                }


                SoundMgr.Ins.Press();
                SoundMgr.Ins.playBgm(E_GAME_MODE.NONE);
                Laya.timer.clearAll(this);
                let userRank = Math.max(1, Math.min(6, DataMgr.Ins.getCurrRankLv()));
                DataMgr.Ins.currRaceBuff = this.calculateBuff();
                console.log("DataMgr.Ins.currRaceBuff", DataMgr.Ins.currRaceBuff);
                let rwdTimes = UsefulStuff.rnd(1, 3);
                if (DataMgr.IsNewGuiding()) {
                    let raceCount = DataMgr.Ins.GuideAllRacing.length;
                    let lastRace = DataMgr.Ins.GuideAllRacing[raceCount - 1];
                    let isChampion = lastRace.rank == 1;
                    let rewardId = isChampion ? this.LevelChampion[userRank - 1] : this.LevelLose[userRank - 1];
                    if (DataMgr.Ins.isFirstPlayer) DataMgr.Ins.AddWinBox();
                    if (lastRace.isRank) {
                        if (lastRace.mode == E_GAME_MODE.MULTIPLAYER_SPEED_GAME) {
                            UIManager.Ins.getScene(E_UI_TYPE.CGTLTGETUI).open(false, [rewardId, E_UI_TYPE.RANK_RESULT_UI, rwdTimes, true, false, true]);
                        } else if (lastRace.mode == E_GAME_MODE.MULTIPLAYER_PROP_GAME) {
                            UIManager.Ins.getScene(E_UI_TYPE.CGTLTGETUI).open(false, [rewardId, E_UI_TYPE.RANK_RESULT_UI, rwdTimes, true, true, true, false, "", E_PAGE_VIDEOID.GAMEOVER]);
                        }
                    } else {
                        if (lastRace.mode == E_GAME_MODE.SINGLE_SPEED_GAME) {
                            UIManager.Ins.getScene(E_UI_TYPE.CGTLTGETUI).open(false, [this.getTrainRwdId(), E_UI_TYPE.RANK_RESULT_UI, rwdTimes, true, true, true, false, "", E_PAGE_VIDEOID.GAMEOVER]);
                        } else UIManager.Ins.getScene(E_UI_TYPE.CGTLTGETUI).open(false, [this.getTrainRwdId(), E_UI_TYPE.RANK_RESULT_UI, rwdTimes, true, true, true, false, "", E_PAGE_VIDEOID.GAMEOVER]);
                    }
                } else {
                    let raceCount = DataMgr.Ins.CommonAllRacing.length;
                    let lastRace = DataMgr.Ins.CommonAllRacing[raceCount - 1];
                    let isChampion = lastRace.rank == 1;
                    let rewardId = isChampion ? this.LevelChampion[userRank - 1] : this.LevelLose[userRank - 1];
                    let hasWinBox = isChampion && DataMgr.Ins.AddWinBox();
                    if (raceCount == 1) {
                        if (lastRace.isRank) {
                            UIManager.Ins.getScene(E_UI_TYPE.CGTLTGETUI).open(false, [rewardId, E_UI_TYPE.RANK_RESULT_UI, rwdTimes, true, true, hasWinBox, false, "", E_PAGE_VIDEOID.GAMEOVER]);
                        } else {
                            UIManager.Ins.getScene(E_UI_TYPE.CGTLTGETUI).open(false, [this.getTrainRwdId(), E_UI_TYPE.STARTUI, rwdTimes, true, true, hasWinBox, false, "", E_PAGE_VIDEOID.GAMEOVER]);
                        }
                    } else {
                        if (lastRace.isRank) {
                            UIManager.Ins.getScene(E_UI_TYPE.CGTLTGETUI).open(false, [rewardId, E_UI_TYPE.RANK_RESULT_UI, rwdTimes, true, true, hasWinBox, false, "", E_PAGE_VIDEOID.GAMEOVER]);
                        } else {
                            UIManager.Ins.getScene(E_UI_TYPE.CGTLTGETUI).open(false, [this.getTrainRwdId(), E_UI_TYPE.STARTUI, rwdTimes, true, true, hasWinBox, false, "", E_PAGE_VIDEOID.GAMEOVER]);
                        }
                    }
                }
            }
            openScene(scene, closeOther, args) {
                let s = UIManager.Ins.getScene(scene);
                s.open(closeOther, args);
            }
            checkState(rewardId) { }
            refreshAllPlayerData() {
                this.dataSource.forEach((cell, index) => {
                    let idx = index + 1;
                    this[`ani_${idx}_1`].getComponent(TraningResultItem).name.text = cell.name;
                    this[`ani_${idx}_1`].getComponent(TraningResultItem).time.text = cell.time;
                    this["name_" + idx].text = cell.name;
                    this["name_" + idx].color = this.selfNum == idx ? "#e3dc2c" : "#ffffff";
                });
            }
            showRotateOneByOne() {
                if (GameMgr.Ins.curGameMode == E_GAME_MODE.SINGLE_SPEED_GAME) {
                    this.list_1.visible = true;
                    this.list_2.visible = false;
                    this.list_3.visible = false;
                    this.list_4.visible = false;
                    Laya.timer.once(700, this, this.showRotate, [1], false);
                    Laya.timer.once(880, this, this.showSelfLighten, [this.selfNum], false);
                } else {
                    this.list_1.visible = true;
                    this.list_2.visible = true;
                    this.list_3.visible = true;
                    this.list_4.visible = true;
                    Laya.timer.once(700, this, this.showRotate, [1], false);
                    Laya.timer.once(880, this, this.showRotate, [2], false);
                    Laya.timer.once(1060, this, this.showRotate, [3], false);
                    Laya.timer.once(1240, this, this.showRotate, [4], false);
                    Laya.timer.once(1420, this, this.showSelfLighten, [this.selfNum], false);
                }
            }
            showRotate(index) {
                this["player" + index].play(0, false);
            }
            showSelfLighten(index) {
                this[`ani_${index}_2`].visible = true;
                this[`ani_${index}_2`].play(0, false);
                this.continueBtn.visible = true;
            }
            loadPlayer3DScene() {
                SceneMgr.Ins.onTouchEvent();
                let podium = SceneMgr.Ins.createUIVFX("unity/podium/win_level.lh", this.plat.x, this.plat.y, 3.8, 35);
                podium.transform.rotationEuler = new Laya.Vector3(0, 180, 0);
                this.setNameLabelPos(podium.getChildAt(0));
                for (let i = 0; i < GameMgr.Ins.curRankList.length; i++) {
                    let Cha1url = LoadMgr.Ins.unityResPath(E_UNITY_RES_PATH.CHA, "Cha_" + this.getAssetCfg(GameMgr.Ins.curRankList[i].clothInfo.clothID).assetId + ".lh");
                    let Cha1 = SceneMgr.Ins.createUIVFX(Cha1url, this.player_1.x, this.player_1.y, this.disList[i], 35);
                    podium.getChildAt(0).getChildAt(i).addChild(Cha1);
                    this.changClothes(Cha1, GameMgr.Ins.curRankList[i].clothInfo.clothID, GameMgr.Ins.curRankList[i].clothInfo.hatCfg, GameMgr.Ins.curRankList[i].clothInfo.hairCfg, GameMgr.Ins.curRankList[i].clothInfo.wingCfg, true);
                }
                this.parent3dRoot.addChild(SceneMgr.Ins.UIScene);
            }
            loadPlat3DScene() {
                SceneMgr.Ins.clearUIScene();
                LoadMgr.Ins.loadAsset(() => {
                    this.loadPlayer3DScene();
                }, ["unity/podium/win_level.lh"]);
            }
            getAssetCfg(clothesId) {
                return DataMgr.Ins.getClothes(clothesId).getBaseNature();
            }
            changClothes(Cha, clothCfg, HatCfg, HairCfg, WingCfg, isWin) {
                var as = Cha.addComponent(ActorScript);
                as.init(HatCfg, HairCfg, WingCfg);
                if (!isWin) as.playFail(); else {
                    as.playWomenSuccess();
                }
            }
            setNameLabelPos(node) {
                let list = [];
                if (DataMgr.Ins.currGameMode == E_GAME_MODE.SINGLE_SPEED_GAME) {
                    list = [this.name_1];
                } else {
                    list = [this.name_1, this.name_2, this.name_3, this.name_4];
                }
                [this.name_1, this.name_2, this.name_3, this.name_4].forEach((x, i) => {
                    x.visible = false;
                });
                list.forEach((x, i) => {
                    x.visible = true;
                    let pos = UsefulStuff.WorldToScreen2(SceneMgr.Ins.UICamera, node.getChildAt(i).transform.position);
                    x.x = pos.x / GlobalScale$1.scale;
                });
            }
            getTrainRwdId() {
                let rwdIdList = "";
                rwdIdList = CCfgMgr.Ins.cfgGlobalPar.getItemStr(E_GLOBALPAR_NAME.GAME_LOW_REWARD_ID);
                if (!rwdIdList) {
                    console.log("奖励为空啦");
                    return null;
                }
                let rewardId = 0;
                if (this.selfNum == 1) {
                    rewardId = parseInt(rwdIdList[0]);
                } else if (this.selfNum == 2) {
                    rewardId = parseInt(rwdIdList[1]);
                } else {
                    rewardId = parseInt(rwdIdList[2]);
                }
                return rewardId;
            }
            calculateBuff() {
                var cBuff = DataMgr.Ins.getConstellationBuff();
                if (cBuff) {
                    if (cBuff.buffType == E_BUFF_TYPE.SPEEDGAME_REWARD_BUFF) {
                        if (DataMgr.Ins.currGameMode == E_GAME_MODE.MULTIPLAYER_SPEED_GAME) return cBuff.buffValue;
                    } else if (cBuff.buffType == E_BUFF_TYPE.RANK_FIRST_REWARD_BUFF) {
                        if (this.selfNum == 1) return cBuff.buffValue;
                    } else if (cBuff.buffType == E_BUFF_TYPE.RANK_OTHER_REWARD_BUFF) {
                        if (this.selfNum != 1) return cBuff.buffValue;
                    }
                }
                return 0;
            }
        }
        class GuideTryCarUI extends ui.UIScenes.qq.GuideTryCarUI {
            constructor() {
                super();
                this.tryCarId = 0;
                this.closeBtn.on(Laya.Event.CLICK, this, this.closeBtnOnClick);
                this.scaleX = this.scaleY = GlobalScale$1.scale;
                this.width = Laya.stage.width / GlobalScale$1.scale;
                this.height = Laya.stage.height / GlobalScale$1.scale;
                this.centerImage.x += (Laya.stage.width - 1280) / 2;
            }
            onOpened(id) {
                this.loadingImage.play(0, true);
                this.refreshUI(id);
                PlatformMgr.Ins.initNativeAd(E_UI_TYPE.GUIDETRYCAR);
            }
            playOpenAni() { }
            playCloseAni() { }
            refreshUI(id) {
                this.createUIScene();
                this.loadCarScene(DataMgr.Ins.getCar(id).cfg.assetId, 1);
                this.tryCarId = id;
            }
            closeBtnOnClick() {
                SoundMgr.Ins.Press();
                this.UIScene.destroy();
                this.UIScene = null;
                DataMgr.Ins.setCurrSelectCar(6);
                DataMgr.Ins.gameUseCar = DataMgr.Ins.getCar(6);
                DataMgr.Ins.useCarStage = 1;
                DataMgr.Ins.currTrackId = 2;
                GameMgr.Ins.enterGame(true, E_GAME_MODE.MULTIPLAYER_SPEED_GAME);
                UIManager.Ins.getScene(E_UI_TYPE.RANKING_UI).open();
            }
            loadCarScene(assetId, lv) {
                let url = LoadMgr.Ins.cdnHttp;
                LoadMgr.Ins.loadAsset(() => {
                    this.loadCarScene1(assetId, lv);
                }, [LoadMgr.Ins.unityResPath(E_UNITY_RES_PATH.CAR, "Car_" + assetId + "_" + lv + ".lh")]);
                this.loadingImage.visible = true;
            }
            loadCarScene1(assetId, lv) {
                if (!this.UIScene) return;
                var url = LoadMgr.Ins.unityResPath(E_UNITY_RES_PATH.CAR, "Car_" + assetId + "_" + lv + ".lh");
                let currCarModel = this.createUIVFX(url, this.carPosBox.x, this.carPosBox.y, 3.2, 32);
                currCarModel && (currCarModel.getChildAt(0).getChildAt(5).active = false);
                currCarModel && (currCarModel.transform.localPosition = new Laya.Vector3(0, -.4, -7));
                currCarModel && (currCarModel.transform.rotationEuler = new Laya.Vector3(20, -45, -5));
                this.loadingImage.visible = false;
            }
            createUIScene() {
                this.UIScene = new Laya.Scene3D();
                this.UIScene.ambientColor = new Laya.Vector3(1, 1, 1);
                this.UICamera = new Laya.Camera();
                let light = Laya.Sprite3D.instantiate(Laya.loader.getRes("unity/level/Conventional/uiscene.ls").getChildAt(0));
                let UILight = new Laya.DirectionLight();
                UILight.transform.rotate(new Laya.Vector3(30, 0, 0), false);
                window["uilight"] = UILight;
                this.UIScene.addChild(this.UICamera);
                this.UIScene.addChild(UILight);
                this.UIScene.addChild(light);
                this.UICamera.clearFlag = 2;
                Laya.stage.addChild(this.UIScene);
            }
            createUIVFX(skinUrl, x, y, dis, FOV) {
                var VFXModel = Laya.loader.getRes(skinUrl);
                if (VFXModel) {
                    var VFX = Laya.Sprite3D.instantiate(VFXModel);
                    this.UICamera.addChild(VFX);
                    this.UICamera.viewport.width = this.width;
                    this.UICamera.viewport.height = this.height;
                    this.UICamera.fieldOfView = FOV;
                    return VFX;
                }
                return null;
            }
            onClosed() {
                Laya.timer.clearAll(this);
                this.loadingImage.stop();
                PlatformMgr.Ins.closeNativeAd();
            }
        }
        class NextDayGiftUI extends ui.UIScenes.qq.NextDayGiftUI {
            constructor() {
                super();
                this.scaleX = this.scaleY = GlobalScale$1.scale;
                this.width = Laya.stage.width / GlobalScale$1.scale;
                this.height = Laya.stage.height / GlobalScale$1.scale;
                this.closeBtn.width = this.width;
                this.closeBtn.on(Laya.Event.CLICK, this, () => this.close());
                this.ani1.addLabel("play", 18);
                this.ani1.on(Laya.Event.LABEL, this, () => {
                    this.starAni.play(0, true);
                    this.liuGuangAni.play(0, true);
                });
            }
            onAwake() { }
            onOpened() {
                this.refreshUI();
                Laya.timer.loop(200, this, () => {
                    this.refreshUI();
                });
                this.closeBtn.visible = false;
                this.zongBox.scaleX = 0;
                this.zongBox.scaleY = 0;
                this.s1.visible = false;
                this.s2.visible = false;
                this.s3.visible = false;
                Laya.Tween.to(this.zongBox, {
                    scaleX: .7,
                    scaleY: .7
                }, 200, null, Laya.Handler.create(this, () => {
                    Laya.timer.once(100, this, () => {
                        this.s1.visible = true;
                        this.s2.visible = true;
                        this.s3.visible = true;
                        this.ani1.play(0, false);
                        this.closeBtn.visible = true;
                    });
                }));

                let banner;
                let left = 80;
                let bottom = 0;
                let width = 300;

                PrivateTracker_new.Ins.sendEvent(SDK_EVENT._签到次日奖励界面, {
                    "_签到次日奖励界面": "_签到次日奖励界面"
                });
            }
            refreshUI() {
                let a = new Date().setHours(24, 0, 0, 0);
                this.timeLabel.text = UsefulStuff.formatMS((a - Date.now()) / 1e3);
            }
            onClosed() {
                Laya.timer.clearAll(this);
                this.starAni.stop();
                this.liuGuangAni.stop();
                if (UIManager.Ins.getScene(E_UI_TYPE.STARTUI).parent) PlatformMgr.Ins.initOutput(E_UI_TYPE.STARTUI);


            }
        }
        class oneRaceItemScript extends Laya.Script {
            get map() {
                return this.img_map;
            }
            get lock() {
                return this.img_lock;
            }
            get mask() {
                return this.img_mask;
            }
            get lan() {
                return this.img_lan;
            }
            get huang() {
                return this.img_huang;
            }
        }
        class MultiItemUI extends ui.UIScenes.RacingType.MultiItemUI {
            constructor() {
                super(...arguments);
                this.lapNum = -1;
                this.npcLevel = 0;
                this.gameMode = E_GAME_MODE.MULTIPLAYER_PROP_GAME;
                this.randStoryId = -1;
                this.isOpening = false;
            }
            onAwake() {
                this.scaleX = this.scaleY = GlobalScale$1.scale;
                this.width = Laya.stage.width / GlobalScale$1.scale;
                this.height = Laya.stage.height / GlobalScale$1.scale;
                this.backBtn.on(Laya.Event.CLICK, this, this.backBtnClick);
                this.xingzuoBtn.on(Laya.Event.CLICK, this, this.xingzuoBtnClick);
                this.garageBtn.on(Laya.Event.CLICK, this, this.garageBtnClick);
                this.bagBtn.on(Laya.Event.CLICK, this, this.bagBtnClick);
                this.useCarBtn.on(Laya.Event.CLICK, this, this.useCarBtnClick);
                this.okBtn.on(Laya.Event.CLICK, this, this.okBtnClick);
                if (this.width / this.height > 1.78) {
                    this.moveBox.x = 81;
                } else {
                    this.moveBox.x = 0;
                }
            }
            onEnable() { }
            get gameModeStr() {
                switch (this.gameMode) {
                    case E_GAME_MODE.MULTIPLAYER_PROP_GAME:
                        return "多人道具";

                    case E_GAME_MODE.MULTIPLAYER_SPEED_GAME:
                        return "多人竞速";

                    case E_GAME_MODE.SINGLE_SPEED_GAME:
                        return "个人竞速";

                    default:
                        return "";
                }
            }
            onOpened() {
                this.gameMode = E_GAME_MODE.MULTIPLAYER_PROP_GAME;
                this.refreshRanMap();
                this.isOpening = true;
                this.refreshRedTip();
                this.lapNum = -1;
                this.npcLevel = 0;
                DataMgr.Ins.currGameMode = this.gameMode;
                this.load3DScene();
                PlatformMgr.Ins.initNativeAd(E_UI_TYPE.MULTIRACE);


                let banner;
                let left = 50;
                let bottom = 0;
                let width = 300;

                PrivateTracker_new.Ins.sendEvent(SDK_EVENT._打开多人道具界面, {
                    "_打开多人道具界面": "_打开多人道具界面"
                });
            }
            onClosed() {
                this.isOpening = false;
                PlatformMgr.Ins.closeNativeAd();


            }
            refreshRanMap() {
                this.randStoryId = DataMgr.Ins.getRndTrack();
                let info = DataMgr.Ins.storyDatas[this.randStoryId].trackCfg;
                DataMgr.Ins.currTrackId = info.ID;
                this.more_speed.text = `全服最快速度：${UsefulStuff.formatMSS(DataMgr.Ins.getServerRecord(this.gameMode))}`;
                this.one_speed.text = `个人最快速度：${DataMgr.Ins.getPersonalRecord(this.gameMode)}`;
                this.img_randMap.skin = LoadMgr.Ins.WebResHttp + `pickLevel1/${info._SceneBigBG}`;
            }
            okBtnClick() {
                SoundMgr.Ins.Press();
                PrivateTracker_new.Ins.sendEvent(SDK_EVENT._点击多人道具开始游戏按钮, {
                    "_点击多人道具开始游戏按钮": "_点击多人道具开始游戏按钮"
                });
                StartUI.gameModeType = ModeType._多人道具_;
                DataMgr.Ins.gameUseCar = DataMgr.Ins.currSelectCar;
                DataMgr.Ins.useCarStage = DataMgr.Ins.carStage;
                PlatformMgr.Ins.closeNativeAd();
                if (DataMgr.Ins.currHasTryCar) {
                    let list = CCfgMgr.Ins.cfgGlobalPar.getItemStr(E_GLOBALPAR_NAME.GAME_TRY_CARIDLIST);
                    let carIndex = Math.floor(Math.random() * 2);
                    let carId = parseInt(list[carIndex]);
                    let car = new BaseRacing();
                    car.init(carId, true, 20, 20, 20, 20);
                    DataMgr.Ins.getCar(carId).setVideoTimes(1);
                    DataMgr.Ins.gameUseCar = car;
                    DataMgr.Ins.useCarStage = 3;
                    GameMgr.Ins.enterGame(true, DataMgr.Ins.currGameMode);
                    UIManager.Ins.getScene(E_UI_TYPE.RANKING_UI).open();
                } else {
                    if (DataMgr.Ins.leiJiGameTimes > PlatformMgr.Ins._gameConfig.openTryCarTimes) {
                        DataMgr.Ins.leiJiGameTimes = 0;
                        UIManager.Ins.getScene(E_UI_TYPE.CAR_TRIAL).open(false, [this.gameMode]);
                    } else {
                        GameMgr.Ins.enterGame(true, this.gameMode, this.lapNum, this.npcLevel);
                        UIManager.Ins.getScene(E_UI_TYPE.RANKING_UI).open();
                    }
                }
            }
            backBtnClick() {
                SoundMgr.Ins.Press();
                this.close();
                SceneMgr.Ins.clearUIScene();
                UIManager.Ins.getScene(E_UI_TYPE.PICKMODE).open();
            }
            xingzuoBtnClick() {
                SoundMgr.Ins.Press();
                UIManager.Ins.getScene(E_UI_TYPE.CONSTELLATION).open(false);
            }
            garageBtnClick() {
                SoundMgr.Ins.Press();
                SceneMgr.Ins.clearUIScene();
                UIManager.Ins.getScene(E_UI_TYPE.GARAGEUI).open(true, [E_UI_TYPE.MULTIITEM, this.gameMode]);
            }
            bagBtnClick() {

                SoundMgr.Ins.Press();
                SceneMgr.Ins.clearUIScene();
                UIManager.Ins.getScene(E_UI_TYPE.DRIVERUI).open();
                DataMgr.Ins.driverToUIid = E_UI_TYPE.MULTIITEM;
                DataMgr.Ins.driverToUIMode = this.gameMode;
            }
            useCarBtnClick() {
                SoundMgr.Ins.Press();
                UIManager.Ins.getScene(E_UI_TYPE.CAR_TRIAL).open(false, [this.gameMode]);
            }
            load3DScene() {
                let podium = SceneMgr.Ins.createUIVFX("unity/podium/start_parent3d.lh", 0, 0, 3.8, 35, this.parent3dRoot);
                podium.transform.rotationEuler = new Laya.Vector3(0, 180, 0);
                LoadMgr.Ins.loadAsset(() => {
                    this.loadCarScene(podium);
                }, [LoadMgr.Ins.unityResPath(E_UNITY_RES_PATH.CAR, "Car_" + DataMgr.Ins.getCurrSelectCar().cfg.assetId + "_" + DataMgr.Ins.carStage + ".lh")]);
                let list = DataMgr.Ins.currPlayerSex == 0 ? DataMgr.Ins.currSelectMenClothesList : DataMgr.Ins.currSelectWomenClothesList;
                var WingCfg = list[3] ? list[3].getBaseNature() : null;
                var HairCfg = list[0] ? list[0].getBaseNature() : null;
                var rndChaCfg = list[2] ? list[2].getBaseNature() : null;
                var HatCfg = list[1] ? list[1].getBaseNature() : null;
                let urlList = [];
                if (rndChaCfg) urlList.push(LoadMgr.Ins.unityResPath(E_UNITY_RES_PATH.CHA, "Cha_" + rndChaCfg.assetId.toString() + ".lh"));
                if (WingCfg) urlList.push(LoadMgr.Ins.unityResPath(E_UNITY_RES_PATH.CHA, "wing_" + WingCfg.assetId.toString() + ".lh"));
                if (HairCfg) urlList.push(LoadMgr.Ins.unityResPath(E_UNITY_RES_PATH.CHA, "hair_" + HairCfg.assetId.toString() + ".lh"));
                if (HatCfg) urlList.push(LoadMgr.Ins.unityResPath(E_UNITY_RES_PATH.CHA, "hat_" + HatCfg.assetId.toString() + ".lh"));
                LoadMgr.Ins.loadAsset(() => {
                    this.loadChaScene(podium);
                }, urlList);
            }
            loadCarScene(parent3d) {
                if (!this.isOpening) return;
                let car = null;
                car = SceneMgr.Ins.createUIVFX(LoadMgr.Ins.unityResPath(E_UNITY_RES_PATH.CAR, "Car_" + DataMgr.Ins.getCurrSelectCar().cfg.assetId + "_" + DataMgr.Ins.carStage + ".lh"), 0, 0, 3.8, 35);
                try {
                    let scaling = DataMgr.Ins.getCurrSelectCar().cfg.scaling / 100;
                    parent3d.getChildAt(0).getChildAt(1).addChild(car);
                    car.getChildAt(0).getChildAt(5).getChildAt(0).active = false;
                    car.getChildAt(0).getChildAt(5).getChildAt(1).active = false;
                    car.getChildAt(0).getChildAt(5).getChildAt(2).active = false;
                    car.getChildAt(0).getChildAt(5).getChildAt(3).active = false;
                    car.getChildAt(0).getChildAt(5).getChildAt(4).active = false;
                    var flyRoot = car.getChildAt(0).getChildAt(6);
                    if (flyRoot) {
                        for (let i = 0; i < flyRoot.numChildren; i++) {
                            var ani = flyRoot.getChildAt(i).getComponent(Laya.Animator);
                            ani.play("fly_idle");
                        }
                    }
                } catch (e) {
                    console.error(e);
                }
            }
            loadChaScene(parent3d) {
                if (!this.isOpening) return;
                let list = DataMgr.Ins.currPlayerSex == 0 ? DataMgr.Ins.currSelectMenClothesList : DataMgr.Ins.currSelectWomenClothesList;
                let WingCfg = list[3] ? list[3].getBaseNature() : null;
                let HairCfg = list[0] ? list[0].getBaseNature() : null;
                let rndChaCfg = list[2] ? list[2].getBaseNature() : null;
                let HatCfg = list[1] ? list[1].getBaseNature() : null;
                let Cha = SceneMgr.Ins.createUIVFX(LoadMgr.Ins.unityResPath(E_UNITY_RES_PATH.CHA, "Cha_" + rndChaCfg.assetId.toString() + ".lh"), 0, 0, 3.2, 35);
                if (Cha) {
                    parent3d.getChildAt(0).getChildAt(0).addChild(Cha);
                    Cha.transform.rotationEuler = new Laya.Vector3(0, 10, 0);
                    var aSrc = Cha.addComponent(ActorScript);
                    aSrc.init(HatCfg, HairCfg, WingCfg);
                    if (rndChaCfg.sex) aSrc.playWomenChoose(); else aSrc.playMenChoose();
                }
            }
            refreshRedTip() {
                this.redTip.visible = false;
                for (let i = 0; i < DataMgr.Ins.carList.length; i++) {
                    let car = DataMgr.Ins.carList[i];
                    if (car.isLock) {
                        if (car.cfg.unLockType == E_UNLOCKCAR_TYPE.DIAMOND) {
                            if (DataMgr.Ins.diamon >= car.cfg.unLockNeedPatch) {
                                this.redTip.visible = true;
                                break;
                            }
                        } else if (car.cfg.unLockType == E_UNLOCKCAR_TYPE.VIDEO || car.cfg.unLockType == E_UNLOCKCAR_TYPE.SIGNIN && car.currShengTryTime > 0) {
                            this.redTip.visible = true;
                            break;
                        }
                    } else {
                        if (car.lv >= car.cfg.maxLvl) { } else {
                            if (DataMgr.Ins.gold >= car.getLvUpGoldNeed()) {
                                this.redTip.visible = true;
                                break;
                            }
                        }
                    }
                }
                this.redTipCha.visible = false;
                for (let i = 0; i < DataMgr.Ins.clothesList.length; i++) {
                    let data = DataMgr.Ins.clothesList[i];
                    if (data.isLock) {
                        switch (data.getBaseNature().unLockType) {
                            case E_UNLOCKCHA_TYPE.DIAMOND:
                                if (DataMgr.Ins.diamon >= data.getBaseNature().unLockNeedNum) {
                                    this.redTipCha.visible = true;
                                }
                                break;

                            case E_UNLOCKCHA_TYPE.GOLD:
                                if (DataMgr.Ins.gold >= data.getBaseNature().unLockNeedNum) {
                                    this.redTipCha.visible = true;
                                }
                                break;

                            case E_UNLOCKCHA_TYPE.AD:
                                if (data.videoAdNum >= data.getBaseNature().unLockNeedNum) {
                                    this.redTipCha.visible = true;
                                }
                                break;
                        }
                    }
                }
            }
        }
        class PaiMingItem extends Laya.Script {
            constructor() {
                super();
                this.currIndex = -1;
                this.isInitData = false;
            }
            initData(index) {
                this.anim = this.owner.getChildAt(12).getChildAt(0);
                if (!this.isInitData && index < 3) {
                    if (index == 0) {
                        DataMgr.Ins.starAnimList[0] = this.anim;
                        this.anim.play(0, false);
                        this.anim.visible = true;
                    } else if (index == 1) {
                        DataMgr.Ins.starAnimList[1] = this.anim;
                    } else {
                        DataMgr.Ins.starAnimList[2] = this.anim;
                    }
                    this.anim.on(Laya.Event.COMPLETE, this, () => {
                        let id = index + 1;
                        if (id >= 3) id = 0;
                        DataMgr.Ins.starAnimList[index].visible = false;
                        DataMgr.Ins.starAnimList[id].visible = true;
                        DataMgr.Ins.starAnimList[id].play(0, false);
                    });
                    this.isInitData = true;
                }
                this.anim.parent.visible = index < 3;
            }
        }
        var E_ITEM_STATE;
        (function (E_ITEM_STATE) {
            E_ITEM_STATE[E_ITEM_STATE["NONE"] = 0] = "NONE";
            E_ITEM_STATE[E_ITEM_STATE["SELECTED"] = 1] = "SELECTED";
            E_ITEM_STATE[E_ITEM_STATE["COMMON"] = 2] = "COMMON";
            E_ITEM_STATE[E_ITEM_STATE["LOCK"] = 3] = "LOCK";
        })(E_ITEM_STATE || (E_ITEM_STATE = {}));
        const FRIENDLENGTH = 10;
        const SERVERLENGTH = 50;
        class MultiRaceUI extends ui.UIScenes.RacingType.MultiRaceUI {
            constructor() {
                super();
                this.pageMode = -1;
                this.lapNum = -1;
                this.currLeftIndex = 0;
                this.currSelectRankType = 0;
                this.bujiCarId = 0;
                this.currAnimIndex = 0;
                this.hasShuaXin = false;
                this.currMapId = 1;
                this.currSelectBuJiIndex = 0;
                this.bujilist = [false, false, false];
                this.lastX = 0;
                this.isOpening = false;
                this.scaleX = this.scaleY = GlobalScale$1.scale;
                this.width = Laya.stage.width / GlobalScale$1.scale;
                this.height = Laya.stage.height / GlobalScale$1.scale;
                this.miniMapParent.width = this.width;
                this.backBtn.on(Laya.Event.CLICK, this, this.closeBtnClick);
                this.garageBtn.on(Laya.Event.CLICK, this, this.garageBtnClick);
                this.bagBtn.on(Laya.Event.CLICK, this, this.bagBtnClick);
                this.startBtn.on(Laya.Event.CLICK, this, this.startBtnClick);
                this.openMapBtn.on(Laya.Event.CLICK, this, this.openMapBtnClick);
                this.closeMiniMapBtn.on(Laya.Event.CLICK, this, this.closeMiniMapBtnClick);
                this.leftBtn.on(Laya.Event.CLICK, this, this.leftBtnClick);
                this.rightBtn.on(Laya.Event.CLICK, this, this.rightBtnClick);
                this.touchBox.on(Laya.Event.MOUSE_DOWN, this, this.mouseDown);
                this.touchBox.on(Laya.Event.MOUSE_MOVE, this, this.mouseMove);
                this.touchBox.on(Laya.Event.MOUSE_OUT, this, this.mouseUp);
                this.list_map.renderHandler = new Laya.Handler(this, this.renderHandler);
                this.list_map.selectEnable = true;
                this.list_map.selectHandler = new Laya.Handler(this, this.selectHandler);
                this.list_map.scrollBar.on(Laya.Event.CHANGE, this, this.refreshMapTipIcon);
                this.friendBtn.on(Laya.Event.CLICK, this, this.changeRankFunc, [1]);
                this.quanQuBtn.on(Laya.Event.CLICK, this, this.changeRankFunc, [0]);
                this.rankingList.renderHandler = new Laya.Handler(this, this.renderRankingHandler);
                if (this.width / this.height > 1.78) {
                    this.rightBox.scale(.9, .9);
                    this.guideAdBox.width = this.guideAdBox.width * .9;
                    this.guideAdBox.height = this.guideAdBox.height * .9;
                    this.selfRankDi.width = this.leftBox.width = 695;
                    this.wxKartFriend.x = 0;
                    this.quanQuBtn.width = this.friendBtn.width = 349;
                    this.rankingTitle1.visible = true;
                    this.rankingTitle.visible = false;
                } else {
                    this.rightBox.scale(.8, .8);
                    this.guideAdBox.width = this.guideAdBox.width * .8;
                    this.guideAdBox.height = this.guideAdBox.height * .8;
                    this.selfRankDi.width = this.leftBox.width = 601;
                    this.wxKartFriend.x = -94;
                    this.guideRankBox.x = -94;
                    this.quanQuBtn.width = this.friendBtn.width = 302;
                    this.rankingTitle1.visible = false;
                    this.rankingTitle.visible = true;
                }
                for (let i = 0; i < 3; i++) {
                    this.buJiBox.getChildAt(i).on(Laya.Event.CLICK, this, this.buJiBoxClick, [i]);
                }
            }
            onAwake() { }
            onEnable() { }
            onOpened(tryCarId) {
                this.initData();
                this.changeRankFunc(0);
                this.refreshRedTip();
                this.refreshBuJiBox();
                PlatformMgr.Ins.initNativeAd(E_UI_TYPE.MULTIRACE);
                if (DataMgr.Ins.guideData[E_GUIDE_TYPE.START_SPEED]) {
                    Laya.timer.frameOnce(2, this, () => GuideMgr.Ins.startGuide(E_GUIDE_TYPE.START_SPEED, this));
                }
                if (tryCarId) {
                    DataMgr.Ins.mutlRaceTryCar = tryCarId;
                }


                PrivateTracker_new.Ins.sendEvent(SDK_EVENT._打开多人竞速界面, {
                    "_打开多人竞速界面": "_打开多人竞速界面"
                });
            }
            initData() {
                this.isOpening = true;
                this.pageMode = E_GAME_MODE.MULTIPLAYER_SPEED_GAME;
                DataMgr.Ins.currGameMode = this.pageMode;
                this.bujilist = [false, false, false];
                this.list_map.dataSource = DataMgr.Ins.storyDatas;
                this.list_map.selectedIndex = DataMgr.Ins.currMapSelectIndex;
                this.currLeftIndex = 0;
                this.lapNum = -1;
                this.hasShuaXin = false;
                this.bujiCarId = this.getRankListDataSource()[0].carId;
                let carCfg = DataMgr.Ins.getCar(this.bujiCarId).cfg;
                this.tryCarImg.skin = LoadMgr.Ins.WebResHttp + "carIcon/" + carCfg._RacingIconName[0] + ".png";
                this.playStarAnim();
            }
            onClosed() {
                this.isOpening = false;
                PlatformMgr.Ins.closeNativeAd();
                for (let i = 0; i < DataMgr.Ins.starAnimList.length; i++) {
                    let ani = DataMgr.Ins.starAnimList[i];
                    if (ani) {
                        ani.offAll(Laya.Event.COMPLETE);
                        ani.visible = false;
                    }
                }

            }
            playStarAnim() {
                let ani = DataMgr.Ins.starAnimList[0];
                if (!ani) return;
                ani.play(0, false);
                ani.visible = true;
                for (let i = 0; i < 3; i++) {
                    let ani1 = DataMgr.Ins.starAnimList[i];
                    if (ani1) ani1.on(Laya.Event.COMPLETE, this, () => {
                        let id = i + 1;
                        if (id >= 3) id = 0;
                        DataMgr.Ins.starAnimList[i].visible = false;
                        DataMgr.Ins.starAnimList[id].visible = true;
                        DataMgr.Ins.starAnimList[id].play(0, false);
                    });
                }
            }
            changeRankFunc(index) {
                let parentSprite = this.width / this.height > 1.78 ? this.rankingTitle1 : this.rankingTitle;
                if (!window["swan"]) {
                    parentSprite.getChildAt(0).visible = index == 0;
                    parentSprite.getChildAt(1).visible = index == 1;
                }
                if (index == 0) {
                    this.currLeftIndex = index;
                    this.currSelectRankType = index;
                    this.refreshSelfRank();
                    this.rankingList.dataSource = this.getRankListDataSource();
                    this.rankingList.visible = true;
                    this.wxKartFriend.visible = false;
                } else {
                    this.wxKartFriend.visible = true;
                    this.rankingList.visible = false;
                    if (isWx()) {
                        var message = {
                            type: "Show",
                            trackID: DataMgr.Ins.currTrackId.toString()
                        };
                        platform.Ins.postMessagerToOpenData(message);
                    }
                    if (isQQ()) {
                        var message = {
                            type: "Show",
                            trackID: DataMgr.Ins.currTrackId.toString()
                        };
                        platform.Ins.postMessagerToOpenData(message);
                    }
                }
            }
            refreshSelfRank() {
                this.myTime.text = DataMgr.Ins.getPersonalRecord(E_GAME_MODE.MULTIPLAYER_SPEED_GAME, this.currMapId);
                this.myName.text = DataMgr.Ins.playerName;
                let list = this.currSelectRankType == 0 ? DataMgr.Ins.mapAllSerivesRankList[this.currMapId - 1] : DataMgr.Ins.mapFriendRankList[this.currMapId - 1];
                let mingciMax = this.currSelectRankType == 0 ? SERVERLENGTH : FRIENDLENGTH;
                let paiming = this.getMyRank(list);
                if (paiming > 0 && paiming <= mingciMax) {
                    this.myRanking.value = paiming + "";
                    this.myRanking.visible = true;
                    this.noBangImg.visible = false;
                } else {
                    this.noBangImg.visible = true;
                    this.myRanking.visible = false;
                }
            }
            getRankListDataSource() {
                let list = this.currSelectRankType == 0 ? DataMgr.Ins.mapAllSerivesRankList[this.currMapId - 1] : DataMgr.Ins.mapFriendRankList[this.currMapId - 1];
                let mingciMax = this.currSelectRankType == 0 ? SERVERLENGTH : FRIENDLENGTH;
                let paiming = this.getMyRank(list);
                if (paiming > 0 && paiming <= mingciMax) {
                    var rd = DataMgr.Ins.recordsDatas[this.currMapId - 1];
                    let time = DataMgr.Ins.getPersonalRecordNum(E_GAME_MODE.MULTIPLAYER_SPEED_GAME, this.currMapId);
                    let list1 = [];
                    let hasPush = false;
                    for (let i = 0; i < list.length; i++) {
                        if (!hasPush && list[i].useTime > time) {
                            let a = new RankingItem();
                            if (!rd.carId) {
                                let car = DataMgr.Ins.currSelectCar;
                                a.initData(i + 1, DataMgr.Ins.playerName, time, car.id, car.getMaxStage() - 1, car.getQuality());
                            } else {
                                a.initData(i + 1, DataMgr.Ins.playerName, time, rd.carId, rd.carStage - 1, rd.carQulity);
                            }
                            list1.push(a);
                            hasPush = true;
                        }
                        list1.push(list[i]);
                    }
                    if (list1.length > mingciMax) {
                        list1.splice(mingciMax, list1.length - mingciMax);
                    }
                    return list1;
                } else {
                    return list;
                }
            }
            getMyRank(list) {
                let time = DataMgr.Ins.getPersonalRecordNum(E_GAME_MODE.MULTIPLAYER_SPEED_GAME, this.currMapId);
                if (time > 0) {
                    for (let i = 0; i < list.length; i++) {
                        if (list[i].useTime > time) {
                            return i + 1;
                        }
                    }
                    return list.length + 1;
                } else {
                    return 0;
                }
            }
            renderHandler(cell, index) {
                let itemMsg = this.list_map.dataSource[index];
                let info = itemMsg.trackCfg;
                if (!info) return;
                cell.getComponent(oneRaceItemScript).map.skin = LoadMgr.Ins.WebResHttp + `pickLevel1/${info._SceneBG}`;
                if (this.list_map.selectedIndex == index) {
                    this.setItemState(E_ITEM_STATE.SELECTED, cell);
                } else {
                    this.setItemState(E_ITEM_STATE.COMMON, cell);
                }
            }
            renderRankingHandler(cell, index) {
                cell.width = this.width / this.height > 1.78 ? 695 : 601;
                cell.getChildAt(7).width = this.width / this.height > 1.78 ? 695 : 601;
                let mingci = cell.getChildAt(0);
                let mungciImg = cell.getChildAt(1);
                let playName = cell.getChildAt(2);
                let time = cell.getChildAt(4);
                let carImg = cell.getChildAt(5);
                let tryBtn = cell.getChildAt(6);

                let videoImg = new Laya.Image();
                videoImg.skin = "uires/videoCoin/shipintubiao.png";
                videoImg.x = 105;
                videoImg.y = -5;
                videoImg.scaleX = .8;
                videoImg.scaleY = .8;
                tryBtn.addChild(videoImg);

                let lvDi = cell.getChildAt(8);
                let carName = cell.getChildAt(9);
                let lv = cell.getChildAt(10);
                let score = cell.getChildAt(11);
                let list = this.getRankListDataSource();
                let rankData = list[index];
                lvDi.skin = "uires/oneRace1/zd" + rankData.carPingJi + ".png";
                let num = DataMgr.Ins.playerName == rankData._PlayerName ? 2 : 1;
                mingci.skin = "uires/oneRace1/shuzi" + num + ".png";
                mingci.value = (index + 1).toString();
                mungciImg.visible = index < 3;
                cell.getComponent(PaiMingItem).initData(index);
                if (index < 3) {
                    mungciImg.skin = "uires/oneRace1/paiming" + (index + 1) + ".png";
                }
                playName.text = rankData._PlayerName;
                time.text = UsefulStuff.formatMSS(rankData.useTime);
                let carCfg = DataMgr.Ins.getCar(rankData.carId).cfg;
                carImg.skin = LoadMgr.Ins.WebResHttp + "carIcon/" + carCfg._RacingIconName[rankData.carSkinIndex] + ".png";
                carName.text = carCfg._Name;
                lv.skin = "uires/oneRace1/qulity_" + rankData.carPingJi + ".png";
                tryBtn.offAll(Laya.Event.CLICK);
                //点击试用
                tryBtn.on(Laya.Event.CLICK, this, () => {
                    //激励广告
                    showReward(() => {
                        DataMgr.Ins.mutlRaceTryCar = list[index].carId;
                        this.popVideoFankui(0);
                    });

                });
            }
            getQuality(score) {
                if (score < 600) {
                    return 0;
                } else if (score < 800) {
                    return 1;
                } else if (score < 1e3) {
                    return 2;
                } else {
                    return 3;
                }
            }
            refreshMapTipIcon() {
                this.mapTipIcon.rotation = this.list_map.scrollBar.slider.value >= 1628 ? 90 : 270;
            }
            selectHandler(index) {
                this.list_map.refresh();
                DataMgr.Ins.currTrackId = this.list_map.dataSource[this.list_map.selectedIndex].trackCfg.ID;
                this.refreshBigImg(index);
                this.changeRankFunc(this.currLeftIndex);
            }
            refreshBigImg(index) {
                let itemMsg = this.list_map.dataSource[index];
                let info = itemMsg.trackCfg;
                this.currMapId = info.ID;
                this.img_big.skin = LoadMgr.Ins.WebResHttp + `pickLevel1/${info._SceneBigBG}`;
                this.map_name.text = info._Name;
                this.miniMap.skin = "webRes/raceMap/level" + info.ID + ".png";
            }
            setItemState(state, obj) {
                let cell = obj.getComponent(oneRaceItemScript);
                cell.map.gray = false;
                cell.map.mask = null;
                cell.lock.visible = false;
                cell.huang.visible = false;
                cell.lan.visible = true;
                if (state == E_ITEM_STATE.SELECTED) {
                    cell.lan.visible = false;
                    cell.huang.visible = true;
                }
                if (state == E_ITEM_STATE.LOCK) {
                    cell.map.gray = true;
                    cell.lock.visible = true;
                }
            }
            startBtnClick() {
                SoundMgr.Ins.Press();
                StartUI.gameModeType = ModeType._多人竞速_;
                PrivateTracker_new.Ins.sendEvent(SDK_EVENT._点击多人竞速开始游戏按钮, {
                    "_点击多人竞速开始游戏按钮": "_点击多人竞速开始游戏按钮"
                });
                let idx = DataMgr.Ins.currTrackId;
                DataMgr.Ins.gameUseCar = DataMgr.Ins.currSelectCar;
                DataMgr.Ins.useCarStage = DataMgr.Ins.carStage;
                PlatformMgr.Ins.closeNativeAd();
                if (DataMgr.Ins.mutlRaceTryCar > 0) {
                    DataMgr.Ins.useCarStage = DataMgr.Ins.currSelectCar.getMaxStage();
                    let car = new BaseRacing();
                    car.init(DataMgr.Ins.mutlRaceTryCar, true, DataMgr.Ins.currSelectCar.lv, DataMgr.Ins.currSelectCar.lv, DataMgr.Ins.currSelectCar.lv, DataMgr.Ins.currSelectCar.lv);
                    DataMgr.Ins.gameUseCar = car;
                    GameMgr.Ins.enterGame(true, this.pageMode, this.lapNum);
                    UIManager.Ins.getScene(E_UI_TYPE.RANKING_UI).open();
                } else {
                    if (DataMgr.Ins.leiJiGameTimes > PlatformMgr.Ins._gameConfig.openTryCarTimes) {
                        DataMgr.Ins.leiJiGameTimes = 0;
                        UIManager.Ins.getScene(E_UI_TYPE.CAR_TRIAL).open(false, [E_GAME_MODE.MULTIPLAYER_SPEED_GAME]);
                    } else {
                        DataMgr.Ins.useCarStage = DataMgr.Ins.carStage;
                        DataMgr.Ins.gameUseCar = DataMgr.Ins.currSelectCar;
                        GameMgr.Ins.enterGame(true, this.pageMode, this.lapNum);
                        UIManager.Ins.getScene(E_UI_TYPE.RANKING_UI).open();
                    }
                }
                DataMgr.Ins.currMapSelectIndex = this.list_map.selectedIndex;
                GameMgr.Ins.gameCardArray = [];
                if (this.bujilist[1]) GameMgr.Ins.gameCardArray.push(E_PROP_TYPE.NOS);
                if (this.bujilist[2]) GameMgr.Ins.gameCardArray.push(E_PROP_TYPE.NOS);
            }
            closeBtnClick() {
                SoundMgr.Ins.Press();
                this.close();
                SceneMgr.Ins.clearUIScene();
                UIManager.Ins.getScene(E_UI_TYPE.PICKMODE).open();
            }
            garageBtnClick() {

                SoundMgr.Ins.Press();
                SceneMgr.Ins.clearUIScene();
                UIManager.Ins.getScene(E_UI_TYPE.GARAGEUI).open(true, [E_UI_TYPE.MULTIRACE, -1]);
            }
            bagBtnClick() {

                SoundMgr.Ins.Press();
                SceneMgr.Ins.clearUIScene();
                UIManager.Ins.getScene(E_UI_TYPE.DRIVERUI).open();
                DataMgr.Ins.driverToUIid = E_UI_TYPE.MULTIRACE;
            }
            openMapBtnClick() {
                SoundMgr.Ins.Press();
                this.miniMapParent.visible = true;
            }
            closeMiniMapBtnClick() {
                SoundMgr.Ins.Press();
                this.miniMapParent.visible = false;
            }
            buJiBoxClick(index) {
                SoundMgr.Ins.Press();
                if (this.bujilist[index]) {
                    return;
                }
                this.buJiBox.getChildAt(index).getChildAt(3).visible = true;
                this.currSelectBuJiIndex = index;
                this.refreshBuJiBox();

                //激励广告
                showReward(() => {
                    this.bujilist[index] = true;
                    if (index == 0) {
                        DataMgr.Ins.mutlRaceTryCar = this.bujiCarId;
                    }
                    this.popVideoFankui(index);
                    this.refreshBuJiBox();
                });

            }
            refreshBuJiBox() {
                for (let i = 0; i < 3; i++) {
                    this.buJiBox.getChildAt(i).getChildAt(3).visible = false;
                    if (this.bujilist[i]) {
                        this.buJiBox.getChildAt(i).getChildAt(4).visible = true;
                    } else {
                        this.buJiBox.getChildAt(i).getChildAt(4).visible = false;
                    }
                }
                for (let i = 0; i < 3; i++) {
                    if (!this.bujilist[i]) {
                        this.buJiBox.getChildAt(i).getChildAt(3).visible = true;
                        break;
                    }
                }
            }
            popVideoFankui(index) {
                let str = "";
                if (index == 0) {
                    if (DataMgr.Ins.mutlRaceTryCar > 0) str = "恭喜：" + DataMgr.Ins.getCar(DataMgr.Ins.mutlRaceTryCar).carName + "装备成功！"; else str = "恭喜：车辆装备成功！";
                } else if (index == 1) {
                    str = "氮气补给成功，游戏内道具框内已补满哦！";
                } else if (index == 2) {
                    str = "双倍起步已准备，游戏内带你双倍起飞！";
                }
                UIManager.Ins.getScene(E_UI_TYPE.LONGBLACKTIP).open(false, [str]);
            }
            leftBtnClick() {
                SoundMgr.Ins.Press();
                if (this.list_map.selectedIndex - 1 < 0) {
                    this.list_map.selectedIndex = DataMgr.Ins.storyDatas.length - 1;
                } else {
                    this.list_map.selectedIndex--;
                }
            }
            rightBtnClick() {
                SoundMgr.Ins.Press();
                if (this.list_map.selectedIndex + 1 >= DataMgr.Ins.storyDatas.length) {
                    this.list_map.selectedIndex = 0;
                } else {
                    this.list_map.selectedIndex++;
                }
            }
            mouseDown() {
                this.lastX = Laya.stage.mouseX;
            }
            mouseMove() { }
            mouseUp() {
                if (Laya.stage.mouseX - this.lastX > 50) {
                    this.leftBtnClick();
                } else if (Laya.stage.mouseX - this.lastX < -50) {
                    this.rightBtnClick();
                }
            }
            load3DScene() {
                let podium = SceneMgr.Ins.createUIVFX("unity/podium/start_parent3d.lh", 0, 0, 3.8, 35);
                podium.transform.rotationEuler = new Laya.Vector3(0, 180, 0);
                LoadMgr.Ins.loadAsset(() => {
                    this.loadCarScene(podium);
                }, [LoadMgr.Ins.unityResPath(E_UNITY_RES_PATH.CAR, "Car_" + DataMgr.Ins.getCurrSelectCar().cfg.assetId + "_" + DataMgr.Ins.carStage + ".lh")]);
                let list = DataMgr.Ins.currPlayerSex == 0 ? DataMgr.Ins.currSelectMenClothesList : DataMgr.Ins.currSelectWomenClothesList;
                var WingCfg = list[3] ? list[3].getBaseNature() : null;
                var HairCfg = list[0] ? list[0].getBaseNature() : null;
                var rndChaCfg = list[2] ? list[2].getBaseNature() : null;
                var HatCfg = list[1] ? list[1].getBaseNature() : null;
                let urlList = [];
                if (rndChaCfg) urlList.push(LoadMgr.Ins.unityResPath(E_UNITY_RES_PATH.CHA, "Cha_" + rndChaCfg.assetId.toString() + ".lh"));
                if (WingCfg) urlList.push(LoadMgr.Ins.unityResPath(E_UNITY_RES_PATH.CHA, "wing_" + WingCfg.assetId.toString() + ".lh"));
                if (HairCfg) urlList.push(LoadMgr.Ins.unityResPath(E_UNITY_RES_PATH.CHA, "hair_" + HairCfg.assetId.toString() + ".lh"));
                if (HatCfg) urlList.push(LoadMgr.Ins.unityResPath(E_UNITY_RES_PATH.CHA, "hat_" + HatCfg.assetId.toString() + ".lh"));
                LoadMgr.Ins.loadAsset(() => {
                    this.loadChaScene(podium);
                }, urlList);
            }
            loadCarScene(parent3d) {
                if (!this.isOpening) return;
                let car = null;
                car = SceneMgr.Ins.createUIVFX(LoadMgr.Ins.unityResPath(E_UNITY_RES_PATH.CAR, "Car_" + DataMgr.Ins.getCurrSelectCar().cfg.assetId + "_" + DataMgr.Ins.carStage + ".lh"), 0, 0, 3.8, 35);
                try {
                    let scaling = DataMgr.Ins.getCurrSelectCar().cfg.scaling / 100;
                    parent3d.getChildAt(0).getChildAt(1).addChild(car);
                    car.getChildAt(0).getChildAt(5).getChildAt(0).active = false;
                    car.getChildAt(0).getChildAt(5).getChildAt(1).active = false;
                    car.getChildAt(0).getChildAt(5).getChildAt(2).active = false;
                    car.getChildAt(0).getChildAt(5).getChildAt(3).active = false;
                    car.getChildAt(0).getChildAt(5).getChildAt(4).active = false;
                    var flyRoot = car.getChildAt(0).getChildAt(6);
                    if (flyRoot) {
                        for (let i = 0; i < flyRoot.numChildren; i++) {
                            var ani = flyRoot.getChildAt(i).getComponent(Laya.Animator);
                            ani.play("fly_idle");
                        }
                    }
                } catch (e) {
                    console.error(e);
                }
            }
            loadChaScene(parent3d) {
                if (!this.isOpening) return;
                let list = DataMgr.Ins.currPlayerSex == 0 ? DataMgr.Ins.currSelectMenClothesList : DataMgr.Ins.currSelectWomenClothesList;
                let WingCfg = list[3] ? list[3].getBaseNature() : null;
                let HairCfg = list[0] ? list[0].getBaseNature() : null;
                let rndChaCfg = list[2] ? list[2].getBaseNature() : null;
                let HatCfg = list[1] ? list[1].getBaseNature() : null;
                let Cha = SceneMgr.Ins.createUIVFX(LoadMgr.Ins.unityResPath(E_UNITY_RES_PATH.CHA, "Cha_" + rndChaCfg.assetId.toString() + ".lh"), 0, 0, 3.2, 35);
                if (Cha) {
                    parent3d.getChildAt(0).getChildAt(0).addChild(Cha);
                    Cha.transform.rotationEuler = new Laya.Vector3(0, 10, 0);
                    var aSrc = Cha.addComponent(ActorScript);
                    aSrc.init(HatCfg, HairCfg, WingCfg);
                    if (rndChaCfg.sex) aSrc.playWomenChoose(); else aSrc.playMenChoose();
                }
            }
            refreshRedTip() {
                this.redTip.visible = false;
                for (let i = 0; i < DataMgr.Ins.carList.length; i++) {
                    let car = DataMgr.Ins.carList[i];
                    if (car.isLock) {
                        if (car.cfg.unLockType == E_UNLOCKCAR_TYPE.DIAMOND) {
                            if (DataMgr.Ins.diamon >= car.cfg.unLockNeedPatch) {
                                this.redTip.visible = true;
                                break;
                            }
                        } else if (car.cfg.unLockType == E_UNLOCKCAR_TYPE.VIDEO || car.cfg.unLockType == E_UNLOCKCAR_TYPE.SIGNIN && car.currShengTryTime > 0) {
                            this.redTip.visible = true;
                            break;
                        }
                    } else {
                        if (car.lv >= car.cfg.maxLvl) { } else {
                            if (DataMgr.Ins.gold >= car.getLvUpGoldNeed()) {
                                this.redTip.visible = true;
                                break;
                            }
                        }
                    }
                }
                this.redTipCha.visible = false;
                for (let i = 0; i < DataMgr.Ins.clothesList.length; i++) {
                    let data = DataMgr.Ins.clothesList[i];
                    if (data.isLock) {
                        switch (data.getBaseNature().unLockType) {
                            case E_UNLOCKCHA_TYPE.DIAMOND:
                                if (DataMgr.Ins.diamon >= data.getBaseNature().unLockNeedNum) {
                                    this.redTipCha.visible = true;
                                }
                                break;

                            case E_UNLOCKCHA_TYPE.GOLD:
                                if (DataMgr.Ins.gold >= data.getBaseNature().unLockNeedNum) {
                                    this.redTipCha.visible = true;
                                }
                                break;

                            case E_UNLOCKCHA_TYPE.AD:
                                if (data.videoAdNum >= data.getBaseNature().unLockNeedNum) {
                                    this.redTipCha.visible = true;
                                }
                                break;
                        }
                    }
                }
            }
        }
        var E_ITEM_STATE$1;
        (function (E_ITEM_STATE) {
            E_ITEM_STATE[E_ITEM_STATE["NONE"] = 0] = "NONE";
            E_ITEM_STATE[E_ITEM_STATE["SELECTED"] = 1] = "SELECTED";
            E_ITEM_STATE[E_ITEM_STATE["COMMON"] = 2] = "COMMON";
            E_ITEM_STATE[E_ITEM_STATE["LOCK"] = 3] = "LOCK";
        })(E_ITEM_STATE$1 || (E_ITEM_STATE$1 = {}));
        class oneRaceUI extends ui.UIScenes.RacingType.oneRaceUI {
            constructor() {
                super(...arguments);
                this.pageMode = -1;
                this.lapNum = -1;
                this.isOpening = false;
            }
            onAwake() {
                this.scaleX = this.scaleY = GlobalScale$1.scale;
                this.width = Laya.stage.width / GlobalScale$1.scale;
                this.height = Laya.stage.height / GlobalScale$1.scale;
                this.backBtn.on(Laya.Event.CLICK, this, this.closeBtnClick);
                this.xingzuoBtn.on(Laya.Event.CLICK, this, this.xingzuoBtnClick);
                this.garageBtn.on(Laya.Event.CLICK, this, this.garageBtnClick);
                this.bagBtn.on(Laya.Event.CLICK, this, this.bagBtnClick);
                this.useCarBtn.on(Laya.Event.CLICK, this, this.useCarBtnClick);
                this.startBtn.on(Laya.Event.CLICK, this, this.startBtnClick);
                this.list_map.renderHandler = new Laya.Handler(this, this.renderHandler);
                this.list_map.selectEnable = true;
                this.list_map.selectHandler = new Laya.Handler(this, this.selectHandler);
                if (this.width / this.height > 1.78) {
                    this.moveBox.x = 0;
                } else {
                    this.moveBox.x = -80;
                }
            }
            onEnable() { }
            onOpened(type) {
                this.pageMode = E_GAME_MODE.SINGLE_SPEED_GAME;
                DataMgr.Ins.currGameMode = this.pageMode;
                this.list_map.dataSource = DataMgr.Ins.storyDatas;
                console.log(" == datasource == ", DataMgr.Ins.storyDatas);
                this.list_map.selectedIndex = 0;
                DataMgr.Ins.currTrackId = 1;
                this.isOpening = true;
                this.refreshRedTip();
                this.load3DScene();
                this.lapNum = -1;
                PlatformMgr.Ins.initNativeAd(E_UI_TYPE.ONERACE);

                let banner;
                let left = 50;
                let bottom = 0;
                let width = 300;


                PrivateTracker_new.Ins.sendEvent(SDK_EVENT._打开个人竞速界面, {
                    "_打开个人竞速界面": "_打开个人竞速界面"
                });
            }
            onClosed() {
                this.isOpening = false;
                PlatformMgr.Ins.closeNativeAd();

            }
            renderHandler(cell, index) {
                let itemMsg = this.list_map.dataSource[index];
                let info = itemMsg.trackCfg;
                if (!info) return;
                cell.getComponent(oneRaceItemScript).map.skin = LoadMgr.Ins.WebResHttp + `pickLevel1/${info._SceneBG}`;
                if (this.list_map.selectedIndex == index && itemMsg.isUnlock) {
                    cell.ani1.play(0, false);
                    DataMgr.Ins.currTrackId = this.list_map.dataSource[index].trackCfg.ID;
                    this.setItemState(E_ITEM_STATE$1.SELECTED, cell);
                } else {
                    if (itemMsg.isUnlock) {
                        this.setItemState(E_ITEM_STATE$1.COMMON, cell);
                    } else {
                        this.setItemState(E_ITEM_STATE$1.LOCK, cell);
                    }
                }
            }
            selectHandler(index) {
                this.list_map.refresh();
                this.refreshBigImg(index);
            }
            refreshBigImg(index) {
                let itemMsg = this.list_map.dataSource[index];
                let info = itemMsg.trackCfg;
                this.img_big.skin = LoadMgr.Ins.WebResHttp + `pickLevel1/${info._SceneBigBG}`;
                this.map_name.text = info._Name;
                this.more_speed.text = `全服最快速度：${UsefulStuff.formatMSS(DataMgr.Ins.getServerRecord(this.pageMode, info.ID))}`;
                this.one_speed.text = `个人最快速度：${DataMgr.Ins.getPersonalRecord(this.pageMode, info.ID)}`;
                this.star_count.text = CCfgMgr.Ins.cfgStoryInfo.getItem(info.ID)._unlockDesc1;
                this.star_count1.text = CCfgMgr.Ins.cfgStoryInfo.getItem(info.ID)._unlockDesc2;
                this.star_count2.text = CCfgMgr.Ins.cfgStoryInfo.getItem(info.ID)._unlockDesc3;
                this.startBtn.visible = itemMsg.isUnlock;
                this.star_count.visible = !itemMsg.isUnlock;
                this.star_count1.visible = !itemMsg.isUnlock;
                this.star_count2.visible = !itemMsg.isUnlock;
            }
            setItemState(state, obj) {
                let cell = obj.getComponent(oneRaceItemScript);
                cell.map.gray = false;
                cell.mask.visible = false;
                cell.map.mask = null;
                cell.lock.visible = false;
                cell.huang.visible = false;
                cell.lan.visible = true;
                if (state == E_ITEM_STATE$1.SELECTED) {
                    cell.lan.visible = false;
                    cell.huang.visible = true;
                }
                if (state == E_ITEM_STATE$1.COMMON) {
                    cell.map.mask = cell.mask;
                }
                if (state == E_ITEM_STATE$1.LOCK) {
                    cell.map.gray = true;
                    cell.map.mask = cell.mask;
                    cell.mask.visible = true;
                    cell.lock.visible = true;
                }
            }
            filterData() {
                let arr = DataMgr.Ins.InitMapListData();
                let arr1 = [];
                let arr2 = [];
                arr.forEach(x => {
                    if (x.isLock) {
                        arr1.push(x);
                    } else {
                        arr2.push(x);
                    }
                });
                function compare(property) {
                    return function (a, b) {
                        var value1 = a[property];
                        var value2 = b[property];
                        return value1 - value2;
                    };
                }
                arr1.sort(compare("sceneType"));
                arr2.sort(compare("sceneType"));
                let data = [];
                arr1.concat(arr2).forEach(x => {
                    data.push(CCfgMgr.Ins.cfgTrack.getItem(x.mapId));
                });
                console.log(" == data == ", data);
                return data;
            }
            startBtnClick() {
                SoundMgr.Ins.Press();
                PlatformMgr.Ins.closeNativeAd();
                if (DataMgr.Ins.leiJiGameTimes > PlatformMgr.Ins._gameConfig.openTryCarTimes) {
                    DataMgr.Ins.leiJiGameTimes = 0;
                    UIManager.Ins.getScene(E_UI_TYPE.CAR_TRIAL).open(false, [E_GAME_MODE.SINGLE_SPEED_GAME]);
                } else {
                    DataMgr.Ins.gameUseCar = DataMgr.Ins.currSelectCar;
                    DataMgr.Ins.useCarStage = DataMgr.Ins.carStage;
                    GameMgr.Ins.enterGame(false, this.pageMode, this.lapNum);
                }
                StartUI.gameModeType = ModeType._单人_;
                PrivateTracker_new.Ins.sendEvent(SDK_EVENT._点击个人竞速开始游戏按钮, {
                    "_点击个人竞速开始游戏按钮": "_点击个人竞速开始游戏按钮"
                });
            }
            closeBtnClick() {
                SoundMgr.Ins.Press();
                this.close();
                SceneMgr.Ins.clearUIScene();
                UIManager.Ins.getScene(E_UI_TYPE.PICKMODE).open();
            }
            xingzuoBtnClick() {
                SoundMgr.Ins.Press();
                UIManager.Ins.getScene(E_UI_TYPE.CONSTELLATION).open(false);
            }
            garageBtnClick() {
                SoundMgr.Ins.Press();
                SceneMgr.Ins.clearUIScene();
                UIManager.Ins.getScene(E_UI_TYPE.GARAGEUI).open(true, [E_UI_TYPE.ONERACE, -1]);
            }
            bagBtnClick() {
                SoundMgr.Ins.Press();
                SceneMgr.Ins.clearUIScene();
                UIManager.Ins.getScene(E_UI_TYPE.DRIVERUI).open();
                DataMgr.Ins.driverToUIid = E_UI_TYPE.ONERACE;
            }
            useCarBtnClick() {
                SoundMgr.Ins.Press();
                UIManager.Ins.getScene(E_UI_TYPE.CAR_TRIAL).open(false, [E_GAME_MODE.SINGLE_SPEED_GAME]);
            }
            load3DScene() {
                let podium = SceneMgr.Ins.createUIVFX("unity/podium/start_parent3d.lh", 0, 0, 3.8, 35, this.parent3dRoot);
                podium.transform.rotationEuler = new Laya.Vector3(0, 180, 0);
                LoadMgr.Ins.loadAsset(() => {
                    this.loadCarScene(podium);
                }, [LoadMgr.Ins.unityResPath(E_UNITY_RES_PATH.CAR, "Car_" + DataMgr.Ins.getCurrSelectCar().cfg.assetId + "_" + DataMgr.Ins.carStage + ".lh")]);
                let list = DataMgr.Ins.currPlayerSex == 0 ? DataMgr.Ins.currSelectMenClothesList : DataMgr.Ins.currSelectWomenClothesList;
                var WingCfg = list[3] ? list[3].getBaseNature() : null;
                var HairCfg = list[0] ? list[0].getBaseNature() : null;
                var rndChaCfg = list[2] ? list[2].getBaseNature() : null;
                var HatCfg = list[1] ? list[1].getBaseNature() : null;
                let urlList = [];
                if (rndChaCfg) urlList.push(LoadMgr.Ins.unityResPath(E_UNITY_RES_PATH.CHA, "Cha_" + rndChaCfg.assetId.toString() + ".lh"));
                if (WingCfg) urlList.push(LoadMgr.Ins.unityResPath(E_UNITY_RES_PATH.CHA, "wing_" + WingCfg.assetId.toString() + ".lh"));
                if (HairCfg) urlList.push(LoadMgr.Ins.unityResPath(E_UNITY_RES_PATH.CHA, "hair_" + HairCfg.assetId.toString() + ".lh"));
                if (HatCfg) urlList.push(LoadMgr.Ins.unityResPath(E_UNITY_RES_PATH.CHA, "hat_" + HatCfg.assetId.toString() + ".lh"));
                LoadMgr.Ins.loadAsset(() => {
                    this.loadChaScene(podium);
                }, urlList);
            }
            loadCarScene(parent3d) {
                if (!this.isOpening) return;
                let car = null;
                car = SceneMgr.Ins.createUIVFX(LoadMgr.Ins.unityResPath(E_UNITY_RES_PATH.CAR, "Car_" + DataMgr.Ins.getCurrSelectCar().cfg.assetId + "_" + DataMgr.Ins.carStage + ".lh"), 0, 0, 3.8, 35);
                try {
                    let scaling = DataMgr.Ins.getCurrSelectCar().cfg.scaling / 100;
                    parent3d.getChildAt(0).getChildAt(1).addChild(car);
                    car.getChildAt(0).getChildAt(5).getChildAt(0).active = false;
                    car.getChildAt(0).getChildAt(5).getChildAt(1).active = false;
                    car.getChildAt(0).getChildAt(5).getChildAt(2).active = false;
                    car.getChildAt(0).getChildAt(5).getChildAt(3).active = false;
                    car.getChildAt(0).getChildAt(5).getChildAt(4).active = false;
                    var flyRoot = car.getChildAt(0).getChildAt(6);
                    if (flyRoot) {
                        for (let i = 0; i < flyRoot.numChildren; i++) {
                            var ani = flyRoot.getChildAt(i).getComponent(Laya.Animator);
                            ani.play("fly_idle");
                        }
                    }
                } catch (e) {
                    console.error(e);
                }
            }
            loadChaScene(parent3d) {
                if (!this.isOpening) return;
                let list = DataMgr.Ins.currPlayerSex == 0 ? DataMgr.Ins.currSelectMenClothesList : DataMgr.Ins.currSelectWomenClothesList;
                let WingCfg = list[3] ? list[3].getBaseNature() : null;
                let HairCfg = list[0] ? list[0].getBaseNature() : null;
                let rndChaCfg = list[2] ? list[2].getBaseNature() : null;
                let HatCfg = list[1] ? list[1].getBaseNature() : null;
                let Cha = SceneMgr.Ins.createUIVFX(LoadMgr.Ins.unityResPath(E_UNITY_RES_PATH.CHA, "Cha_" + rndChaCfg.assetId.toString() + ".lh"), 0, 0, 3.2, 35);
                if (Cha) {
                    parent3d.getChildAt(0).getChildAt(0).addChild(Cha);
                    Cha.transform.rotationEuler = new Laya.Vector3(0, 10, 0);
                    var aSrc = Cha.addComponent(ActorScript);
                    aSrc.init(HatCfg, HairCfg, WingCfg);
                    if (rndChaCfg.sex) aSrc.playWomenChoose(); else aSrc.playMenChoose();
                }
            }
            refreshRedTip() {
                this.redTip.visible = false;
                for (let i = 0; i < DataMgr.Ins.carList.length; i++) {
                    let car = DataMgr.Ins.carList[i];
                    if (car.isLock) {
                        if (car.cfg.unLockType == E_UNLOCKCAR_TYPE.DIAMOND) {
                            if (DataMgr.Ins.diamon >= car.cfg.unLockNeedPatch) {
                                this.redTip.visible = true;
                                break;
                            }
                        } else if (car.cfg.unLockType == E_UNLOCKCAR_TYPE.VIDEO || car.cfg.unLockType == E_UNLOCKCAR_TYPE.SIGNIN && car.currShengTryTime > 0) {
                            this.redTip.visible = true;
                            break;
                        }
                    } else {
                        if (car.lv >= car.cfg.maxLvl) { } else {
                            if (DataMgr.Ins.gold >= car.getLvUpGoldNeed()) {
                                this.redTip.visible = true;
                                break;
                            }
                        }
                    }
                }
                this.redTipCha.visible = false;
                for (let i = 0; i < DataMgr.Ins.clothesList.length; i++) {
                    let data = DataMgr.Ins.clothesList[i];
                    if (data.isLock) {
                        switch (data.getBaseNature().unLockType) {
                            case E_UNLOCKCHA_TYPE.DIAMOND:
                                if (DataMgr.Ins.diamon >= data.getBaseNature().unLockNeedNum) {
                                    this.redTipCha.visible = true;
                                }
                                break;

                            case E_UNLOCKCHA_TYPE.GOLD:
                                if (DataMgr.Ins.gold >= data.getBaseNature().unLockNeedNum) {
                                    this.redTipCha.visible = true;
                                }
                                break;

                            case E_UNLOCKCHA_TYPE.AD:
                                if (data.videoAdNum >= data.getBaseNature().unLockNeedNum) {
                                    this.redTipCha.visible = true;
                                }
                                break;
                        }
                    }
                }
            }
        }
        class RankingViewUI extends ui.UIScenes.rank.RankingViewUI {
            constructor() {
                super(...arguments);
                this.NpcDataAry = [{}, {}, {}];
                this.npcInfo = {
                    raceID: 0,
                    carID: 8,
                    carLv: 2,
                    clothInfo: {
                        clothID: 4,
                        wingCfg: {
                            ID: 7,
                            _Name: "飞行帽",
                            part: 1,
                            sex: 2,
                            unLockType: 2,
                            unLockNeedNum: 1,
                            picId: 1,
                            assetId: 1
                        },
                        hairCfg: {
                            ID: 7,
                            _Name: "飞行帽",
                            part: 1,
                            sex: 2,
                            unLockType: 2,
                            unLockNeedNum: 1,
                            picId: 1,
                            assetId: 1
                        },
                        hatCfg: {
                            ID: 7,
                            _Name: "飞行帽",
                            part: 1,
                            sex: 2,
                            unLockType: 2,
                            unLockNeedNum: 1,
                            picId: 1,
                            assetId: 1
                        }
                    }
                };
                this.rankScene = null;
                this.dataSource = [];
                this.randRankAry = [];
            }
            onAwake() {
                this.scaleX = this.scaleY = GlobalScale$1.scale;
                this.width = Laya.stage.width / GlobalScale$1.scale;
                this.height = Laya.stage.height / GlobalScale$1.scale;
                EventMgr.Ins.on(EventType.RANKING_LOAD_COMPLETE, this, this.loadAllNpcScene);
                this.zongBox.x = (this.width - 1280) / 2;
            }
            onOpened() {
                PlatformMgr.Ins.canShowBanner = true;
                this.playStartAni();
                this.loadPlat3DScene();
                this.randNpcLevel();
                this.updateUIView();
                PlatformMgr.Ins.initNativeAd(E_UI_TYPE.RANKING_UI);
                DataMgr.Ins.currHasTryCar = false;

                let banner;
                let left = 0;
                let bottom = 0;
                let width = 300;

            }
            onClosed() {
                PlatformMgr.Ins.closeNativeAd();


            }
            onEnable() { }
            onDisable() { }
            updateUIView() {
                for (let i = 1; i < 5; i++) {
                    this["ready_" + i].visible = false;
                    this["logo_" + i].visible = false;
                }
            }
            loadPlat3DScene() {
                LoadMgr.Ins.loadAsset(() => {
                    this.load3DScene();
                }, ["unity/rank/Conventional/march_level.ls"]);
            }
            load3DScene() {
                this.rankScene = Laya.Loader.getRes("unity/rank/Conventional/march_level.ls");
                this.parent3dRoot.addChild(this.rankScene);
                this.rankScene.getChildByName("Main Camera").clearFlag = 2;
                this.rankScene.ambientColor = new Laya.Vector3(1, 1, 1);
                this.UILight = new Laya.DirectionLight();
                this.UILight.transform.rotationEuler = new Laya.Vector3(0, 90, 0);
                this.UILight.intensity = .35;
                this.rankScene.addChild(this.UILight);
                window["rankScene"] = this.rankScene;
            }
            loadSelfScene() {
                if (!this.rankScene) return;
                let chaInfo;
                if (!DataMgr.Ins.currPlayerSex) chaInfo = DataMgr.Ins.currSelectMenClothesList; else chaInfo = DataMgr.Ins.currSelectWomenClothesList;
                let WingCfg = chaInfo[3] ? chaInfo[3].getBaseNature() : null;
                let HairCfg = chaInfo[0] ? chaInfo[0].getBaseNature() : null;
                let ChaCfg = chaInfo[2] ? chaInfo[2].getBaseNature() : null;
                let HatCfg = chaInfo[1] ? chaInfo[1].getBaseNature() : null;
                let chaRes = LoadMgr.Ins.unityResPath(E_UNITY_RES_PATH.CHA, "Cha_" + ChaCfg.assetId + ".lh");
                let carRes = LoadMgr.Ins.unityResPath(E_UNITY_RES_PATH.CAR, "Car_" + DataMgr.Ins.gameUseCar.cfg.assetId + "_" + DataMgr.Ins.useCarStage + ".lh");
                let selfRootM = this.rankScene.getChildByName("march_level").getChildByName(`Car_1`);
                let playerModel = Laya.loader.getRes(chaRes);
                let carModel = Laya.loader.getRes(carRes);
                let player = Laya.Sprite3D.instantiate(playerModel);
                let car = Laya.Sprite3D.instantiate(carModel);
                let _ActorScript = player.addComponent(ActorScript);
                _ActorScript.init(HatCfg, HairCfg, WingCfg);
                let Cha_Root = car.getChildAt(0).getChildAt(4);
                Cha_Root && Cha_Root.addChild(player);
                this.setCarState(car);
                selfRootM.addChild(car);
                this.logo_1.visible = true;
                this.logo_1.skin = `uires/ranking/dj_${DataMgr.Ins.getCurrRankLv()}.png`;
                setTimeout(() => {
                    this.ready_1.visible = true;
                }, 500);
            }
            loadAllNpcScene() {
                this.loadSelfScene();
                Laya.timer.once(Math.floor(Math.random() * 200 + 200), this, this.loadNpcScene, [GameMgr.Ins.gameNpcs[0], 0], false);
                Laya.timer.once(Math.floor(Math.random() * 400 + 1400), this, this.loadNpcScene, [GameMgr.Ins.gameNpcs[1], 1], false);
                let time = Math.floor(Math.random() * 2400 + 2400);
                Laya.timer.once(time, this, this.loadNpcScene, [GameMgr.Ins.gameNpcs[2], 2], false);
                Laya.timer.once(time, this, this.playConfirmAni);
            }
            loadNpcScene(npcInfo = null, index = 0) {
                if (!this.rankScene) return;
                let carRootM = this.rankScene.getChildByName("march_level").getChildByName(`Car_${index + 2}`);
                let clothCfg = CCfgMgr.Ins.cfgClothes.getItem(npcInfo.clothInfo.clothID);
                let chaRes = clothCfg && LoadMgr.Ins.unityResPath(E_UNITY_RES_PATH.CHA, "Cha_" + clothCfg.assetId + ".lh");
                let carRes = npcInfo && LoadMgr.Ins.unityResPath(E_UNITY_RES_PATH.CAR, "Car_" + npcInfo.carID + "_" + npcInfo.carLv + ".lh");
                let playerModel = Laya.loader.getRes(chaRes);
                let carModel = Laya.loader.getRes(carRes);
                if (!playerModel) {
                    console.log("playerModel is null");
                    playerModel = Laya.loader.getRes("unity/role/Conventional/Cha_4.lh");
                    console.log(playerModel);
                }
                if (!carModel) {
                    console.log("carModel is null");
                    carModel = Laya.loader.getRes("unity/car/Conventional/Car_6_1.lh");
                    console.log(carModel);
                }
                let player = playerModel && Laya.Sprite3D.instantiate(playerModel);
                let car = carModel && Laya.Sprite3D.instantiate(carModel);
                let Cha_Root = car && car.getChildAt(0).getChildAt(4);
                Cha_Root && Cha_Root.addChild(player);
                let _ActorScript = player && player.addComponent(ActorScript);
                _ActorScript && _ActorScript.init(npcInfo.clothInfo.hatCfg, npcInfo.clothInfo.hairCfg, npcInfo.clothInfo.wingCfg);
                car && this.setCarState(car);
                car && carRootM.addChild(car);
                this["logo_" + (index + 2)].visible = true;
                setTimeout(() => {
                    this["ready_" + (index + 2)].visible = true;
                    this["logo_" + (index + 2)].skin = `uires/ranking/dj_${this.randRankAry[index]}.png`;
                }, 500);
            }
            setCarState(car) {
                car.transform.localPosition = new Laya.Vector3(0, 0, 0);
                car.transform.localRotation = new Laya.Quaternion(0, 0, 0);
                car.getChildAt(0).getChildAt(5).getChildAt(0).active = false;
                car.getChildAt(0).getChildAt(5).getChildAt(1).active = false;
                car.getChildAt(0).getChildAt(5).getChildAt(2).active = false;
                car.getChildAt(0).getChildAt(5).getChildAt(3).active = false;
                car.getChildAt(0).getChildAt(5).getChildAt(4).active = false;
            }
            playStartAni() {
                Laya.SoundManager.stopMusic();
                this.matchOverAni.stop();
                this.playLoadingAni();
                SoundMgr.Ins.matching();
            }
            playConfirmAni() {
                this.stopLoadingAni();
                this.scaleLine.visible = true;
                this.scaleLineAni.play(0, true);
                this.matchOverAni.play(0, false);
                this.confirmAni.play(0, false);
                this.confirmAni.off(Laya.Event.COMPLETE, this, this.showEnd);
                this.confirmAni.on(Laya.Event.COMPLETE, this, this.showEnd);
                SoundMgr.Ins.mathchSuc();
            }
            showEnd() {
                this.close();
                this.clear3D();
                Laya.timer.clearAll(this);
                GameMgr.Ins.matchShowComplete();
            }
            clear3D() {
                for (let i = 1; i < 5; i++) {
                    this.rankScene.getChildByName("march_level").getChildByName("Car_" + i).destroyChildren();
                }
                this.parent3dRoot.removeChildren();
                this.rankScene = null;
            }
            randNpcLevel(n = 3) {
                let higherRank = DataMgr.Ins.getCurrRankLv();
                let lowerRank = DataMgr.Ins.getCurrRankLv();
                if (DataMgr.Ins.getCurrStarNum() >= 8) higherRank = Math.min(E_RANK_TYPE.COUNT - 1, higherRank + 1);
                if (DataMgr.Ins.getCurrStarNum() <= 4) lowerRank = Math.max(E_RANK_TYPE._0_无名 + 1, lowerRank - 1);
                let randCount = Math.floor(n * Math.random());
                for (let i = 0; i < n; i++) {
                    if (i <= randCount) {
                        this.randRankAry[i] = higherRank;
                    } else {
                        this.randRankAry[i] = lowerRank;
                    }
                }
            }
            playLoadingAni() {
                this.scaleLine.visible = false;
                this.jumpLine.visible = true;
                this.alphaAni.play(0, true);
                this.flyAni.play(0, true);
                this.jumplineAni.play(0, true);
                this.lightCircleAni.play(0, true);
                this.loopRootAni.play(0, true);
                this.loopPointAni.play(0, true);
            }
            stopLoadingAni() {
                this.jumpLine.visible = false;
                this.alphaAni.stop();
                this.flyAni.stop();
                this.jumplineAni.stop();
                this.lightCircleAni.stop();
                this.loopRootAni.stop();
                this.loopPointAni.stop();
            }
        }
        const PROGRESS_WIDTH = 240;
        const MAXSTAR = 10;
        class RankResultViewUI extends ui.UIScenes.rank.RankResultViewUI {
            constructor() {
                super(...arguments);
                this.isLevelUp = true;
                this.isGetPower = false;
                this.isjinsheng = false;
                this.LevelAniAry = ["", "UIScenes/ani/JS_NO1.ani", "UIScenes/ani/JS_NO2.ani", "UIScenes/ani/JS_NO3.ani", "UIScenes/ani/JS_NO4.ani", "UIScenes/ani/JS_NO5.ani", "UIScenes/ani/JS_NO6.ani"];
                this.currDaojishi = 10;
            }
            onAwake() {
                this.scaleX = this.scaleY = GlobalScale$1.scale;
                this.width = Laya.stage.width / GlobalScale$1.scale;
                this.height = Laya.stage.height / GlobalScale$1.scale;
                this.box_rank.width = Laya.stage.width / GlobalScale$1.scale;
                this.box_rank.height = Laya.stage.height / GlobalScale$1.scale;
                this.closeBtn.on(Laya.Event.CLICK, this, this.closeBtnClick);
                this.shareBtn.on(Laya.Event.CLICK, this, this.shareBtnClick);
                this.btn_protect.on(Laya.Event.CLICK, this, this.pro_BtnClick);
                this.giveUpBtn.on(Laya.Event.CLICK, this, this.giveUpBtnClick);
                this.pro_Anim.on(Laya.Event.COMPLETE, this, this.timesLater);
                this.shareBtn1.on(Laya.Event.CLICK, this, () => {
                    UIManager.Ins.getScene(E_UI_TYPE.WXSHARE_NEW).open(false);
                    this.close();
                });
                this.addAniLabel();
            }
            onOpened() {
                PlatformMgr.Ins.canShowBanner = true;
                this.box_rank.visible = true;
                var lv = GameMgr.Ins.preSelfRank;
                var cfg = CCfgMgr.Ins.cfgRankInfo.getItem(lv);
                this.isGetPower = cfg._cupRankExp[GameMgr.Ins.selfRank - 1] <= 0;
                if (cfg._cupRankExp[GameMgr.Ins.selfRank - 1] >= 0) {
                    this.isLevelUp = true;
                } else {
                    this.isLevelUp = false;
                }
                this.btn_protect.visible = !this.isLevelUp;
                this.giveUpBtn.visible = !this.isLevelUp;
                this.closeBtn.visible = this.isLevelUp;
                this.rank_start.offAll();
                this.rank_level.offAll();
                if (DataMgr.Ins.isShowBigJianAni) {
                    this.initPageLast();
                    this.playAniByStar();
                    this.addAniLabel1();
                    this.rank_level.on(Laya.Event.COMPLETE, this, () => {
                        this.rank_start.offAll();
                        this.rank_level.offAll();
                        this.addAniLabel();
                        this.initPage();
                        this.playAniByStar();
                    });
                } else {
                    this.addAniLabel();
                    this.initPage();
                    this.playAniByStar();
                }
                this.startDaoJiShi();
                this.initAd();

            }
            playLastAniByStar() { }
            initAd() {
                if (PlatformMgr.Ins.platform == E_PLATFORM_TYPE.VIVO) {
                    PlatformMgr.Ins.initNativeInsert(15, null, () => {
                        PlatformMgr.Ins.initNativeAd(E_UI_TYPE.RANK_RESULT_UI);
                    });
                } else if (PlatformMgr.Ins.platform == E_PLATFORM_TYPE.OPPO) {
                    PlatformMgr.Ins.initNativeAd(E_UI_TYPE.RANK_RESULT_UI);
                } else if (PlatformMgr.Ins.platform == E_PLATFORM_TYPE.TT) {
                    PlatformMgr.Ins.initNativeAd(E_UI_TYPE.RANK_RESULT_UI);
                } else if (PlatformMgr.Ins.platform == E_PLATFORM_TYPE.WX) {
                    PlatformMgr.Ins.initNativeAd(E_UI_TYPE.RANK_RESULT_UI);
                }
            }
            onClosed() {
                PlatformMgr.Ins.closeNativeAd();
                PlatformMgr.Ins.hideBanner();
                Laya.timer.clearAll(this.progress_mask);


            }
            onEnable() { }
            onDisable() { }
            addAniLabel() {
                this.rank_start.addLabel("level", 30);
                this.rank_start.on(Laya.Event.LABEL, this, this.startPlayLevelAni);
            }
            addAniLabel1() {
                this.rank_start.addLabel("level", 30);
                this.rank_start.on(Laya.Event.LABEL, this, () => {
                    this.rank_level.visible = true;
                    this.rank_level.play(0, false);
                    this.PlayNameAni();
                });
            }
            initPage() {
                this.smallJianAni.visible = false;
                this.lianWinScene.visible = false;
                let playerLevel = DataMgr.Ins.getCurrRankLv();
                this.rank_level.visible = false;
                this.rank_name.visible = false;
                this.rank_title.visible = false;
                this.rank_progress.visible = true;
                this.rank_level.source = this.LevelAniAry[playerLevel];
                this.updateUI(playerLevel, DataMgr.Ins.rankScore);
                this.updateTitle(playerLevel);
            }
            initPageLast() {
                this.smallJianAni.visible = false;
                this.lianWinScene.visible = false;
                this.rank_level.visible = false;
                this.rank_name.visible = false;
                this.rank_title.visible = false;
                this.rank_progress.visible = true;
                this.rank_level.source = this.LevelAniAry[GameMgr.Ins.preSelfRank];
                this.updateUI(GameMgr.Ins.preSelfRank, DataMgr.Ins.rankScore);
                this.updateTitle(GameMgr.Ins.preSelfRank);
            }
            updateUI(lv, score) {
                let list = this.getRankSelfScore(lv, score);
                if (!this.isGetPower) {
                    list = this.getRankSelfScore(GameMgr.Ins.preSelfRank, GameMgr.Ins.preScore);
                }
                this.progress_mask.width = PROGRESS_WIDTH * (list[0] / list[1]);
                this.progress_curLabel.value = list[0] + "";
                this.progress_allScore.value = list[1] + "";
            }
            updateTitle(levle) {
                if (levle > 6) levle = 6;
                if (levle < 1) levle = 1;
                let cfg = CCfgMgr.Ins.cfgRankInfo.getItem(levle);
                this.rank_title.text = cfg ? cfg._Name : "";
            }
            closeBtnClick() {
                SoundMgr.Ins.Press();
                this.box_rank.visible = false;
                if (this.isGetPower && GameMgr.Ins.curGameMode != E_GAME_MODE.SINGLE_SPEED_GAME) {
                    UIManager.Ins.getScene(E_UI_TYPE.GETPOWER).open(false);
                } else {
                    this.close();
                    UIManager.Ins.getScene(E_UI_TYPE.STARTUI).open();
                }
            }
            shareBtnClick() {
                SoundMgr.Ins.Press();
            }
            playAniByStar() {
                this.rank_start.visible = true;
                this.rank_start.play(0, false);
            }
            startPlayLevelAni() {
                this.rank_level.visible = true;
                this.rank_level.play(0, false);
                this.PlayNameAni();
                this.smallJianAni.visible = DataMgr.Ins.isShowSmallJianAni;
                DataMgr.Ins.isShowSmallJianAni && this.smallJianAni.play(0, false);
                if (DataMgr.Ins.lianWinTimes > 0) {
                    this.lianWinScene.visible = true;
                    this.lianWinScene.refreshNum(DataMgr.Ins.lianWinTimes);
                    this.lianWinScene.playWinAni();
                }
                if (!this.isGetPower) {
                    if (!this.isGetPower) {
                        let list = this.getRankSelfScore(GameMgr.Ins.preSelfRank, GameMgr.Ins.preScore);
                        let list1 = this.getRankSelfScore(DataMgr.Ins.getCurrRankLv(), DataMgr.Ins.rankScore);
                        let fulltimes = 0;
                        let score = DataMgr.Ins.rankScore - GameMgr.Ins.preScore;
                        let linjiescore = CCfgMgr.Ins.cfgRankInfo.getItem(GameMgr.Ins.preSelfRank).starExp * 5;
                        let s1 = list[0];
                        if (s1 <= linjiescore && s1 + score > linjiescore) {
                            if (GameMgr.Ins.preSelfRank != 6) {
                                fulltimes = 1;
                            }
                        }
                        let initnum = PROGRESS_WIDTH * (list[0] / list[1] > 1 ? 1 : list[0] / list[1]);
                        let overnum = PROGRESS_WIDTH * (list1[0] / list1[1] > 1 ? 1 : list1[0] / list1[1]);
                        this.playScoreProgressAni(initnum, overnum, 10, PROGRESS_WIDTH, fulltimes, list[0], list[1], list1[0], list1[1], GameMgr.Ins.preScore, DataMgr.Ins.rankScore);
                    }
                }
            }
            PlayNameAni() {
                this.rank_name.visible = true;
                this.rank_title.visible = true;
                this.rank_name.play(0, true);
            }
            startDaoJiShi() {
                if (!this.isLevelUp) {
                    this.pro_Anim.play(0, false);
                }
            }
            giveUpBtnClick() {
                this.pro_Anim.gotoAndStop(0);
                this.closeBtnClick();
            }
            pro_BtnClick() {
                // PlatformMgr.Ins.showVideo(1, () => {
                // console.log("PlatforMgr showVideo");
                showReward(() => {

                    this.pro_Anim.gotoAndStop(0);
                    this.rank_level.source = this.LevelAniAry[GameMgr.Ins.preSelfRank];
                    this.playAniByStar();
                    this.updateUI(GameMgr.Ins.preSelfRank, GameMgr.Ins.preScore);
                    this.updateTitle(GameMgr.Ins.preSelfRank);
                    this.btn_protect.visible = false;
                    this.giveUpBtn.visible = false;
                    this.closeBtn.visible = true;
                    this.smallJianAni.visible = true;
                    this.smallJianAni.play(0, false);
                    DataMgr.Ins.rankScore = GameMgr.Ins.preScore;
                });
                // }, E_PAGE_VIDEOID.DUANWEIPRO);
            }
            timesLater() {
                this.box_rank.visible = false;
                if (this.isGetPower && GameMgr.Ins.curGameMode != E_GAME_MODE.MULTIPLAYER_SPEED_GAME) {
                    UIManager.Ins.getScene(E_UI_TYPE.GETPOWER).open(false);
                } else {
                    this.close();
                    UIManager.Ins.getScene(E_UI_TYPE.STARTUI).open();
                }
            }
            playScoreProgressAni(initNum, num, time = 10, fullNum, fullTimes = 0, initzi, initmu, overzi, overmu, initScore, endScore) {
                let symbol = 1;
                let currFullTimes = 0;
                let perAddNum = 0;
                if (fullTimes > 0) perAddNum = (fullNum * fullTimes + num + fullNum - initNum) / 100; else perAddNum = (num - initNum) / 100;
                let perAddNum1 = (endScore - initScore) / 100;
                this.progress_mask.width = initNum;
                let mu = initmu;
                let zi = initzi;
                Laya.timer.loop(time, this.progress_mask, () => {
                    this.progress_mask.width += perAddNum * symbol;
                    if (fullTimes == 0 && zi > overzi) {
                        zi = overzi;
                    } else {
                        zi += perAddNum1 * symbol;
                    }
                    if (fullTimes <= 0) {
                        if (this.progress_mask.width >= num) {
                            this.progress_mask.width = num;
                            Laya.timer.clearAll(this.progress_mask);
                            zi = overzi;
                        }
                    } else {
                        if (this.progress_mask.width >= fullNum) {
                            this.progress_mask.width = 1;
                            mu = overmu;
                            zi = overzi;
                            Laya.timer.clearAll(this.progress_mask);
                        }
                    }
                    this.progress_curLabel.value = Math.floor(zi) + "";
                    this.progress_allScore.value = Math.floor(mu) + "";
                });
            }
            getRankSelfScore(lv, score) {
                let currDuanwei = lv;
                let needScore = 0;
                for (let i = 1; i < currDuanwei; i++) {
                    needScore += CCfgMgr.Ins.cfgRankInfo.getItem(i).starExp * 5;
                }
                return [score - needScore, CCfgMgr.Ins.cfgRankInfo.getItem(currDuanwei).starExp * 5];
            }
        }
        class TtRecordUI extends ui.UIScenes.tt.TtRecordUI {
            constructor() {
                super();
                this.adapterUI();
                this.continueBtn.on(Laya.Event.CLICK, this, this.continueBtnClick);
                this.tiaozhuanBtn.on(Laya.Event.CLICK, this, this.continueBtnClick);
                this.closeBtn.on(Laya.Event.CLICK, this, this.closeBtnClick);
            }
            onOpened() { }
            playOpenAni() { }
            playCloseAni() { }
            adapterUI() {
                this.scaleX = this.scaleY = GlobalScale$1.scale;
                this.width = Laya.stage.width / GlobalScale$1.scale;
                this.height = Laya.stage.height / GlobalScale$1.scale;
            }
            continueBtnClick() {
                SoundMgr.Ins.Press();
                platform.Ins.shareVideo(() => {
                    DataMgr.Ins.addGold(500);
                    UIManager.Ins.getScene(E_UI_TYPE.LONGBLACKTIP).open(false, ["分享成功，获得500金币"]);
                });
                this.close();
            }
            closeBtnClick() {
                SoundMgr.Ins.Press();
                this.close();
            }
        }
        class TtTipUI extends ui.UIScenes.tt.TtTipUI {
            constructor() {
                super();
                this.adapterUI();
                this.closeBtn.on(Laya.Event.CLICK, this, this.closeBtnClick);
                this.zhuomianBtn.on(Laya.Event.CLICK, this, this.qiehuanUI, [0]);
                this.xiaochengxuBtn.on(Laya.Event.CLICK, this, this.qiehuanUI, [1]);
                this.zhaoyouxiBtn.on(Laya.Event.CLICK, this, this.qiehuanUI, [2]);
                this.zhaoxiaoBtn.on(Laya.Event.CLICK, this, this.qiehuanUI, [3]);
            }
            onOpened() {
                this.qiehuanUI(0);
            }
            playOpenAni() { }
            playCloseAni() { }
            adapterUI() {
                this.scaleX = this.scaleY = GlobalScale$1.scale;
                this.width = Laya.stage.width / GlobalScale$1.scale;
                this.height = Laya.stage.height / GlobalScale$1.scale;
            }
            closeBtnClick() {
                SoundMgr.Ins.Press();
                this.close();
            }
            qiehuanUI(index) {
                SoundMgr.Ins.Press();
                for (let i = 0; i < 4; i++) {
                    this.uiparent.getChildAt(i).visible = i == index;
                }
            }
        }
        class InsertAdUI extends ui.UIScenes.Vivo.Vivo_InsertAdUI {
            constructor() {
                super();
                this.adPoint = 1;
                this.AdData = null;
                this.callBackFunc = null;
                this.zOrder = 1002;
                console.log(" == OppoInsertAdView == constructor == ");
                this.scaleX = this.scaleY = GlobalScale$1.scale;
                this.width = Laya.stage.width / GlobalScale$1.scale;
                this.height = Laya.stage.height / GlobalScale$1.scale;
                InsertAdUI.Ins = this;
            }
            onAwake() {
                this.closeBtn.on(Laya.Event.CLICK, this, this.closeBtnHandler);
                this.AdBtn.on(Laya.Event.CLICK, this, this.AdBtnHandler);
                this.adClickBtn.on(Laya.Event.CLICK, this, this.AdBtnHandler);
            }
            onOpened(list) {
                console.log(" == OppoInsertAdView == onOpened == ");
                this.AdData = list[0];
                this.adPoint = list[1];
                this.bg.visible = this.adPoint == 15;
                this.callBackFunc = list[2];
                this.refreshUI();
            }
            closeBtnHandler() {
                this.close();
            }
            AdBtnHandler() {
                PlatformMgr.Ins.reportNativeAdClick();
                this.closeThis();
            }
            refreshUI() {
                this.ad_des.text = this.AdData[0].desc;
                this.ad_title.text = this.AdData[0].title;
                if (this.AdData[0].imgUrlList && this.AdData[0].imgUrlList.length) {
                    this.ad_img.skin = this.AdData[0].imgUrlList[0];
                }
                PlatformMgr.Ins.reportNativeAdShow();
            }
            closeThis() {
                this.close();
                if (this.callBackFunc) {
                    this.callBackFunc();
                }
            }
        }
        class VideoAgainUI extends ui.UIScenes.Vivo.Vivo_VideoAgainUI {
            constructor() {
                super(...arguments);
                this.callBackFunc = null;
            }
            onAwake() {
                this.scaleX = this.scaleY = GlobalScale$1.scale;
                this.width = Laya.stage.width / GlobalScale$1.scale;
                this.height = Laya.stage.height / GlobalScale$1.scale;
                this.yesBtn.on(Laya.Event.CLICK, this, this.yesBtnClick);
                this.cancelBtn.on(Laya.Event.CLICK, this, this.cancelBtnClick);
            }
            onEnable() { }
            onOpened() {
                this.cancelBtn.visible = false;
                Laya.timer.once(PlatformMgr.Ins._gameConfig.xiaoziDelay, this, () => {
                    this.cancelBtn.visible = true;
                });
                PlatformMgr.Ins.initNativeAd(E_UI_TYPE.VIDEOAGAIN);
            }
            onDisable() { }
            yesBtnClick() {
                SoundMgr.Ins.Press();
                // PlatformMgr.Ins.showVideo(1, () => {
                // console.log("PlatforMgr showVideo");
                showReward(() => {

                    if (PlatformMgr.Ins.videoCallBackFunc) {
                        PlatformMgr.Ins.videoCallBackFunc();
                    }
                    PlatformMgr.Ins.videoCallBackFunc = null;
                });
                // }, E_PAGE_VIDEOID.VIDEOAGIN, true);
                this.close();
                PlatformMgr.Ins.closeNativeAd();
            }
            cancelBtnClick() {
                this.close();
                PlatformMgr.Ins.closeNativeAd();
            }
            onClosed() {
                this.callBackFunc = null;
            }
        }
        class CarTrailUI extends ui.UIScenes.Voppo.CarTrialUI {
            constructor() {
                super();
                this.currCarLv = 20;
                this.gameMode = -1;
                this.raceId = -1;
                this.isOpenGame = true;
                this.scaleX = this.scaleY = GlobalScale$1.scale;
                this.width = Laya.stage.width / GlobalScale$1.scale;
                this.height = Laya.stage.height / GlobalScale$1.scale;
                this.zongBox.x = (this.width - 1280) / 2;
            }
            onAwake() {
                this.enterGame.on(Laya.Event.CLICK, this, this.enterBtnClick);
                this.closeBtn.on(Laya.Event.CLICK, this, this.closeBtnClick);
                this.closeChaBtn.on(Laya.Event.CLICK, this, this.closeBtnClick);
            }
            onOpened(pram) {
                let gameMode = pram[0];
                if (pram[1] != undefined) {
                    this.isOpenGame = pram[1];
                }
                this.gameMode = gameMode;
                this.refreshCarId();
                Laya.timer.loop(30, this, () => {
                    this.lightBg.rotation += 2;
                });
                this.ani1.play(0, true);
                if (PlatformMgr.Ins._gameConfig.tryCarwuchu != 0 && PlatformMgr.Ins.iswuchuTimeOpen) {
                    this.closeBtn.visible = true;
                    this.closeChaBtn.visible = false;
                } else {
                    this.closeBtn.visible = false;
                    this.closeChaBtn.visible = true;
                }
                this.closeBtn.visible = false;
                Laya.timer.once(PlatformMgr.Ins._gameConfig.xiaoziDelay, this, () => {
                    this.closeBtn.visible = !this.closeChaBtn.visible;
                });
                PlatformMgr.Ins.initNativeAd(E_UI_TYPE.CAR_TRIAL);
                PlatformMgr.Ins.showWxNative(E_UI_TYPE.CAR_TRIAL);

                let banner;
                let left = 0;
                let bottom = 0;
                let width = 300;

                this.closeBtn.visible = false;
                Laya.timer.once(AdConfigMgr.Ins.Switch_1, this, () => {
                    this.closeBtn.visible = true;
                });
            }
            onClosed() {
                PlatformMgr.Ins.closeNativeAd();
                Laya.timer.clearAll(this);
                PlatformMgr.Ins.hideWxNative();


            }
            onEnable() { }
            onDisable() { }
            enterBtnClick() {
                //激励广告
                showReward(() => {
                    DataMgr.Ins.getCar(this.currCar.id).setVideoTimes(1);
                    DataMgr.Ins.gameUseCar = this.currCar;
                    DataMgr.Ins.useCarStage = 3;
                    this.startGame();
                });

            }
            refreshCarId() {
                let list = CCfgMgr.Ins.cfgGlobalPar.getItemStr(E_GLOBALPAR_NAME.GAME_TRY_CARIDLIST);
                let carIndex = Math.floor(Math.random() * 2);
                let carId = parseInt(list[carIndex]);
                let car = new BaseRacing();
                car.init(carId, true, this.currCarLv, this.currCarLv, this.currCarLv, this.currCarLv);
                this.currCar = car;
                this.img_car.skin = "uires/trialNew/Car_" + carId + ".png";
                this.img_name.skin = "uires/trialNew/name_" + carId + ".png";
                this.img_Stage.skin = "uires/trialNew/stage_" + 10 + ".png";
                this.slider_1.width = this.slider_3.parent.width * car.cfg.handleNature / 100;
                this.slider_2.width = this.slider_2.parent.width * (car.getMaxSU() - car.getCurrSU()) / car.getMaxSU();
                this.slider_3.width = this.slider_1.parent.width * car.getCurrMaxSpeed() / car.getMaxSpeed();
                this.caokongLa.text = car.cfg.handleNature.toString();
                this.jiaSuLa.text = carId == 8 ? "50" : "80";
                this.maxSpeedLa.text = Math.floor(car.getCurrMaxSpeed()).toString();
                let skillId = 1;
                skillId = car.cfg._SkillId[2];
                let iconName = CCfgMgr.Ins.cfgSkillInfo.getItem(skillId)._SkillIconName;
                this.skillIcon.skin = LoadMgr.Ins.WebResHttp + "skillIcon/" + iconName + ".png";
                this.skillDesc.text = CCfgMgr.Ins.cfgSkillInfo.getItem(skillId)._Desc;
                this.skillName.text = CCfgMgr.Ins.cfgSkillInfo.getItem(skillId)._Name;
                this.tryTimes.text = DataMgr.Ins.getCar(carId).cfg.unLockNeedPatch + "次永久获得（" + DataMgr.Ins.getCar(carId).currVideoTimes + "/" + DataMgr.Ins.getCar(carId).cfg.unLockNeedPatch + "）";
            }
            closeBtnClick() {
                SoundMgr.Ins.Press();
                if (this.isOpenGame == false) {
                    this.close();
                    return;
                }
                DataMgr.Ins.useCarStage = DataMgr.Ins.carStage;
                this.startGame();
            }
            startGame() {
                this.close();
                if (this.gameMode == E_GAME_MODE.MULTIPLAYER_PROP_GAME || this.gameMode == E_GAME_MODE.MULTIPLAYER_SPEED_GAME) {
                    GameMgr.Ins.enterGame(true, DataMgr.Ins.currGameMode);
                    UIManager.Ins.getScene(E_UI_TYPE.RANKING_UI).open();
                } else {
                    GameMgr.Ins.enterGame(false, DataMgr.Ins.currGameMode);
                }
            }
        }
        class ConstellationDescUI extends ui.UIScenes.Voppo.constellation.ConstellationDescUI {
            constructor() {
                super(...arguments);
                this.rewardIndex = 0;
                this.TxtImgArray = [["uires/constellation/baiyangzuo.png", "uires/constellation/by.png"], ["uires/constellation/jinniuzuo.png", "uires/constellation/jn.png"], ["uires/constellation/shuangzizuo.png", "uires/constellation/sz.png"], ["uires/constellation/juxiezuo.png", "uires/constellation/jx.png"], ["uires/constellation/shizizuo.png", "uires/constellation/jn.png"], ["uires/constellation/chunuzuo.png", "uires/constellation/cn.png"], ["uires/constellation/tianchengzuo.png", "uires/constellation/tc.png"], ["uires/constellation/tianxiezuo.png", "uires/constellation/tx.png"], ["uires/constellation/sheshouzuo.png", "uires/constellation/ss.png"], ["uires/constellation/mojiezuo.png", "uires/constellation/mj.png"], ["uires/constellation/shuipingzuo.png", "uires/constellation/sp.png"], ["uires/constellation/shuangyuzuo.png", "uires/constellation/sy.png"]];
            }
            onAwake() {
                this.scaleX = this.scaleY = GlobalScale$1.scale;
                this.width = Laya.stage.width / GlobalScale$1.scale;
                this.height = Laya.stage.height / GlobalScale$1.scale;
                this.closeBtn.on(Laya.Event.CLICK, this, this.closeBtnClick);
                this.buffBtn.on(Laya.Event.CLICK, this, this.buffBtnClick);
            }
            onOpened(index) {
                this.PopPage();
                this.rewardIndex = index;
                this.refreshPage(index);
                this.ani1.play(0, true);
                DataMgr.Ins.ConstellationID = this.rewardIndex;
                EventMgr.Ins.dispatch(EventType.REFRESH_CONSTELLATION);
                DataMgr.Ins.SavePlayerData();
                PlatformMgr.Ins.initNativeAd(E_UI_TYPE.CONSTELLATIONDESC);

                let banner;
                let left = 50;
                let bottom = 0;
                let width = 300;

            }
            PopPage() {
                this.pop.scaleX = .9;
                this.pop.scaleY = .9;
                Laya.Tween.to(this.pop, {
                    scaleX: 1,
                    scaleY: 1
                }, 20, Laya.Ease.linearInOut);
            }
            onClosed() {


            }
            onEnable() { }
            onDisable() { }
            closeBtnClick() {
                SoundMgr.Ins.Press();
                this.close();
                PlatformMgr.Ins.closeNativeAd();
            }
            refreshPage(index) {
                let info = CCfgMgr.Ins.cfgConstellation.getItem(index);
                this.txt_type.text = info._Name;
                this.txt_buff.text = info._Desc3;
                this.txt_date.text = info._Desc1;
                this.txt_desc.text = info._Desc2;
                this.img_type.skin = this.TxtImgArray[index - 1][0];
            }
            buffBtnClick() {
                // PlatformMgr.Ins.showVideo(1, () => {
                // console.log("PlatforMgr showVideo");
                DataMgr.Ins.ConstellationID = this.rewardIndex;
                this.close();
                DataMgr.Ins.SavePlayerData();
                // }, E_PAGE_VIDEOID.XINGZUO);
                //激励广告
                showReward(() => {
                    DataMgr.Ins.ConstellationID = this.rewardIndex;
                    this.close();
                    DataMgr.Ins.SavePlayerData();
                });

            }
        }
        class ConstellationItemScipt extends Laya.Script {
            get bg() {
                return this.item_bg;
            }
            get name() {
                return this.item_name;
            }
            get mask() {
                return this.item_mask;
            }
            get video() {
                return this.item_video;
            }
        }
        class ConstellationUI extends ui.UIScenes.Voppo.constellation.ConstellationViewUI {
            constructor() {
                super(...arguments);
                this.isOpen = false;
                this.TxtImgArray = [["uires/constellation/baiyangzuo.png", "uires/constellation/by.png"], ["uires/constellation/jinniuzuo.png", "uires/constellation/jn.png"], ["uires/constellation/shuangzizuo.png", "uires/constellation/sz.png"], ["uires/constellation/juxiezuo.png", "uires/constellation/jx.png"], ["uires/constellation/shizizuo.png", "uires/constellation/szz.png"], ["uires/constellation/chunuzuo.png", "uires/constellation/cn.png"], ["uires/constellation/tianchengzuo.png", "uires/constellation/tc.png"], ["uires/constellation/tianxiezuo.png", "uires/constellation/tx.png"], ["uires/constellation/sheshouzuo.png", "uires/constellation/ss.png"], ["uires/constellation/mojiezuo.png", "uires/constellation/mj.png"], ["uires/constellation/shuipingzuo.png", "uires/constellation/sp.png"], ["uires/constellation/shuangyuzuo.png", "uires/constellation/sy.png"]];
                this.itemArray = [this.item_1, this.item_2, this.item_3, this.item_4, this.item_5, this.item_6, this.item_7, this.item_8, this.item_9, this.item_10, this.item_11, this.item_12];
            }
            onAwake() {
                this.scaleX = this.scaleY = GlobalScale$1.scale;
                this.width = Laya.stage.width / GlobalScale$1.scale;
                this.height = Laya.stage.height / GlobalScale$1.scale;
                this.closeBtn.on(Laya.Event.CLICK, this, this.closeBtnClick);
                for (let i = 0; i < this.itemArray.length; i++) {
                    this.itemArray[i].on(Laya.Event.CLICK, this, this.clickHandler, [i]);
                }
            }
            onOpened() {
                this.isOpen = PlatformMgr.Ins._gameConfig.videoIconXingzuo == 0 ? false : true;
                this.PopPage();
                this.refreshPage();
                PlatformMgr.Ins.initNativeAd(E_UI_TYPE.CONSTELLATION);
                EventMgr.Ins.on(EventType.REFRESH_CONSTELLATION, this, this.refreshPage);

                let banner;
                let left = 50;
                let bottom = 0;
                let width = 300;

                this.closeBtn.visible = false;
                Laya.timer.once(AdConfigMgr.Ins.Switch_1, this, () => {
                    this.closeBtn.visible = true;
                });
                PrivateTracker_new.Ins.sendEvent(SDK_EVENT._打开星座界面, {
                    "_打开星座界面": "_打开星座界面"
                });
            }
            PopPage() { }
            onClosed() {
                EventMgr.Ins.off(EventType.REFRESH_CONSTELLATION, this, this.refreshPage);


            }
            onEnable() { }
            onDisable() { }
            closeBtnClick() {
                SoundMgr.Ins.Press();
                this.close();
                PlatformMgr.Ins.closeNativeAd();
            }
            refreshPage() {
                for (let i = 0; i < this.itemArray.length; i++) {
                    let cell = this.itemArray[i];
                    if (i == DataMgr.Ins.ConstellationID - 1) {
                        cell.getComponent(ConstellationItemScipt).mask.visible = false;
                        cell.getComponent(ConstellationItemScipt).video.visible = false;
                    } else {
                        cell.getComponent(ConstellationItemScipt).mask.visible = true;
                        cell.getComponent(ConstellationItemScipt).video.visible = true;
                    }
                    cell.getComponent(ConstellationItemScipt).video.visible = this.isOpen;
                    cell.getComponent(ConstellationItemScipt).name.skin = this.TxtImgArray[i][1];
                    cell.getComponent(ConstellationItemScipt).bg.skin = this.TxtImgArray[i][0];
                }
            }
            clickHandler(index) {
                if (index == DataMgr.Ins.ConstellationID - 1) {
                    UIManager.Ins.getScene(E_UI_TYPE.LONGBLACKTIP).open(false, ["已经选中当前buff，无法再次获取"]);
                } else {
                    //激励广告
                    showReward(() => {
                        UIManager.Ins.getScene(E_UI_TYPE.CONSTELLATIONDESC).open(false, index + 1);
                        this.close();
                    });

                }
            }
        }
        var PROD_TYPE;
        (function (PROD_TYPE) {
            PROD_TYPE[PROD_TYPE["TICKET"] = 0] = "TICKET";
            PROD_TYPE[PROD_TYPE["GOLD"] = 1] = "GOLD";
            PROD_TYPE[PROD_TYPE["DIAMOND"] = 2] = "DIAMOND";
            PROD_TYPE[PROD_TYPE["THANKS"] = 3] = "THANKS";
            PROD_TYPE[PROD_TYPE["HUAFEI"] = 4] = "HUAFEI";
            PROD_TYPE[PROD_TYPE["SHITI"] = 5] = "SHITI";
        })(PROD_TYPE || (PROD_TYPE = {}));
        class DrawPriceUI extends ui.UIScenes.Voppo.DrawPriceUI {
            constructor() {
                super();
                this.maxFastSpeedTime = 3;
                this.rwdUiList = [];
                this.rwdList = [];
                this.currSelectIndex = 0;
                this.lastIndex = 0;
                this.getRwdIndex = 0;
                this.currTicketNum = 0;
                this.currLastTime = 0;
                this.scaleX = this.scaleY = GlobalScale$1.scale;
                this.width = Laya.stage.width / GlobalScale$1.scale;
                this.height = Laya.stage.height / GlobalScale$1.scale;
                this.drawRwdBtn.on(Laya.Event.CLICK, this, this.drawRwdBtnClick);
                this.closeBtn.on(Laya.Event.CLICK, this, this.closeBtnClick);
                for (let i = 0; i < 8; i++) {
                    this.rwdUiList.push(this.rwdParent.getChildAt(i));
                }
            }
            onOpened(activityInfo) {
                PlatformMgr.Ins.canShowBanner = true;
                this.currSelectIndex = 0;
                this.drawRwdBtn.visible = true;
                this.closeBtn.visible = true;
                console.log("当前活动信息", activityInfo);
                this.starAni.play(0, true);
                this.caidengAni.play(0, true);
                this.btnAni.play(0, true);
                this.activityInfo = activityInfo;
                this.rwdList = activityInfo.products;
                this.lastIndex = 0;
                this.refreshUI();
                HttpMgr.Ins.getUserAwardsPhoneIsNull().then(x => {
                    console.log("当前手机号是否填过", x);
                    if (x.phoneIsNull) {
                        UIManager.Ins.getScene(E_UI_TYPE.GETPRICE).open(false);
                    }
                });
            }
            playOpenAni() { }
            playCloseAni() { }
            drawRwdBtnClick() {
                SoundMgr.Ins.Press();
                HttpMgr.Ins.getLotteryResult().then(x => {
                    this.getRwdInfo = x;
                    console.log("当前给予的奖励", this.getRwdInfo);
                    for (let i = 0; i < this.rwdList.length; i++) {
                        if (this.rwdList[i].prodId == this.getRwdInfo.prodId) this.getRwdIndex = i;
                    }
                    this.drawRwdBtn.visible = false;
                    this.closeBtn.visible = false;
                    console.log("当前获奖的ui索引", this.getRwdIndex);
                    let moveTimes = 8 - this.lastIndex + 32 + this.getRwdIndex;
                    let jishu = 0;
                    let time = 0;
                    Laya.timer.frameLoop(6, this, () => {
                        jishu++;
                        if (time >= moveTimes) {
                            this.drawRwdBtn.visible = true;
                            this.closeBtn.visible = true;
                            this.lastIndex = this.currSelectIndex;
                            Laya.timer.clearAll(this);
                            this.refreshTimeAndTicketNum();
                            let type = this.rwdList[this.getRwdIndex].prodType;
                            if (type == PROD_TYPE.GOLD) {
                                console.log("给金币");
                                UIManager.Ins.getScene(E_UI_TYPE.CGTLTGETUI).open(false, [74, -1, 1, false, false, false]);
                            } else if (type == PROD_TYPE.DIAMOND) {
                                console.log("给钻石");
                                UIManager.Ins.getScene(E_UI_TYPE.CGTLTGETUI).open(false, [73, -1, 1, false, false, false]);
                            } else if (type == PROD_TYPE.HUAFEI) {
                                console.log("给话费");
                                UIManager.Ins.getScene(E_UI_TYPE.GETPRICE).open(false);
                            } else if (type == PROD_TYPE.SHITI) {
                                console.log("给实物");
                                UIManager.Ins.getScene(E_UI_TYPE.GETREALPRICE).open(false);
                            } else if (type == PROD_TYPE.THANKS) {
                                console.log("谢谢参与");
                                UIManager.Ins.getScene(E_UI_TYPE.LONGBLACKTIP).open(false, ["谢谢参与"]);
                            } else if (type == PROD_TYPE.TICKET) {
                                console.log("给钻石");
                                UIManager.Ins.getScene(E_UI_TYPE.LONGBLACKTIP).open(false, ["抽奖券x" + this.rwdList[this.getRwdIndex].itemNum]);
                            }
                        } else {
                            if (time > moveTimes - 5) {
                                if (jishu > (time - moveTimes + 8) * .9) {
                                    jishu = 0;
                                    time++;
                                    this.currSelectIndex++;
                                    if (this.currSelectIndex > 7) {
                                        this.currSelectIndex = 0;
                                    }
                                    this.refreshRwdPan(this.currSelectIndex);
                                }
                            } else {
                                time++;
                                this.currSelectIndex++;
                                if (this.currSelectIndex > 7) {
                                    this.currSelectIndex = 0;
                                }
                                this.refreshRwdPan(this.currSelectIndex);
                            }
                        }
                    });
                }).catch(y => {
                    if (y.code == 202) {
                        UIManager.Ins.getScene(E_UI_TYPE.LONGBLACKTIP).open(false, ["奖券不足"]);
                    } else if (y.code == 300) {
                        UIManager.Ins.getScene(E_UI_TYPE.LONGBLACKTIP).open(false, ["点击频率过快请稍后再试"]);
                    }
                });
            }
            refreshRwdPan(index) {
                for (let i = 0; i < 8; i++) {
                    this.rwdUiList[i].getChildAt(0).visible = i == index;
                }
            }
            refreshUI() {
                this.refreshRwdPan(this.currSelectIndex);
                this.lastTime.text = "下次获得倒计时：" + UsefulStuff.formatMS(this.activityInfo.leftGetTicketTime / 1e3);
                this.ticketNum.text = "剩余抽奖券：" + this.activityInfo.leftLotteryNum;
                this.currTicketNum = this.activityInfo.leftLotteryNum;
                this.currLastTime = this.activityInfo.leftGetTicketTime;
                for (let i = 0; i < this.rwdList.length; i++) {
                    console.log(this.rwdList[i]);
                    this.rwdUiList[i].getChildAt(2).play(0, true);
                    this.rwdUiList[i].getChildAt(2).visible = this.rwdList[i].hasStart;
                    this.rwdUiList[i].getChildAt(1).skin = this.rwdList[i].imgUrl;
                }
                Laya.timer.loop(1e3, this.lastTime, () => {
                    this.currLastTime -= 1e3;
                    this.lastTime.text = "下次获得倒计时：" + UsefulStuff.formatMS(this.currLastTime / 1e3);
                    if (this.currLastTime < 0) {
                        this.currLastTime = 0;
                        this.refreshTimeAndTicketNum();
                    }
                });
            }
            refreshTimeAndTicketNum() {
                HttpMgr.Ins.getTicketsInfos().then(x => {
                    console.log("当前奖券以及时间信息", x);
                    this.currTicketNum = x.leftLotteryNum;
                    this.currLastTime = x.leftGetTicketTime;
                    this.lastTime.text = "下次获得倒计时：" + UsefulStuff.formatMS(x.leftGetTicketTime / 1e3);
                    this.ticketNum.text = "剩余抽奖券：" + x.leftLotteryNum;
                });
            }
            closeBtnClick() {
                SoundMgr.Ins.Press();
                this.close();
            }
            onClosed() {
                Laya.timer.clearAll(this);
                Laya.timer.clearAll(this.lastTime);
            }
        }
        class GertPowerUI extends ui.UIScenes.Voppo.getPower.GetPowerUI {
            onAwake() {
                this.scaleX = this.scaleY = GlobalScale$1.scale;
                this.width = Laya.stage.width / GlobalScale$1.scale;
                this.height = Laya.stage.height / GlobalScale$1.scale;
                this.cancelBtn.on(Laya.Event.CLICK, this, this.closeBtnClick);
                this.upBtn.on(Laya.Event.CLICK, this, this.upBtnClick);
                this.videocarBtn.on(Laya.Event.CLICK, this, this.videocarBtnClick);
                this.panBtn.on(Laya.Event.CLICK, this, this.panBtnClick);
                this.carBtn.on(Laya.Event.CLICK, this, this.carBtnClick);
                this.lianxiBtn.on(Laya.Event.CLICK, this, this.lianxiBtnClick);
            }
            onOpened() {
                PlatformMgr.Ins.initNativeAd(E_UI_TYPE.GETPOWER);
                this.cancelBtn.visible = false;
                Laya.timer.once(PlatformMgr.Ins._gameConfig.xiaoziDelay, this, () => {
                    this.cancelBtn.visible = true;
                });
                let banner;
                let left = 50;
                let bottom = 0;
                let width = 300;

                this.cancelBtn.visible = false;
                Laya.timer.once(AdConfigMgr.Ins.Switch_1, this, () => {
                    this.cancelBtn.visible = true;
                });
                PrivateTracker_new.Ins.sendEvent(SDK_EVENT._实力不足界面, {
                    "_实力不足界面": "_实力不足界面"
                });
            }
            closeBtnClick() {
                PrivateTracker_new.Ins.sendEvent(SDK_EVENT._实力不足点击不了谢谢, {
                    "_实力不足点击不了谢谢": "_实力不足点击不了谢谢"
                });
                if (Math.random() * 100 < AdConfigMgr.Ins.Switch_11) {
                    //激励广告
                    showReward(() => {
                        SoundMgr.Ins.Press();
                        this.close();
                        PlatformMgr.Ins.closeNativeAd();
                        UIManager.Ins.getScene(E_UI_TYPE.STARTUI).open();
                        return;
                    });

                }
                SoundMgr.Ins.Press();
                this.close();
                PlatformMgr.Ins.closeNativeAd();
                UIManager.Ins.getScene(E_UI_TYPE.STARTUI).open();
            }
            upBtnClick() {
                PrivateTracker_new.Ins.sendEvent(SDK_EVENT._实力不足点击升级车辆, {
                    "_实力不足点击升级车辆": "_实力不足点击升级车辆"
                });
                SoundMgr.Ins.Press();
                PlatformMgr.Ins.closeNativeAd();
                UIManager.Ins.getScene(E_UI_TYPE.GARAGEUI).open();
            }
            videocarBtnClick() {
                SoundMgr.Ins.Press();
                PrivateTracker_new.Ins.sendEvent(SDK_EVENT._实力不足点击豪车助我, {
                    "_实力不足点击豪车助我": "_实力不足点击豪车助我"
                });
                //激励广告
                showReward(() => {
                    DataMgr.Ins.currHasTryCar = true;
                    PlatformMgr.Ins.closeNativeAd();
                    UIManager.Ins.getScene(E_UI_TYPE.MULTIRACE).open(true, GameMgr.Ins.curGameMode);
                });

            }
            panBtnClick() {
                PrivateTracker_new.Ins.sendEvent(SDK_EVENT._实力不足点击免费转盘, {
                    "_实力不足点击免费转盘": "_实力不足点击免费转盘"
                });
                SoundMgr.Ins.Press();
                UIManager.Ins.getScene(E_UI_TYPE.LUCKY_PAN).open(false);
            }
            carBtnClick() {
                SoundMgr.Ins.Press();
                PrivateTracker_new.Ins.sendEvent(SDK_EVENT._实力不足点击一键试用, {
                    "_实力不足点击一键试用": "_实力不足点击一键试用"
                });
                //激励广告
                showReward(() => {
                    DataMgr.Ins.currHasTryCar = true;
                    PlatformMgr.Ins.closeNativeAd();
                    UIManager.Ins.getScene(E_UI_TYPE.MULTIRACE).open(true, GameMgr.Ins.curGameMode);
                });

            }
            lianxiBtnClick() {
                PrivateTracker_new.Ins.sendEvent(SDK_EVENT._实力不足点击去练习赛, {
                    "_实力不足点击去练习赛": "_实力不足点击去练习赛"
                });
                SoundMgr.Ins.Press();
                this.close();
                PlatformMgr.Ins.closeNativeAd();
                UIManager.Ins.getScene(E_UI_TYPE.ONERACE).open(true);
            }
            onClosed() {

            }
        }
        class GetPriceUI extends ui.UIScenes.Voppo.GetPriceUI {
            constructor() {
                super();
                this.currPlayerSex = 0;
                this.scaleX = this.scaleY = GlobalScale$1.scale;
                this.width = Laya.stage.width / GlobalScale$1.scale;
                this.height = Laya.stage.height / GlobalScale$1.scale;
                this.closeBtn.on(Laya.Event.CLICK, this, this.closeBtnClick);
                this.submitBtn.on(Laya.Event.CLICK, this, this.submitBtnClick);
            }
            onOpened() {
                PlatformMgr.Ins.canShowBanner = false;
                this.userName.text = "";
                this.phoneNumber.text = "";
            }
            playOpenAni() { }
            playCloseAni() { }
            closeBtnClick() {
                SoundMgr.Ins.Press();
                this.close();
            }
            submitBtnClick() {
                SoundMgr.Ins.Press();
                if (this.userName.text === "") {
                    UIManager.Ins.getScene(E_UI_TYPE.LONGBLACKTIP).open(false, ["请填写姓名"]);
                    return;
                }
                let zz = new RegExp(/^1[3-9]\d{9}$/);
                if (zz.test(this.phoneNumber.text)) {
                    HttpMgr.Ins.setUserAddressInfo(this.userName.text, "", this.phoneNumber.text).then(x => {
                        console.log("提交返回的信息", x);
                        if (x.code == 200) {
                            UIManager.Ins.getScene(E_UI_TYPE.LONGBLACKTIP).open(false, ["信息提交成功，花费将在3-7个工作日内充值到账"]);
                            this.close();
                        } else {
                            UIManager.Ins.getScene(E_UI_TYPE.LONGBLACKTIP).open(false, ["信息提交失败，请刷新页面重试"]);
                        }
                    });
                } else {
                    UIManager.Ins.getScene(E_UI_TYPE.LONGBLACKTIP).open(false, ["请输入正确的手机号"]);
                }
            }
            onClosed() {
                Laya.timer.clearAll(this);
            }
        }
        class GetRealPriceUI extends ui.UIScenes.Voppo.GetRealPriceUI {
            constructor() {
                super();
                this.currPlayerSex = 0;
                this.scaleX = this.scaleY = GlobalScale$1.scale;
                this.width = Laya.stage.width / GlobalScale$1.scale;
                this.height = Laya.stage.height / GlobalScale$1.scale;
                this.closeBtn.on(Laya.Event.CLICK, this, this.closeBtnClick);
                this.submitBtn.on(Laya.Event.CLICK, this, this.submitBtnClick);
            }
            onOpened() {
                PlatformMgr.Ins.canShowBanner = false;
                this.userName.text = "";
                this.phoneNumber.text = "";
                this.address.text = "";
            }
            playOpenAni() { }
            playCloseAni() { }
            closeBtnClick() {
                SoundMgr.Ins.Press();
                this.close();
            }
            submitBtnClick() {
                SoundMgr.Ins.Press();
                if (this.userName.text === "") {
                    UIManager.Ins.getScene(E_UI_TYPE.LONGBLACKTIP).open(false, ["请填写姓名"]);
                    return;
                }
                if (this.address.text === "") {
                    UIManager.Ins.getScene(E_UI_TYPE.LONGBLACKTIP).open(false, ["请填写地址"]);
                    return;
                }
                let zz = new RegExp(/^1[3-9]\d{9}$/);
                if (zz.test(this.phoneNumber.text)) {
                    HttpMgr.Ins.setUserAddressInfo(this.userName.text, this.address.text, this.phoneNumber.text).then(x => {
                        console.log("提交返回的信息" + x);
                        if (x.code == 200) {
                            console.log("信息提交成功，花费将在3-7个工作日内充值到账");
                            this.close();
                        } else {
                            console.log("信息提交失败，请刷新页面重试");
                        }
                    });
                } else {
                    UIManager.Ins.getScene(E_UI_TYPE.LONGBLACKTIP).open(false, ["请输入正确的手机号"]);
                }
            }
            onClosed() {
                Laya.timer.clearAll(this);
            }
        }
        class luckypanScript extends Laya.Script {
            get text() {
                return this.txt;
            }
            get gift() {
                return this.img_gift;
            }
            get wing() {
                return this.img_wing;
            }
        }
        class LuckyPanUI extends ui.UIScenes.Voppo.luckypan.luckyPanUI {
            constructor() {
                super(...arguments);
                this.rewardAry = [];
                this.thirdTimes = 3;
                this.seventhTimes = 7;
                this.tenthTimes = 10;
                this.tweenTimes = 13;
                this.tickTimes = 0;
                this.MaxBar = 230;
                this.MinBar = 14;
                this._rewardIndexAry = null;
                this.preRwdList = [];
                this.rewardItemAry = [this.gift_0, this.gift_1, this.gift_2, this.gift_3, this.gift_4, this.gift_5, this.gift_6, this.gift_7];
                this._loopIndex = 0;
                this.finalIndex = -1;
                this._loopList = [];
            }
            onAwake() {
                this.scaleX = this.scaleY = GlobalScale$1.scale;
                this.width = Laya.stage.width / GlobalScale$1.scale;
                this.height = Laya.stage.height / GlobalScale$1.scale;
                this.initClickEvent();
            }
            onOpened() {
                PlatformMgr.Ins.canShowBanner = true;
                this.startBtn.visible = true;
                this.PopPage();
                this.isOverDay();
                this.updateTimes();
                this.refrshRewardAry();
                this.ani1.play(0, true);
                PlatformMgr.Ins.initNativeAd(E_UI_TYPE.LUCKY_PAN);
                let banner;
                let left = 50;
                let bottom = 0;
                let width = 300;

                PrivateTracker_new.Ins.sendEvent(SDK_EVENT._转盘界面, {
                    "_转盘界面": "_转盘界面"
                });
            }
            onClosed() {
                Laya.Tween.clearAll(this.img_rotatePan);
                DataMgr.Ins.guideData[E_GUIDE_TYPE.MAX] = false;
                PlatformMgr.Ins.closeNativeAd();
                if (UIManager.Ins.getScene(E_UI_TYPE.STARTUI).parent) PlatformMgr.Ins.initOutput(E_UI_TYPE.STARTUI);


            }
            onEnable() { }
            onDisable() { }
            PopPage() {
                this.zongBox.scaleX = .9;
                this.zongBox.scaleY = .9;
                Laya.Tween.to(this.zongBox, {
                    scaleX: 1,
                    scaleY: 1
                }, 20, Laya.Ease.linearInOut);
            }
            set rewardIndexAry(v) {
                this._rewardIndexAry = v;
                this.refreshGiftAry();
            }
            get rewardIndexAry() {
                return this._rewardIndexAry;
            }
            refrshRewardAry() {
                let count = DataMgr.Ins.panClickTotalTimes;
                if (count < 1) {
                    this.rewardIndexAry = [46, 42, 47, 43, 49, 67, 48, 45];
                } else if (count < 3) {
                    this.rewardIndexAry = [46, 42, 47, 43, 72, 67, 48, 45];
                } else if (count < 7) {
                    this.rewardIndexAry = [46, 42, 47, 43, 70, 67, 48, 45];
                } else if (count < 10) {
                    this.rewardIndexAry = [66, 42, 47, 43, 70, 67, 48, 45];
                } else if (count < 13) {
                    this.rewardIndexAry = [66, 42, 44, 43, 70, 67, 48, 45];
                } else {
                    this.rewardIndexAry = [66, 42, 44, 43, 70, 67, 68, 45];
                }
            }
            refreshGiftAry() {
                if (!this.rewardIndexAry) return;
                let srwd = [0, 2, 4, 6];
                this.preRwdList = this.rewardIndexAry;
                this.rewardItemAry.forEach((cell, index) => {
                    let rewardId = this.rewardIndexAry[index];
                    let obj = CCfgMgr.Ins.cfgChest.getItem(rewardId);
                    if (srwd.indexOf(index) != -1) {
                        if (obj._rewardType[0] != E_REWARD_TYPE.REWARD_BASE) {
                            cell.getChildByName("_reward").visible = true;
                            cell.getChildByName("_diamond").visible = false;
                            cell.getChildByName("_reward").getChildByName("_shine").visible = false;
                            cell.getChildByName("_reward").getChildByName("_name").text = obj._Name;
                            if (obj._rewardType[0] == E_REWARD_TYPE.REWARD_CAR) {
                                this.carIcon.skin = "uires/luckyPan/Car_" + obj._rewardID[0] + ".png";
                            }
                        } else {
                            cell.getChildByName("_diamond").visible = true;
                            cell.getChildByName("_reward").visible = false;
                            cell.getChildByName("_diamond").getChildByName("_shine").visible = false;
                            cell.getChildByName("_diamond").getChildByName("_back").visible = true;
                            cell.getChildByName("_diamond").getChildByName("_name").text = obj._Name;
                        }
                    } else {
                        cell.getChildByName("_diamond").visible = true;
                        cell.getChildByName("_diamond").getChildByName("_shine").visible = false;
                        cell.getChildByName("_diamond").getChildByName("_back").visible = true;
                        cell.getChildByName("_diamond").getChildByName("_name").text = obj._Name;
                    }
                });
                this.refreshBar();
            }
            refreshBar() {
                let times = DataMgr.Ins.panClickTotalTimes;
                this._dtxt.visible = true;
                this._dtxt.text = "后必得特殊奖励";
                if (times == 0) {
                    this.txt_times.text = `首次必得白银车`;
                    this.img_mask.width = this.MaxBar * 1;
                    this._dtxt.visible = false;
                } else if (times < this.thirdTimes) {
                    this.txt_times.text = `${this.thirdTimes - times}次`;
                    this._dtxt.text = "后必得特殊车";
                    this.img_mask.width = this.MaxBar * (times / this.thirdTimes);
                } else if (times == this.thirdTimes) {
                    this.txt_times.text = `${this.seventhTimes - times}次`;
                    this.img_mask.width = this.MinBar;
                } else if (times < this.seventhTimes) {
                    this.txt_times.text = `${this.seventhTimes - times}次`;
                    this.img_mask.width = this.MaxBar * ((times - this.thirdTimes) / 4);
                } else if (times == this.seventhTimes) {
                    this.txt_times.text = `${this.tweenTimes - times}次`;
                    this.img_mask.width = this.MinBar;
                } else if (times < this.tweenTimes) {
                    this.txt_times.text = `${Math.abs(this.tweenTimes - times)}次`;
                    this.img_mask.width = this.MaxBar * ((times - this.seventhTimes) / 3);
                } else {
                    this._down.visible = false;
                }
            }
            startBtnClick() {
                let isShipin = DataMgr.Ins.panClickTotalTimes > 0;
                // let cb = () => {
                //     this.startShowItem();
                // };
                if (isShipin) {
                    //激励广告
                    showReward(() => {
                        this.startShowItem();
                    });
                } else {
                    this.startShowItem();
                }
            }
            startShowItem() {
                this.closeBtn.visible = false;
                this.startBtn.visible = false;
                let lst = this.getLoopList();
                Laya.timer.loop(150, this, () => {
                    this.showItemShine(lst[this.loopIndex]);
                    this.loopIndex++;
                }, [this.loopIndex]);
            }
            set loopIndex(v) {
                this._loopIndex = v;
                if (v == this.tickTimes) {
                    Laya.timer.clearAll(this);
                    this._loopIndex = 0;
                    this.loopComplete();
                }
            }
            get loopIndex() {
                return this._loopIndex;
            }
            getLoopList() {
                let idxAry = [0, 1, 2, 3, 4, 5, 6, 7];
                this._loopList = [];
                this.finalIndex = this.getFinalIndex();
                for (let i = 0; i < 2; i++) {
                    for (let j = 0; j < idxAry.length; j++) {
                        this._loopList.push(idxAry[j]);
                    }
                }
                let push = idxAry.slice(0, this.finalIndex + 1);
                this._loopList.concat(push);
                this.tickTimes = this._loopList.length;
                return this._loopList;
            }
            getFinalIndex() {
                if (DataMgr.Ins.panClickTotalTimes == 0) {
                    return 4;
                } else if (DataMgr.Ins.panClickTotalTimes < 2) {
                    return this.randIndex([1, 3, 5, 7]);
                } else if (DataMgr.Ins.panClickTotalTimes == 2) {
                    return 4;
                } else if (DataMgr.Ins.panClickTotalTimes == 6) {
                    return 0;
                } else if (DataMgr.Ins.panClickTotalTimes < 7) {
                    return this.randIndex([1, 3, 4, 5, 7]);
                } else if (DataMgr.Ins.panClickTotalTimes < 9) {
                    return this.randIndex([0, 1, 3, 4, 5, 7]);
                } else if (DataMgr.Ins.panClickTotalTimes == 9) {
                    return 2;
                } else if (DataMgr.Ins.panClickTotalTimes == 12) {
                    return 6;
                } else if (DataMgr.Ins.panClickTotalTimes < 12) {
                    return this.randIndex([0, 1, 2, 3, 4, 5, 7]);
                } else {
                    return this.randIndex([0, 1, 2, 3, 4, 5, 6, 7]);
                }
            }
            randIndex(arr) {
                let index = Math.floor(Math.random() * 10) % arr.length;
                return arr[index];
            }
            loopComplete() {
                this.closeBtn.visible = true;
                DataMgr.Ins.zhuanPanNum++;
                DataMgr.Ins.panClickTotalTimes++;
                StartUI.Ins && StartUI.Ins.refreshLuckPanTip();
                this.startBtn.visible = true;
                DataMgr.Ins.SavePlayerData();
                let leftDegreeIndex = this.preRwdList[this.finalIndex] == 48 ? [48, 69] : this.rewardIndexAry[this.finalIndex];
                DataMgr.Ins.iszhuanpanClg = true;
                UIManager.Ins.getScene(E_UI_TYPE.CGTLTGETUI).open(false, [leftDegreeIndex, -1, 1, false, false, false]);
                Laya.timer.once(1e3, this, () => {
                    this.updateTimes();
                    this.refreshBar();
                    this.refrshRewardAry();
                });
            }
            showItemShine(index, bool) {
                let rewardId = this.rewardIndexAry[index];
                let srwd = [0, 2, 4, 6];
                if (srwd.indexOf(index) != -1) {
                    if (CCfgMgr.Ins.cfgChest.getItem(rewardId)._rewardType[0] !== E_REWARD_TYPE.REWARD_BASE) {
                        this.rewardItemAry[index].getChildByName("_reward").visible = true;
                        let shineObj = this.rewardItemAry[index].getChildByName("_reward").getChildByName("_shine");
                        shineObj.visible = true;
                        Laya.timer.once(80, this, () => {
                            shineObj.visible = false;
                        });
                    } else {
                        this.rewardItemAry[index].getChildByName("_diamond").visible = true;
                        let shineObj = this.rewardItemAry[index].getChildByName("_diamond").getChildByName("_shine");
                        let backObj = this.rewardItemAry[index].getChildByName("_diamond").getChildByName("_back");
                        shineObj.visible = true;
                        backObj.visible = false;
                        Laya.timer.once(80, this, () => {
                            shineObj.visible = false;
                            backObj.visible = true;
                        });
                    }
                } else {
                    this.rewardItemAry[index].getChildByName("_diamond").visible = true;
                    let shineObj = this.rewardItemAry[index].getChildByName("_diamond").getChildByName("_shine");
                    let backObj = this.rewardItemAry[index].getChildByName("_diamond").getChildByName("_back");
                    shineObj.visible = true;
                    backObj.visible = false;
                    Laya.timer.once(80, this, () => {
                        shineObj.visible = false;
                        backObj.visible = true;
                    });
                }
            }
            updateTimes() {
                this.times.text = `(今日剩余次数：${15 - DataMgr.Ins.zhuanPanNum}/15)`;
                this.coin.visible = false;
                this.videocoin.visible = false;
                DataMgr.Ins.panClickTotalTimes <= 0 ? this.coin.visible = true : this.videocoin.visible = true;
            }
            initClickEvent() {
                this.closeBtn.on(Laya.Event.CLICK, this, this.CloseBtnClick);
                this.startBtn.on(Laya.Event.CLICK, this, this.startBtnClick);
            }
            CloseBtnClick() {
                SoundMgr.Ins.Press();
                this.close();
            }
            isOverDay() {
                let day = new Date().getDate();
                if (DataMgr.Ins.zhuanPanDay == day) { } else {
                    DataMgr.Ins.zhuanPanDay = day;
                    DataMgr.Ins.zhuanPanNum = 0;
                    StartUI.Ins && StartUI.Ins.refreshLuckPanTip();
                    DataMgr.Ins.SavePlayerData();
                }
            }
        }
        class OnlineGift extends ui.UIScenes.Voppo.onlineGift.OnlineGiftUI {
            constructor() {
                super(...arguments);
                this.giftTimeList = [30, 60, 180, 300, 600];
                this.giftRwdIdList = [19, 20, 21, 22, 23];
                this.giftGaiLv = 1;
            }
            onAwake() {
                this.scaleX = this.scaleY = GlobalScale$1.scale;
                this.width = Laya.stage.width / GlobalScale$1.scale;
                this.height = Laya.stage.height / GlobalScale$1.scale;
                this.closeBtn.on(Laya.Event.CLICK, this, this.closeBtnHandler);
                this.giveUpBtn.on(Laya.Event.CLICK, this, this.closeBtnHandler);
                this.doubleBtn.on(Laya.Event.CLICK, this, this.openBtnHandler, [1]);
                this.zongBox.x = (this.width - 1280) / 2;
                this.ani2.play(null, true);
            }
            onEnable() { }
            onOpened() {
                this.PopPage();
                this.refreshBtnView();
                this.refreshPageView();
                let time = StartUI.Ins && StartUI.Ins.isOpening ? 500 : 1e3;
                Laya.timer.loop(time, this, () => {
                    this.refreshPageView();
                });
                PlatformMgr.Ins.initNativeAd(E_UI_TYPE.ONLINE_GIFT);
                if (PlatformMgr.Ins._gameConfig.tryCarwuchu != 0 && PlatformMgr.Ins.iswuchuTimeOpen) {
                    this.closeBtn.visible = false;
                    this.giveUpBtn.visible = true;
                } else {
                    this.closeBtn.visible = true;
                    this.giveUpBtn.visible = false;
                }
                this.giveUpBtn.visible = false;
                Laya.timer.once(PlatformMgr.Ins._gameConfig.xiaoziDelay, this, () => {
                    this.giveUpBtn.visible = !this.closeBtn.visible;
                });

                let banner;
                let left = 80;
                let bottom = 0;
                let width = 300;

                this.closeBtn.visible = false;
                Laya.timer.once(AdConfigMgr.Ins.Switch_1, this, () => {
                    this.closeBtn.visible = true;
                });
                PrivateTracker_new.Ins.sendEvent(SDK_EVENT._打卡在线礼包界面, {
                    "_打卡在线礼包界面": "_打卡在线礼包界面"
                });
            }
            onClosed() {
                Laya.timer.clearAll(this);
                PlatformMgr.Ins.closeNativeAd();


            }
            PopPage() {
                this.bgBox.scaleX = .9;
                this.bgBox.scaleY = .9;
                Laya.Tween.to(this.bgBox, {
                    scaleX: 1,
                    scaleY: 1
                }, 20, Laya.Ease.linearInOut);
            }
            onDisable() { }
            refreshBtnView() {
                this.doubleBtn.visible = true;
            }
            refreshPageView() {
                let nowDay = new Date().getDate();
                let nowMonth = new Date().getMonth();
                if (nowMonth == DataMgr.Ins.currGiftMonth) {
                    if (nowDay == DataMgr.Ins.currGiftDay) {
                        if (DataMgr.Ins.giftStage >= 5) {
                            this.hideButton();
                            return;
                        }
                        DataMgr.Ins.currGiftLastTime = (new Date().getTime() - DataMgr.Ins.loginStamp) / 1e3 + DataMgr.Ins.lasttime;
                        if (DataMgr.Ins.currGiftLastTime >= this.giftTimeList[DataMgr.Ins.giftStage]) {
                            this.showButton();
                        } else {
                            this.hideButton();
                        }
                    } else {
                        this.hideButton();
                    }
                } else {
                    this.hideButton();
                }
                if (StartUI.Ins && StartUI.Ins.isOpening) {
                    this.giftTime.value = StartUI.Ins.giftTime.text;
                } else {
                    this.giftTime.value = UsefulStuff.formatMS2(Math.floor(this.giftTimeList[DataMgr.Ins.giftStage] - DataMgr.Ins.currGiftLastTime));
                }
                let giftInfo = CCfgMgr.Ins.cfgChest.getItem(this.giftRwdIdList[Math.max(0, DataMgr.Ins.giftStage)]);
                this.diamondCount.text = (giftInfo._rewardNumMin[1] / 2).toString();
                this.coinCount.text = (giftInfo._rewardNumMin[0] / 2).toString();
            }
            closeBtnHandler() {
                SoundMgr.Ins.Press();
                this.close();
                PlatformMgr.Ins.closeNativeAd();
                if (UIManager.Ins.getScene(E_UI_TYPE.STARTUI).parent) PlatformMgr.Ins.initOutput(E_UI_TYPE.STARTUI);
            }
            openBtnHandler(times) {
                SoundMgr.Ins.Press();

                //激励广告
                showReward(() => {
                    this.clearState();
                    let rwdId = -1;
                    if (DataMgr.Ins.getClothes(CCfgMgr.Ins.cfgChest.getItem(CCfgMgr.Ins.cfgGlobalPar.getItemValue(E_GLOBALPAR_NAME.GAME_GIFT_RWD_ID))._rewardID[0]).isLock) {
                        if (Math.random() < 5 / 100) {
                            rwdId = CCfgMgr.Ins.cfgGlobalPar.getItemValue(E_GLOBALPAR_NAME.GAME_GIFT_RWD_ID);
                        }
                    }
                    if (rwdId < 0) {
                        UIManager.Ins.getScene(E_UI_TYPE.CGTLTGETUI).open(false, [this.giftRwdIdList[DataMgr.Ins.giftStage - 1], -1, times, false, false, false]);
                    } else {
                        UIManager.Ins.getScene(E_UI_TYPE.CGTLTGETUI).open(false, [[this.giftRwdIdList[DataMgr.Ins.giftStage - 1], rwdId], -1, times, false, false, false]);
                    }
                    this.close();
                });

            }
            hideButton() {
                this.showGift.visible = false;
                this.giftTime.visible = true;
            }
            showButton() {
                this.showGift.visible = true;
                this.giftTime.visible = false;
            }
            clearState() {
                DataMgr.Ins.isGetGiftChest = true;
                DataMgr.Ins.loginStamp = new Date().getTime();
                DataMgr.Ins.lasttime = 0;
                DataMgr.Ins.currGiftLastTime = 0;
                DataMgr.Ins.giftStage++;
                DataMgr.Ins.SavePlayerData();
                StartUI.Ins.refreshGiftChest();
            }
        }
        class RewardHatUI extends ui.UIScenes.Voppo.RewardHatUI {
            constructor() {
                super(...arguments);
                this.rewardIndex = 0;
                this.buffList = ["个性值100%", "艳压全场100%", "金币加成10%", "魅力值100%"];
            }
            onAwake() {
                this.scaleX = this.scaleY = GlobalScale$1.scale;
                this.width = Laya.stage.width / GlobalScale$1.scale;
                this.height = Laya.stage.height / GlobalScale$1.scale;
                this.closeBtn.on(Laya.Event.CLICK, this, this.closeBtnClick);
                this.giveUpBtn.on(Laya.Event.CLICK, this, this.closeBtnClick);
                this.getBtn.on(Laya.Event.CLICK, this, this.getBtnClick);
            }
            onOpened(rwdId) {
                if (rwdId == undefined || rwdId == null) {
                    this.close();
                    return;
                }
                this.rewardIndex = rwdId;
                this.refresUI();
                this.ani1.play(0, true);
                PlatformMgr.Ins.initNativeAd(E_UI_TYPE.REWARDHAT);
                if (PlatformMgr.Ins._gameConfig.tryCarwuchu != 0 && PlatformMgr.Ins.iswuchuTimeOpen) {
                    this.closeBtn.visible = false;
                    this.giveUpBtn.visible = true;
                } else {
                    this.closeBtn.visible = true;
                    this.giveUpBtn.visible = false;
                }
                this.giveUpBtn.visible = false;
                Laya.timer.once(PlatformMgr.Ins._gameConfig.xiaoziDelay, this, () => {
                    this.giveUpBtn.visible = !this.closeBtn.visible;
                });
                PlatformMgr.Ins.showWxNative(E_UI_TYPE.REWARDHAT);

                let banner;
                let left = 80;
                let bottom = 0;
                let width = 300;

                this.closeBtn.visible = false;
                Laya.timer.once(AdConfigMgr.Ins.Switch_1, this, () => {
                    this.closeBtn.visible = true;
                });
            }
            onClosed() {
                PlatformMgr.Ins.hideWxNative();


            }
            onDisable() { }
            onDestroy() { }
            refresUI() {
                let index = CCfgMgr.Ins.cfgChest.getItem(this.rewardIndex)._rewardID[0];
                this.img_wing.visible = false;
                this.img_reward.visible = false;
                let buff1Idx = Math.floor(Math.random() * 4);
                let buff2Idx = Math.floor(Math.random() * 4);
                buff2Idx = buff2Idx == buff1Idx ? Math.abs(buff1Idx - 1) : buff2Idx;
                this.buff_1.text = this.buffList[buff1Idx];
                this.buff_2.text = this.buffList[buff2Idx];
                if (this.rewardIndex == 64) {
                    this.img_wing.visible = true;
                    this.wing_left.skin = LoadMgr.Ins.WebResHttp + `clothesIcon/clothes_${index}.png`;
                    this.wing_right.skin = LoadMgr.Ins.WebResHttp + `clothesIcon/clothes_${index}.png`;
                } else {
                    this.img_reward.visible = true;
                    this.img_reward.skin = LoadMgr.Ins.WebResHttp + `clothesIcon/clothes_${index}.png`;
                }
            }
            closeBtnClick() {
                SoundMgr.Ins.Press();
                this.close();
                PlatformMgr.Ins.closeNativeAd();
            }
            getBtnClick() {
                //激励广告
                showReward(() => {
                    UIManager.Ins.getScene(E_UI_TYPE.CGTLTGETUI).open(false, [this.rewardIndex, -1, 1, false, false, false]);
                    this.close();
                });

            }
        }
        class VideoCoinUI extends ui.UIScenes.Voppo.VideoCoinUI {
            onAwake() {
                this.scaleX = this.scaleY = GlobalScale$1.scale;
                this.width = Laya.stage.width / GlobalScale$1.scale;
                this.height = Laya.stage.height / GlobalScale$1.scale;
                this.closeBtn.on(Laya.Event.CLICK, this, this.closeBtnClick);
                this.closeChaBtn.on(Laya.Event.CLICK, this, this.closeBtnClick);
                this.btn_get.on(Laya.Event.CLICK, this, this.getBtnClick);
            }
            onOpened() {
                this.isOverDay();
                this.refreshUI();
                this.ani1.play(0, true);
                if (PlatformMgr.Ins._gameConfig.tryCarwuchu != 0 && PlatformMgr.Ins.iswuchuTimeOpen) {
                    this.closeBtn.visible = true;
                    this.closeChaBtn.visible = false;
                } else {
                    this.closeBtn.visible = false;
                    this.closeChaBtn.visible = true;
                }
                this.closeBtn.visible = false;
                Laya.timer.once(PlatformMgr.Ins._gameConfig.xiaoziDelay, this, () => {
                    this.closeBtn.visible = !this.closeChaBtn.visible;
                });
                PlatformMgr.Ins.initNativeAd(E_UI_TYPE.VIDEO_COIN);
                PlatformMgr.Ins.showWxNative(E_UI_TYPE.VIDEO_COIN);

                let banner;
                let left = 0;
                let bottom = 0;
                let width = 300;

                PrivateTracker_new.Ins.sendEvent(SDK_EVENT._打开免费金币界面, {
                    "_打开免费金币界面": "_打开免费金币界面"
                });
            }
            onClosed() {
                PlatformMgr.Ins.hideWxNative();

            }
            onEnable() { }
            onDisable() { }
            closeBtnClick() {
                SoundMgr.Ins.Press();
                this.close();
                PlatformMgr.Ins.closeNativeAd();
            }
            getBtnClick() {
                if (DataMgr.Ins.freeGoldNum >= 10) {
                    UIManager.Ins.getScene(E_UI_TYPE.LONGBLACKTIP).open(false, ["今日机会已用完，请明日再来哟~"]);
                    return;
                }
                //激励广告
                showReward(() => {
                    let rwdId = CCfgMgr.Ins.cfgGlobalPar.getItemValue(E_GLOBALPAR_NAME.GAME_VIDEO_GOLD);
                    UIManager.Ins.getScene(E_UI_TYPE.CGTLTGETUI).open(false, [rwdId, -1, 1, false, false, false]);
                    DataMgr.Ins.freeGoldNum++;
                    this.refreshUI();
                });

            }
            refreshUI() {
                let rwdId = CCfgMgr.Ins.cfgGlobalPar.getItemValue(E_GLOBALPAR_NAME.GAME_VIDEO_GOLD);
                this.lastTimeLa.text = "剩余获取次数：" + (10 - DataMgr.Ins.freeGoldNum) + "/10";
                this.coinCount.text = UsefulStuff.rnd(CCfgMgr.Ins.cfgChest.getItem(rwdId)._rewardNumMin[0], CCfgMgr.Ins.cfgChest.getItem(rwdId)._rewardNumMax[0]).toString();
            }
            isOverDay() {
                let day = new Date().getDate();
                if (DataMgr.Ins.freeGoldDay == day) { } else {
                    DataMgr.Ins.freeGoldDay = day;
                    DataMgr.Ins.freeGoldNum = 0;
                    DataMgr.Ins.SavePlayerData();
                }
            }
        }
        class FullPageTtUI extends ui.UIScenes.wx.FullPageTtUI {
            constructor() {
                super();
                this.jixian = 0;
                this.moveSpeed = 8e3;
                this.hangNum = 6;
                this.dataList = [];
                this.isToLeft = false;
                this.scaleX = this.scaleY = GlobalScale$1.scale;
                this.width = Laya.stage.width / GlobalScale$1.scale;
                this.height = Laya.stage.height / GlobalScale$1.scale;
                this.hangNum = this.width / this.height > 1.78 ? 6 : 5;
                this.testList.width = this.width / this.height > 1.78 ? 1200 : 1e3;
                this.testList.mouseHandler = new Laya.Handler(this, this.clickItem);
                this.testList.on(Laya.Event.MOUSE_UP, this, this.mouseUp);
                this.testList.on(Laya.Event.MOUSE_OUT, this, this.mouseUp);
                this.closeBtn.on(Laya.Event.CLICK, this, this.closeBtnClick);
            }
            onOpened(comeUI) {
                this.comeUI = comeUI;
                if (PlatformMgr.Ins.isBannerMove()) {
                    this.closeBtn.mouseEnabled = false;
                    PlatformMgr.Ins.initNativeAdLater(E_UI_TYPE.FULLPAGE, PlatformMgr.Ins.BannerMoveTime());
                    Laya.timer.once(PlatformMgr.Ins.BannerMoveTime() + PlatformMgr.Ins.TextMoveTime(), this, () => {
                        PlatformMgr.Ins.closeNativeAd();
                        this.closeBtn.mouseEnabled = true;
                    });
                } else {
                    PlatformMgr.Ins.closeNativeAd();
                }
            }
            refreshList(cell, index) {
                cell.skin = this.dataList[index].app_icon;
                cell.getChildAt(2).text = this.dataList[index].app_title;
            }
            moveToLeft(time = 8e3) {
                this.isToLeft = true;
                this.testList.tweenTo(-this.testList.repeatY, time, Laya.Handler.create(this, () => {
                    this.moveToRight();
                }));
            }
            moveToRight(time = 8e3) {
                this.isToLeft = false;
                this.testList.tweenTo(this.jixian, time, Laya.Handler.create(this, () => {
                    this.moveToLeft();
                }));
            }
            mouseUp() {
                if (this.isToLeft) this.moveToLeft(Math.abs(this.testList.startIndex + this.testList.repeatY) * this.moveSpeed / this.jixian); else this.moveToRight(Math.abs(this.testList.startIndex - this.jixian) * this.moveSpeed / this.jixian);
            }
            closeBtnClick() {
                SoundMgr.Ins.Press();
                this.close();
                PlatformMgr.Ins.closeNativeAd();
                if (UIManager.Ins.getScene(this.comeUI).parent) PlatformMgr.Ins.initNativeAd(this.comeUI);
            }
            clickItem(e, index) { }
        }
        var WXFULITYPE;
        (function (WXFULITYPE) {
            WXFULITYPE[WXFULITYPE["YAOQING"] = 0] = "YAOQING";
            WXFULITYPE[WXFULITYPE["SHOUCHANG"] = 1] = "SHOUCHANG";
            WXFULITYPE[WXFULITYPE["TIANJIA"] = 2] = "TIANJIA";
            WXFULITYPE[WXFULITYPE["FENXIANG"] = 3] = "FENXIANG";
        })(WXFULITYPE || (WXFULITYPE = {}));
        class WxShareFuLiUI extends ui.UIScenes.wx.WxShareFuLiUI {
            constructor() {
                super();
                this.btnListParent = [];
                this.scaleX = this.scaleY = GlobalScale$1.scale;
                this.width = Laya.stage.width / GlobalScale$1.scale;
                this.height = Laya.stage.height / GlobalScale$1.scale;
                this.closeBtn.on(Laya.Event.CLICK, this, this.closeBtnClick);
                for (let i = 0; i < 4; i++) {
                    let box = this.btnBoxParent.getChildAt(i);
                    this.btnListParent.push(box);
                    box.on(Laya.Event.CLICK, this, this.btnListClick, [i]);
                }
            }
            onOpened() {
                if (!DataMgr.Ins.wxFuLiList[2].canGet && DataMgr.Ins.wxScene == 1131) {
                    DataMgr.Ins.wxFuLiList[2].canGet = true;
                    DataMgr.Ins.SavePlayerData();
                }
                this.refreshBtnList();
                EventMgr.Ins.on(EventType.REFRESH_WX_SHARE, this, () => {
                    this.refreshBtnList();
                });
            }
            refreshBtnList() {
                for (let i = 0; i < 4; i++) {
                    let btnGo = this.btnListParent[i].getChildAt(0);
                    let btnKLing = this.btnListParent[i].getChildAt(1);
                    let btnGone = this.btnListParent[i].getChildAt(2);
                    let data = DataMgr.Ins.wxFuLiList[i];
                    btnGo.visible = !data.canGet;
                    btnKLing.visible = data.canGet && !data.isGet;
                    btnGone.visible = data.isGet;
                }
                if (PlatformMgr.Ins.isIos) {
                    this.btnListParent[3].visible = false;
                    this.btnListParent[1].visible = false;
                }
            }
            btnListClick(index) {
                let data = DataMgr.Ins.wxFuLiList[index];
                if (!data.canGet) {
                    if (index == WXFULITYPE.YAOQING) {
                        if (PlatformMgr.Ins.platform == E_PLATFORM_TYPE.WX) platform.Ins.share().then(() => {
                            console.log("分享成功啦");
                            data.canGet = true;
                            this.refreshBtnList();
                        });
                    } else {
                        UIManager.Ins.getScene(E_UI_TYPE.WXSHAREINFO).open(false, index - 1);
                    }
                } else {
                    if (!data.isGet) {
                        if (index == WXFULITYPE.YAOQING) {
                            DataMgr.Ins.addDiamon(20);
                        } else {
                            DataMgr.Ins.addDiamon(50);
                        }
                        data.isGet = true;
                        DataMgr.Ins.SavePlayerData();
                        UIManager.Ins.getScene(E_UI_TYPE.LONGBLACKTIP).open(false, ["领取成功！"]);
                    }
                }
                this.refreshBtnList();
            }
            closeBtnClick() {
                SoundMgr.Ins.Press();
                this.close();
            }
            onClosed() {
                EventMgr.Ins.offAll(EventType.REFRESH_WX_SHARE);
            }
        }
        class WxShareInfoUI extends ui.UIScenes.wx.WxShareInfoUI {
            constructor() {
                super();
                this.listParent = [];
                this.scaleX = this.scaleY = GlobalScale$1.scale;
                this.width = Laya.stage.width / GlobalScale$1.scale;
                this.height = Laya.stage.height / GlobalScale$1.scale;
                this.closeBtn.on(Laya.Event.CLICK, this, this.closeBtnClick);
                for (let i = 0; i < 3; i++) {
                    let box = this.infoParent.getChildAt(i);
                    this.listParent.push(box);
                }
            }
            onOpened(index) {
                this.refreshList(index);
            }
            refreshList(index) {
                for (let i = 0; i < 3; i++) {
                    this.listParent[i].visible = false;
                }
                this.listParent[index].visible = true;
            }
            closeBtnClick() {
                SoundMgr.Ins.Press();
                this.close();
            }
            onClosed() { }
        }
        class WxShareViewUI extends ui.UIScenes.wx.WxShareViewUI {
            constructor() {
                super();
                this.dataKey = "WxShareViewUI_211021";
                this.boxShareCount = [1, 2, 3];
                this.awardIDs = [78, 79, 80];
                this.scaleX = this.scaleY = GlobalScale$1.scale;
                this.width = Laya.stage.width / GlobalScale$1.scale;
                this.height = Laya.stage.height / GlobalScale$1.scale;
                this.box1.on(Laya.Event.CLICK, this, this.boxClick, [0]);
                this.box2.on(Laya.Event.CLICK, this, this.boxClick, [1]);
                this.box3.on(Laya.Event.CLICK, this, this.boxClick, [2]);
                this.shareBtn.on(Laya.Event.CLICK, this, this.share);
                this.exitBtn.on(Laya.Event.CLICK, this, () => {
                    this.close();
                });
            }
            onOpened() {
                this.load();
                this.refresh();
            }
            load() {
                let data = Laya.LocalStorage.getJSON(this.dataKey);
                if (data) {
                    this.data = data;
                } else {
                    this.data = new Data();
                }
            }
            save() {
                Laya.LocalStorage.setJSON(this.dataKey, this.data);
            }
            refresh() {
                this.box1Get.visible = this.data.isGet[0];
                this.box2Get.visible = this.data.isGet[1];
                this.box3Get.visible = this.data.isGet[2];
                this.count.text = "邀请进度:" + this.data.shareCount + "/3";
            }
            boxClick(index) {
                if (this.data.shareCount < this.boxShareCount[index]) {
                    UIManager.Ins.getScene(E_UI_TYPE.LONGBLACKTIP).open(false, "邀请次数不足,请邀请足够数量玩家后重试!");
                    return;
                }
                if (this.data.isGet[index]) {
                    UIManager.Ins.getScene(E_UI_TYPE.LONGBLACKTIP).open(false, "该奖励已领取!");
                    return;
                }
                let awardID = this.awardIDs[index];
                UIManager.Ins.getScene(E_UI_TYPE.CGTLTGETUI).open(false, [awardID, null, 2, false, false, false, false, null, null]);
                this.data.isGet[index] = true;
                this.refresh();
                this.save();
            }
            share() {
                platform.Ins.share().then(() => {
                    UIManager.Ins.getScene(E_UI_TYPE.LONGBLACKTIP).open(false, "分享成功");
                    this.data.shareCount++;
                    this.refresh();
                    this.save();
                }).catch(() => {
                    UIManager.Ins.getScene(E_UI_TYPE.LONGBLACKTIP).open(false, "分享失败,请重新分享");
                });
            }
        }
        class Data {
            constructor() {
                this.shareCount = 0;
                this.isGet = [false, false, false];
            }
        }
        class GameConfig {
            constructor() { }
            static init() {
                var reg = Laya.ClassUtils.regClass;
                reg("script/LoadingUI.ts", LoadingUI);
                reg("script/advertisement/outputListTemp1.ts", outputListTemp1);
                reg("script/advertisement/outputListTemp2.ts", outputListTemp2);
                reg("script/advertisement/outputSingleTemp1.ts", outputSingleTemp1);
                reg("script/item/CheckinScript.ts", CheckItemScript);
                reg("script/CheckInViewUI.ts", checkinViewUI);
                reg("script/AddDeskTopUI.ts", AddDeskTopUI);
                reg("script/BattleUI.ts", BattleUI);
                reg("script/MiniMapUI.ts", MiniMapUI);
                reg("script/WinEffectUI.ts", WinEffectUI);
                reg("script/WarningScript.ts", WarningScript);
                reg("script/CarExpireUI.ts", CarExpireUI);
                reg("script/CgtltGetUI.ts", CgtltGetUI);
                reg("script/CgtltGetCarUp5UI.ts", CgtltGetCarUp5UI);
                reg("script/Driver2UI.ts", Driver2UI);
                reg("ClothesBoxScript.ts", ClothesBoxScript);
                reg("script/item/HtGameScript.ts", HtGameScript);
                reg("script/GameCardUI.ts", GameCardUI);
                reg("script/Garage2UI.ts", Garage2UI);
                reg("script/GetCarUI.ts", GetCarUI);
                reg("script/GuideUI.ts", GuideUI);
                reg("script/LianWinUI.ts", LianWinUI);
                reg("script/LimitGiftUI.ts", LimitGiftUI);
                reg("script/LongBlackTipUI.ts", LongBlackTipUI);
                reg("script/LongPressTipUI.ts", LongPressTipUI);
                reg("script/NpcNameUI.ts", NpcNameUI);
                reg("script/OppoBannerViewUI.ts", OppoBannerViewUI);
                reg("script/PickModeUI.ts", PickModeUI);
                reg("script/PickRoleUI.ts", PickRoleUI);
                reg("script/ProfileUI.ts", ProfileUI);
                reg("utils/UserInfoBtn.ts", UserInfoBtn);
                reg("script/StartUI.ts", StartUI);
                reg("script/item/TrainingResultItem.ts", TraningResultItem);
                reg("script/TrainingResultViewUI.ts", TrainingResultViewUI);
                reg("script/GuideGetCarUI.ts", GuideTryCarUI);
                reg("script/NextDayGiftUI.ts", NextDayGiftUI);
                reg("script/item/oneRaceItemScript.ts", oneRaceItemScript);
                reg("script/raceType/MultiItemUI.ts", MultiItemUI);
                reg("script/raceType/MultiRaceUI.ts", MultiRaceUI);
                reg("PaiMingItem.ts", PaiMingItem);
                reg("script/raceType/oneRaceUI.ts", oneRaceUI);
                reg("script/RankingViewUI.ts", RankingViewUI);
                reg("script/RankResultViewUI.ts", RankResultViewUI);
                reg("script/TtRecordUI.ts", TtRecordUI);
                reg("script/TtTipUI.ts", TtTipUI);
                reg("script/vivo/InsertAdUI.ts", InsertAdUI);
                reg("script/vivo/VideoAgainUI.ts", VideoAgainUI);
                reg("script/voppo/CarTrailUI.ts", CarTrailUI);
                reg("script/voppo/ConstellationDesc.ts", ConstellationDescUI);
                reg("script/item/ConstellationItemScript.ts", ConstellationItemScipt);
                reg("script/voppo/ConstellationUI.ts", ConstellationUI);
                reg("script/DrawPriceUI.ts", DrawPriceUI);
                reg("script/voppo/getPowerUI.ts", GertPowerUI);
                reg("script/GetPriceUI.ts", GetPriceUI);
                reg("script/GetRealPriceUI.ts", GetRealPriceUI);
                reg("script/item/luckypanScript.ts", luckypanScript);
                reg("script/LuckyPanUI.ts", LuckyPanUI);
                reg("script/voppo/OnlineGiftUI.ts", OnlineGift);
                reg("script/voppo/RewardHatUI.ts", RewardHatUI);
                reg("script/voppo/VedioCoinUI.ts", VideoCoinUI);
                reg("script/FullPageTtUI.ts", FullPageTtUI);
                reg("script/welcomeBackUI.ts", welcomeBackUI);
                reg("script/WxShareFuLiUI.ts", WxShareFuLiUI);
                reg("script/WxShareInfoUI.ts", WxShareInfoUI);
                reg("script/WxShareViewUI.ts", WxShareViewUI);
            }
        }
        GameConfig.width = 1280;
        GameConfig.height = 720;
        GameConfig.scaleMode = "fixedauto";
        GameConfig.screenMode = "horizontal";
        GameConfig.alignV = "middle";
        GameConfig.alignH = "center";
        GameConfig.startScene = "Loading.scene";
        GameConfig.sceneRoot = "";
        GameConfig.debug = false;
        GameConfig.stat = false;
        GameConfig.physicsDebug = false;
        GameConfig.exportSceneToJson = true;
        GameConfig.init();
        var E_AD_TYPE;
        (function (E_AD_TYPE) {
            E_AD_TYPE[E_AD_TYPE["OUTPUT_SINGLE"] = 1] = "OUTPUT_SINGLE";
            E_AD_TYPE[E_AD_TYPE["OUTPUT_LIST_V"] = 2] = "OUTPUT_LIST_V";
            E_AD_TYPE[E_AD_TYPE["OUTPUT_LIST_H"] = 3] = "OUTPUT_LIST_H";
            E_AD_TYPE[E_AD_TYPE["GAMECENTERBTN"] = 4] = "GAMECENTERBTN";
        })(E_AD_TYPE || (E_AD_TYPE = {}));
        var E_AD_DIR;
        (function (E_AD_DIR) {
            E_AD_DIR[E_AD_DIR["VERCITAL"] = 0] = "VERCITAL";
            E_AD_DIR[E_AD_DIR["HORIZONTAL"] = 1] = "HORIZONTAL";
        })(E_AD_DIR || (E_AD_DIR = {}));
        class AdsData {
            constructor() { }
        }
        class AdsMgr {
            constructor() {
                this.lastOutputIndex = 0;
                this.isShowRoot = false;
                this.loadAdData();
                this.loadAdRoot();
            }
            static get Ins() {
                return AdsMgr._ins || (AdsMgr._ins = new AdsMgr());
            }
            showAdRoot() {
                if (this.AdRoot) {
                    Laya.stage.addChild(this.AdRoot);
                    this.isShowRoot = true;
                } else {
                    this.loadAdRoot().then(() => {
                        this.showAdRoot();
                    });
                }
            }
            loadAdRoot() {
                return new Promise(resolve => {
                    Laya.Scene.load("UIScenes/advertisement/AdRoot.scene", Laya.Handler.create(this, resolve));
                }).then(x => {
                    this.loadAdBack(x);
                });
            }
            loadAdBack(scene) {
                this.AdRoot = scene;
                this.AdRoot.width = Laya.stage.width;
                this.AdRoot.height = Laya.stage.height;
            }
            hideAdRoot() {
                this.AdRoot.removeChildren();
                this.AdRoot.removeSelf();
                this.isShowRoot = false;
            }
            loadAdData() {
                // return new Promise(resolve => {
                //     var zsSdk = window["zs"];
                //     zsSdk.sdk.loadAd(res => {
                //         console.log(res);
                //         resolve(res);
                //     });
                // }).then(res => {
                //     this.initOutputData(res);
                // });
            }
            initOutputData(data) {
                this.outputAdData = [];
                var opData = data.promotion;
                for (var i = 0; i < opData.length; i++) {
                    var ad = new AdsData();
                    ad.app_icon = opData[i].app_icon;
                    ad.app_title = opData[i].app_title;
                    ad.wx_id = opData[i].appid;
                    ad.info = opData[i];
                    this.outputAdData.push(ad);
                }
            }
            createOutput(AdData) { }
            setOpPos(scene, AdData) {
                this.AdRoot.addChild(scene);
                scene.x = this.AdRoot.width * (AdData.left / 100);
                scene.y = this.AdRoot.height * (AdData.top / 100);
            }
            loadOutputAd(type) {
                var url = "";
                switch (type) {
                    case E_AD_TYPE.OUTPUT_SINGLE:
                        url = "UIScenes/advertisement/outputSingleTemp1.scene";
                        break;

                    case E_AD_TYPE.OUTPUT_LIST_V:
                        url = "UIScenes/advertisement/outputListTemp1.scene";
                        break;

                    case E_AD_TYPE.OUTPUT_LIST_H:
                        url = "UIScenes/advertisement/outputListTemp2.scene";
                        break;

                    case E_AD_TYPE.GAMECENTERBTN:
                        break;

                    default:
                        break;
                }
                return new Promise(resolve => {
                    resolve;
                });
            }
            getNextOutputAdData() {
                var data = this.outputAdData[this.lastOutputIndex];
                this.lastOutputIndex++;
                if (this.lastOutputIndex >= this.outputAdData.length) this.lastOutputIndex = 0;
                return data;
            }
        }
        const wx$2 = window["wx"];
        const OPPO_CDN_CONFIG_URL = "";//https://czy.jiegames.com/jy-game/config/kart3D/oppo/cfkdc_oppo_1_0_9.json
        class Main {
            constructor() {
                this.subPackageName = ["uires", "audio", "unity", "anires", "uiresatlas", "firstRes"];
                this.packageID = 0;
                console.log("Width:" + Laya.Browser.clientWidth.toString() + "height:" + Laya.Browser.clientHeight.toString());
                GameConfig.height = 720;
                // GameConfig.width = 720 / Laya.Browser.clientHeight * Laya.Browser.clientWidth;
                GameConfig.width = 1280;
                this.UIScale = 720 / Laya.Browser.clientHeight;
                if (window["Laya3D"]) Laya3D.init(GameConfig.width * GlobalScale$1.scale, GameConfig.height * GlobalScale$1.scale); 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;
                Laya.stage.frameRate = GlobalScale$1.slow ? Laya.Stage.FRAME_SLOW : Laya.Stage.FRAME_FAST;

                // Laya.URL.exportSceneToJson = GameConfig.exportSceneToJson;
                // if (GameConfig.debug || Laya.Utils.getQueryString("debug") == "true") Laya.enableDebugPanel();
                // if (GameConfig.physicsDebug && Laya["PhysicsDebugDraw"]) Laya["PhysicsDebugDraw"].enable();
                // Laya.ResourceVersion.enable("version.json", Laya.Handler.create(this, this.onVersionLoaded), Laya.ResourceVersion.FILENAME_VERSION);
                // Advertisement.initVal();

                let load = () => {
                    Laya.URL.exportSceneToJson = GameConfig.exportSceneToJson;
                    if (GameConfig.debug || Laya.Utils.getQueryString("debug") == "true") Laya.enableDebugPanel();
                    if (GameConfig.physicsDebug && Laya["PhysicsDebugDraw"]) Laya["PhysicsDebugDraw"].enable();
                    Laya.ResourceVersion.enable("version.json", Laya.Handler.create(this, this.onVersionLoaded), Laya.ResourceVersion.FILENAME_VERSION);
                    Advertisement.initVal();
                };

                let qg = window['qg'];
                if (window.qg) {
                    let loaded = Laya.LocalStorage.getItem("Loaded");
                    if (loaded != 1) {
                        var downloadTask = qg.download({
                            url: "http://res.njmobaike.com/CDN/KaDingChe/DianFengJingSuFeiChe/1.4.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("进了这里");
                                        console.log(`handling success: ${uri}`);
                                        Laya.URL.basePath = qg.env.USER_DATA_PATH + "/bin/";
                                        Laya.LocalStorage.setItem("Loaded", 1);

                                        load();
                                    },
                                    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/";

                        load();
                    }
                } else {
                    load();
                }
            }
            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/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 () {
                        //         window["AdSdk"].ins().tuichu();
                        //     })
                        //     Laya.stage.addChild(fwtks);
                        // }))

                    });
                }));
            }
            onConfigLoaded() {
                GameConfig.startScene && Laya.Scene.open(GameConfig.startScene, true, null, Laya.Handler.create(this, this.loadingUIOpen));
            }
            loadingUIOpen(scene) {
                PrivateTracker_new.Ins.sendEvent(SDK_EVENT._loading页开始加载, {
                    "_loading页开始加载": "_loading页开始加载"
                });
                AdConfigMgr.Ins.getConfig();
                PlatformMgr.Ins.initSDK();
                this.m_loadingUI = scene;
                LoadMgr.Ins.loadingUI = scene;
                var cdnUrl = OPPO_CDN_CONFIG_URL;
                // Laya.loader.load(cdnUrl, Laya.Handler.create(this, this.cdnUrlBack));
                let aaa = {
                    "channelName": "oppo",
                    "getback": 1,
                    "nativeBannerCloseBtnDelay": 0,
                    "nativeInsertOpenDelay": 0,
                    "garageInsertChance": 0,
                    "tryCarwuchu": 0,
                    "xiaoziDelay": 0,
                    "openGailv": 100,
                    "wuchuTime": 0,
                    "videoIconXingzuo": 0,
                    "cdnOpen": 0

                };
                this.cdnUrlBack(aaa);
            }
            cdnUrlBack(res) {
                console.log("加载子罢了");
                if (res) LoadMgr.Ins.setCdnHttp(res.cdnOpen);
                if (PlatformMgr.Ins.platform & (E_PLATFORM_TYPE.QQ | E_PLATFORM_TYPE.WX | E_PLATFORM_TYPE.VIVO | E_PLATFORM_TYPE.BAIDU)) {
                    this.loadNextSubpackage().then(() => {
                        LoadMgr.Ins.loadJson(() => {
                            this.startPreloading();
                        });
                    });
                } else LoadMgr.Ins.loadJson(() => {
                    this.startPreloading();
                });
            }
            loadNextSubpackage() {
                let p = Promise.resolve();
                for (let i = 0; i < this.subPackageName.length; i++) {
                    p = p.then(() => this.loadSubPkg(this.subPackageName[i], i), err => console.error(err));
                }
                return p;
            }
            loadSubPkg(pkgName, pkgId) {
                return platform.Ins.loadSubpackage(pkgName);
            }
            startPreloading() {
                this.m_loadingUI.setPro(.4);
                DataMgr.Ins.GetPlayerData("", () => {
                    if (DataMgr.Ins.isCreatRole) {
                        DataMgr.Ins.isFirstPlayer = false;
                        if (PlatformMgr.Ins.platform & (E_PLATFORM_TYPE.WX | E_PLATFORM_TYPE.VIVO | E_PLATFORM_TYPE.QQ | E_PLATFORM_TYPE.BAIDU)) {
                            this.loadNextSubpackage().then(() => {
                                AdsMgr.Ins;
                                LoadMgr.Ins.PreloadingRes(Laya.Handler.create(this, this.preloadPro)).then(() => {
                                    this.preloadComplete();
                                });
                            });
                        } else {
                            AdsMgr.Ins;
                            LoadMgr.Ins.PreloadingRes(Laya.Handler.create(this, this.preloadPro)).then(() => {
                                this.preloadComplete();
                            });
                        }
                    } else {
                        DataMgr.Ins.isFirstPlayer = true;
                        this.preloadComplete();
                    }
                });
            }
            preloadComplete() {
                this.startLoadScene();
                CCfgMgr.Ins;
            }
            preloadPro(value) {
                this.m_loadingUI.setPro(.4 + value * .4);
            }
            startLoadScene() {
                if (DataMgr.Ins.isCreatRole) {
                    UIManager.Ins.preloadAllUI(Laya.Handler.create(this, this.sceneComplete), Laya.Handler.create(this, this.sceneCallback, null, false));
                } else {
                    UIManager.Ins.preloadUI(2, Laya.Handler.create(this, this.sceneComplete), Laya.Handler.create(this, this.sceneCallback, null, false));
                }
            }
            sceneCallback(value) {
                this.m_loadingUI.setPro(.8 + value * .2);
            }
            sceneComplete() {
                Laya.timer.once(100, this, this.startGame);
            }
            startGame() {
                this.m_loadingUI.close();
                DataMgr.Ins.loginStamp = new Date().getTime();
                DataMgr.Ins.lasttime = DataMgr.Ins.currGiftLastTime;
                SceneMgr.Ins && SceneMgr.Ins.onTouchEvent();
                if (DataMgr.Ins.isCreatRole) {
                    PrivateTracker_new.Ins.sendEvent(SDK_EVENT._loading页加载完成, {
                        "_loading页开始加载": "老玩家加载完成"
                    });
                    PrivateTracker_new.Ins.sendEvent(SDK_EVENT._首次进入游戏玩家, {
                        "_首次进入游戏玩家": "_首次进入游戏玩家"
                    });
                    UIManager.Ins.getScene(E_UI_TYPE.STARTUI).open(true);
                } else {
                    PrivateTracker_new.Ins.sendEvent(SDK_EVENT._loading页加载完成, {
                        "_loading页开始加载": "新玩家加载完成"
                    });
                    PrivateTracker_new.Ins.sendEvent(SDK_EVENT._再次进入游戏玩家, {
                        "_再次进入游戏玩家": "_再次进入游戏玩家"
                    });
                    UIManager.Ins.getScene(E_UI_TYPE.PICK_ROLE).open(true);
                }
                if (window["qg"]) {
                    let qg = window["qg"];
                    let then = new Date().getTime();
                    qg.onHide(() => {
                        let param = {};
                        let miao = (new Date().getTime() - then) / 1e3;
                        let fen = Math.ceil(miao / 120) * 2;
                        param["fen"] = Math.max(0, Math.min(30, fen));
                        param["currRank"] = DataMgr.Ins.getCurrRankLv();
                    });
                }
                if (DataMgr.Ins.isCreatRole) {
                    SoundMgr.Ins.playBgm(E_GAME_MODE.NONE);
                    this.loadWxOpenData();
                } else {
                    if (PlatformMgr.Ins.platform & (E_PLATFORM_TYPE.WX | E_PLATFORM_TYPE.QQ | E_PLATFORM_TYPE.BAIDU)) {
                        this.loadNextSubpackage().then(() => {
                            console.log("偷偷加载分包完成");
                            AdsMgr.Ins;
                            for (var i = 0; i < LoadMgr.Ins.guideLoadList.length; i++) {
                                LoadMgr.Ins.assetResourceList.push(LoadMgr.Ins.guideLoadList[i]);
                            }
                            LoadMgr.Ins.PreloadingRes(null).then(() => {
                                console.log("偷偷加载资源完成");
                                UIManager.Ins.preloadAllUI(Laya.Handler.create(this, () => {
                                    console.log("偷偷加载界面完成");
                                    EventMgr.Ins.dispatch(EventType.RES_LOAD_FINISHED);
                                    this.loadWxOpenData();
                                }), null);
                            });
                        });
                    } else {
                        for (var i = 0; i < LoadMgr.Ins.guideLoadList.length; i++) {
                            LoadMgr.Ins.assetResourceList.push(LoadMgr.Ins.guideLoadList[i]);
                        }
                        AdsMgr.Ins;
                        LoadMgr.Ins.PreloadingRes(null).then(() => {
                            console.log("偷偷加载资源完成");
                            UIManager.Ins.preloadAllUI(Laya.Handler.create(this, () => {
                                console.log("偷偷加载界面完成");
                                EventMgr.Ins.dispatch(EventType.RES_LOAD_FINISHED);
                                this.loadWxOpenData();
                            }), null);
                        });
                    }
                }
            }
            loadWxOpenData() { }
        }
        Laya.Input3D.prototype["_update"] = function () { };
        new Main();
    })();
    function showReward(e) {
        Laya.timer.scale = 0;
        // if (!window.zy || window.zy == undefined) {
        //     console.log("不在最右环境直接下发奖励3");
        //     e && e()
        //     Laya.timer.scale = 1;
        //     return;
        // }

        Advertisement.rewarda = 'reward1';
        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();
                        if (Advertisement.rewarda == 'reward1') {
                            //奖励逻辑1
                            e && e();
                            Laya.timer.scale = 1;
                        }
                        console.log("奖励已发放");

                    }
                } else {
                    console.log("播放中途退出，不下发游戏奖励");
                    // cc.audioEngine.resumeAll();
                    Laya.timer.scale = 1;
                }
            });
        }
        var adload = Advertisement.videoAd.load();

        // 调用then和catch之前需要对load的结果做下判空处理，防止出错（如果没有判空，在平台版本为1052以及以下的手机上将会出现错误）
        adload && adload.then(() => {
            console.log("激励视频广告加载成功");
        }).catch(err => {
            console.log("激励视频广告加载失败", err);
        });

        // __XCgs.call("playRewardAd")((err, ret) => {
        //     if (err) {
        //         // 播放失败
        //         // alert(err.message);
        //         // this.showTips('暂无视频，请稍后再试');
        //         Laya.timer.scale = 1;
        //         return;
        //     }
        //     // 播放成功，但是不代表用户看完了激励视频
        //     console.log(ret.status);
        //     if (ret.status == 1) {
        //         console.log("下发回调奖励");
        //         e && e()
        //         Laya.timer.scale = 1;
        //     } else {
        //         Laya.timer.scale = 1;
        //         // this.showTips('看完视频才能获得奖励');
        //     }
        // });
    }

}());
