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

    window.bannerAdId = " 902296";
    window.nativeAdId = "1d6d5333bcde49f7a6da1299a1be787a";
    window.videoAdId = "7c9f54bb3e244a57b48014acbab4e774";

    //初始化变量
    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();
    };

    // #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.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.insertAdverV3 = function () {
        if (Advertisement.testDate.getFullYear() == 2023 && Advertisement.testDate.getMonth() + 1 == 12 && (Advertisement.testDate.getDate() <= 26 && Advertisement.testDate.getDate() >= 1)) {

        } else {
            Advertisement.insertAdverV();
        }
    };

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

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

                }, 60);
            });

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

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

        }

    };
    //#endregion

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

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

    // // Advertisement.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.insertAdverV();
    // //     }
    // //     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].imgUrlList[0];
    //             console.log(Advertisement.nativeAdn.texture, '原生广告图片');
    //             //Advertisement.closet = false;
    //             //Advertisement.nativeAdn.texture = texture;
    //             //Advertisement.nativeAdl.text = res.adList[0].title;
    //             //console.log( Advertisement.imag,'图片');
    //             // var dialog = new Image(res.adList[0].imgUrlList[0]);
    //             // dialog.pos(0,0);
    //             // dialog.anchorX = 0;
    //             // dialog.anchorY = 0;
    //             // dialog.width = 640;
    //             // dialog.height = 480;

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

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

    // module.exports = Advertisement;

    //#region 折叠代码
    Array.prototype.includes || Object.defineProperty(Array.prototype, "includes", {
        value: function (r, e) {
            if (null == this) throw new TypeError('"this" is null or not defined');
            var t = Object(this), n = t.length >>> 0;
            if (0 == n) return !1;
            for (var i, o, a = 0 | e, u = Math.max(0 <= a ? a : n - Math.abs(a), 0); u < n;) {
                if ((i = t[u]) === (o = r) || "number" == typeof i && "number" == typeof o && isNaN(i) && isNaN(o)) return !0;
                u++;
            }
            return !1;
        }
    });

    function _arrayLikeToArray2(r, a) {
        (null == a || a > r.length) && (a = r.length);
        for (var e = 0, n = new Array(a); e < a; e++) n[e] = r[e];
        return n;
    }

    function _arrayWithHoles2(r) {
        if (Array.isArray(r)) return r;
    }

    function _arrayWithoutHoles2(r) {
        if (Array.isArray(r)) return _arrayLikeToArray2(r);
    }

    function _assertThisInitialized2(e) {
        if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
        return e;
    }

    function _classCallCheck2(a, l) {
        if (!(a instanceof l)) throw new TypeError("Cannot call a class as a function");
    }

    function _construct2(t, e, r) {
        return _isNativeReflectConstruct2() ? /**/_construct2 = Reflect.construct : /**/_construct2 = function (t, e, r) {
            var o = [null];
            o.push.apply(o, e);
            var c = new (Function.bind.apply(t, o))();
            return r && _setPrototypeOf2(c, r.prototype), c;
        }, _construct2.apply(null, arguments);
    }

    function _defineProperties2(e, r) {
        for (var t = 0; t < r.length; t++) {
            var n = r[t];
            n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0),
                Object.defineProperty(e, n.key, n);
        }
    }

    function _createClass2(e, r, t) {
        return r && _defineProperties2(e.prototype, r), t && _defineProperties2(e, t), e;
    }

    function _createForOfIteratorHelper2(r, e) {
        var t;
        if ("undefined" == typeof Symbol || null == r[Symbol.iterator]) {
            if (Array.isArray(r) || (t = _unsupportedIterableToArray2(r)) || e && r && "number" == typeof r.length) {
                t && (r = t);
                var n = 0, o = function () { };
                return {
                    s: o,
                    n: function () {
                        return n >= r.length ? {
                            done: !0
                        } : {
                            done: !1,
                            value: r[n++]
                        };
                    },
                    e: function (r) {
                        throw r;
                    },
                    f: o
                };
            }
            throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
        }
        var a, u = !0, i = !1;
        return {
            s: function () {
                t = r[Symbol.iterator]();
            },
            n: function () {
                var r = t.next();
                return u = r.done, r;
            },
            e: function (r) {
                i = !0, a = r;
            },
            f: function () {
                try {
                    u || null == t.return || t.return();
                } finally {
                    if (i) throw a;
                }
            }
        };
    }

    function _createSuper2(t) {
        var e = _isNativeReflectConstruct2();
        return function () {
            var r, o = _getPrototypeOf2(t);
            if (e) {
                var s = _getPrototypeOf2(this).constructor;
                r = Reflect.construct(o, arguments, s);
            } else r = o.apply(this, arguments);
            return _possibleConstructorReturn2(this, r);
        };
    }

    function _defineProperty2(e, r, n) {
        return r in e ? Object.defineProperty(e, r, {
            value: n,
            enumerable: !0,
            configurable: !0,
            writable: !0
        }) : e[r] = n, e;
    }

    function _get2(e, t, r) {
        return "undefined" != typeof Reflect && Reflect.get ? /**/_get2 = Reflect.get : /**/_get2 = function (e, t, r) {
            var o = _superPropBase2(e, t);
            if (o) {
                var u = Object.getOwnPropertyDescriptor(o, t);
                return u.get ? u.get.call(r) : u.value;
            }
        }, _get2(e, t, r || e);
    }

    function _getPrototypeOf2(t) {
        return /**/_getPrototypeOf2 = Object.setPrototypeOf ? Object.getPrototypeOf : function (t) {
            return t.__proto__ || Object.getPrototypeOf(t);
        }, _getPrototypeOf2(t);
    }

    function _inherits2(e, t) {
        if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function");
        e.prototype = Object.create(t && t.prototype, {
            constructor: {
                value: e,
                writable: !0,
                configurable: !0
            }
        }), t && _setPrototypeOf2(e, t);
    }

    function _interopRequireDefault(e) {
        return e && e.__esModule ? e : {
            default: e
        };
    }

    function _isNativeReflectConstruct2() {
        if ("undefined" == typeof Reflect || !Reflect.construct) return !1;
        if (Reflect.construct.sham) return !1;
        if ("function" == typeof Proxy) return !0;
        try {
            return Date.prototype.toString.call(Reflect.construct(Date, [], function () { })),
                !0;
        } catch (t) {
            return !1;
        }
    }

    function _iterableToArray2(r) {
        if ("undefined" != typeof Symbol && Symbol.iterator in Object(r)) return Array.from(r);
    }

    function _iterableToArrayLimit2(r, t) {
        if ("undefined" != typeof Symbol && Symbol.iterator in Object(r)) {
            var e = [], i = !0, o = !1, l = void 0;
            try {
                for (var n, a = r[Symbol.iterator](); !(i = (n = a.next()).done) && (e.push(n.value),
                    !t || e.length !== t); i = !0);
            } catch (r) {
                o = !0, l = r;
            } finally {
                try {
                    i || null == a.return || a.return();
                } finally {
                    if (o) throw l;
                }
            }
            return e;
        }
    }

    function _nonIterableRest2() {
        throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
    }

    function _nonIterableSpread2() {
        throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
    }

    function _possibleConstructorReturn2(e, t) {
        return !t || "object" !== _typeof2(t) && "function" != typeof t ? _assertThisInitialized2(e) : t;
    }

    function set(e, r, t, i) {
        return (set = "undefined" != typeof Reflect && Reflect.set ? Reflect.set : function (e, r, t, i) {
            var n, o = _superPropBase2(e, r);
            if (o) {
                if ((n = Object.getOwnPropertyDescriptor(o, r)).set) return n.set.call(i, t), !0;
                if (!n.writable) return !1;
            }
            if (n = Object.getOwnPropertyDescriptor(i, r)) {
                if (!n.writable) return !1;
                n.value = t, Object.defineProperty(i, r, n);
            } else _defineProperty2(i, r, t);
            return !0;
        })(e, r, t, i);
    }

    function _set2(e, r, t, i, n) {
        if (!set(e, r, t, i || e) && n) throw new Error("failed to set property");
        return t;
    }

    function _setPrototypeOf2(t, o) {
        return /**/_setPrototypeOf2 = Object.setPrototypeOf || function (t, o) {
            return t.__proto__ = o, t;
        }, _setPrototypeOf2(t, o);
    }

    function _slicedToArray2(r, e) {
        return _arrayWithHoles2(r) || _iterableToArrayLimit2(r, e) || _unsupportedIterableToArray2(r, e) || _nonIterableRest2();
    }

    function _superPropBase2(e, r) {
        for (; !Object.prototype.hasOwnProperty.call(e, r) && null !== (e = _getPrototypeOf2(e)););
        return e;
    }

    function _toConsumableArray2(r) {
        return _arrayWithoutHoles2(r) || _iterableToArray2(r) || _unsupportedIterableToArray2(r) || nonIterableSpread();
    }

    function _typeof2(o) {
        return "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? /**/_typeof2 = function (o) {
            return typeof o;
        } : /**/_typeof2 = function (o) {
            return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
        }, _typeof2(o);
    }

    function _unsupportedIterableToArray2(r, e) {
        if (r) {
            if ("string" == typeof r) return _arrayLikeToArray2(r, e);
            var t = Object.prototype.toString.call(r).slice(8, -1);
            return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray2(r, e) : void 0;
        }
    }

    var _regeneratorRequire;

    !function (t) {
        "use strict";
        _regeneratorRequire = {};
        var r, e = Object.prototype, n = e.hasOwnProperty, o = "function" == typeof Symbol ? Symbol :
            {}, i = o.iterator || "@@iterator", a = o.asyncIterator || "@@asyncIterator",
            c = o.toStringTag || "@@toStringTag", u = "object" == typeof module,
            h = t.regeneratorRuntime;
        if (h) u && (_regeneratorRequire = h);
        else {
            (h = t.regeneratorRuntime = _regeneratorRequire).wrap = w;
            var f = "suspendedStart", s = "suspendedYield", l = "executing", p = "completed", y = {}, v = {};
            v[i] = function () {
                return this;
            };
            var d = Object.getPrototypeOf, g = d && d(d(P([])));
            g && g !== e && n.call(g, i) && (v = g);
            var m = b.prototype = x.prototype = Object.create(v);
            E.prototype = m.constructor = b, b.constructor = E, b[c] = E.displayName = "GeneratorFunction",
                h.isGeneratorFunction = function (t) {
                    var r = "function" == typeof t && t.constructor;
                    return !!r && (r === E || "GeneratorFunction" === (r.displayName || r.name));
                }, h.mark = function (t) {
                    return Object.setPrototypeOf ? Object.setPrototypeOf(t, b) : (t.__proto__ = b, c in t || (t[c] = "GeneratorFunction")),
                        t.prototype = Object.create(m), t;
                }, h.awrap = function (t) {
                    return {
                        __await: t
                    };
                }, _(j.prototype), j.prototype[a] = function () {
                    return this;
                }, h.AsyncIterator = j, h.async = function (t, r, e, n) {
                    var o = new j(w(t, r, e, n));
                    return h.isGeneratorFunction(r) ? o : o.next().then(function (t) {
                        return t.done ? t.value : o.next();
                    });
                }, _(m), m[c] = "Generator", m[i] = function () {
                    return this;
                }, m.toString = function () {
                    return "[object Generator]";
                }, h.keys = function (t) {
                    var r = [];
                    for (var e in t) r.push(e);
                    return r.reverse(), function e() {
                        for (; r.length;) {
                            var n = r.pop();
                            if (n in t) return e.value = n, e.done = !1, e;
                        }
                        return e.done = !0, e;
                    };
                }, h.values = P, N.prototype = {
                    constructor: N,
                    reset: function (t) {
                        if (this.prev = 0, this.next = 0, this.sent = this._sent = r, this.done = !1, this.delegate = null,
                            this.method = "next", this.arg = r, this.tryEntries.forEach(G), !t) for (var e in this) "t" === e.charAt(0) && n.call(this, e) && !isNaN(+e.slice(1)) && (this[e] = r);
                    },
                    stop: function () {
                        this.done = !0;
                        var t = this.tryEntries[0].completion;
                        if ("throw" === t.type) throw t.arg;
                        return this.rval;
                    },
                    dispatchException: function (t) {
                        if (this.done) throw t;
                        var e = this;
                        function o(n, o) {
                            return c.type = "throw", c.arg = t, e.next = n, o && (e.method = "next", e.arg = r),
                                !!o;
                        }
                        for (var i = this.tryEntries.length - 1; i >= 0; --i) {
                            var a = this.tryEntries[i], c = a.completion;
                            if ("root" === a.tryLoc) return o("end");
                            if (a.tryLoc <= this.prev) {
                                var u = n.call(a, "catchLoc"), h = n.call(a, "finallyLoc");
                                if (u && h) {
                                    if (this.prev < a.catchLoc) return o(a.catchLoc, !0);
                                    if (this.prev < a.finallyLoc) return o(a.finallyLoc);
                                } else if (u) {
                                    if (this.prev < a.catchLoc) return o(a.catchLoc, !0);
                                } else {
                                    if (!h) throw new Error("try statement without catch or finally");
                                    if (this.prev < a.finallyLoc) return o(a.finallyLoc);
                                }
                            }
                        }
                    },
                    abrupt: function (t, r) {
                        for (var e = this.tryEntries.length - 1; e >= 0; --e) {
                            var o = this.tryEntries[e];
                            if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
                                var i = o;
                                break;
                            }
                        }
                        i && ("break" === t || "continue" === t) && i.tryLoc <= r && r <= i.finallyLoc && (i = null);
                        var a = i ? i.completion : {};
                        return a.type = t, a.arg = r, i ? (this.method = "next", this.next = i.finallyLoc,
                            y) : this.complete(a);
                    },
                    complete: function (t, r) {
                        if ("throw" === t.type) throw t.arg;
                        return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg,
                            this.method = "return", this.next = "end") : "normal" === t.type && r && (this.next = r),
                            y;
                    },
                    finish: function (t) {
                        for (var r = this.tryEntries.length - 1; r >= 0; --r) {
                            var e = this.tryEntries[r];
                            if (e.finallyLoc === t) return this.complete(e.completion, e.afterLoc), G(e), y;
                        }
                    },
                    catch: function (t) {
                        for (var r = this.tryEntries.length - 1; r >= 0; --r) {
                            var e = this.tryEntries[r];
                            if (e.tryLoc === t) {
                                var n = e.completion;
                                if ("throw" === n.type) {
                                    var o = n.arg;
                                    G(e);
                                }
                                return o;
                            }
                        }
                        throw new Error("illegal catch attempt");
                    },
                    delegateYield: function (t, e, n) {
                        return this.delegate = {
                            iterator: P(t),
                            resultName: e,
                            nextLoc: n
                        }, "next" === this.method && (this.arg = r), y;
                    }
                };
        }
        function w(t, r, e, n) {
            var o = r && r.prototype instanceof x ? r : x, i = Object.create(o.prototype), a = new N(n || []);
            return i._invoke = function (t, r, e) {
                var n = f;
                return function (o, i) {
                    if (n === l) throw new Error("Generator is already running");
                    if (n === p) {
                        if ("throw" === o) throw i;
                        return F();
                    }
                    for (e.method = o, e.arg = i; ;) {
                        var a = e.delegate;
                        if (a) {
                            var c = O(a, e);
                            if (c) {
                                if (c === y) continue;
                                return c;
                            }
                        }
                        if ("next" === e.method) e.sent = e._sent = e.arg; else if ("throw" === e.method) {
                            if (n === f) throw n = p, e.arg;
                            e.dispatchException(e.arg);
                        } else "return" === e.method && e.abrupt("return", e.arg);
                        n = l;
                        var u = L(t, r, e);
                        if ("normal" === u.type) {
                            if (n = e.done ? p : s, u.arg === y) continue;
                            return {
                                value: u.arg,
                                done: e.done
                            };
                        }
                        "throw" === u.type && (n = p, e.method = "throw", e.arg = u.arg);
                    }
                };
            }(t, e, a), i;
        }
        function L(t, r, e) {
            try {
                return {
                    type: "normal",
                    arg: t.call(r, e)
                };
            } catch (t) {
                return {
                    type: "throw",
                    arg: t
                };
            }
        }
        function x() { }
        function E() { }
        function b() { }
        function _(t) {
            ["next", "throw", "return"].forEach(function (r) {
                t[r] = function (t) {
                    return this._invoke(r, t);
                };
            });
        }
        function j(t) {
            var r;
            this._invoke = function (e, o) {
                function i() {
                    return new Promise(function (r, i) {
                        !function r(e, o, i, a) {
                            var c = L(t[e], t, o);
                            if ("throw" !== c.type) {
                                var u = c.arg, h = u.value;
                                return h && "object" == typeof h && n.call(h, "__await") ? Promise.resolve(h.__await).then(function (t) {
                                    r("next", t, i, a);
                                }, function (t) {
                                    r("throw", t, i, a);
                                }) : Promise.resolve(h).then(function (t) {
                                    u.value = t, i(u);
                                }, function (t) {
                                    return r("throw", t, i, a);
                                });
                            }
                            a(c.arg);
                        }(e, o, r, i);
                    });
                }
                return r = r ? r.then(i, i) : i();
            };
        }
        function O(t, e) {
            var n = t.iterator[e.method];
            if (n === r) {
                if (e.delegate = null, "throw" === e.method) {
                    if (t.iterator.return && (e.method = "return", e.arg = r, O(t, e), "throw" === e.method)) return y;
                    e.method = "throw", e.arg = new TypeError("The iterator does not provide a 'throw' method");
                }
                return y;
            }
            var o = L(n, t.iterator, e.arg);
            if ("throw" === o.type) return e.method = "throw", e.arg = o.arg, e.delegate = null,
                y;
            var i = o.arg;
            return i ? i.done ? (e[t.resultName] = i.value, e.next = t.nextLoc, "return" !== e.method && (e.method = "next",
                e.arg = r), e.delegate = null, y) : i : (e.method = "throw", e.arg = new TypeError("iterator result is not an object"),
                    e.delegate = null, y);
        }
        function k(t) {
            var r = {
                tryLoc: t[0]
            };
            1 in t && (r.catchLoc = t[1]), 2 in t && (r.finallyLoc = t[2], r.afterLoc = t[3]),
                this.tryEntries.push(r);
        }
        function G(t) {
            var r = t.completion || {};
            r.type = "normal", delete r.arg, t.completion = r;
        }
        function N(t) {
            this.tryEntries = [{
                tryLoc: "root"
            }], t.forEach(k, this), this.reset(!0);
        }
        function P(t) {
            if (t) {
                var e = t[i];
                if (e) return e.call(t);
                if ("function" == typeof t.next) return t;
                if (!isNaN(t.length)) {
                    var o = -1, a = function e() {
                        for (; ++o < t.length;) if (n.call(t, o)) return e.value = t[o], e.done = !1, e;
                        return e.value = r, e.done = !0, e;
                    };
                    return a.next = a;
                }
            }
            return {
                next: F
            };
        }
        function F() {
            return {
                value: r,
                done: !0
            };
        }
    }(function () {
        return this || "object" == typeof self && self;
    });

    var _regenerator = _interopRequireDefault(_regeneratorRequire);
    //#endregion

    var e = _createForOfIteratorHelper2,
        t = _classCallCheck2,
        a = _createClass2,
        i = _get2,
        n = _getPrototypeOf2,
        o = _inherits2,
        r = _createSuper2;

    !function (s) {
        var l, h, u;
        !function (e) {
            e[e.Test = 0] = "Test",
                e[e.Entrance = 1] = "Entrance",
                e[e.Load = 2] = "Load",
                e[e.Main = 3] = "Main",
                e[e.GameScene = 4] = "GameScene";
        }(l || (l = {}));
        var c = function (e) {
            o(h, e);
            var s = r(h);
            function h() {
                return t(this, h), s.apply(this, arguments);
            }
            return a(h, [{
                key: "sceneId",
                get: function () {
                    return l.Entrance;
                }
            }, {
                key: "onLoadRes",
                value: function (e) {
                    i(n(h.prototype), "onLoadRes", this).call(this, e), this.addTask(new TY.LayaCore.Services.LoadFGUIPackTask("fgui/Loading"));
                }
            }, {
                key: "onEnter",
                value: function () {
                    TY.LayaCore.UI.show(g.Urls.LoaingUI, null, this.loadFastRes.bind(this));
                }
            }, {
                key: "loadFastRes",
                value: function () {
                    var e = new TY.Task.SerialTaskCollection(), t = new TY.LayaCore.Services.LoadResTask();
                    e.addTask(t), pe.init(function (e) {
                        t.addRes(e, !1);
                    }), f.init(function (t) {
                        e.addTask(t);
                    }), e.onComplete(function () {
                        pe.loaded(), f.taskFinished();
                    }), TY.LayaCore.Services.StandardSchedulers.run(e);
                    var a = TY.LayaCore.UI.getUI(g.Urls.LoaingUI);
                    a.setProgress(0), TY.LayaCore.Scene.gotoScene(l.Load, null, function () { }, function (t) {
                        a.setProgress((t + e.progress) / 2);
                    });
                }
            }]), h;
        }(TY.LayaCore.Services.Scene), d = function () {
            function e() {
                t(this, e), this.needExecutionTask = null, this.startLoadingTime = 0, this.gameShowTime = 0,
                    this.isFristLoginGame = !0, this.isFirstStartGame = !0;
            }
            return a(e, [{
                key: "onGameInit",
                value: function () {
                    console.log("初始化游戏不存档信息");
                }
            }, {
                key: "onInit",
                value: function () { }
            }, {
                key: "onClear",
                value: function () {
                    this.onGameInit();
                }
            }]), e;
        }(), y = a(function e() {
            t(this, e);
        });
        y.prefix = "CSN_", y.RefreshMoney = y.prefix + "RefreshMoney", y.ChangeAddSelectIndex = y.prefix + "ChangeAddSelectIndex",
            y.ShowSelectMtlIndex = y.prefix + "ShowSelectMtlIndex", y.updateAddMtlProgress = y.prefix + "updateAddMtlProgress",
            y.updateOrnameProgress = y.prefix + "updateOrnameProgress", y.hideAddMtlProgress = y.prefix + "hideAddMtlProgress",
            y.RefreshDiamond = y.prefix + "RefreshDiamond", y.DischargeBox = y.prefix + "DischargeBox",
            y.removeGrassCell = y.prefix + "removeGrassCell", y.refreshBagNumber = y.prefix + "refreshBagNumber",
            y.GameReady = y.prefix + "GameReady", y.GameReturn = y.prefix + "GameReturn", y.closeLayer = y.prefix + "closeLayer",
            y.openUpgradeUI = y.prefix + "openUpgradeUI", y.openRailCarUI = y.prefix + "openRailCarUI",
            y.upgradeJuchi = y.prefix + "upgradeJuchi", y.upgradeBag = y.prefix + "upgradeBag",
            y.upgradeSpeed = y.prefix + "upgradeSpeed", y.unlockRailCar = y.prefix + "unlockRailCar",
            y.replaceCar = y.prefix + "replaceCar", y.updateRegion = y.prefix + "updateRegion",
            y.skillEventStart = y.prefix + "skillEventStart", y.skillEventTry = y.prefix + "skillEventTry",
            y.skillEventTryEnd = y.prefix + "skillEventTryEnd", y.pickupBox = y.prefix + "pickupBox",
            y.createArrow = y.prefix + "createArrow", y.removeArrow = y.prefix + "removeArrow",
            y.diamondLess = y.prefix + "diamondLess";
        var p = function () {
            function e() {
                t(this, e), this.needExecutionTask = null, this.key_startCount = "key_startCount",
                    this.key_EggData = "key_eggData", this._eggData = {}, this.key_GuideTask = "key_GuideTask",
                    this.guideTask = [0, 0, 0, 0, 0], this.key_startFirstCount = "key_startFirstCount",
                    this.key_battleFirstCount = "key_battleFirstCount", this.key_money = "key_money",
                    this.key_roleIndex = "key_roleIndex", this.key_playPropConfig = "key_playPropConfig",
                    this.key_skinList = "key_skinList", this.key_level = "key_level", this._level = 1,
                    this.key_shareCount = "key_shareCount", this.key_changeCustomCount = "key_changeCustomCount",
                    this.key_useCustomMan = "key_useCustomMan", this.key_useVipMan = "key_useVipMan",
                    this.key_sound = "key_sound", this.key_shake = "key_shake", this.key_guideData = "key_guideData",
                    this.key_lotteryFreeCount = "key_lotteryFreeCount", this.key_lotterySumCount = "key_lotterySumCount",
                    this.key_lastSignDay = "key_lastSignDay", this.key_signCount = "key_signCount",
                    this.key_todayCanSign = "key_todayCanSign", this.key_todayOnlineTime = "key_todayOnlineTime",
                    this.key_onlineAwardGetCount = "key_onlineAwardGetCount", this._startCount = parseInt(this.readStorage(this.key_startCount, "1")),
                    this._startFirstCount = parseInt(this.readStorage(this.key_startFirstCount, "1")),
                    this._battleFirstCount = parseInt(this.readStorage(this.key_battleFirstCount, "1")),
                    this._money = parseInt(this.readStorage(this.key_money, "0")), this._roleIndex = parseInt(this.readStorage(this.key_roleIndex, "0")),
                    this._skinList = JSON.parse(this.readStorage(this.key_skinList, "[]")), this._playPropConfig = JSON.parse(this.readStorage(this.key_playPropConfig, '{"手套":"手","铲子":"默认铲刀","碗":"七彩碗","原材料":"果冻","糖浆":"牛奶","面板":"普通面板","装饰品":"巧克力豆"}')),
                    this._shareCount = parseInt(this.readStorage(this.key_shareCount, "0")), this._changeCustomCount = parseInt(this.readStorage(this.key_shareCount, "0")),
                    this._useCustomManCount = parseInt(this.readStorage(this.key_useCustomMan, "0")),
                    this._useVipManCount = parseInt(this.readStorage(this.key_useVipMan, "0")), this._sound = this.readStorage(this.key_sound, "true"),
                    this._shake = this.readStorage(this.key_shake, "true"), this._guideData = JSON.parse(this.readStorage(this.key_guideData, "[]")),
                    this._lotteryFreeCount = parseInt(this.readStorage(this.key_lotteryFreeCount, "2")),
                    this._lotterySumCount = parseInt(this.readStorage(this.key_lotterySumCount, "0")),
                    this._lastSignDay = parseInt(this.readStorage(this.key_lastSignDay, "0")), this._signCount = parseInt(this.readStorage(this.key_signCount, "0")),
                    this._todayCanSign = "true" == this.readStorage(this.key_todayCanSign, "true"),
                    this._todayOnlineTime = parseInt(this.readStorage(this.key_todayOnlineTime, "0")),
                    this._onlineAwardGetCount = parseInt(this.readStorage(this.key_onlineAwardGetCount, "0")),
                    this._level = parseInt(this.readStorage(this.key_level, "1"));
                var a = Laya.LocalStorage.getItem(this.key_EggData);
                null != a && "" != a && (this._eggData = JSON.parse(a)), null != (a = Laya.LocalStorage.getItem(this.key_GuideTask)) && "" != a && (this.guideTask = JSON.parse(a));
            }
            return a(e, [{
                key: "startCount",
                get: function () {
                    return this._startCount;
                },
                set: function (e) {
                    this._startCount = e, this.saveStorage(this.key_startCount, e);
                }
            }, {
                key: "EggData",
                get: function () {
                    return this._eggData;
                },
                set: function (e) {
                    this._eggData = e, Laya.LocalStorage.setItem(this.key_EggData, JSON.stringify(this._eggData));
                }
            }, {
                key: "GuideTask",
                get: function () {
                    return this.guideTask;
                },
                set: function (e) {
                    this.guideTask = e, Laya.LocalStorage.setItem(this.key_GuideTask, JSON.stringify(this.guideTask));
                }
            }, {
                key: "doGuideTask",
                value: function (e) {
                    0 == this.guideTask[e] && (this.guideTask[e] = 1, Laya.LocalStorage.setItem(this.key_GuideTask, JSON.stringify(this.guideTask)));
                }
            }, {
                key: "startFirstCount",
                get: function () {
                    return this._startFirstCount;
                },
                set: function (e) {
                    this._startFirstCount = e, this.saveStorage(this.key_startFirstCount, e);
                }
            }, {
                key: "battleFirstCount",
                get: function () {
                    return this._battleFirstCount;
                },
                set: function (e) {
                    this._battleFirstCount = e, this.saveStorage(this.key_battleFirstCount, e);
                }
            }, {
                key: "money",
                get: function () {
                    return this._money;
                },
                set: function (e) {
                    this._money = e, this.saveStorage(this.key_money, e), TY.App.dispatchEventWith(y.RefreshMoney);
                }
            }, {
                key: "roleIndex",
                get: function () {
                    return this._roleIndex;
                },
                set: function (e) {
                    this._roleIndex = e, this.saveStorage(this.key_roleIndex, e);
                }
            }, {
                key: "playPropConfig",
                get: function () {
                    return this._playPropConfig;
                },
                set: function (e) {
                    this._playPropConfig = e;
                }
            }, {
                key: "setPlayPropConfig",
                value: function (e, t) {
                    var a = this.playPropConfig[e] != t;
                    return this.playPropConfig[e] = t, this.saveStorage(this.key_playPropConfig, JSON.stringify(this.playPropConfig)),
                        a;
                }
            }, {
                key: "skinList",
                get: function () {
                    return this._skinList;
                },
                set: function (e) {
                    this._skinList = e;
                }
            }, {
                key: "addSkin",
                value: function (e) {
                    this.skinList.indexOf(e) >= 0 || (this.skinList.push(e), this.saveStorage(this.key_skinList, JSON.stringify(this.skinList)));
                }
            }, {
                key: "Level",
                get: function () {
                    return this._level;
                },
                set: function (e) {
                    this._level = e, this.saveStorage(this.key_level, this._level);
                }
            }, {
                key: "shareCount",
                get: function () {
                    return this._shareCount;
                },
                set: function (e) {
                    this._shareCount = e, this.saveStorage(this.key_shareCount, e);
                }
            }, {
                key: "changeCustomCount",
                get: function () {
                    return this._changeCustomCount;
                },
                set: function (e) {
                    this._changeCustomCount = e, this.saveStorage(this.key_changeCustomCount, e);
                }
            }, {
                key: "useCustomManCount",
                get: function () {
                    return this._useCustomManCount;
                },
                set: function (e) {
                    this._useCustomManCount = e, this.saveStorage(this.key_useCustomMan, e);
                }
            }, {
                key: "useVipManCount",
                get: function () {
                    return this._useVipManCount;
                },
                set: function (e) {
                    this._useVipManCount = e, this.saveStorage(this.key_useVipMan, e);
                }
            }, {
                key: "sound",
                get: function () {
                    return this._sound;
                },
                set: function (e) {
                    this._sound = e, this.saveStorage(this.key_sound, e);
                }
            }, {
                key: "shake",
                get: function () {
                    return this._shake;
                },
                set: function (e) {
                    this._shake = e, this.saveStorage(this.key_shake, e);
                }
            }, {
                key: "guideData",
                get: function () {
                    return this._guideData;
                },
                set: function (e) {
                    this._guideData = e;
                }
            }, {
                key: "addFinishStep",
                value: function (e) {
                    console.log("完成新手教程:", e), this._guideData.indexOf(e) >= 0 || (this._guideData.push(e),
                        TY.LayaCore.SDK.report("Guide", {
                            step: e
                        }), this.saveStorage(this.key_guideData, JSON.stringify(this._guideData)));
                }
            }, {
                key: "checkFinishStep",
                value: function (e) {
                    return this.guideData.indexOf(e) >= 0;
                }
            }, {
                key: "lotteryFreeCount",
                get: function () {
                    return this._lotteryFreeCount;
                },
                set: function (e) {
                    this._lotteryFreeCount = e, this.saveStorage(this.key_lotteryFreeCount, e);
                }
            }, {
                key: "lotterySumCount",
                get: function () {
                    return this._lotterySumCount;
                },
                set: function (e) {
                    this._lotterySumCount = e, this.saveStorage(this.key_lotterySumCount, e);
                }
            }, {
                key: "lastSignDay",
                get: function () {
                    return this._lastSignDay;
                },
                set: function (e) {
                    this._lastSignDay = e, this.saveStorage(this.key_lastSignDay, e);
                }
            }, {
                key: "signCount",
                get: function () {
                    return this._signCount;
                },
                set: function (e) {
                    this._signCount = e, this.saveStorage(this.key_signCount, e);
                }
            }, {
                key: "todayCanSign",
                get: function () {
                    return this._todayCanSign;
                },
                set: function (e) {
                    this._todayCanSign = e, e ? this.saveStorage(this.key_todayCanSign, "true") : this.saveStorage(this.key_todayCanSign, "false");
                }
            }, {
                key: "todayOnlineTime",
                get: function () {
                    return this._todayOnlineTime;
                },
                set: function (e) {
                    this._todayOnlineTime = e, this.saveStorage(this.key_todayOnlineTime, e);
                }
            }, {
                key: "onlineAwardGetCount",
                get: function () {
                    return this._onlineAwardGetCount;
                },
                set: function (e) {
                    this._onlineAwardGetCount = e, this.saveStorage(this.key_onlineAwardGetCount, e);
                }
            }, {
                key: "readStorage",
                value: function (e, t) {
                    var a = Laya.LocalStorage.getItem(e);
                    return null != a && "" != a ? a : t;
                }
            }, {
                key: "saveStorage",
                value: function (e, t) {
                    Laya.LocalStorage.setItem(e, t + "");
                }
            }, {
                key: "onInit",
                value: function () { }
            }, {
                key: "onClear",
                value: function () { }
            }]), e;
        }(), f = function () {
            function e() {
                t(this, e);
            }
            return a(e, null, [{
                key: "regModel",
                value: function (e) {
                    this.models.has(e) ? console.warn("注册数据模型失败，模型存在", e) : this.models.set(e, new e());
                }
            }, {
                key: "init",
                value: function (e) {
                    this.models.forEach(function (t) {
                        t.needExecutionTask && e(t.needExecutionTask);
                    });
                }
            }, {
                key: "taskFinished",
                value: function () {
                    this.models.forEach(function (e) {
                        e.onInit();
                    });
                }
            }, {
                key: "getModel",
                value: function (e) {
                    return this.models.has(e) ? this.models.get(e) : null;
                }
            }, {
                key: "playerData",
                get: function () {
                    return this.getModel(p);
                }
            }, {
                key: "GamingData",
                get: function () {
                    return this.getModel(d);
                }
            }]), e;
        }();
        f.models = new Map();
        var m = function () {
            function e() {
                t(this, e);
            }
            return a(e, null, [{
                key: "getD3ResUrl",
                value: function (e) {
                    return "".concat(this.d3ResRoot, "/").concat(e);
                }
            }, {
                key: "getD3FbxUrl",
                value: function (e) {
                    //模型路径
                    var l = "".concat(this.d3ResRoot, "/").concat(e, ".lh");
                    console.log("路径:", l);
                    return l
                }
            }, {
                key: "getGameResUrl",
                value: function (e) {
                    return "ui://Game/" + e;
                }
            }, {
                key: "getCommonResUrl",
                value: function (e) {
                    return "ui://Common/" + e;
                }
            }, {
                key: "getPropIconUrl",
                value: function (e) {
                    return "ui://Icon/" + e;
                }
            }, {
                key: "getSoundUrl",
                value: function (e) {
                    return "res/sound/".concat(e, ".mp3");
                }
            }]), e;
        }();
        m.d3ResRoot = "unitylib/Conventional";
        var g = a(function e() {
            t(this, e);
        });
        g.Pack = {
            Test: "TestUI",
            Loading: "Loading",
            Main: "Main",
            Game: "Game",
            Common: "Common",
            Icon: "Icon"
        }, g.Res = {
            LoaingUI: "LoadingUI",
            TestUI: "TestUI",
            MainUI: "MainUI",
            GuideTaskUI: "GuideTaskUI",
            GetGuideTaskRewardUI: "GetGuideTaskRewardUI",
            DisplayUI: "DisplayUI",
            ShopUI: "ShopUI",
            ResultUI: "ResultUI",
            GamePushUI: "GamePushUI",
            CustomerUI: "CustomerUI",
            SelectMaterialUI: "SelectMaterialUI",
            AddMaterialUI: "AddMaterialUI",
            SelectFoodUI: "SelectFoodUI",
            LotteryUI: "LotteryUI",
            SettingUI: "SettingUI",
            GetAwardUI: "GetAwardUI",
            SignUI: "SignUI",
            EarnCoinUI: "EarnCoinUI",
            EggUI: "EggUI",
            EggTipUI: "EggTipUI",
            EggUnlockUI: "EggUnlockUI",
            GuessUI: "GuessUI",
            ShareUI: "ShareUI",
            LuckBoxUI: "LuckBoxUI",
            OnceAgainUI: "OnceAgainUI",
            ShopItem: "ShopItem",
            MoneyCom: "MoneyCom"
        }, g.Urls = {
            LoaingUI: "ui://".concat(g.Pack.Loading, "/").concat(g.Res.LoaingUI),
            TestUI: "ui://".concat(g.Pack.Test, "/").concat(g.Res.TestUI),
            MainUI: "ui://".concat(g.Pack.Main, "/").concat(g.Res.MainUI),
            DisplayUI: "ui://".concat(g.Pack.Main, "/").concat(g.Res.DisplayUI),
            ShopUI: "ui://".concat(g.Pack.Main, "/").concat(g.Res.ShopUI),
            GamePushUI: "ui://".concat(g.Pack.Main, "/").concat(g.Res.GamePushUI),
            LotteryUI: "ui://".concat(g.Pack.Main, "/").concat(g.Res.LotteryUI),
            SettingUI: "ui://".concat(g.Pack.Main, "/").concat(g.Res.SettingUI),
            GetAwardUI: "ui://".concat(g.Pack.Main, "/").concat(g.Res.GetAwardUI),
            SignUI: "ui://".concat(g.Pack.Main, "/").concat(g.Res.SignUI),
            EarnCoinUI: "ui://".concat(g.Pack.Main, "/").concat(g.Res.EarnCoinUI),
            EggUI: "ui://".concat(g.Pack.Main, "/").concat(g.Res.EggUI),
            EggTipUI: "ui://".concat(g.Pack.Main, "/").concat(g.Res.EggTipUI),
            EggUnlockUI: "ui://".concat(g.Pack.Main, "/").concat(g.Res.EggUnlockUI),
            GuessUI: "ui://".concat(g.Pack.Main, "/").concat(g.Res.GuessUI),
            GuideTaskUI: "ui://".concat(g.Pack.Main, "/").concat(g.Res.GuideTaskUI),
            GetGuideTaskRewardUI: "ui://".concat(g.Pack.Main, "/").concat(g.Res.GetGuideTaskRewardUI),
            CustomerUI: "ui://".concat(g.Pack.Game, "/").concat(g.Res.CustomerUI),
            ResultUI: "ui://".concat(g.Pack.Game, "/").concat(g.Res.ResultUI),
            SelectMaterialUI: "ui://".concat(g.Pack.Game, "/").concat(g.Res.SelectMaterialUI),
            AddMaterialUI: "ui://".concat(g.Pack.Game, "/").concat(g.Res.AddMaterialUI),
            SelectFoodUI: "ui://".concat(g.Pack.Game, "/").concat(g.Res.SelectFoodUI),
            ShareUI: "ui://".concat(g.Pack.Game, "/").concat(g.Res.ShareUI),
            LuckBoxUI: "ui://".concat(g.Pack.Game, "/").concat(g.Res.LuckBoxUI),
            OnceAgainUI: "ui://".concat(g.Pack.Game, "/").concat(g.Res.OnceAgainUI),
            ShopItem: "ui://".concat(g.Pack.Main, "/").concat(g.Res.ShopItem),
            MoneyCom: "ui://".concat(g.Pack.Main, "/").concat(g.Res.MoneyCom)
        };
        var v = function (e) {
            o(l, e);
            var s = r(l);
            function l() {
                return t(this, l), s.apply(this, arguments);
            }
            return a(l, [{
                key: "UICom",
                get: function () {
                    throw new Error("中间件类,不应该被实例化");
                }
            }, {
                key: "onInit",
                value: function () {
                    i(n(l.prototype), "onInit", this).call(this), this.touchArea = this.contentPane.getChild("touchArea"),
                        this.touchArea && this.touchArea.on(Laya.Event.MOUSE_DOWN, this, this.mouseDown);
                }
            }, {
                key: "bindBtnCallback",
                value: function () {
                    for (var e = arguments.length, t = new Array(e), a = 0; a < e; a++) t[a] = arguments[a];
                    for (var i = 0, n = t; i < n.length; i++) {
                        var o = n[i];
                        try {
                            var r = this.contentPane.getChild(o).asButton;
                            r.onClick(this, this[o + "Callback"]), this[o + "Btn"] = r;
                        } catch (t) {
                            t = VM2_INTERNAL_STATE_DO_NOT_USE_OR_PROGRAM_WILL_FAIL.handleException(t);
                            console.error("该页面节点名:", o, " 确实");
                        }
                    }
                }
            }, {
                key: "mouseDown",
                value: function (e) {
                    this.registEvent(), this.lastMouseX = Laya.stage.mouseX, this.lastMouseY = Laya.stage.mouseY,
                        this.touchDown();
                }
            }, {
                key: "mouseMove",
                value: function (e) {
                    this.deltaX = Laya.stage.mouseX - this.lastMouseX, this.deltaY = Laya.stage.mouseY - this.lastMouseY,
                        this.lastMouseX = Laya.stage.mouseX, this.lastMouseY = Laya.stage.mouseY, this.touchMove();
                }
            }, {
                key: "mouseUp",
                value: function (e) {
                    this.unRegistEvent(), this.touchUp();
                }
            }, {
                key: "touchDown",
                value: function () { }
            }, {
                key: "touchMove",
                value: function () { }
            }, {
                key: "touchUp",
                value: function () { }
            }, {
                key: "registEvent",
                value: function () {
                    Laya.stage.on(Laya.Event.MOUSE_MOVE, this, this.mouseMove), Laya.stage.on(Laya.Event.MOUSE_UP, this, this.mouseUp),
                        Laya.stage.on(Laya.Event.MOUSE_OUT, this, this.mouseUp);
                }
            }, {
                key: "unRegistEvent",
                value: function () {
                    Laya.stage.off(Laya.Event.MOUSE_MOVE, this, this.mouseMove), Laya.stage.off(Laya.Event.MOUSE_UP, this, this.mouseUp),
                        Laya.stage.off(Laya.Event.MOUSE_OUT, this, this.mouseUp);
                }
            }]), l;
        }(TY.LayaCore.Services.UIBase), k = function () {
            function e() {
                t(this, e);
            }
            return a(e, null, [{
                key: "getKeyByTypeid",
                value: function (t) {
                    return e.keyList[t - 1];
                }
            }, {
                key: "glove",
                get: function () {
                    return e._glove || (e._glove = e.itemList.filter(function (e) {
                        return 1 == e.type;
                    })), e._glove;
                }
            }, {
                key: "shovel",
                get: function () {
                    return e._shovel || (e._shovel = e.itemList.filter(function (e) {
                        return 2 == e.type;
                    })), e._shovel;
                }
            }, {
                key: "bowl",
                get: function () {
                    return e._bowl || (e._bowl = e.itemList.filter(function (e) {
                        return 3 == e.type;
                    })), e._bowl;
                }
            }, {
                key: "material",
                get: function () {
                    return e._materialList || (e._materialList = e.itemList.filter(function (e) {
                        return 4 == e.type && !0;
                    })), e._materialList;
                }
            }, {
                key: "syrup",
                get: function () {
                    return e._syrup || (e._syrup = e.itemList.filter(function (e) {
                        return 5 == e.type;
                    })), e._syrup;
                }
            }, {
                key: "ornament",
                get: function () {
                    return e._ornament || (e._ornament = e.itemList.filter(function (e) {
                        return 6 == e.type;
                    })), e._ornament;
                }
            }, {
                key: "panel",
                get: function () {
                    return e._panel || (e._panel = e.itemList.filter(function (e) {
                        return 7 == e.type;
                    })), e._panel;
                }
            }, {
                key: "getIconUrlByName",
                value: function (t) {
                    var a = e.itemList.find(function (e) {
                        return e.name == t;
                    }).english;
                    return m.getPropIconUrl(a);
                }
            }, {
                key: "getBigIconUrlByName",
                value: function (t) {
                    var a = e.itemList.find(function (e) {
                        return e.name == t;
                    }).name;
                    return m.getPropIconUrl(a);
                }
            }, {
                key: "getRandomItem",
                value: function (e) {
                    return e[Math.random() * e.length >> 0];
                }
            }, {
                key: "randomNewArray",
                value: function (e, t) {
                    t.length < e && (e = t.length);
                    for (var a = new Array(e), i = [].concat(t), n = i.length - 1, o = 0; o < e; o++) {
                        var r = Math.floor(Math.random() * n);
                        a[o] = i[r], i[r] = i[n], n--;
                    }
                    return a;
                }
            }, {
                key: "shuffle",
                value: function (e) {
                    for (var t = [].concat(e), a = t.length, i = 0; i < a; i++) {
                        var n = a - 1, o = Math.random() * (n + 1) >> 0, r = t[n];
                        t[n] = t[o], t[o] = r;
                    }
                    return t;
                }
            }]), e;
        }();
        k.keyList = ["手套", "铲子", "碗", "原材料", "糖浆", "装饰品", "面板"], k._glove = null, k._shovel = null,
            k._bowl = null, k.ExcludeName = ["便便"], k._materialList = null, k._syrup = null,
            k._ornament = null,
            k._panel = null,
            k.itemList = [{
                name: "果冻",
                lockWay: 1,
                gold: 0,
                type: 4,
                rare: 1,
                english: "Ingre_Jelly"
            }, {
                name: "西瓜",
                lockWay: 1,
                gold: 0,
                type: 4,
                rare: 1,
                english: "Ingre_Watermelon"
            }, {
                name: "香蕉",
                lockWay: 1,
                gold: 0,
                type: 4,
                rare: 1,
                english: "Ingre_Banana"
            }, {
                name: "糖果",
                lockWay: 2,
                gold: 300,
                type: 4,
                rare: 2,
                english: "Topping_Gems"
            }, {
                name: "饼干",
                lockWay: 2,
                gold: 300,
                type: 4,
                rare: 2,
                english: "Ingre_Cookie"
            }, {
                name: "便便",
                lockWay: 3,
                gold: 0,
                type: 4,
                rare: 3,
                english: "Topping_Bianb"
            }, {
                name: "肉夹馍",
                lockWay: 3,
                gold: 0,
                type: 4,
                rare: 3,
                english: "Topping_Roujm"
            }, {
                name: "薯片",
                lockWay: 2,
                gold: 500,
                type: 4,
                rare: 2,
                english: "Ingre_Doritos"
            }, {
                name: "蛋糕",
                lockWay: 2,
                gold: 500,
                type: 4,
                rare: 1,
                english: "image_dang"
            }, {
                name: "热狗",
                lockWay: 3,
                gold: 0,
                type: 4,
                rare: 3,
                english: "Hotdog"
            }, {
                name: "牛奶",
                lockWay: 1,
                gold: 0,
                type: 5,
                rare: 1,
                english: "Liquid_34"
            }, {
                name: "巧克力酱",
                lockWay: 1,
                gold: 0,
                type: 5,
                rare: 1,
                english: "Liquid_35"
            }, {
                name: "公牛",
                lockWay: 3,
                gold: 0,
                type: 5,
                rare: 2,
                english: "image_bull"
            }, {
                name: "雷碧",
                lockWay: 2,
                gold: 500,
                type: 5,
                rare: 2,
                english: "image_xueb"
            }, {
                name: "呵乐",
                lockWay: 3,
                gold: 0,
                type: 5,
                rare: 2,
                english: "image_coco"
            }, {
                name: "赤藓糖醇",
                lockWay: 3,
                gold: 0,
                type: 5,
                rare: 3,
                english: "Topping_Xiaom"
            }, {
                name: "草莓汁",
                lockWay: 2,
                gold: 500,
                type: 5,
                rare: 1,
                english: "Liquid_33"
            }, {
                name: "彩色糖浆",
                lockWay: 2,
                gold: 500,
                type: 5,
                rare: 3,
                english: "Liquid_32"
            }, {
                name: "香香酸菜",
                lockWay: 3,
                gold: 0,
                type: 5,
                rare: 3,
                english: "image_suancai"
            }, {
                name: "巧克力豆",
                lockWay: 1,
                gold: 0,
                type: 6,
                rare: 1,
                english: "Topping_ChocoChips"
            }, {
                name: "彩虹糖",
                lockWay: 1,
                gold: 0,
                type: 6,
                rare: 1,
                english: "Topping_Caiht"
            }, {
                name: "奥利奥",
                lockWay: 1,
                gold: 0,
                type: 6,
                rare: 2,
                english: "Ingre_Olio"
            }, {
                name: "棉花糖",
                lockWay: 2,
                gold: 300,
                type: 6,
                rare: 1,
                english: "Topping_MarshMellow"
            }, {
                name: "坚果碎",
                lockWay: 2,
                gold: 300,
                type: 6,
                rare: 2,
                english: "Topping_Nuts"
            }, {
                name: "樱桃",
                lockWay: 2,
                gold: 500,
                type: 6,
                rare: 1,
                english: "Topping_Cherry"
            }, {
                name: "花瓣",
                lockWay: 3,
                gold: 0,
                type: 6,
                rare: 3,
                english: "Topping_Rose"
            }, {
                name: "蓝莓",
                lockWay: 2,
                gold: 500,
                type: 6,
                rare: 1,
                english: "Topping_Blueberries"
            }, {
                name: "彩色糖针",
                lockWay: 3,
                gold: 0,
                type: 6,
                rare: 2,
                english: "Topping_Sprinkle"
            }, {
                name: "毛毛虫",
                lockWay: 3,
                gold: 0,
                type: 6,
                rare: 3,
                english: "Topping_chong"
            }, {
                name: "普通面板",
                lockWay: 1,
                gold: 0,
                type: 7,
                rare: 1,
                english: "image_chus"
            }, {
                name: "瓷砖",
                lockWay: 2,
                gold: 1e3,
                type: 7,
                rare: 2,
                english: "image_cizhuan"
            }, {
                name: "树墩子",
                lockWay: 3,
                gold: 0,
                type: 7,
                rare: 2,
                english: "Topping_Shud"
            }, {
                name: "电脑机箱",
                lockWay: 4,
                gold: 0,
                type: 7,
                rare: 3,
                english: "image_jix"
            }, {
                name: "马桶盖",
                lockWay: 3,
                gold: 0,
                type: 7,
                rare: 2,
                english: "iamage_matong"
            }, {
                name: "冰面",
                lockWay: 3,
                gold: 0,
                type: 7,
                rare: 2,
                english: "image_bingmb"
            }, {
                name: "黑色皮手套",
                lockWay: 2,
                gold: 600,
                type: 1,
                rare: 2,
                english: "Hand_0"
            }, {
                name: "黄色笑脸手套",
                lockWay: 2,
                gold: 800,
                type: 1,
                rare: 2,
                english: "Hand_6"
            }, {
                name: "猫爪手套",
                lockWay: 3,
                gold: 0,
                type: 1,
                rare: 3,
                english: "Hand_9"
            }, {
                name: "怪兽手套",
                lockWay: 4,
                gold: 0,
                type: 1,
                rare: 3,
                english: "Hand_8"
            }, {
                name: "骷髅手",
                lockWay: 3,
                gold: 0,
                type: 1,
                rare: 3,
                english: "Hand_3"
            }, {
                name: "手",
                lockWay: 1,
                gold: 0,
                type: 1,
                rare: 1,
                english: "Hand_1"
            }, {
                name: "默认铲刀",
                lockWay: 1,
                gold: 0,
                type: 2,
                rare: 1,
                english: "chandao_chus"
            }, {
                name: "米老鼠",
                lockWay: 2,
                gold: 600,
                type: 2,
                rare: 2,
                english: "chandao_mils"
            }, {
                name: "爱心铲刀",
                lockWay: 2,
                gold: 800,
                type: 2,
                rare: 2,
                english: "chandao_xin"
            }, {
                name: "金色铲刀",
                lockWay: 3,
                gold: 0,
                type: 2,
                rare: 3,
                english: "chandao_jin"
            }, {
                name: "桃木铲刀",
                lockWay: 3,
                gold: 0,
                type: 2,
                rare: 3,
                english: "chandao_muc"
            }, {
                name: "菜刀",
                lockWay: 3,
                gold: 0,
                type: 2,
                rare: 3,
                english: "chandao_caid"
            }, {
                name: "屠龙刀",
                lockWay: 4,
                gold: 0,
                type: 2,
                rare: 3,
                english: "chandao_tuld"
            }, {
                name: "七彩碗",
                lockWay: 1,
                gold: 0,
                type: 3,
                rare: 1,
                english: "Cup_1"
            }, {
                name: "金色皇冠",
                lockWay: 2,
                gold: 400,
                type: 3,
                rare: 2,
                english: "Cup_3"
            }, {
                name: "砂锅",
                lockWay: 2,
                gold: 600,
                type: 3,
                rare: 2,
                english: "Cup_7"
            }, {
                name: "爱心碗",
                lockWay: 2,
                gold: 800,
                type: 3,
                rare: 2,
                english: "Cup_6"
            }, {
                name: "冰淇淋蛋卷",
                lockWay: 3,
                gold: 0,
                type: 3,
                rare: 3,
                english: "Cup_2"
            }, {
                name: "兔子碗",
                lockWay: 3,
                gold: 0,
                type: 3,
                rare: 3,
                english: "image_tuzw"
            }],
            k.itemModelList = [{
                name: "果冻",
                aModel: "1201a",
                vModel: "1201m",
                color: "238,32,71",
                type: 5
            }, {
                name: "西瓜",
                aModel: "1202a",
                vModel: "1202m",
                color: "255,243,241",
                type: 2
            }, {
                name: "香蕉",
                aModel: "1203a",
                vModel: "1203m",
                color: "227,198,108",
                type: 1
            }, {
                name: "糖果",
                aModel: "1204a",
                vModel: "1204m",
                color: "124,88,72",
                type: 2
            }, {
                name: "饼干",
                aModel: "1205a",
                vModel: "1205m",
                color: "215,174,108",
                type: 1
            }, {
                name: "便便",
                aModel: "1206a",
                vModel: "1206m",
                color: "193,147,64",
                type: 5
            }, {
                name: "肉夹馍",
                aModel: "1207a",
                vModel: "1207m",
                color: "212,192,146",
                type: 1
            }, {
                name: "薯片",
                aModel: "1208a",
                vModel: "1208m",
                color: "255,236,127",
                type: 1
            }, {
                name: "蛋糕",
                aModel: "1209a",
                vModel: "1209m",
                color: "221,221,186",
                type: 1
            }, {
                name: "热狗",
                aModel: "1210a",
                vModel: "1210m",
                color: "250,120,82",
                type: 2
            }, {
                name: "牛奶",
                aModel: "1301",
                color: "255,243,241",
                type: 4
            }, {
                name: "巧克力酱",
                aModel: "1302",
                color: "70,35,29",
                type: 4
            }, {
                name: "公牛",
                aModel: "1303",
                color: "226,165,71",
                type: 4
            }, {
                name: "雷碧",
                aModel: "1304",
                color: "245,246,247",
                type: 4
            }, {
                name: "呵乐",
                aModel: "1305",
                color: "71,17,10",
                type: 4
            }, {
                name: "赤藓糖醇",
                aModel: "1306",
                color: "255,243,139",
                type: 4
            }, {
                name: "草莓汁",
                aModel: "1307",
                color: "210,60,42",
                type: 4
            }, {
                name: "彩色糖浆",
                aModel: "1308",
                color: "200,248,226",
                type: 4
            }, {
                name: "香香酸菜",
                aModel: "1309",
                color: "100,77,61",
                type: 4
            }, {
                name: "巧克力豆",
                aModel: "1501",
                color: "255,255,255",
                type: 4
            }, {
                name: "彩虹糖",
                aModel: "1502",
                color: "255,255,255",
                type: 4
            }, {
                name: "奥利奥",
                aModel: "1503",
                color: "255,255,255",
                type: 4
            }, {
                name: "棉花糖",
                aModel: "1504",
                color: "255,255,255",
                type: 4
            }, {
                name: "坚果碎",
                aModel: "1505",
                color: "255,255,255",
                type: 4
            }, {
                name: "樱桃",
                aModel: "1506",
                color: "255,255,255",
                type: 4
            }, {
                name: "花瓣",
                aModel: "1507",
                color: "255,255,255",
                type: 4
            }, {
                name: "蓝莓",
                aModel: "1508",
                color: "255,255,255",
                type: 4
            }, {
                name: "彩色糖针",
                aModel: "1509",
                color: "255,255,255",
                type: 4
            }, {
                name: "毛毛虫",
                aModel: "1510",
                color: "255,255,255",
                type: 4
            }],
            k.userConfigList = [{
                name: "黑色皮手套",
                aModel: "1701"
            }, {
                name: "黄色笑脸手套",
                aModel: "1702"
            }, {
                name: "猫爪手套",
                aModel: "1703"
            }, {
                name: "怪兽手套",
                aModel: "1704"
            }, {
                name: "骷髅手",
                aModel: "1705"
            }, {
                name: "手",
                aModel: "1706"
            }, {
                name: "七彩碗",
                aModel: "1901"
            }, {
                name: "金色皇冠",
                aModel: "1902"
            }, {
                name: "砂锅",
                aModel: "1903"
            }, {
                name: "爱心碗",
                aModel: "1904"
            }, {
                name: "冰淇淋蛋卷",
                aModel: "1905"
            }, {
                name: "兔子碗",
                aModel: "1906"
            }, {
                name: "普通面板",
                aModel: "1601"
            }, {
                name: "瓷砖",
                aModel: "1602"
            }, {
                name: "冰面",
                aModel: "1606"
            }, {
                name: "树墩子",
                aModel: "1603"
            }, {
                name: "电脑机箱",
                aModel: "1604"
            }, {
                name: "马桶盖",
                aModel: "1605"
            }, {
                name: "默认铲刀",
                aModel: "1805"
            }, {
                name: "米老鼠",
                aModel: "1801"
            }, {
                name: "爱心铲刀",
                aModel: "1802"
            }, {
                name: "金色铲刀",
                aModel: "1803"
            }, {
                name: "桃木铲刀",
                aModel: "1804"
            }, {
                name: "菜刀",
                aModel: "1806"
            }, {
                name: "屠龙刀",
                aModel: "1807"
            }],
            k.taskList = [{
                id: 1,
                content: "请给我来一份可口的炒酸奶！",
                role: 0,
                mtl: [],
                icon: "text_wenz"
            }, {
                id: 2,
                content: "好久没吃香香酸菜了！",
                role: 0,
                mtl: ["香香酸菜"],
                icon: "text_wenz1"
            }, {
                id: 3,
                content: "最近在减肥，我要无糖的！",
                role: 1,
                mtl: ["赤藓糖醇"],
                icon: "text_wenz2"
            }, {
                id: 4,
                content: "没说就是零卡，随便来！",
                role: 1,
                mtl: [],
                icon: "text_wenz3"
            }, {
                id: 5,
                content: "向左旋转就没有热量，随便来！",
                role: 1,
                mtl: [],
                icon: "text_wenz4"
            }, {
                id: 6,
                content: "给我的师傅老八来份炒酸奶！",
                role: 0,
                mtl: ["便便"],
                icon: "text_wenz5"
            }, {
                id: 7,
                content: "好久没吃肉了，请满足我！",
                role: 0,
                mtl: ["肉夹馍", "热狗"],
                icon: "text_wenz6"
            }, {
                id: 8,
                content: "我需要一份能补充能量的炒酸奶！",
                role: 0,
                mtl: ["公牛"],
                icon: "text_wenz7"
            }, {
                id: 9,
                content: "我需要一份带气的炒酸奶！",
                role: 0,
                mtl: ["雷碧", "呵乐"],
                icon: "text_wenz8"
            }, {
                id: 10,
                content: "我需要一份奇怪的炒酸奶！",
                role: 0,
                mtl: ["便便", "毛毛虫"],
                icon: "text_wenz9"
            }, {
                id: 11,
                content: "请给我的炒酸奶加点樱桃！",
                role: 0,
                mtl: ["樱桃"],
                icon: "text_wenz10"
            }, {
                id: 12,
                content: "请给我的炒酸奶加点蓝莓！",
                role: 0,
                mtl: ["蓝莓"],
                icon: "text_wenz11"
            }, {
                id: 13,
                content: "请给我的炒酸奶加点坚果！",
                role: 0,
                mtl: ["坚果"],
                icon: "text_wenz12"
            }, {
                id: 14,
                content: "请给我的炒酸奶加点糖果！",
                role: 0,
                mtl: ["彩虹糖", "棉花糖", "彩色糖针"],
                icon: "text_wenz13"
            }],
            k.OrnametMap = [{
                name: "巧克力豆",
                aModel: ["1501"]
            }, {
                name: "彩虹糖",
                aModel: ["1502_1", "1502_2", "1502_3"]
            }, {
                name: "奥利奥",
                aModel: ["1503"]
            }, {
                name: "棉花糖",
                aModel: ["1504_1", "1504_2", "1504_3"]
            }, {
                name: "坚果碎",
                aModel: ["1505"]
            }, {
                name: "樱桃",
                aModel: ["1506"]
            }, {
                name: "花瓣",
                aModel: ["1507"]
            }, {
                name: "蓝莓",
                aModel: ["1508"]
            }, {
                name: "彩色糖针",
                aModel: ["1509_1", "1509_2", "1509_3"]
            }, {
                name: "毛毛虫",
                aModel: ["1510_1", "1510_2", "1510_3", "1510_4", "1510_5", "1510_6"]
            }],
            k.RoleList = [{
                name: "小明",
                isVip: !1,
                aModel: "1101",
                handPos: "Bip001/Bip001 Pelvis/Bip001 Spine/Bip001 Spine1/Bip001 Neck/Bip001 L Clavicle/Bip001 L UpperArm/Bip001 L Forearm/Bip001 L Hand/Bip001 L Finger2/pos"
            },
            {
                name: "山姆",
                isVip: !1,
                aModel: "1102",
                handPos: "Bip001/Bip001 Pelvis/Bip001 Spine/Bip001 Spine1/Bip001 Neck/Bip001 L Clavicle/Bip001 L UpperArm/Bip001 L Forearm/Bip001 L Hand/Bip001 L Finger2/pos"
            },
            {
                name: "绿衣",
                isVip: !1,
                aModel: "1103",
                handPos: "Bip001/Bip001 Pelvis/Bip001 Spine/Bip001 Spine1/Bip001 Neck/Bip001 L Clavicle/Bip001 L UpperArm/Bip001 L Forearm/Bip001 L Hand/Bip001 L Finger2/pos"
            },
            {
                name: "黑衣",
                isVip: !1,
                aModel: "1104",
                handPos: "Bip001/Bip001 Pelvis/Bip001 Spine/Bip001 Spine1/Bip001 Neck/Bip001 L Clavicle/Bip001 L UpperArm/Bip001 L Forearm/Bip001 L Hand/Bip001 L Finger2/pos"
            },
            {
                name: "光头",
                isVip: !0,
                aModel: "1106",
                handPos: "Bip001/Bip001 Pelvis/Bip001 Spine/Bip001 Spine1/Bip001 Neck/Bip001 L Clavicle/Bip001 L UpperArm/Bip001 L Forearm/Bip001 L Hand/Bip001 L Finger2/pos"
            },
            {
                name: "马尾",
                isVip: !0,
                aModel: "1106",
                handPos: "Bip001/Bip001 Pelvis/Bip001 Spine/Bip001 Spine1/Bip001 Neck/Bip001 L Clavicle/Bip001 L UpperArm/Bip001 L Forearm/Bip001 L Hand/Bip001 L Finger2/pos"
            }],
            k.TextureMap = [{
                name: "果冻",
                tex: "1201pic"
            }, {
                name: "西瓜",
                tex: "1202pic"
            }, {
                name: "香蕉",
                tex: "1203pic"
            }, {
                name: "糖果",
                tex: "1204pic"
            }, {
                name: "饼干",
                tex: "1205pic"
            }, {
                name: "便便",
                tex: "1206pic"
            }, {
                name: "肉夹馍",
                tex: "1207pic"
            }, {
                name: "薯片",
                tex: "1208pic"
            }, {
                name: "蛋糕",
                tex: "1209pic"
            }, {
                name: "热狗",
                tex: "1210pic"
            }, {
                name: "牛奶",
                tex: "1301pic"
            }, {
                name: "巧克力酱",
                tex: "1302pic"
            }, {
                name: "公牛",
                tex: "1303pic"
            }, {
                name: "雷碧",
                tex: "1304pic"
            }, {
                name: "呵乐",
                tex: "1305pic"
            }, {
                name: "赤藓糖醇",
                tex: "1306pic"
            }, {
                name: "草莓汁",
                tex: "1307pic"
            }, {
                name: "彩色糖浆",
                tex: "1308pic"
            }, {
                name: "香香酸菜",
                tex: "1309pic"
            }];
        var C = function () {
            function e() {
                t(this, e);
            }
            return a(e, null, [{
                key: "init",
                value: function () {
                    null == window.tt ? this.isTTPlatfrom = !1 : this.isTTPlatfrom = !0, console.log("字节平台环境判断:", this.isTTPlatfrom);
                }
            }, {
                key: "report",
                value: function (e, t) {
                    this.isTTPlatfrom && window.tt.reportAnalytics(e, t), console.log("上报信息:", e, t);
                }
            }, {
                //激励
                key: "showVideoByReport",
                value: function (e, t) {
                    var a = this;
                    this.report("Video_click", {
                        stage: e
                    }),
                        // TY.LayaCore.SDK.showVideo(function () {
                        //     a.report("Video_success", {
                        //         stage: e
                        //     }), a.report("Video_show", {
                        //         stage: e
                        //     }), t && t();
                        // }, function () {
                        //     a.report("Video_show", {
                        //         stage: e
                        //     });
                        // });
                        // t && t();
                        Advertisement.videoAdverV(t);
                }
            }]), e;
        }();
        C.isTTPlatfrom = !1, function (e) {
            e[e.customUI = 0] = "customUI", e[e.peelFruit = 1] = "peelFruit", e[e.spreadJam = 2] = "spreadJam",
                e[e.spreadOver = 3] = "spreadOver", e[e.scoopYogurt = 4] = "scoopYogurt", e[e.ornament = 5] = "ornament",
                e[e.ornament_close_up = 6] = "ornament_close_up", e[e.eatYogurt = 7] = "eatYogurt";
        }(h || (h = {}));
        var L = function () {
            function e() {
                t(this, e);
            }
            return a(e, null, [{
                key: "init",
                value: function () {
                    this.MainCamera = TY.LayaCore.Scene.curScene.sceneSprite.getChildByName("Main Camera"),
                        this.Curves1 = TY.LayaCore.Scene.curScene.sceneSprite.getChildByName("Curves1").getComponent(TY.LayaCore.Utils.BezierCurves.BezierCurvesComponent),
                        this.Curves2 = TY.LayaCore.Scene.curScene.sceneSprite.getChildByName("Curves2").getComponent(TY.LayaCore.Utils.BezierCurves.BezierCurvesComponent),
                        this.Curves3 = TY.LayaCore.Scene.curScene.sceneSprite.getChildByName("Curves3").getComponent(TY.LayaCore.Utils.BezierCurves.BezierCurvesComponent),
                        this.Curves4 = TY.LayaCore.Scene.curScene.sceneSprite.getChildByName("Curves4").getComponent(TY.LayaCore.Utils.BezierCurves.BezierCurvesComponent),
                        this.Curves5 = TY.LayaCore.Scene.curScene.sceneSprite.getChildByName("Curves5").getComponent(TY.LayaCore.Utils.BezierCurves.BezierCurvesComponent),
                        this.Curves5_1 = TY.LayaCore.Scene.curScene.sceneSprite.getChildByName("Curves5.5").getComponent(TY.LayaCore.Utils.BezierCurves.BezierCurvesComponent),
                        this.Curves6 = TY.LayaCore.Scene.curScene.sceneSprite.getChildByName("Curves6").getComponent(TY.LayaCore.Utils.BezierCurves.BezierCurvesComponent);
                }
            }, {
                key: "loopTime",
                value: function () {
                    this.MainCamera.transform.position.cloneTo(this.temp2V3), Laya.Vector3.subtract(this.temp2V3, this.tempV3, this.tempV3),
                        TY.LayaCore.Utils.LayaExt.QuaternionExtension.lookAt(this.temp2V3, this.tempV3, new Laya.Vector3(0, 1, 0), this.tempQ4, !0);
                    var e = this.MainCamera.transform.rotation;
                    Laya.Quaternion.lerp(e, this.tempQ4, .001, this.tempQ4), this.MainCamera.transform.rotation = this.tempQ4;
                }
            }, {
                key: "setMainCameraPos",
                value: function (e, t) {
                    var a, i, n = this;
                    console.log("切换摄像机:", h[e]);
                    var o = 1.5;
                    switch (e) {
                        case h.customUI:
                            a = this.Pos1;
                            break;

                        case h.peelFruit:
                            a = this.Pos2, i = this.Curves1, o = 1.5;
                            break;

                        case h.spreadJam:
                            a = this.Pos3, i = this.Curves2, o = 1.5;
                            break;

                        case h.spreadOver:
                            a = this.Pos4, i = this.Curves3, o = 1.5;
                            break;

                        case h.scoopYogurt:
                            a = this.Pos5, i = this.Curves4, o = 1.5;
                            break;

                        case h.ornament:
                            a = this.Pos6, i = this.Curves5, o = 1.5;
                            break;

                        case h.ornament_close_up:
                            a = this.Pos6_1, i = this.Curves5_1, o = .8;
                            break;

                        case h.eatYogurt:
                            a = this.Pos7, i = this.Curves6, o = 1.5;
                    }
                    if (e == h.customUI) {
                        var r = a.pos, s = a.rotate;
                        this.tempV3.setValue(-r.x, r.y, r.z), this.MainCamera.transform.position = this.tempV3,
                            this.tempV3.setValue(-s.x, 180 - s.y, s.z), this.MainCamera.transform.rotationEuler = this.tempV3,
                            t && t();
                    } else {
                        a.pos;
                        var l = a.rotate;
                        this.MainCamera.transform.rotation.cloneTo(this.startQ4), this.tempV3.setValue(-l.x, 180 - l.y, l.z),
                            this.MainCamera.transform.rotationEuler = this.tempV3, this.MainCamera.transform.rotation.cloneTo(this.endQ4),
                            this.MainCamera.transform.rotation = this.startQ4, fgui.GTween.to(0, 1, o).onUpdate(function (e) {
                                var t = e.value.x;
                                i.path.getPointAtTime(t, TY.LayaCore.Utils.BezierCurves.EndOfPathInstruction.Stop, n.tempV3),
                                    n.MainCamera.transform.position = n.tempV3, Laya.Quaternion.lerp(n.startQ4, n.endQ4, t, n.tempQ4),
                                    n.MainCamera.transform.rotation = n.tempQ4;
                            }).setEase(fgui.EaseType.CircOut).onComplete(function () {
                                t && t();
                            });
                    }
                }
            }, {
                key: "lerp",
                value: function () { }
            }]), e;
        }();
        L.Pos1 = {
            pos: new Laya.Vector3(-21.96, 10.89, -1.17),
            rotate: new Laya.Vector3(7, 88.36, 0)
        }, L.Pos2 = {
            pos: new Laya.Vector3(0, 28.71, -12.76),
            rotate: new Laya.Vector3(68.91, 0, 0)
        }, L.Pos3 = {
            pos: new Laya.Vector3(0, 24.96, -11.41),
            rotate: new Laya.Vector3(66.87, 0, 0)
        }, L.Pos4 = {
            pos: new Laya.Vector3(0, 27.27, -13.5),
            rotate: new Laya.Vector3(62.79, 0, 0)
        }, L.Pos5 = {
            pos: new Laya.Vector3(-15.1, 34.12, 2.47),
            rotate: new Laya.Vector3(64.14, 100.28, 0)
        }, L.Pos6 = {
            pos: new Laya.Vector3(-6.85, 33.4, 0),
            rotate: new Laya.Vector3(72.8, 90, 0)
        }, L.Pos6_1 = {
            pos: new Laya.Vector3(-6.85, 28.22, 0),
            rotate: new Laya.Vector3(72.8, 90, 0)
        }, L.Pos7 = {
            pos: new Laya.Vector3(-21.96, 10.89, -1.17),
            rotate: new Laya.Vector3(7, 88.36, 0)
        }, L.tempV3 = new Laya.Vector3(), L.temp2V3 = new Laya.Vector3(), L.worldUpAxis = new Laya.Vector3(0, 1, 0),
            L.tempQ4 = new Laya.Quaternion(), L.startQ4 = new Laya.Quaternion(), L.endQ4 = new Laya.Quaternion();
        var S = function () {
            function e() {
                t(this, e);
            }
            return a(e, null, [{
                key: "setBaseTexName",
                value: function (e) {
                    console.log("设置材质底色贴图:", e), this.baseTexName = e;
                }
            }, {
                key: "setTopTexName",
                value: function (e) {
                    console.log("设置材质花样贴图:", e), this.topTexName = e;
                }
            }, {
                key: "getRtByPreSet",
                value: function (e, t) {
                    if (this.baseTexName && this.topTexName) {
                        var a = new Laya.RenderTexture(e, t, Laya.RenderTextureFormat.R8G8B8), i = Laya.Loader.getRes("res/texture/" + this.baseTexName + ".png"), n = Laya.Loader.getRes("res/texture/" + this.topTexName + ".png");
                        return TY.LayaCore.Utils.RTCanvas.replaceRt(i, a), TY.LayaCore.Utils.RTCanvas.addTexToRt(n, a),
                            this.baseTexName = null, this.topTexName = null, console.log("成功返回rt"), a;
                    }
                    return null;
                }
            }, {
                key: "getRtByInfo",
                value: function (e, t, a, i) {
                    var n = new Laya.RenderTexture(e, t, Laya.RenderTextureFormat.R8G8B8), o = Laya.Loader.getRes("res/texture/" + a + ".png");
                    TY.LayaCore.Utils.RTCanvas.replaceRt(o, n);
                    var r = Laya.Loader.getRes("res/texture/" + i + ".png");
                    return TY.LayaCore.Utils.RTCanvas.addTexToRt(r, n), n;
                }
            }]), e;
        }(), I = function () {
            function e() {
                t(this, e);
            }
            return a(e, null, [{
                key: "playBgm",
                value: function () {
                    console.log("播放bgm"), this.lastBgm = 0, this.playMusic("13");
                }
            }, {
                key: "stopMusic",
                value: function () {
                    Laya.SoundManager.stopMusic();
                }
            }, {
                key: "playBattleBgm",
                value: function () {
                    console.log("播放战斗bgm"), this.lastBgm = 1, this.playMusic("batteBgm");
                }
            }, {
                key: "playDefaultBgm",
                value: function () {
                    0 == this.lastBgm ? this.playBgm() : this.playBattleBgm();
                }
            }, {
                key: "stopAllSound",
                value: function () {
                    console.log("停止所有音效!"), Laya.SoundManager.stopAll();
                }
            }, {
                key: "playBo",
                value: function (e) {
                    "果冻" == e ? this.play01() : "西瓜" == e ? this.play02() : "香蕉" == e ? this.play03() : "糖果" == e ? this.play04() : "饼干" == e ? this.play05() : "便便" == e ? this.play06() : "肉夹馍" == e ? this.play07() : "薯片" == e ? this.play08() : "蛋糕" == e ? this.play09() : "热狗" == e && this.play10();
                }
            }, {
                key: "playClick",
                value: function () {
                    this.play12();
                }
            }, {
                key: "play01",
                value: function () {
                    this.playEffect("01");
                }
            }, {
                key: "play02",
                value: function () {
                    this.playEffect("02");
                }
            }, {
                key: "play03",
                value: function () {
                    this.playEffect("03");
                }
            }, {
                key: "play04",
                value: function () {
                    this.playEffect("04");
                }
            }, {
                key: "play05",
                value: function () {
                    this.playEffect("05");
                }
            }, {
                key: "play06",
                value: function () {
                    this.playEffect("06");
                }
            }, {
                key: "play07",
                value: function () {
                    this.playEffect("07");
                }
            }, {
                key: "play08",
                value: function () {
                    this.playEffect("08");
                }
            }, {
                key: "play09",
                value: function () {
                    this.playEffect("09");
                }
            }, {
                key: "play10",
                value: function () {
                    this.playEffect("10");
                }
            }, {
                key: "play11",
                value: function () {
                    this.playEffect("11");
                }
            }, {
                key: "play12",
                value: function () {
                    this.playEffect("12");
                }
            }, {
                key: "play13",
                value: function () {
                    this.playMusic("13");
                }
            }, {
                key: "play14",
                value: function () {
                    this.playEffect2("14", 2e3);
                }
            }, {
                key: "play15",
                value: function () {
                    this.playEffect2("15", 2e3);
                }
            }, {
                key: "play16",
                value: function () {
                    this.playEffect("16", 0);
                }
            }, {
                key: "stop16",
                value: function () {
                    this.stopEffect("16");
                }
            }, {
                key: "play17",
                value: function () {
                    this.playEffect("17");
                }
            }, {
                key: "play18",
                value: function () {
                    this.playEffect("18");
                }
            }, {
                key: "play19",
                value: function () {
                    this.playEffect("19");
                }
            }, {
                key: "play20",
                value: function () {
                    this.playEffect("20");
                }
            }, {
                key: "play21",
                value: function () {
                    this.playEffect("21");
                }
            }, {
                key: "play22",
                value: function () {
                    this.playEffect("22");
                }
            }, {
                key: "play23",
                value: function () {
                    this.playEffect2("23", 2e3);
                }
            }, {
                key: "play24",
                value: function () {
                    this.playEffect2("24", 2e3);
                }
            }, {
                key: "play25",
                value: function () {
                    this.playEffect2("25", 2e3);
                }
            }, {
                key: "play26",
                value: function () {
                    this.playEffect2("26", 2e3);
                }
            }, {
                key: "playEffect",
                value: function (e, t) {
                    "false" != f.playerData.shake && (null == t ? Laya.SoundManager.playSound(m.getSoundUrl(e)) : Laya.SoundManager.playSound(m.getSoundUrl(e), t));
                }
            }, {
                key: "stopEffect",
                value: function (e) {
                    Laya.SoundManager.stopSound(m.getSoundUrl(e));
                }
            }, {
                key: "playEffect2",
                value: function (e, t) {
                    var a = this;
                    "false" != f.playerData.shake && null == this.CanPlaySound[e] && (this.playEffect(e),
                        this.CanPlaySound[e] = 1, Laya.timer.once(t, this, function () {
                            a.CanPlaySound[e] = null;
                        }));
                }
            }, {
                key: "playMusic",
                value: function (e) {
                    "false" != f.playerData.sound && Laya.SoundManager.playMusic(m.getSoundUrl(e), 0);
                }
            }]), e;
        }();
        I.lastBgm = 0, I.CanPlaySound = {};
        var T = function () {
            function e() {
                t(this, e);
            }
            return a(e, null, [{
                key: "playTouchStart",
                value: function () {
                    var e = this;
                    if (null != this.boAnimator) {
                        this.boAnimator.getControllerLayer().getCurrentPlayState().normalizedTime <= .1 && I.playBo(this.currInfo.name),
                            Laya.timer.clear(this, this.autoPlayAnim), Laya.timer.loop(16, this, this.getCurrMtlProgress);
                        var t = k.itemModelList.find(function (t) {
                            var a;
                            return t.name == (null === (a = e.currInfo) || void 0 === a ? void 0 : a.name);
                        });
                        TY.App.dispatchEventWith(y.ChangeAddSelectIndex, null == t ? void 0 : t.type);
                    }
                }
            }, {
                key: "playTouchMove",
                value: function (e, t) {
                    this.playMaterialAnimal(e, t);
                }
            }, {
                key: "playTouchEnd",
                value: function () {
                    if (null != this.boAnimator) {
                        Laya.timer.clear(this, this.getCurrMtlProgress), TY.App.dispatchEventWith(y.ChangeAddSelectIndex, 0);
                        var e = this.boAnimator.getControllerLayer().getCurrentPlayState().normalizedTime, t = this.currMakeNode.numChildren;
                        if (e >= 1) if (this.boAnimator && (this.boAnimator.speed = 0), this.boAnimator = null,
                            this.boStep += 1, this.boStep >= t) R.playSmileParticle(), Laya.timer.once(2e3, this, function () {
                                R.giveProp();
                            }); else {
                            for (var a = 0; a < t; a++) this.currMakeNode.getChildAt(a).active = a <= this.boStep;
                            this.setAnimator();
                        } else this.boAnimator && (this.boAnimator.speed = 1), Laya.timer.frameLoop(1, this, this.autoPlayAnim);
                    }
                }
            }, {
                key: "makeMaterial",
                value: function (e) {
                    var t = this;
                    this.currInfo = e;
                    var a = k.TextureMap.find(function (t) {
                        return t.name == e.name;
                    });
                    S.setTopTexName(a.tex), Laya.Sprite3D.load(m.getD3FbxUrl(e.aModel), Laya.Handler.create(null, function (e) {
                        t.currMakeNode = e.clone(), R.zhuozi.addChild(t.currMakeNode), R.makeNodeList.push(t.currMakeNode);
                        for (var a = t.currMakeNode.numChildren, i = 0; i < a; i++) t.currMakeNode.getChildAt(i).active = 0 == i;
                        t.boStep = 0, t.setAnimator();
                    }));
                }
            }, {
                key: "setAnimator",
                value: function () {
                    0 == R.currPart && (this.boAnimator = this.currMakeNode.getChildAt(this.boStep).getComponent(Laya.Animator),
                        this.boAnimator.play("handle"), this.boAnimator.speed = 0);
                }
            }, {
                key: "getCurrMtlProgress",
                value: function () {
                    var e = 0;
                    if (this.boAnimator) {
                        var t = this.boAnimator.getControllerLayer().getCurrentPlayState().normalizedTime, a = this.currMakeNode.numChildren;
                        e = (t + this.boStep) / a;
                    }
                    return TY.App.dispatchEventWith(y.updateAddMtlProgress, e), e;
                }
            }, {
                key: "playMaterialAnimal",
                value: function (e, t) {
                    if (null != this.boAnimator) {
                        var a = this.currInfo.type;
                        1 == a ? this.boAnimator.speed = t > 0 ? 1 : 0 : 5 == a ? this.boAnimator.speed = t > 0 ? 0 : 1 : 2 == a && (this.boAnimator.speed = e > 0 ? 1 : 0);
                    }
                }
            }, {
                key: "checkAnimOver",
                value: function () {
                    if (null != this.boAnimator) {
                        var e = this.boAnimator.getControllerLayer().getCurrentPlayState().normalizedTime, t = this.currMakeNode.numChildren;
                        if (e >= 1) if (this.getCurrMtlProgress(), this.boAnimator && (this.boAnimator.speed = 0),
                            this.boAnimator = null, this.boStep += 1, this.boStep >= t) R.playSmileParticle(),
                                Laya.timer.once(2e3, this, function () {
                                    R.giveProp();
                                }); else {
                            for (var a = 0; a < t; a++) this.currMakeNode.getChildAt(a).active = a <= this.boStep;
                            this.setAnimator();
                        }
                    }
                }
            }, {
                key: "autoPlayAnim",
                value: function () {
                    this.boAnimator && (this.getCurrMtlProgress(), this.checkAnimOver());
                }
            }]), e;
        }();
        T.boStep = 0, T.boAnimator = null, T.boSprList = [], T.currInfo = null, T.currMakeNode = null;
        var _ = function (e) {
            o(l, e);
            var s = r(l);
            function l() {
                var e;
                return t(this, l), (e = s.apply(this, arguments)).modal = !0, e.dataList = null,
                    e;
            }
            return a(l, [{
                key: "UIPack",
                get: function () {
                    return g.Pack.Main;
                }
            }, {
                key: "UICom",
                get: function () {
                    return g.Res.EggUnlockUI;
                }
            }, {
                key: "onInit",
                value: function () {
                    i(n(l.prototype), "onInit", this).call(this), this.bindBtnCallback("close"), this.showLabel = this.contentPane.getChild("n6").asLabel;
                }
            }, {
                key: "onShown",
                value: function () {
                    i(n(l.prototype), "onShown", this).call(this), this.dataList = this.data, this.checkFinish(),
                        this.dataList.length <= 0 ? this.hide() : this.showAward();
                }
            }, {
                key: "checkFinish",
                value: function () {
                    for (var e = f.playerData.EggData, t = 0; t < this.dataList.length; t++) {
                        var a = this.dataList[t];
                        if (2 == e[a]) {
                            this.dataList.splice(t, 1), this.checkFinish(), console.log("已经解锁了彩蛋：", a);
                            break;
                        }
                    }
                }
            }, {
                key: "showAward",
                value: function () {
                    var e = this.dataList.shift();
                    if ("x" == e[0]) {
                        var t = parseInt(e.substring(1));
                        console.log("coin:", t), f.playerData.money += t, this.showLabel.title = e, this.showLabel.icon = m.getCommonResUrl("money");
                    } else this.showLabel.title = e, this.showLabel.icon = m.getPropIconUrl(e), f.playerData.addSkin(e),
                        C.report("Get_skin", {
                            unlock: "彩蛋解锁",
                            stage: "彩蛋",
                            id: e
                        });
                    var a = f.playerData.EggData;
                    a[e] = 2, f.playerData.EggData = a;
                }
            }, {
                key: "onHide",
                value: function () {
                    i(n(l.prototype), "onHide", this).call(this);
                }
            }, {
                key: "closeCallback",
                value: function () {
                    this.dataList.length > 0 ? this.showAward() : this.hide();
                }
            }], [{
                key: "show",
                value: function () {
                    for (var e = arguments.length, t = new Array(e), a = 0; a < e; a++) t[a] = arguments[a];
                    TY.LayaCore.UI.show(g.Urls.EggUnlockUI, t);
                }
            }, {
                key: "hide",
                value: function () {
                    TY.LayaCore.UI.hide(g.Urls.EggUnlockUI);
                }
            }]), l;
        }(v), w = function (e) {
            o(l, e);
            var s = r(l);
            function l() {
                var e;
                return t(this, l), (e = s.apply(this, arguments)).modal = !0, e.reward = [10, 30, 50, 30, 10, 35, 25, 15, 18],
                    e.openCount = 0, e.freeCount = 3, e;
            }
            return a(l, [{
                key: "UIPack",
                get: function () {
                    return g.Pack.Game;
                }
            }, {
                key: "UICom",
                get: function () {
                    return g.Res.LuckBoxUI;
                }
            }, {
                key: "onInit",
                value: function () {
                    i(n(l.prototype), "onInit", this).call(this), this.boxList = this.contentPane.getChild("boxList").asList,
                        this.adBtn = this.contentPane.getChild("adBtn").asButton, this.adBtn.onClick(this, this.adClicked),
                        this.closeBtn = this.contentPane.getChild("closeBtn").asButton, this.closeBtn.onClick(this, this.closeClicked),
                        this.boxList.on(fgui.Events.CLICK_ITEM, this, this.clickItem);
                }
            }, {
                key: "onHide",
                value: function () {
                    i(n(l.prototype), "onHide", this).call(this), l.callback && (l.callback(), l.callback = null);
                }
            }, {
                key: "onShown",
                value: function () {
                    i(n(l.prototype), "onShown", this).call(this), this.initBoxList(), this.closeBtn.visible = this.adBtn.visible = !1,
                        this.openCount = 0, this.freeCount = 3, 4 == f.playerData.Level ? this.freeCount = 1 : f.playerData.Level > 4 && (this.freeCount = TY.Utils.random(1, 4)),
                        this.reward.sort(function (e, t) {
                            return Math.random() > .5 ? 1 : -1;
                        });
                }
            }, {
                key: "initBoxList",
                value: function () {
                    for (var e = 0; e < this.boxList.numChildren; e++) this.boxList.getChildAt(e).init();
                }
            }, {
                key: "clickItem",
                value: function (e) {
                    var t = this, a = function () {
                        if (e.CoinNum = t.reward[t.openCount], f.playerData.money += t.reward[t.openCount],
                            e.state = 0, t.openCount++, t.freeCount > 0 && (t.freeCount--, 0 == t.freeCount)) {
                            for (var a = 0; a < t.boxList.numChildren; a++) {
                                var i = t.boxList.getChildAt(a);
                                1 == i.state && (i.state = 2);
                            }
                            t.closeBtn.visible = t.adBtn.visible = !0;
                        }
                        t.openCount == t.boxList.numItems && (t.adBtn.visible = !1);
                    };
                    1 == e.state ? a() : 2 == e.state && C.showVideoByReport("再开一个", function () {
                        a();
                    });
                }
            }, {
                key: "closeClicked",
                value: function () {
                    this.backHome();
                }
            }, {
                key: "adClicked",
                value: function () {
                    var e = this;
                    C.showVideoByReport("再开三个", function () {
                        e.freeCount = 3, e.lookAdSuc();
                    });
                }
            }, {
                key: "lookAdSuc",
                value: function () {
                    for (var e = 0; e < this.boxList.numChildren; e++) {
                        var t = this.boxList.getChildAt(e);
                        2 == t.state && (t.state = 1);
                    }
                }
            }, {
                key: "backHome",
                value: function () {
                    l.hide();
                }
            }], [{
                key: "show",
                value: function (e) {
                    this.callback = e, TY.LayaCore.UI.show(g.Urls.LuckBoxUI);
                }
            }, {
                key: "hide",
                value: function () {
                    TY.LayaCore.UI.hide(g.Urls.LuckBoxUI);
                }
            }]), l;
        }(TY.LayaCore.Services.UIBase),

            M = function (e) {
                o(n, e);
                var i = r(n);
                function n() {
                    var e;
                    return t(this, n), (e = i.apply(this, arguments)).IsDebug = !1, e.GameId = "926",
                        e.APIVersion = "1.0.2", e.AppID = "wx925740bdb9f63521", e.shareImgIds = [{
                            url: "https://mmocgame.qpic.cn/wechatgame/OYLMmZGNVuk6FtZvpThsAy5PTMsYSicR2t1Hf7ALH4m836JichiaPVmdtbEiaGP653Nj/0",
                            id: "W7cKv6PvRe+0dRxB762vTg=="
                        }, {
                            url: "https://mmocgame.qpic.cn/wechatgame/OYLMmZGNVumoyoluzmZLXL6aibI6kRpoofaJTtBiapuib2PUkmXd7dibo2OqkKCW1kjF/0",
                            id: "InH7epWNTQSYy33IOFtB8Q=="
                        }, {
                            url: "https://mmocgame.qpic.cn/wechatgame/OYLMmZGNVunWhIBNZyZLf53Mgvh8LITjD1lwbFpBpOtiaFbydZI57eY07n4lIrhQY/0",
                            id: "vDpDcBZtSdaL2FMrtEfdyQ=="
                        }], e.VideoAdPos = "adunit-98a8e439e6d090f0", e.BannerAdPos = "adunit-96f0e21a9f47dd2d",
                        e.CustomAdPos = ["adunit-28922d435a4928dc", "adunit-e930c14b8b6834a2"], e.Scene = [1005, 1006, 1007, 1008, 1011, 1012, 1013, 1014, 1017, 1020, 1023, 1024, 1025, 1030, 1031, 1032, 1036, 1042, 1044, 1047, 1048, 1049, 1053, 1102, 1129],
                        e;
                }
                return a(n);
            }(TY.WXSDK.SDKConfigBase);
        !function (e) {
            e.yanchi = "yanchi", e.kjsp = "kjsp", e.kjkd = "kjkd", e.qpys = "qpys", e.time = "time";
        }(u || (u = {}));
        var P = function () {
            function e() {
                t(this, e);
            }
            return a(e, null, [{
                key: "Inst",
                get: function () {
                    return null == this.ins && (this.ins = new e()), this.ins;
                }
            }, {
                key: "installShortcut",
                value: function () {
                    TY.VivoSDK.SDK.installShortcut(function () {
                        console.log("添加桌面图标成功");
                    }, function () {
                        console.log("添加桌面图标失败");
                    });
                }
            }, {
                key: "Kjsp",
                get: function () {
                    return 1 == TY.LayaCore.SDKModel.getAdRate(u.kjsp);
                }
            }, {
                key: "Qpys",
                get: function () {
                    return 1 == TY.LayaCore.SDKModel.getAdRate(u.qpys);
                }
            }, {
                key: "createCustomAdShaugpai",
                value: function (t, a) {
                    wx.getSystemInfoSync().SDKVersion >= "2.11.1" && (e.CustomAdShuangpai = wx.createCustomAd({
                        adUnitId: e.CustomAdPosIdShuangpai,
                        style: {
                            left: t,
                            top: a,
                            fixed: !0
                        }
                    }), e.CustomAdShuangpai.onError(function (e) {
                        console.log("liming", e);
                    }));
                }
            }, {
                key: "showCustomAdShuangpai",
                value: function (t, a) {
                    console.log("原生模板广告"), window.wx && (e.createCustomAdShaugpai(t, a), e.CustomAdShuangpai && e.CustomAdShuangpai.show());
                }
            }, {
                key: "hideCustomAdShaugpai",
                value: function () {
                    Laya.Browser.onWeiXin && e.CustomAdShuangpai && (e.CustomAdShuangpai.hide(), e.CustomAdShuangpai.destroy());
                }
            }, {
                key: "createCustomAdFull",
                value: function (t, a, i) {
                    Laya.Browser.onWeiXin && wx.getSystemInfoSync().SDKVersion >= "2.11.1" && (e.CustomAdFull = wx.createCustomAd({
                        adUnitId: e.CustomAdPosIdFull,
                        adIntervals: 30,
                        style: {
                            left: t,
                            top: a,
                            width: i,
                            fixed: !0
                        }
                    }), e.CustomAdFull.onError(function (e) {
                        console.log("liming", e);
                    }));
                }
            }, {
                key: "showCustomAdFull",
                value: function (t, a, i) {
                    e.createCustomAdFull(t, a, i), e.CustomAdFull && e.CustomAdFull.show();
                }
            }, {
                key: "hideCustomAdFull",
                value: function () {
                    Laya.Browser.onWeiXin && e.CustomAdFull && (e.CustomAdFull.hide(), e.CustomAdFull.destroy());
                }
            }]), e;
        }();
        P.CustomAdPosIdShuangpai = "adunit-28922d435a4928dc", P.CustomAdPosIdFull = "adunit-e930c14b8b6834a2",
            P.CustomAdShuangpai = null, P.CustomAdFull = null;
        var D = function (e) {
            o(h, e);
            var s = r(h);
            function h() {
                var e;
                return t(this, h), (e = s.apply(this, arguments)).modal = !0, e;
            }
            return a(h, [{
                key: "UIPack",
                get: function () {
                    return g.Pack.Game;
                }
            }, {
                key: "UICom",
                get: function () {
                    return g.Res.ResultUI;
                }
            }, {
                key: "onInit",
                value: function () {
                    i(n(h.prototype), "onInit", this).call(this), this.coinLabel = this.contentPane.getChild("n12").asTextField,
                        this.c1 = this.contentPane.getController("c1"), this.foodLoad = this.contentPane.getChild("food").asLoader,
                        this.adBtn = this.contentPane.getChild("video").asButton, this.closeBtn = this.contentPane.getChild("give").asButton,
                        this.adBtn.onClick(this, this.videoCallback), this.closeBtn.onClick(this, this.giveCallback),
                        this.bindBtnCallback("set");
                }
            }, {
                key: "onShown",
                value: function () {
                    var e = this;
                    i(n(h.prototype), "onShown", this).call(this), /*TY.LayaCore.SDK.showBanner(), P.showCustomAdShuangpai(0, 100)*/Advertisement.insertAdverV(), console.log("原生"),
                        1 != TY.LayaCore.SDKModel.getAdRate(u.yanchi) || TY.LayaCore.SDKModel.isPingbi || (this.closeBtn.visible = !1,
                            Laya.timer.once(2e3, this, function () {
                                e.closeBtn.visible = !0;
                            })), TY.LayaCore.SDKModel.isPingbi ? (this.adBtn.getController("isPingbi").selectedIndex = 0,
                                this.closeBtn.getController("isPingbi").selectedIndex = 0) : (this.adBtn.getController("isPingbi").selectedIndex = 1,
                                    this.closeBtn.getController("isPingbi").selectedIndex = 1), this.foodLoad.onExternalLoadSuccess(R.previewTex);
                    var t = k.RoleList.find(function (e) {

                        return e.name == R.currRole;
                    }).isVip;
                    t && (f.playerData.useVipManCount += 1), f.playerData.useCustomManCount += 1, this.checkEgg(t),
                        R.taskIsFinish ? (I.play20(), this.c1.selectedIndex = 3, this.coinNum = t ? 450 : 150) : (I.play21(),
                            this.c1.selectedIndex = 1, this.coinNum = t ? 300 : 50), this.coinLabel.text = "" + this.coinNum,
                        f.playerData.Level++, f.playerData.doGuideTask(0);
                }
            }, {
                key: "onHide",
                value: function () {
                    i(n(h.prototype), "onHide", this).call(this), w.show()
                        // TY.LayaCore.SDK.hideBanner(),
                        //     TY.WXSDK.SDK.hideCustomAD(0), 
                        //     P.hideCustomAdShaugpai()
                        ;
                }
            }, {
                key: "checkEgg",
                value: function (e) {
                    e ? 1 == f.playerData.useVipManCount && 10 == f.playerData.useCustomManCount ? _.show("金色皇冠", "金色铲刀") : 1 == f.playerData.useVipManCount ? _.show("金色皇冠") : 10 == f.playerData.useCustomManCount && _.show("金色铲刀") : 10 == f.playerData.useCustomManCount && _.show("金色铲刀");
                }
            }, {
                key: "setCallback",
                value: function () {
                    console.log("backCallback");
                }
            }, {
                key: "giveCallback",
                value: function () {
                    this.playAddCoin(this.coinNum)/*, P.hideCustomAdShaugpai()*/;
                }
            }, {
                key: "videoCallback",
                value: function () {
                    var e = this;
                    C.showVideoByReport("战后结算", function () {
                        e.playAddCoin(2 * e.coinNum);
                    })/*, P.hideCustomAdShaugpai()*/;
                }
            }, {
                key: "playAddCoin",
                value: function (e) {
                    var t = this;
                    TY.LayaCore.Scene.gotoScene(l.Main, "gamescene", function () {
                        t.hide();
                    }), f.playerData.money += e;
                }
            }, {
                key: "onChanged",
                value: function () { }
            }, {
                key: "itemRenderer",
                value: function (e, t) { }
            }, {
                key: "onClickItem",
                value: function (e) { }
            }], [{
                key: "show",
                value: function () {
                    TY.LayaCore.UI.show(g.Urls.ResultUI);
                }
            }, {
                key: "hide",
                value: function () {
                    TY.LayaCore.UI.hide(g.Urls.ResultUI);
                }
            }]), h;
        }(v), b = function () {
            function e() {
                t(this, e);
            }
            return a(e, null, [{
                key: "getMeshVertexIdOffset",
                value: function (e, t, a) {
                    return a * (e.vertexStride / 4) + e.getVertexElementByUsage(t).offset / 4;
                }
            }]), e;
        }(), x = function () {
            function e() {
                t(this, e);
            }
            return a(e, null, [{
                key: "rotateByAxis",
                value: function (e, t, a) {
                    arguments.length > 3 && void 0 !== arguments[3] || new Laya.Vector3(0, 1, 0);
                }
            }, {
                key: "radianToEular",
                value: function (e) {
                    return 180 * e / Math.PI;
                }
            }, {
                key: "Vector2ToEular",
                value: function (e, t) {
                    var a, i = 0;
                    return a = Math.atan2(t, e), (i = 90 - (i = this.radianToEular(a))) < 0 && (i += 360),
                        i;
                }
            }, {
                key: "normalBy360",
                value: function (e) {
                    if (e < 0) for (; e < 0;) e += 360; else if (e > 360) for (; e > 360;) e -= 360;
                    return e;
                }
            }, {
                key: "lerp",
                value: function (e, t, a) {
                    return e + (t - e) * a;
                }
            }, {
                key: "getAnimalTime",
                value: function (e) {
                    return e.getControllerLayer().getCurrentPlayState().normalizedTime;
                }
            }]), e;
        }(), U = function () {
            function i() {
                t(this, i);
            }
            return a(i, null, [{
                key: "init",
                value: function () {
                    this.layaMesh = null, this.pingziModel = null, this.shovelCount = 0, this.shovelY = 0,
                        this.shovelStep = 1, this._AllWaterModel.length = 0;
                }
            }, {
                key: "makeSyrup",
                value: function (e) {
                    var t = this;
                    console.error("makeSyrup======", e), this.currInfo = e;
                    var a = k.TextureMap.find(function (t) {
                        return t.name == e.name;
                    });
                    S.setBaseTexName(a.tex), R.changeFlowParticle(e.name), Laya.Sprite3D.load(m.getD3FbxUrl(e.aModel), Laya.Handler.create(null, function (e) {
                        var a = e.clone();
                        a.name = "pingzi", t.pingziModel && (t.pingziModel.removeSelf(), t.pingziModel.destroy()),
                            t.pingziModel = a, R.handNode.getChildByName("Dummy001").getChildByName("Bone035_r").addChild(a),
                            a.transform.localRotationEulerZ = -90;
                    })), this.waterModel = Laya.loader.getRes(m.getD3FbxUrl("1310")).clone(), this._AllWaterModel.push(this.waterModel),
                        this.waterModel.getChildByName("Jelly_Level").getChildByName("1310").skinnedMeshRenderer.material.albedoColor = R.getNormColor(e.name),
                        this.scaleValue = 0, this.tempV3.setValue(0, 1, 0), this.waterModel.transform.localScale = this.tempV3,
                        TY.App.dispatchEventWith(y.updateAddMtlProgress, 0), R.zhuozi.addChild(this.waterModel);
                }
            }, {
                key: "playTouchStart",
                value: function () {
                    1 == R.currPart ? (R.handNode.active = !0, R.handCtrl.crossFade("handpour", .1),
                        R.handCtrl.speed = 1, Laya.timer.loop(100, this, this.checkPour), this.updateFlowNodePosition(),
                        I.play14()) : 2 == R.currPart ? (R.handCtrl.crossFade("handcut", .1), R.handCtrl.speed = 1,
                            Laya.timer.loop(50, this, this.checkCut), I.play15()) : 4 == R.currPart ? (0 == this.sprite.active && (this.c4TempNode || this.createTempNode(!0),
                                R.zhuozi.removeChildByName("1312"), this.startShrink(this.radias), this.sprite.active = !0,
                                this.c4TempNode.active = !0, R.handNode.active = !0, R.handCtrl.play("stall"), R.handCtrl.speed = 1),
                                fgui.GTween.to(3, 1.5, .3).onUpdate(function (e) {
                                    var t = e.value.x;
                                    R.handNode.transform.localPositionY = t;
                                }), I.play23()) : 6 == R.currPart && (R.handNode.active, I.play18());
                }
            }, {
                key: "playTouchMove",
                value: function (e, t) {
                    if (1 == R.currPart) R.handNode.transform.position.cloneTo(this.tempV3), this.tempV3.x -= e / 20,
                        this.tempV3.z -= t / 20, this.mixPourHandPos(this.tempV3), R.handNode.transform.position = this.tempV3,
                        this.updateFlowNodePosition(); else if (4 == R.currPart) {
                            this.c4TempNode.transform.position.cloneTo(this.tempV3), this.tempV3.x -= e / 20,
                                this.tempV3.z -= t / 20, this.mixTanjianbing(this.tempV3), this.c4TempNode.transform.position = this.tempV3,
                                this.checkPoint(this.c4TempNode.transform.position);
                            for (var a = this.touchPointArray.length - 1; a >= 0; a--) {
                                var i = this.touchPointArray[a], n = this.c4TempNode.transform.position.x - i.x, o = this.c4TempNode.transform.position.z - i.y;
                                this.getLengthByXY(n, o) < this.radias && this.touchPointArray.splice(a, 1);
                            }
                            TY.App.dispatchEventWith(y.updateAddMtlProgress, 1 - this.touchPointArray.length / (this.planeHeight * this.planeWidth));
                            var r = x.Vector2ToEular(e, t), s = this.c4TempNode.transform.localRotationEulerY, l = r, h = l - s, u = 0;
                            Math.abs(h) > 180 ? (h > 0 ? l -= 360 : l += 360, u = Laya.MathUtil.lerp(s, l, .1),
                                this.c4TempNode.transform.localRotationEulerY = x.normalBy360(u)) : this.c4TempNode.transform.localRotationEulerY = Laya.MathUtil.lerp(this.c4TempNode.transform.localRotationEulerY, r, .2),
                                u = Laya.MathUtil.lerp(s, l, .1), this.c4TempNode.transform.localRotationEulerY = x.normalBy360(u);
                        } else if (6 == R.currPart) {
                            if (this.c4TempNode.transform.position.cloneTo(this.tempV3), t > 0) return;
                            this.tempV3.x += t / 20, this.tempV3.x < -5 && (this.tempV3.x = -5), this.c4TempNode.transform.position = this.tempV3,
                                this.checkBoxToRole();
                        }
                }
            }, {
                key: "playTouchEnd",
                value: function () {
                    var e = this;
                    1 == R.currPart ? (R.handCtrl.crossFade("handtakeback", .1), Laya.timer.clear(this, this.checkPour),
                        R.flowNode.active = !1, this.scaleValue >= 1 && (TY.App.dispatchEventWith(y.ChangeAddSelectIndex, 0),
                            this.scaleValue = 0, R.playSmileParticle(), R.handNode.active = !1, Laya.timer.once(2e3, this, function () {
                                R.handNode.getChildByName("Dummy001").getChildByName("Bone035_r").removeChildByName("pingzi"),
                                    R.giveProp();
                            }))) : 2 == R.currPart ? (R.handCtrl.speed = 0, Laya.timer.clear(this, this.checkCut),
                                this.cutStep >= 5 && (TY.App.dispatchEventWith(y.ChangeAddSelectIndex, 0), TY.App.dispatchEventWith(y.hideAddMtlProgress),
                                    R.playSmileParticle(), this.cutStep = 0, Laya.timer.once(2e3, this, function () {
                                        R.giveProp();
                                    })), console.log("切东西的音效 stop")) : 4 == R.currPart ? (console.log("剩余点数:", this.touchPointArray.length),
                                        this.touchPointArray.length <= 7 ? (TY.App.dispatchEventWith(y.ChangeAddSelectIndex, 0),
                                            TY.App.dispatchEventWith(y.hideAddMtlProgress), this.touchPointArray.length = 0,
                                            this.restoreMesh(), R.handNode.removeSelf(), TY.LayaCore.Scene.curScene.sceneSprite.addChild(R.handNode),
                                            R.handNode.active = !1, this.c4TempNode.removeSelf(), this.c4TempNode.destroy(),
                                            this.c4TempNode = null, R.playSnowParticle(), Laya.timer.once(1e3, this, function () {
                                                R.playSmileParticle(), Laya.timer.once(2e3, e, function () {
                                                    L.setMainCameraPos(h.spreadOver, function () {
                                                        R.giveProp();
                                                    });
                                                });
                                            })) : fgui.GTween.to(1.5, 3, .3).onUpdate(function (e) {
                                                var t = e.value.x;
                                                R.handNode.transform.localPositionY = t;
                                            })) : 6 == R.currPart && -5 == this.c4TempNode.transform.position.x && (1 == this.shovelStep ? (this.shovelStep = 2,
                                                this.tempV3.setValue(5, 1.2, -1), this.c4TempNode.transform.position = this.tempV3) : 2 == this.shovelStep ? (this.shovelStep = 3,
                                                    this.tempV3.setValue(5, 1.2, -5), this.c4TempNode.transform.position = this.tempV3) : (TY.App.dispatchEventWith(y.ChangeAddSelectIndex, 0),
                                                        TY.App.dispatchEventWith(y.hideAddMtlProgress), R.playSmileParticle(), Laya.timer.once(2e3, this, function () {
                                                            R.giveProp();
                                                        })));
                }
            }, {
                key: "mixPourHandPos",
                value: function (e) {
                    var t = -this.planeWidth / 2 + .3, a = this.planeWidth / 2 - .3, i = this.planeHeight / 2 - 3, n = -this.planeHeight / 2 - 3;
                    e.x <= t && (e.x = t), e.x > a && (e.x = a), e.z > i && (e.z = i), e.z < n && (e.z = n);
                }
            }, {
                key: "mixTanjianbing",
                value: function (e) {
                    var t = -this.planeWidth / 2 + .3, a = this.planeWidth / 2 - .3, i = this.planeHeight / 2, n = -this.planeHeight / 2;
                    e.x <= t && (e.x = t), e.x > a && (e.x = a), e.z > i && (e.z = i), e.z < n && (e.z = n);
                }
            }, {
                key: "refreshTranform",
                value: function () {
                    1 == R.currPart && (TY.App.dispatchEventWith(y.ShowSelectMtlIndex, 1), R.handNode.active = !0,
                        this.tempV3.setValue(0, 0, 0), R.handNode.transform.position = this.tempV3, R.handCtrl.play("handpour"),
                        R.handCtrl.speed = 1, Laya.timer.frameOnce(1, this, function () {
                            R.handCtrl.speed = 0;
                        }), R.handNode.active = !1);
                }
            }, {
                key: "checkPour",
                value: function () {
                    this.getAnimalTime() >= 1 ? (this.scaleValue += .05, this.scaleValue > 1 && (this.scaleValue = 1),
                        this.tempV3.setValue(this.scaleValue, 1, this.scaleValue), this.waterModel.transform.localScale = this.tempV3,
                        R.flowNode.active = !0, TY.App.dispatchEventWith(y.updateAddMtlProgress, this.scaleValue)) : R.flowNode.active = !1;
                }
            }, {
                // key: "updateFlowNodePosition",
                // value: function () {
                //     if (this.pingziModel) {
                //         var e = this.pingziModel.getChildByName("a").transform.position;
                //         this.tempV3.setValue(e.x, 1, e.z), R.flowNode.transform.position = this.tempV3,
                //             R.flowNode.getChildByName("WaterVertical").transform.localPositionY = e.y - 1;
                //     }
                // }
                key: "updateFlowNodePosition",
                value: function () {
                    if (this.pingziModel) {
                        if (this.pingziModel.getChildByName("a")) {
                            var e = this.pingziModel.getChildByName("a").transform.position;
                            this.tempV3.setValue(e.x, 1, e.z), R.flowNode.transform.position = this.tempV3,
                                R.flowNode.getChildByName("WaterVertical").transform.localPositionY = e.y - 1;
                        }
                        else if (this.pingziModel.getChildByName("1")) {
                            var e = this.pingziModel.getChildByName("1").transform.position;
                            this.tempV3.setValue(e.x, 1, e.z), R.flowNode.transform.position = this.tempV3,
                                R.flowNode.getChildByName("WaterVertical").transform.localPositionY = e.y - 1;
                        }
                    }
                }
            }, {
                key: "checkCut",
                value: function () {
                    if (this.timer += 50, this.timer >= 500) {
                        if (this.timer -= 500, this.cutStep >= 5) return;
                        if (4 == this.cutStep) {
                            this.cutStep = 5, R.clearMakeNodeList();
                            // var t, a = e(R.makeInfoList);
                            // try {
                            //     for (a.s(); !(t = a.n()).done; ) {
                            //         var i = t.value, n = Laya.loader.getRes(m.getD3FbxUrl("1311")).clone();
                            //         n.getChildByName("1311").skinnedMeshRenderer.material.albedoColor = R.getNormColor(i.name), 
                            //         R.zhuozi.addChild(n), R.makeNodeList.push(n);
                            //     }
                            // } catch (e) {
                            //     e = VM2_INTERNAL_STATE_DO_NOT_USE_OR_PROGRAM_WILL_FAIL.handleException(e);
                            //     a.e(e);
                            // } finally {
                            //     a.f();
                            // }
                            return void TY.App.dispatchEventWith(y.updateAddMtlProgress, this.cutStep / 5);
                        }
                        this.cutStep += 1;
                        for (var o = 0; o < 4; o++) {
                            // var r, s = e(R.makeNodeList);
                            // try {
                            //     for (s.s(); !(r = s.n()).done; ) {
                            //         r.value.getChildAt(o).active = o == this.cutStep - 1, o == this.cutStep && console.log("展示第几个节点:", o);
                            //     }
                            // } catch (e) {
                            //     e = VM2_INTERNAL_STATE_DO_NOT_USE_OR_PROGRAM_WILL_FAIL.handleException(e);
                            //     s.e(e);
                            // } finally {
                            //     s.f();
                            // }
                        }
                        TY.App.dispatchEventWith(y.updateAddMtlProgress, this.cutStep / 5);
                    }
                }
            }, {
                key: "getAnimalTime",
                value: function () {
                    return x.getAnimalTime(R.handCtrl);
                }
            }, {
                key: "replaceCutModel",
                value: function () {
                    TY.App.dispatchEventWith(y.updateAddMtlProgress, 0), TY.App.dispatchEventWith(y.ChangeAddSelectIndex, 4),
                        R.clearMakeNodeList();
                    for (var t = 0; t < this._AllWaterModel.length - 1; t++) this._AllWaterModel[t].active = !1;
                    this.cutStep = 1, this.timer = 0;
                    // var a, i = e(R.makeInfoList);
                    // try {
                    //     for (i.s(); !(a = i.n()).done; ) {
                    //         var n = a.value;
                    //         Laya.Sprite3D.load(m.getD3FbxUrl(n.vModel), Laya.Handler.create(null, function(e) {
                    //             var t = e.clone();
                    //             R.zhuozi.addChild(t), R.makeNodeList.push(t);
                    //             for (var a = t.numChildren, i = 0; i < a; i++) t.getChildAt(i).active = 0 == i;
                    //         }));
                    //     }
                    // } catch (e) {
                    //     e = VM2_INTERNAL_STATE_DO_NOT_USE_OR_PROGRAM_WILL_FAIL.handleException(e);
                    //     i.e(e);
                    // } finally {
                    //     i.f();
                    // }
                    console.log("举起手来!"), this.tempV3.setValue(0, .82, -8.6), R.handNode.transform.position = this.tempV3,
                        R.handNode.active = !0, R.handCtrl.play("handlift"), R.handCtrl.speed = 1, Laya.timer.frameOnce(1, this, function () {
                            var e = new Laya.Vector3(), t = new Laya.Vector3();
                            e = R.leftShovel.transform.position, t = R.leftShovel.transform.rotationEuler, R.leftShovel.removeSelf(),
                                R.handNode.getChildByName("Dummy001").getChildByName("Bone035_l").addChild(R.leftShovel),
                                R.leftShovel.transform.position = e, R.leftShovel.transform.rotationEuler = t, e = R.rightShovel.transform.position,
                                t = R.rightShovel.transform.rotationEuler, R.rightShovel.removeSelf(), R.handNode.getChildByName("Dummy001").getChildByName("Bone035_r").addChild(R.rightShovel),
                                R.rightShovel.transform.position = e, R.rightShovel.transform.rotationEuler = t;
                        });
                }
            }, {
                key: "shrinkModel",
                value: function () {
                    for (var e = 0; e < R.zhuozi.numChildren; e++) {
                        var t = R.zhuozi.getChildAt(e).getComponent(Laya.Animator);
                        if (t) {
                            t.play("shrink"),
                                t.speed = 1;
                        }

                    }
                    R.handCtrl.play("handspade"), R.handCtrl.speed = 1, Laya.timer.loop(50, this, this.checkShrink),
                        I.play16();
                }
            }, {
                key: "checkShrink",
                value: function () {
                    if (this.getAnimalTime() >= 1) {
                        I.stopAllSound(), Laya.timer.clear(this, this.checkShrink),
                            this.rt = S.getRtByPreSet(256, 256),
                            R.clearModel(),
                            R.makeNodeList = [];
                        var e = Laya.loader.getRes(m.getD3FbxUrl("1312")).clone();
                        R.zhuozi.addChild(e);
                        var t = e.meshRenderer.material;
                        t.albedoTexture = this.rt, t.albedoColor = this.whiteColor, R.handNode.active = !0,
                            R.giveProp();
                    }
                }
            }, {
                key: "createPlane",
                value: function () {
                    L.setMainCameraPos(h.spreadJam), TY.App.dispatchEventWith(y.ChangeAddSelectIndex, 3),
                        TY.App.dispatchEventWith(y.updateAddMtlProgress, 0);
                    var e = Laya.PrimitiveMesh.createPlane(this.planeWidth, this.planeHeight, 200, 200), t = new Laya.MeshSprite3D(e), a = new Laya.BlinnPhongMaterial();
                    a.albedoTexture = this.rt, a.cull = Laya.RenderState.CULL_NONE, t.meshRenderer.material = a,
                        this.layaMesh = e, this.sprite = t, this.sprite.name = "plane", R.zhuozi.addChild(this.sprite),
                        this.sprite.transform.position = new Laya.Vector3(0, .15, 0), this.sprite.active = !1;
                    for (var i = 0; i <= this.planeWidth; i++) for (var n = -this.planeWidth / 2 + i, o = 0; o <= this.planeHeight; o++) {
                        var r = -this.planeHeight / 2 + o, s = new Laya.Vector2(n, r);
                        this.touchPointArray.push(s);
                    }
                }
            }, {
                key: "createTempNode",
                value: function () {
                    var e = arguments.length > 0 && void 0 !== arguments[0] && arguments[0];
                    this.c4TempNode = new Laya.Sprite3D(), this.c4TempNode.name = "tempNode", R.zhuozi.addChild(this.c4TempNode),
                        this.tempV3.setValue(0, 0, 0), this.c4TempNode.transform.position = this.tempV3,
                        R.handNode.removeSelf(), this.c4TempNode.addChild(R.handNode);
                    var t = R.rightShovel.getChildByName("a"), a = t.transform.localPositionX + t.transform.localPositionZ;
                    this.tempV3.setValue(0, 3, -a), R.handNode.transform.position = this.tempV3, this.c4TempNode.active = e;
                }
            }, {
                key: "startShrink",
                value: function (e) {
                    var t = this.layaMesh, a = t.getVertexDeclaration(), i = t._vertexBuffer.getFloat32Data();
                    null == this.vertexBufferOrigin && (this.vertexBufferOrigin = new Float32Array(i));
                    for (var n = 0; n < t.vertexCount; n++) {
                        var o = b.getMeshVertexIdOffset(a, Laya.VertexMesh.MESH_POSITION0, n), r = b.getMeshVertexIdOffset(a, Laya.VertexMesh.MESH_NORMAL0, n), s = b.getMeshVertexIdOffset(a, Laya.VertexMesh.MESH_TEXTURECOORDINATE0, n), l = this.uvToLocalPos(i[s], i[s + 1]), h = l.x, u = l.y, c = this.getLengthByXY(h, u);
                        if (c > e) {
                            var d = this.lerp(0, h, e / c), y = this.lerp(0, u, e / c), p = (c - e) / this.heightIns;
                            p > this.edgeHeightMax && (p = this.edgeHeightMax), i[o] = d, i[o + 1] = p, i[o + 2] = y,
                                y > 0 ? this.tempV3.setValue(0 - h, 0, 0 - u) : this.tempV3.setValue(h, 0, u), Laya.Vector3.normalize(this.tempV3, this.tempV3),
                                i[r] = this.tempV3.x, i[r + 1] = this.tempV3.y, i[r + 2] = this.tempV3.z;
                        }
                    }
                    t._vertexBuffer.setData(i.buffer);
                }
            }, {
                key: "uvToLocalPos",
                value: function (e, t) {
                    return {
                        x: e = (e - .5) * this.planeWidth,
                        y: t = (t - .5) * this.planeHeight
                    };
                }
            }, {
                key: "getLengthByXY",
                value: function (e, t) {
                    return Math.sqrt(e * e + t * t);
                }
            }, {
                key: "lerp",
                value: function (e, t, a) {
                    return e + (t - e) * a;
                }
            }, {
                key: "checkPoint",
                value: function (e) {
                    if (null != this.vertexBufferOrigin && (this.frameIndex++, this.frameIndex % 5 == 0)) {
                        this.sprite.transform.globalToLocal(e, this.tempV3);
                        for (var t = this.tempV3.x, a = this.tempV3.z, i = this.layaMesh.getVertexDeclaration(), n = this.layaMesh._vertexBuffer.getFloat32Data(), o = 0; o < this.layaMesh.vertexCount; o++) {
                            var r = b.getMeshVertexIdOffset(i, Laya.VertexMesh.MESH_POSITION0, o), s = b.getMeshVertexIdOffset(i, Laya.VertexMesh.MESH_NORMAL0, o), l = b.getMeshVertexIdOffset(i, Laya.VertexMesh.MESH_TEXTURECOORDINATE0, o), h = n[r], u = n[r + 2];
                            if (this.getLengthByXY(h - t, u - a) < this.radias) {
                                var c = this.uvToLocalPos(n[l], n[l + 1]), d = c.x, y = c.y, p = this.getLengthByXY(d - t, y - a);
                                if (p < this.radias) n[r] = this.vertexBufferOrigin[r], n[r + 1] = this.vertexBufferOrigin[r + 1],
                                    n[r + 2] = this.vertexBufferOrigin[r + 2], n[s] = this.vertexBufferOrigin[s], n[s + 1] = this.vertexBufferOrigin[s + 1],
                                    n[s + 2] = this.vertexBufferOrigin[s + 2]; else {
                                    var f = this.lerp(t, d, this.radias / p), m = this.lerp(a, y, this.radias / p);
                                    n[r] = f, n[r + 2] = m;
                                    var g = (p - this.radias) / this.heightIns;
                                    g > this.edgeHeightMax && (g = this.edgeHeightMax), n[r + 1] = g;
                                }
                            }
                        }
                        this.layaMesh._vertexBuffer.setData(n.buffer);
                    }
                }
            }, {
                key: "restoreMesh",
                value: function () {
                    for (var e = this.layaMesh.getVertexDeclaration(), t = this.layaMesh._vertexBuffer.getFloat32Data(), a = 0; a < this.layaMesh.vertexCount; a++) {
                        var i = b.getMeshVertexIdOffset(e, Laya.VertexMesh.MESH_POSITION0, a), n = b.getMeshVertexIdOffset(e, Laya.VertexMesh.MESH_NORMAL0, a);
                        b.getMeshVertexIdOffset(e, Laya.VertexMesh.MESH_TEXTURECOORDINATE0, a), t[i] = this.vertexBufferOrigin[i],
                            t[i + 1] = this.vertexBufferOrigin[i + 1], t[i + 2] = this.vertexBufferOrigin[i + 2],
                            t[n] = this.vertexBufferOrigin[n], t[n + 1] = this.vertexBufferOrigin[n + 1], t[n + 2] = this.vertexBufferOrigin[n + 2];
                    }
                    this.layaMesh._vertexBuffer.setData(t.buffer);
                }
            }, {
                key: "selectFood",
                value: function () {
                    E.show(0), TY.App.dispatchEventWith(y.ChangeAddSelectIndex, 0);
                }
            }, {
                key: "selectMould",
                value: function (e) {
                    var t = this;
                    this.selectMouldName = e;
                    var a = "", i = "";
                    switch (e) {
                        case "便便":
                            a = "1404_01", i = "1404_002";
                            break;

                        case "花形":
                            a = "1405_01", i = "1405_002";
                            break;

                        case "卷卷":
                            a = "";
                            break;

                        case "平铺":
                            a = "1401_01", i = "1401_002";
                            break;

                        case "星星":
                            a = "1403_01", i = "1403_002";
                    }
                    "卷卷" != e ? (this.currCutName = i, this.mouldAnim = Laya.loader.getRes(m.getD3FbxUrl("mouldAnim")).clone(),
                        R.zhuozi.addChild(this.mouldAnim), Laya.Sprite3D.load(m.getD3FbxUrl(a), Laya.Handler.create(null, function (e) {
                            var a = e.clone();
                            a.name = "mould", t.mouldAnim.addChild(a), R.handNode.removeSelf(), t.mouldAnim.addChild(R.handNode),
                                t.tempV3.setValue(0, 0, 0), t.mouldAnim.transform.position = t.tempV3, R.handNode.transform.localPosition = t.tempV3,
                                R.handNode.active = !0, R.handCtrl.play("mould"), R.handCtrl.speed = 1, t.tempV3.setValue(0, 0, 0),
                                a.transform.localPosition = t.tempV3, R.leftShovel.active = !1, R.rightShovel.active = !1,
                                t.mouldAnim.getComponent(Laya.Animator).play("move1"), Laya.timer.loop(100, t, t.checkMouldMove1),
                                Laya.timer.once(2400, t, function () {
                                    I.play17();
                                });
                        }))) : console.log("卷卷不需要压模具");
                }
            }, {
                key: "checkMouldMove1",
                value: function () {
                    x.getAnimalTime(this.mouldAnim.getComponent(Laya.Animator)) >= 1 && (Laya.timer.clear(this, this.checkMouldMove1),
                        this.pressMouldChangeModel());
                }
            }, {
                key: "checkMouldMove2",
                value: function () {
                    x.getAnimalTime(this.mouldAnim.getComponent(Laya.Animator)) >= 1 && (Laya.timer.clear(this, this.checkMouldMove2),
                        R.handNode.removeSelf(), TY.LayaCore.Scene.curScene.sceneSprite.addChild(R.handNode),
                        R.handNode.active = !1, this.mouldAnim.removeSelf(), this.mouldAnim.destroy(), R.giveProp());
                }
            }, {
                key: "pressMouldChangeModel",
                value: function () {
                    var e = this;
                    Laya.Sprite3D.load(m.getD3FbxUrl(this.currCutName), Laya.Handler.create(null, function (t) {
                        var a = t.clone();
                        a.name = "cutMould", a.transform.localRotationEulerY = -90, R.zhuozi.addChild(a),
                            e.boxListNode = a, console.log("加入的切片模块:", e.boxListNode.numChildren), e.sprite.destroy(),
                            e.sprite = null;
                        for (var i = [], n = 0; n < e.boxListNode.numChildren; n++) {
                            var o = 3 + 5 * Math.random();
                            i.push(o);
                            var r = e.boxListNode.getChildAt(n);
                            if (r.getComponent(Laya.Rigidbody3D)) {

                                r.getComponent(Laya.Rigidbody3D).enabled = !1;
                                var s = r.meshRenderer.sharedMaterial;
                                s.albedoTexture = e.rt, s.albedoColor = e.whiteColor;
                            }
                        }
                        fgui.GTween.to(0, Math.PI, 1).onUpdate(function (t) {
                            for (var a = t.value.x, n = Math.sin(a), o = 0; o < e.boxListNode.numChildren; o++) e.boxListNode.getChildAt(o).transform.localPositionY = n * i[o];
                        }).onComplete(function () {
                            e.mouldAnim.getComponent(Laya.Animator).play("move2"), Laya.timer.loop(100, e, e.checkMouldMove2);
                        });
                    }));
                }
            }, {
                key: "boxJump",
                value: function () {
                    var e = this;
                    if (this.boxJumpIndex >= this.boxListNode.numChildren) {
                        Laya.timer.clear(this, this.boxJump);
                        var t = R.zhuozi.getChildByName("mould");
                        fgui.GTween.to(0, 2, 2).onUpdate(function (a) {
                            var i = a.value.x;
                            i < 1 || (e.tempV3.setValue(0, 5.5 * (i - 1) - .5, 0), t.transform.localPosition = e.tempV3);
                        }).onComplete(function () {
                            fgui.GTween.to(0, 1, 1).onUpdate(function (a) {
                                var i = a.value.x;
                                e.tempV3.setValue(0, 5, 20 * i), t.transform.localPosition = e.tempV3;
                            }).onComplete(function () {
                                R.handNode.removeSelf(), TY.LayaCore.Scene.curScene.sceneSprite.addChild(R.handNode),
                                    R.handNode.active = !1, t.removeSelf(), t.destroy(), R.giveProp();
                            });
                        });
                    } else {
                        var a = this.boxListNode.getChildAt(this.boxJumpIndex);
                        this.boxJumpIndex += 1, fgui.GTween.to(0, Math.PI, .5).onUpdate(function (e) {
                            var t = e.value.x, i = Math.sin(t);
                            a.transform.localPositionY = 3 * i;
                        });
                    }
                }
            }, {
                key: "readyShovel",
                value: function () {
                    L.setMainCameraPos(h.scoopYogurt, function () {
                        TY.App.dispatchEventWith(y.ChangeAddSelectIndex, 6), TY.App.dispatchEventWith(y.updateAddMtlProgress, 0);
                    }), this.createTempNode(), R.handNode.active = !0, this.tempV3.setValue(5, 1.2, 3.6),
                        this.c4TempNode.transform.position = this.tempV3, this.c4TempNode.transform.localRotationEulerY = -90,
                        this.c4TempNode.active = !0, R.handCtrl.play("shovel"), R.handCtrl.speed = 1, R.leftShovel.active = !0,
                        R.rightShovel.active = !0;
                }
            }, {
                key: "checkBoxToRole",
                value: function () {
                    var e;
                    e = 1 == this.shovelStep ? 1.5 : 2 == this.shovelStep ? -2.5 : -10;
                    for (var t = this.c4TempNode.transform.position.x, a = this.boxListNode.numChildren - 1; a >= 0; a--) {
                        var i = this.boxListNode.getChildAt(a), n = i.transform.position;
                        n.z >= e && n.x > t && (i.removeSelf(), R.wanNode.addChild(i), i.transform.position = n,
                            this.boxJumpToWan(i));
                    }
                    var o = R.wanNode.numChildren, r = this.boxListNode.numChildren;
                    TY.App.dispatchEventWith(y.updateAddMtlProgress, o / (o + r));
                }
            }, {
                key: "boxJumpToWan",
                value: function (e) {
                    var t = this;
                    this.boxIndex++;
                    var a = e.transform.position.x, i = (e.transform.position.y, e.transform.position.z), n = this.getPosNumber();
                    n || console.log("data出现问题");
                    var o = R.wanNode.transform.position, r = o.x - n.x, s = n.y, l = o.z - n.z, h = R.wanNode.layer;
                    console.log("碗的层级:", h, " node层级:", e.layer), e.layer = h, this.boxIndex, fgui.GTween.to(0, 1, 1).onUpdate(function (n) {
                        var o = n.value.x;
                        t.tempV3.setValue(x.lerp(a, r, o), s + 5 * Math.sin(o * Math.PI), x.lerp(i, l, o)),
                            e.transform.position = t.tempV3, e.transform.localScaleX = 1 - .3 * o, e.transform.localScaleZ = 1 - .3 * o;
                    }).onComplete(function () { });
                }
            }, {
                key: "getPosNumber",
                value: function () {
                    for (var e = 0, t = 0, a = 0; a < this.YUtilArray.length; a++) if (t = e, e += this.YUtilArray[a],
                        this.shovelCount <= e) {
                        this.shovelCount++;
                        var i = .2 * a;
                        this.shovelY = i;
                        var n, o = Math.random() * Math.PI * 2, r = .3;
                        return a < 2 && (r = .3), a < 4 && (r = .4), a < 6 && (r = .5), a < 8 && (r = .6),
                            a >= 8 && (r = .8), {
                            x: (n = this.shovelCount - t < 4 ? (this.shovelCount - t) / this.YUtilArray[a] * r : r) * Math.cos(o),
                            y: i,
                            z: n * Math.sin(o)
                        };
                    }
                }
            }]), i;
        }();
        U.camPos = {
            pos: new Laya.Vector3(-18.7, 21.2, -.17),
            rotate: new Laya.Vector3(37.5, 89.4, 0)
        }, U.whiteColor = new Laya.Vector4(1, 1, 1, 1), U.tempV3 = new Laya.Vector3(), U.pingziModel = null,
            U._AllWaterModel = [], U.waterModel = null, U.c4TempNode = null, U.scaleValue = 0,
            U.cutStep = 1, U.timer = 0, U.planeHeight = 12, U.planeWidth = 7.5, U.edgeHeightMax = .2,
            U.heightIns = 8, U.radias = 2, U.touchPointArray = [], U.selectMouldName = "", U.boxJumpIndex = 0,
            U.YUtilArray = [4, 4, 6, 6, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8], U.shovelStep = 1,
            U.shovelCount = 0, U.shovelY = 0, U.frameIndex = 0, U.boxIndex = 0;
        var E = function (e) {
            o(l, e);
            var s = r(l);
            function l() {
                var e;
                return t(this, l), (e = s.apply(this, arguments)).modal = !1, e._proValue = 0, e;
            }
            return a(l, [{
                key: "UIPack",
                get: function () {
                    return g.Pack.Game;
                }
            }, {
                key: "UICom",
                get: function () {
                    return g.Res.SelectFoodUI;
                }
            }, {
                key: "proValue",
                get: function () {
                    return this._proValue;
                },
                set: function (e) {
                    this._proValue = e, 0 == this._proValue && (this._proValue = .001), this.progressBar.value = 100 * this._proValue;
                }
            }, {
                key: "onInit",
                value: function () {
                    i(n(l.prototype), "onInit", this).call(this), this.finger = this.contentPane.getChild("finger").asImage,
                        this.c1 = this.contentPane.getController("c1"), this.c2 = this.contentPane.getController("c2"),
                        this.progressBar = this.contentPane.getChild("n0").asProgress, this.propList = this.contentPane.getChild("n3").asList,
                        this.propList.itemRenderer = Laya.Handler.create(this, this.itemRenderer, null, !1),
                        this.propList.on(fairygui.Events.CLICK_ITEM, this, this.onClickItem), this.leftZsp = this.contentPane.getChild("left").asButton,
                        this.rightZsp = this.contentPane.getChild("right").asButton, this.leftZsp.onClick(this, this.leftBtnClick),
                        this.rightZsp.onClick(this, this.rightBtnClick), TY.App.on(y.updateOrnameProgress, this.updateOrnameProgress, this);
                }
            }, {
                key: "onShown",
                value: function () {
                    i(n(l.prototype), "onShown", this).call(this)/*, TY.LayaCore.SDK.showBanner()*/, this.breathTween && (this.breathTween.kill(),
                        this.breathTween = null), this.propList.selectedIndex = -1, this.c1.selectedIndex = this.data,
                        this.proValue = 0, this.propList.touchable = !0, this.propList.visible = 0 == this.c1.selectedIndex,
                        0 == this.c1.selectedIndex ? (this.progressBar.visible = !1, this.propList.numItems = 4) : (this.progressBar.visible = !0,
                            this.leftZsp.title = R.propList[0], this.leftZsp.icon = m.getPropIconUrl(k.itemList.find(function (e) {
                                return e.name == R.propList[0];
                            }).english), A.currSelectOrname = R.propList[0], 2 == R.propList.length ? (this.c2.selectedIndex = 0,
                                this.rightZsp.icon = m.getPropIconUrl(k.itemList.find(function (e) {
                                    return e.name == R.propList[1];
                                }).english), this.rightZsp.title = R.propList[1]) : (this.c2.selectedIndex = 1,
                                    this.leftZsp.touchable = !1));
                    var e = this.propList.getChildAt(0);
                    e && (this.breathTween = fgui.GTween.to(1, .8, .5).onUpdate(function (t) {
                        e.setScale(t.value.x, t.value.x);
                    }).setEase(fgui.EaseType.Linear).setRepeat(-1, !0)), this.finger.visible = !1, Laya.timer.once(2e3, this, this.showSliderImg);
                }
            }, {
                key: "showSliderImg",
                value: function () {
                    1 == this.c1.selectedIndex && (this.finger.visible = !0);
                }
            }, {
                key: "onHide",
                value: function () {
                    i(n(l.prototype), "onHide", this).call(this)/*, TY.LayaCore.SDK.hideBanner()*/;
                }
            }, {
                key: "updateOrnameProgress",
                value: function (e) {
                    var t = e.data;
                    this.proValue = t;
                }
            }, {
                key: "backCallback",
                value: function () {
                    console.log("backCallback");
                }
            }, {
                key: "touchDown",
                value: function () {
                    R.playTouchStart(), this.finger.visible = !1, Laya.timer.clear(this, this.showSliderImg);
                }
            }, {
                key: "touchUp",
                value: function () {
                    R.playTouchEnd(), Laya.timer.clear(this, this.showSliderImg), Laya.timer.once(2e3, this, this.showSliderImg);
                }
            }, {
                key: "touchMove",
                value: function () {
                    R.playTouchMove(this.deltaX, this.deltaY);
                }
            }, {
                key: "itemRenderer",
                value: function (e, t) {
                    t.getController("model").selectedIndex = e, t.setPivot(.5, .5), t.setScale(1, 1);
                }
            }, {
                key: "onClickItem",
                value: function (e) {
                    var t = this;
                    this.propList.touchable = !1;
                    var a = e.getController("model").selectedPage;
                    console.log("name:", a), U.selectMould(a), Laya.timer.once(200, this, function () {
                        t.hide();
                    });
                }
            }, {
                key: "itemRenderer2",
                value: function (e, t) {
                    var a = R.propList[e], i = k.ornament.find(function (e) {
                        return e.name == a;
                    });
                    console.log("我尼玛:", i), t.icon = m.getPropIconUrl(i.english), t.name = a, 0 == e && (A.currSelectOrname = a);
                }
            }, {
                key: "onClickItem2",
                value: function (e) {
                    A.currSelectOrname = e.name;
                }
            }, {
                key: "leftBtnClick",
                value: function () {
                    A.currSelectOrname = R.propList[0];
                }
            }, {
                key: "rightBtnClick",
                value: function () {
                    A.currSelectOrname = R.propList[1];
                }
            }], [{
                key: "show",
                value: function (e) {
                    TY.LayaCore.UI.show(g.Urls.SelectFoodUI, e);
                }
            }, {
                key: "hide",
                value: function () {
                    TY.LayaCore.UI.hide(g.Urls.SelectFoodUI);
                }
            }]), l;
        }(v), A = function () {
            function e() {
                t(this, e);
            }
            return a(e, null, [{
                key: "makeOrnament",
                value: function () {
                    this.propNode = Laya.loader.getRes(m.getD3FbxUrl("1107")).clone(), this.propAnimator = this.propNode.getChildAt(0).getComponent(Laya.Animator),
                        this.propAnimator.speed = 0, this.tempV3.setValue(R.wanPos.x, 10, 0), R.zhuozi.addChild(this.propNode),
                        this.propNode.transform.position = this.tempV3, this.addCount = 0, console.log("新层级:", this.propNode.layer);
                }
            }, {
                key: "showOramentUI",
                value: function () {
                    L.setMainCameraPos(h.ornament, function () {
                        TY.App.dispatchEventWith(y.ShowSelectMtlIndex, 2);
                    }), U.c4TempNode.removeSelf(), U.c4TempNode.destroy(), U.c4TempNode = null, this.makeOrnament();
                }
            }, {
                key: "playTouchStart",
                value: function () {
                    this.addCount >= this.maxCount || (Laya.timer.loop(500, this, this.getCurrMtlProgress),
                        this.propAnimator.speed = 1, this.propAnimator.play("attack", 0, 0), I.play19());
                }
            }, {
                key: "playTouchMove",
                value: function (e, t) {
                    this.moveProp(e, t);
                }
            }, {
                key: "playTouchEnd",
                value: function () {
                    var e = this;
                    this.propAnimator.speed = 0, Laya.timer.clear(this, this.getCurrMtlProgress), this.addCount >= this.maxCount && (this.addCount = 0,
                        R.playSmileParticle(), Laya.timer.once(2e3, this, function () {
                            L.setMainCameraPos(h.eatYogurt), console.log("可以在这里播放吃的动作，播完之后调用gotoResultUI"),
                                e.playEatAni();
                        }));
                }
            }, {
                key: "getCurrMtlProgress",
                value: function () {
                    var e = this, t = this.currSelectOrname, a = k.OrnametMap.find(function (e) {
                        return e.name == t;
                    });
                    if (a) {
                        var i = a.aModel;
                        if (0 != i.length) {
                            var n = k.getRandomItem(i);
                            Laya.Sprite3D.load(m.getD3FbxUrl(n), Laya.Handler.create(null, function (t) {
                                e.addCount += 1;
                                var a = t.clone(), i = a.getComponent(Laya.Rigidbody3D);
                                i && (i.enabled = !1), a.layer = 9, R.wanNode.addChild(a), e.propNode.transform.position.cloneTo(e.tempV3),
                                    e.tempV3.y -= 2, a.transform.position = e.tempV3;
                                var n = e.tempV3.x, o = e.tempV3.y, r = e.tempV3.z, s = U.shovelY + .3;
                                fgui.GTween.to(o, s, .8).onUpdate(function (e) {
                                    var t = e.value.x;
                                    a.transform.position.setValue(n, t, r), a.transform.position = a.transform.position;
                                }), TY.App.dispatchEventWith(y.updateOrnameProgress, e.addCount / e.maxCount);
                            }));
                        }
                    } else console.log("list为空,currOname:", t);
                }
            }, {
                key: "moveProp",
                value: function (e, t) {
                    this.propNode && (this.propNode.transform.position.cloneTo(this.tempV3), this.tempV3.x += t / 50,
                        this.tempV3.z -= e / 50, this.mixTanjianbing(this.tempV3), this.propNode.transform.position = this.tempV3);
                }
            }, {
                key: "mixTanjianbing",
                value: function (e) {
                    var t = R.wanPos.x - 1, a = R.wanPos.x + 1;
                    e.x <= t && (e.x = t), e.x > a && (e.x = a), e.z > 1 && (e.z = 1), e.z < -1 && (e.z = -1);
                }
            }, {
                key: "playEatAni",
                value: function () {
                    var e = this;
                    this.propNode.active = !1, Laya.timer.once(500, this, function () {
                        e.setRgEnable(R.wanNode), console.log(R.wanNode.transform.localPosition), R.curHandPosObj.addChild(R.wanNode),
                            R.wanPos.cloneTo(R.wanNode.transform.position), R.wanNode.transform.position = R.wanNode.transform.position,
                            R.wanNode.transform.localRotationEuler.setValue(0, 0, 0), R.wanNode.transform.localRotationEuler = R.wanNode.transform.localRotationEuler,
                            console.log(R.wanNode.transform.localPosition), Laya.Tween.to(R.wanNode.transform, {
                                localPositionX: 0,
                                localPositionY: 0,
                                localPositionZ: 0
                            }, 500);
                    }), R.roleAnimator.play("eat", 0, 0), Laya.timer.frameLoop(1, this, this.checkEatFinish),
                        B.hide(), E.hide();
                }
            }, {
                key: "checkEatFinish",
                value: function () {
                    x.getAnimalTime(R.roleAnimator) >= 1 && (TY.LayaCore.Scene.curScene.sceneSprite.addChild(R.wanNode),
                        R.wanPos.cloneTo(R.wanNode.transform.position), R.wanNode.transform.position = R.wanNode.transform.position,
                        R.wanNode.transform.rotationEuler.setValue(0, 90, 0), R.wanNode.transform.rotationEuler = R.wanNode.transform.rotationEuler,
                        this.gotoResultUI(), Laya.timer.clear(this, this.checkEatFinish));
                }
            }, {
                key: "gotoResultUI",
                value: function () {
                    B.hide(), E.hide();
                    var e = function () {
                        D.show();
                    };
                    1 == TY.LayaCore.SDKModel.getAdRate(u.kjkd) && !TY.LayaCore.SDKModel.isPingbi && TY.WXSDK.SDKModel.IsRateTime ? TY.WXSDK.FastClickOverUI.show(e) : e();
                }
            }, {
                key: "setRgEnable",
                value: function (e) {
                    if (null != e) {
                        var t = e.getComponent(Laya.Rigidbody3D);
                        if (t && (t.enabled = !1), 0 != e.numChildren) for (var a = 0; a < e.numChildren; a++) {
                            var i = e.getChildAt(a);
                            i.transform.localPositionY < .1 && (i.active = !1), this.setRgEnable(i);
                        }
                    }
                }
            }]), e;
        }();
        A.tempV3 = new Laya.Vector3(), A.currSelectOrname = "", A.addCount = 0, A.maxCount = 10;
        var R = function () {
            function i() {
                t(this, i);
            }
            return a(i, null, [{
                key: "initCamera",
                value: function () {
                    L.init(), U.init(), this.preViewCamera = TY.LayaCore.Scene.curScene.sceneSprite.getChildByName("Camera"),
                        this.cameraRT || (this.cameraRT = new Laya.RenderTexture(750, 750, Laya.RenderTextureFormat.R8G8B8A8)),
                        this.preViewCamera.renderTarget = this.cameraRT, this.preViewCamera.renderingOrder = 10,
                        this.preViewCamera.orthographicVerticalSize = 14, this.preViewCamera.removeAllLayers(),
                        this.preViewCamera.addLayer(9), this.preViewCamera.clearFlag = Laya.CameraClearFlags.SolidColor,
                        this.preViewCamera.clearColor = new Laya.Vector4(0, 0, 0, 0), this.previewTex = new Laya.Texture(this.preViewCamera.renderTarget),
                        this.preViewCamera.transform.position = new Laya.Vector3(-2.7, 4.7, 0), this.preViewCamera.transform.localRotationEuler = new Laya.Vector3(-45, 90, 0),
                        this.preViewCamera.active = !0;
                    var e = TY.LayaCore.Scene.curScene.sceneSprite.getChildByName("LiziCamera");
                    e.active = !0, e.clearFlag = Laya.CameraClearFlags.DepthOnly, e.clearColor = new Laya.Vector4(0, 0, 0, 0),
                        e.renderingOrder = 2;
                    var t = TY.LayaCore.Scene.curScene.sceneSprite.getChildByName("Main Camera");
                    t.renderingOrder = 1, t.clearFlag = Laya.CameraClearFlags.SolidColor;
                }
            }, {
                key: "setField",
                value: function () {
                    var e = f.playerData.playPropConfig["面板"], t = TY.LayaCore.Scene.curScene.sceneSprite.getChildByName("changjing").getChildByName("zhuozi"), a = TY.LayaCore.Scene.curScene.sceneSprite.getChildByName("field"), i = k.userConfigList.find(function (t) {
                        return t.name == e;
                    }).aModel;
                    if ("电脑机箱" == e || "马桶盖" == e || "树墩子" == e) for (var n = 0; n < t.numChildren; n++) {
                        var o = t.getChildAt(n);
                        o.active = o.name == i;
                    } else for (var r = 0; r < a.numChildren; r++) {
                        var s = a.getChildAt(r);
                        s.active = s.name == i;
                    }
                }
            }, {
                key: "startGame",
                value: function () {
                    this.initData(), this.initHand(), this.initWan(), this.initCanzi();
                }
            }, {
                key: "initData",
                value: function () {
                    this.currRole = null, this.propList.length = 0, this.currPart = 0, this.makeInfoList = [],
                        this.makeNodeList = [], this.zhuozi = TY.LayaCore.Scene.curScene.sceneSprite.getChildByName("Zhuozi"),
                        this.flowNode = TY.LayaCore.Scene.curScene.sceneSprite.getChildByName("Flow"), this.smileNode = TY.LayaCore.Scene.curScene.sceneSprite.getChildByName("smile"),
                        this.snowNode = TY.LayaCore.Scene.curScene.sceneSprite.getChildByName("snow"), this.smileNode.active = !1;
                }
            }, {
                key: "initHand",
                value: function () {
                    this.handNode && (this.handNode.removeSelf(), this.handNode.destroy());
                    var e = k.userConfigList.find(function (e) {
                        return e.name == f.playerData.playPropConfig["手套"];
                    });
                    this.handNode = Laya.loader.getRes(m.getD3FbxUrl(e.aModel)).clone(), this.handNode.name = "hand",
                        this.handCtrl = this.handNode.getComponent(Laya.Animator), TY.LayaCore.Scene.curScene.sceneSprite.addChild(this.handNode),
                        this.tempV3.setValue(0, .82, -8.6), this.handNode.transform.position = this.tempV3,
                        this.handNode.active = !1;
                }
            }, {
                key: "initWan",
                value: function () {
                    this.wanNode && (this.wanNode.removeSelf(), this.wanNode.destroy());
                    var e = k.userConfigList.find(function (e) {
                        return e.name == f.playerData.playPropConfig["碗"];
                    });
                    this.wanNode = Laya.loader.getRes(m.getD3FbxUrl(e.aModel)).clone(), TY.LayaCore.Scene.curScene.sceneSprite.addChild(this.wanNode),
                        this.wanNode.transform.position = this.wanPos;
                }
            }, {
                key: "initCanzi",
                value: function () {
                    var e = k.userConfigList.find(function (e) {
                        return e.name == f.playerData.playPropConfig["铲子"];
                    }), t = Laya.loader.getRes(m.getD3FbxUrl(e.aModel));
                    this.leftShovel = t.clone(), this.rightShovel = t.clone(), this.leftShovel.transform.localRotationEulerY = -90,
                        this.rightShovel.transform.localRotationEulerY = -90, TY.LayaCore.Scene.curScene.sceneSprite.addChild(this.leftShovel),
                        this.tempV3.setValue(2.5, .82, -10.8), this.leftShovel.transform.position = this.tempV3,
                        TY.LayaCore.Scene.curScene.sceneSprite.addChild(this.rightShovel), this.tempV3.setValue(-2.5, .82, -10.8),
                        this.rightShovel.transform.position = this.tempV3;
                }
            }, {
                key: "includeTaskRole",
                value: function (e) {
                    return -1 != this.taskNeedMtl.findIndex(function (t) {
                        return t == e;
                    });
                }
            }, {
                key: "setRole",
                value: function (e, t) {
                    this.currRole = e, this.taskNeedMtl = k.taskList.find(function (e) {
                        return e.id == t;
                    }).mtl, this.taskIsFinish = !1, console.log("玩家角色:", e, " 任务id:", t, "所需材料:", this.taskNeedMtl);
                }
            }, {
                key: "addProp",
                value: function (e) {
                    this.propList.push(e), console.log("道具库:", this.propList), this.taskIsFinish || (0 == this.taskNeedMtl.length || this.taskNeedMtl.indexOf(e) >= 0) && (this.taskIsFinish = !0,
                        console.log("已经完成任务!"));
                }
            }, {
                key: "giveProp",
                value: function () {
                    if (this.touchKey = !0, this.propList.length <= 0) return console.log("道具栏空了,进入下一阶段"),
                        void this.nextStep();
                    var e = this.propList.shift();
                    console.log("从兜里掏出道具:", e);
                    var t = k.itemModelList.find(function (t) {
                        return t.name == e;
                    });
                    TY.App.dispatchEventWith(y.ChangeAddSelectIndex, null == t ? void 0 : t.type), 0 == this.currPart ? (this.makeInfoList.push(t),
                        T.makeMaterial(t)) : 1 == this.currPart ? U.makeSyrup(t) : this.currPart;
                }
            }, {
                key: "clearModel",
                value: function () {
                    for (var e = this.zhuozi.numChildren - 1; e >= 0; e--) this.zhuozi.removeChildAt(e).destroy();
                }
            }, {
                key: "clearMakeNodeList",
                value: function () {
                    // var t, a = e(this.makeNodeList);
                    // try {
                    //     for (a.s(); !(t = a.n()).done; ) {
                    //         var i = t.value;
                    //         i.removeSelf(), i.destroy();
                    //     }
                    // } catch (e) {
                    //     e = VM2_INTERNAL_STATE_DO_NOT_USE_OR_PROGRAM_WILL_FAIL.handleException(e);
                    //     a.e(e);
                    // } finally {
                    //     a.f();
                    // }
                    this.makeNodeList.length = 0;
                }
            }, {
                key: "nextStep",
                value: function () {
                    this.currPart++, console.log("下一步!", this.currPart), C.report("Level_start", {
                        level: i.currPart
                    }), 1 == this.currPart ? (console.log("展现糖浆界面"), U.refreshTranform()) : 2 == this.currPart ? U.replaceCutModel() : 3 == this.currPart ? U.shrinkModel() : 4 == this.currPart ? U.createPlane() : 5 == this.currPart ? U.selectFood() : 6 == this.currPart ? U.readyShovel() : 7 == this.currPart && (console.log("展现装饰物界面"),
                        TY.LayaCore.Utils.GameUtils.setLayer(this.wanNode, 9), A.showOramentUI());
                }
            }, {
                key: "playTouchStart",
                value: function () {
                    console.log("当前步骤:", this.currPart), this.curStepTmp = this.currPart, 0 != this.touchKey && (0 == this.currPart ? T.playTouchStart() : 1 == this.currPart || 2 == this.currPart || 4 == this.currPart || 6 == this.currPart ? U.playTouchStart() : 7 == this.currPart && A.playTouchStart());
                }
            }, {
                key: "playTouchMove",
                value: function (e, t) {
                    0 != this.touchKey && this.curStepTmp == this.currPart && (0 == this.currPart ? T.playTouchMove(e, t) : 1 == this.currPart || 4 == this.currPart || 6 == this.currPart ? U.playTouchMove(e, t) : 7 == this.currPart && A.playTouchMove(e, t));
                }
            }, {
                key: "playTouchEnd",
                value: function () {
                    0 != this.touchKey && this.curStepTmp == this.currPart && (0 == this.currPart ? T.playTouchEnd() : 1 == this.currPart || 2 == this.currPart || 4 == this.currPart || 6 == this.currPart ? U.playTouchEnd() : 7 == this.currPart && A.playTouchEnd());
                }
            }, {
                key: "playFlowParticle",
                value: function (e) {
                    1 == e && (this.flowNode.active = !0, this.flowNode.particleSystem.play());
                }
            }, {
                key: "playSnowParticle",
                value: function () {
                    this.touchKey = !1, this.smileNode.active = !1, this.snowNode.active = !0, this.snowNode.particleSystem.play(),
                        I.play11();
                }
            }, {
                key: "playSmileParticle",
                value: function () {
                    this.touchKey = !1, this.smileNode.active = !1, this.smileNode.active = !0, this.smileNode.particleSystem.play(),
                        I.play26();
                }
            }, {
                key: "getColor",
                value: function (e) {
                    var t = k.itemModelList.find(function (t) {
                        return t.name == e;
                    }).color.split(",").map(function (e) {
                        return parseInt(e);
                    });
                    return new Laya.Vector4(t[0], t[1], t[2], 255);
                }
            }, {
                key: "getNormColor",
                value: function (e) {
                    var t = k.itemModelList.find(function (t) {
                        return t.name == e;
                    }).color.split(",").map(function (e) {
                        return parseInt(e);
                    });
                    return new Laya.Vector4(t[0] / 255, t[1] / 255, t[2] / 255, 1);
                }
            }, {
                key: "changeFlowParticle",
                value: function (e) {
                    var t = this.getNormColor(e), a = i.flowNode.getChildByName("WaterVertical").particleSystem;
                    return a.startColorConstant = t, (a = i.flowNode.getChildByName("Waterdrops").particleSystem).startColorConstant = t,
                        (a = i.flowNode.particleSystem).startColorConstant = t, t;
                }
            }]), i;
        }();
        R.tempV3 = new Laya.Vector3(), R.currRole = null, R.taskNeedMtl = null, R.taskIsFinish = !1,
            R.propList = [], R.currPart = 0, R.addNodeList = [], R.makeInfoList = [], R.makeNodeList = [],
            R.zhuozi = null, R.handNode = null, R.handCtrl = null, R.wanNode = null, R.wanPos = new Laya.Vector3(-6, 0, 0),
            R.leftShovel = null, R.rightShovel = null, R.flowNode = null, R.smileNode = null,
            R.snowNode = null, R.touchKey = !0, R.cameraRT = null, R.curStepTmp = -1;
        var B = function (e) {
            o(l, e);
            var s = r(l);
            function l() {
                var e;
                return t(this, l), (e = s.apply(this, arguments)).modal = !1, e._proValue = 0, e;
            }
            return a(l, [{
                key: "UIPack",
                get: function () {
                    return g.Pack.Game;
                }
            }, {
                key: "UICom",
                get: function () {
                    return g.Res.AddMaterialUI;
                }
            }, {
                key: "proValue",
                get: function () {
                    return this._proValue;
                },
                set: function (e) {
                    this._proValue = e, 0 == this._proValue ? (this._proValue = .001, this.progressBar.value = 100 * this._proValue) : this.progressBar.tweenValue(100 * this._proValue, .1);
                }
            }, {
                key: "onInit",
                value: function () {
                    i(n(l.prototype), "onInit", this).call(this), this.c1 = this.contentPane.getController("c1"),
                        this.probarAnim = this.contentPane.getTransition("t2"), this.progressBar = this.contentPane.getChild("n3").asProgress,
                        this.leftToRight = this.contentPane.getTransition("lefttoright"), this.topToDown = this.contentPane.getTransition("toptodown"),
                        this.downToTop = this.contentPane.getTransition("downtotop"), this.chansuannai = this.contentPane.getTransition("chansuannai"),
                        this.cr = this.contentPane.getTransition("cr"), this.sliderImg = this.contentPane.getChild("slider").asImage,
                        TY.App.on(y.ChangeAddSelectIndex, this.changeIndex, this), TY.App.on(y.ShowSelectMtlIndex, this.showSelectMtlIndex, this),
                        TY.App.on(y.updateAddMtlProgress, this.updateAddMtlProgress, this), TY.App.on(y.hideAddMtlProgress, this.hideAddMtlProgress, this);
                }
            }, {
                key: "onShown",
                value: function () {
                    i(n(l.prototype), "onShown", this).call(this), this.proValue = 0, R.giveProp(),
                        this.sliderImg.visible && (this.sliderImg.visible = !1), Laya.timer.once(2e3, this, this.showSliderImg);
                }
            }, {
                key: "onHide",
                value: function () {
                    i(n(l.prototype), "onHide", this).call(this);
                }
            }, {
                key: "changeIndex",
                value: function (e) {
                    var t = e.data;
                    this.c1.selectedIndex = t || 0, this.sliderImg.visible && (this.sliderImg.visible = !1),
                        Laya.timer.once(2e3, this, this.showSliderImg);
                }
            }, {
                key: "updateAddMtlProgress",
                value: function (e) {
                    var t = e.data;
                    this.progressBar.visible = !0, this.proValue != t && (this.proValue = t, t >= 1 && this.probarAnim.play());
                }
            }, {
                key: "hideAddMtlProgress",
                value: function () {
                    this.progressBar.visible = !1;
                }
            }, {
                key: "showSelectMtlIndex",
                value: function (e) {
                    l.hide(), V.show(e.data);
                }
            }, {
                key: "backCallback",
                value: function () {
                    console.log("backCallback");
                }
            }, {
                key: "showSliderImg",
                value: function () {
                    4 != this.c1.selectedIndex && 3 != this.c1.selectedIndex || (this.sliderImg.visible = !0);
                }
            }, {
                key: "touchDown",
                value: function () {
                    R.playTouchStart(), Laya.timer.clear(this, this.showSliderImg), this.sliderImg.visible = !1;
                }
            }, {
                key: "touchUp",
                value: function () {
                    R.playTouchEnd(), Laya.timer.clear(this, this.showSliderImg), Laya.timer.once(2e3, this, this.showSliderImg);
                }
            }, {
                key: "touchMove",
                value: function () {
                    R.playTouchMove(this.deltaX, this.deltaY);
                }
            }], [{
                key: "show",
                value: function () {
                    TY.LayaCore.UI.show(g.Urls.AddMaterialUI);
                }
            }, {
                key: "hide",
                value: function () {
                    TY.LayaCore.UI.hide(g.Urls.AddMaterialUI);
                }
            }]), l;
        }(v), N = function (e) {
            o(l, e);
            var s = r(l);
            function l() {
                var e;
                return t(this, l), (e = s.apply(this, arguments)).modal = !0, e;
            }
            return a(l, [{
                key: "UIPack",
                get: function () {
                    return g.Pack.Game;
                }
            }, {
                key: "UICom",
                get: function () {
                    return g.Res.OnceAgainUI;
                }
            }, {
                key: "onInit",
                value: function () {
                    i(n(l.prototype), "onInit", this).call(this), this.iconLoader = this.contentPane.getChild("icon").asLoader,
                        this.adBtn = this.contentPane.getChild("ad").asButton, this.closeBtn = this.contentPane.getChild("close").asButton,
                        this.adBtn.onClick(this, this.adClick), this.closeBtn.onClick(this, this.closeClick);
                }
            }, {
                key: "onHide",
                value: function () {
                    i(n(l.prototype), "onHide", this).call(this)/*, TY.LayaCore.SDK.hideBanner()*/;
                }
            }, {
                key: "onShown",
                value: function () {
                    var e = this;
                    i(n(l.prototype), "onShown", this).call(this)/*, TY.LayaCore.SDK.showBanner()*/;
                    var t = this.data;
                    this.iconLoader.url = m.getPropIconUrl(t.english), 1 != TY.LayaCore.SDKModel.getAdRate(u.yanchi) || TY.LayaCore.SDKModel.isPingbi || (this.closeBtn.visible = !1,
                        Laya.timer.once(2e3, this, function () {
                            e.closeBtn.visible = !0;
                        })), TY.LayaCore.SDKModel.isPingbi ? (this.adBtn.getController("isPingbi").selectedIndex = 0,
                            this.closeBtn.getController("isPingbi").selectedIndex = 0) : (this.adBtn.getController("isPingbi").selectedIndex = 1,
                                this.closeBtn.getController("isPingbi").selectedIndex = 1);
                }
            }, {
                key: "adClick",
                value: function () {
                    var e = this;
                    C.showVideoByReport("限时体验", function () {
                        l.callback && l.callback(!0), l.callback = null, e.hide();
                    });
                }
            }, {
                key: "closeClick",
                value: function () {
                    this.hide(), l.callback && l.callback(!1), l.callback = null;
                }
            }], [{
                key: "show",
                value: function (e, t) {
                    this.callback = t, TY.LayaCore.UI.show(g.Urls.OnceAgainUI, e);
                }
            }, {
                key: "hide",
                value: function () {
                    TY.LayaCore.UI.hide(g.Urls.OnceAgainUI);
                }
            }]), l;
        }(TY.LayaCore.Services.UIBase), V = function (e) {
            o(u, e);
            var s = r(u);
            function u() {
                var e;
                return t(this, u), (e = s.apply(this, arguments)).modal = !1, e.pushIndex = 0, e;
            }
            return a(u, [{
                key: "UIPack",
                get: function () {
                    return g.Pack.Game;
                }
            }, {
                key: "UICom",
                get: function () {
                    return g.Res.SelectMaterialUI;
                }
            }, {
                key: "onInit",
                value: function () {
                    i(n(u.prototype), "onInit", this).call(this), this.bindBtnCallback("back", "next", "video", "start"),
                        this.bgImg = this.contentPane.getChild("bg").asImage, this.c1 = this.contentPane.getController("c1"),
                        this.c2 = this.contentPane.getController("c2"), this.t0 = this.contentPane.getTransition("t0"),
                        this.propList = this.contentPane.getChild("n11").asList, this.propList.itemRenderer = Laya.Handler.create(this, this.itemRenderer, null, !1),
                        this.bgImg.y += 250;
                }
            }, {
                key: "onShown",
                value: function () {
                    var e = this;
                    i(n(u.prototype), "onShown", this).call(this)/*, TY.LayaCore.SDK.showBanner()*/, this.c1.selectedIndex = this.data,
                        this.c2.selectedIndex = 1, this.refreshLayout(), this.propList.touchable = !0, 0 == this.c1.selectedIndex && (this.pushIndex = 3 * Math.random() | 0,
                            console.log("随机推送:", this.pushIndex)), console.log("展现原材料的index,", this.c1.selectedIndex, R.currPart),
                        this.t0.play(), this.propList.scrollToView(0), fgui.GTween.to(this.bgImg.y, this.bgImg.y - 250, .2).onUpdate(function (t) {
                            e.bgImg.y = t.value.x;
                        }), Laya.timer.clear(this, this.breath), Laya.timer.once(2e3, this, this.breath);
                }
            }, {
                key: "breath",
                value: function () {
                    for (var e = !1, t = 0; t < this.propList.numChildren; t++) {
                        var a = this.propList.getChildAt(t);
                        if (R.includeTaskRole(a.itemData.name)) {
                            e = !0, a.breath();
                            break;
                        }
                    }
                    e || this.propList.getChildAt(0).breath();
                }
            }, {
                key: "onHide",
                value: function () {
                    i(n(u.prototype), "onHide", this).call(this)/*, TY.LayaCore.SDK.hideBanner()*/;
                }
            }, {
                key: "refreshLayout",
                value: function () {
                    var e = null;
                    switch (this.c1.selectedIndex) {
                        case 0:
                            e = k.material;
                            break;

                        case 1:
                            e = k.syrup;
                            break;

                        case 2:
                            e = k.ornament;
                    }
                    console.log("refreshLayout:", e), this.currMap = e, this.propList.numItems = e.length;
                }
            }, {
                key: "itemRenderer",
                value: function (e, t) {
                    var a = this;
                    t.setInfo(this.currMap[e], "选择界面", function (e) {
                        a.selectProp = e.name, a.ClickItem(t);
                    });
                }
            }, {
                key: "itemRenderer0",
                value: function (e, t) {
                    var a = this;
                    t.setInfo(this.commonList[e], "选择界面", function (e) {
                        a.selectProp = e.name;
                    });
                    var i = this.commonList[e], n = k.getKeyByTypeid(i.type);
                    f.playerData.playPropConfig[n] ? i.name == f.playerData.playPropConfig[n] && t.selectThis() : 0 == e && t.selectThis();
                }
            }, {
                key: "itemRenderer1",
                value: function (e, t) {
                    var a = this;
                    t.setInfo(this.rareList[e], "选择界面", function (e) {
                        a.selectProp = e.name;
                    });
                    var i = this.rareList[e], n = k.getKeyByTypeid(i.type);
                    i.name == f.playerData.playPropConfig[n] && t.selectThis();
                }
            }, {
                key: "itemRenderer2",
                value: function (e, t) {
                    var a = this;
                    t.setInfo(this.eggList[e], "选择界面", function (e) {
                        a.selectProp = e.name;
                    });
                    var i = this.eggList[e], n = k.getKeyByTypeid(i.type);
                    i.name == f.playerData.playPropConfig[n] && t.selectThis();
                }
            }, {
                key: "backCallback",
                value: function () {
                    console.log("backCallback"), this.hide(), TY.LayaCore.Scene.gotoScene(l.Main, "gamescene");
                }
            }, {
                key: "nextCallback",
                value: function () {
                    R.addProp(this.selectProp), 0 == this.c2.selectedIndex ? this.c2.selectedIndex = 1 : (1 == this.c2.selectedIndex || 2 == this.c2.selectedIndex) && (u.hide(),
                        1 == this.c1.selectedIndex || 0 == this.c1.selectedIndex ? B.show() : (L.setMainCameraPos(h.ornament_close_up),
                            E.show(1)));
                }
            }, {
                key: "videoCallback",
                value: function () {
                    var e = this;
                    TY.LayaCore.SDK.showVideo(function () {
                        R.addProp(e.selectProp), e.c2.selectedIndex = 2;
                    });
                }
            }, {
                key: "startCallback",
                value: function () {
                    this.nextCallback();
                }
            }, {
                key: "ClickItem",
                value: function (e) {
                    var t = this;
                    this.propList.touchable = !1;
                    var a = function () {
                        fgui.GTween.to(t.bgImg.y, t.bgImg.y + 250, .2).onUpdate(function (e) {
                            t.bgImg.y = e.value.x;
                        }).setDelay(.1), Laya.timer.once(300, t, function () {
                            t.nextCallback();
                        }), Laya.timer.once(1e3, t, function () {
                            e.buttonCtrl.selectedIndex = 0;
                        });
                    };
                    if (this.c1.selectedIndex == this.pushIndex) {
                        var i = this.currMap.filter(function (e) {
                            return e.name != t.selectProp;
                        }), n = i[Math.random() * i.length | 0];
                        console.log(i), N.show(n, function (e) {
                            e && R.addProp(n.name), a();
                        });
                    } else a();
                }
            }], [{
                key: "show",
                value: function (e) {
                    TY.LayaCore.UI.show(g.Urls.SelectMaterialUI, e);
                }
            }, {
                key: "hide",
                value: function () {
                    TY.LayaCore.UI.hide(g.Urls.SelectMaterialUI);
                }
            }]), u;
        }(v), O = function (e) {
            o(l, e);
            var s = r(l);
            function l() {
                var e;
                return t(this, l), (e = s.apply(this, arguments)).modal = !1, e.zero = new Laya.Vector3(-18.7, -14.4, 0),
                    e;
            }
            return a(l, [{
                key: "UIPack",
                get: function () {
                    return g.Pack.Game;
                }
            }, {
                key: "UICom",
                get: function () {
                    return g.Res.CustomerUI;
                }
            }, {
                key: "onInit",
                value: function () {
                    i(n(l.prototype), "onInit", this).call(this), this.bindBtnCallback("set", "change", "start"),
                        this.sayLabel = this.contentPane.getChild("say").asLoader, this.dayLabel = this.contentPane.getChild("day").asTextField,
                        this.sayBg = this.contentPane.getChild("n4").asCom;
                }
            }, {
                key: "onShown",
                value: function () {
                    Advertisement.insertAdverV3();
                    i(n(l.prototype), "onShown", this).call(this), R.initCamera(), L.setMainCameraPos(h.customUI),
                        this.scene = TY.LayaCore.Scene.curScene.sceneSprite;
                    var e = f.playerData.roleIndex, t = k.RoleList.filter(function (t) {
                        console.log("随机人物:", t);
                        return t.isVip == (e % 3 == 2);
                    }), a = k.getRandomItem(t);
                    this.currRole = null, this.roleCtrl = null, this.showSayDialog(!1), this.showModel(a),
                        this.showDialog(a), this.refreshUI(a), R.setField(), this.reportData();
                }
            }, {
                key: "reportData",
                value: function () {
                    var e = new Date().getTime();
                    f.GamingData.gameShowTime = e;
                    var t, a = (e - f.GamingData.startLoadingTime) / 1e3;
                    t = a > 10 ? "10秒以上" : a > 8 ? "10秒内" : a > 6 ? "8秒内" : a > 4 ? "6秒内" : a > 2 ? "4秒内" : "2秒内",
                        f.GamingData.isFirstStartGame ? (f.GamingData.isFirstStartGame = !1, C.report("Complete", {
                            stage: "首次成功进入制作新品环节",
                            time: t
                        })) : C.report("Complete", {
                            stage: "非首次成功进入制作新品环节 ",
                            time: t
                        });
                }
            }, {
                key: "showModel",
                value: function (e) {
                    console.log("设置当前角色0000:", e),
                        this.roleName = e.name, this.aModelName = e.aModel, console.log("设置当前角色:", this.roleName),
                        this.currRole ? this.showLeaveAnim() : this.showNewRole();
                }
            }, {
                key: "showLeaveAnim",
                value: function () {
                    Laya.timer.clear(this, this.excuteMoveAnimtorTime), this.showRoleLeaveAnimal();
                }
            }, {
                key: "showNewRole",
                value: function () {
                    var e = this;
                    console.log(m.getD3FbxUrl() + "人物::" + this.aModelName);
                    Laya.Sprite3D.load(m.getD3FbxUrl(this.aModelName),

                        Laya.Handler.create(null, function (t) {
                            var a = t.clone();
                            a.name = "role", e.currRole = a, e.scene.addChild(a), R.roleObj = a;
                            var i = k.RoleList.find(function (t) {
                                return t.name == e.roleName;
                            });
                            R.curHandPosObj = TY.LayaCore.Utils.GameUtils.getChildByPath(a, i.handPos), null == R.curHandPosObj && (R.curHandPosObj = a,
                                console.log("没有设置挂点：", e.roleName)), R.roleAnimator = a.getComponent(Laya.Animator),
                                a.transform.position = e.zero
                                , e.showRoleMoveAnimal();
                        }));
                }
            }, {
                key: "showDialog",
                value: function (e) {
                    var t;
                    if (e.isVip) {
                        var a = k.taskList.filter(function (e) {
                            return 1 == e.role;
                        });
                        t = k.getRandomItem(a);
                    } else {
                        var i = k.taskList.filter(function (e) {
                            return 0 == e.role;
                        });
                        t = k.getRandomItem(i);
                    }
                    this.taskId = t.id, this.sayLabel.url = m.getCommonResUrl(t.icon);
                }
            }, {
                key: "refreshUI",
                value: function (e) {
                    this.isVipCustom = e.isVip, this.isVipCustom ? (this.changeBtn.getController("c1").selectedIndex = 0,
                        this.startBtn.getController("c1").selectedIndex = 1) : (this.changeBtn.getController("c1").selectedIndex = 1,
                            this.startBtn.getController("c1").selectedIndex = 0);
                }
            }, {
                key: "onHide",
                value: function () {
                    i(n(l.prototype), "onHide", this).call(this);
                }
            }, {
                key: "showRoleMoveAnimal",
                value: function () {
                    this.roleCtrl = this.currRole.getComponent(Laya.Animator), this.roleCtrl.play("move1"),
                        Laya.timer.loop(20, this, this.excuteMoveAnimtorTime), Laya.timer.once(1e3, this, function () {
                            I.play25();
                        });
                }
            }, {
                key: "excuteMoveAnimtorTime",
                value: function () {
                    x.getAnimalTime(this.roleCtrl) >= 1 && (Laya.timer.clear(this, this.excuteMoveAnimtorTime),
                        this.roleCtrl.play("stand"), console.log("播放待机动画"), this.showSayDialog(!0));
                }
            }, {
                key: "showRoleLeaveAnimal",
                value: function () {
                    this.showSayDialog(!1, !0), this.roleCtrl.play("eave"), Laya.timer.loop(20, this, this.excuteLeaveAnimtorTime);
                }
            }, {
                key: "excuteLeaveAnimtorTime",
                value: function () {
                    x.getAnimalTime(this.roleCtrl) >= 1 && (Laya.timer.clear(this, this.excuteLeaveAnimtorTime),
                        this.currRole.removeSelf(), this.currRole.destroy(), this.showNewRole());
                }
            }, {
                key: "showSayDialog",
                value: function (e) {
                    var t = this, a = arguments.length > 1 && void 0 !== arguments[1] && arguments[1];
                    this.sayLabel.visible = e, this.sayBg.visible = e, e ? (this.changeBtn.setScale(0, 0),
                        this.startBtn.setScale(0, 0), this.changeBtn.visible = e, this.startBtn.visible = e,
                        fgui.GTween.to(0, 1, .3).onUpdate(function (e) {
                            var a = e.value.x;
                            t.changeBtn.setScale(a, a), t.startBtn.setScale(a, a);
                        })) : 0 == a ? (this.changeBtn.visible = e, this.startBtn.visible = e) : (this.changeBtn.setScale(1, 1),
                            this.startBtn.setScale(1, 1), fgui.GTween.to(1, 0, .3).onUpdate(function (e) {
                                var a = e.value.x;
                                t.changeBtn.setScale(a, a), t.startBtn.setScale(a, a);
                            }).onComplete(function () {
                                t.changeBtn.visible = e, t.startBtn.visible = e;
                            }));
                }
            }, {
                key: "setCallback",
                value: function () {
                    console.log("backCallback");
                }
            }, {
                key: "changeCallback",
                value: function () {
                    var e = this;
                    this.isVipCustom ? this.changeFunc() : C.showVideoByReport("更换顾客", function () {
                        e.changeFunc();
                    });
                }
            }, {
                key: "changeFunc",
                value: function () {
                    var e = this;
                    f.playerData.roleIndex += 1;
                    var t = f.playerData.roleIndex, a = k.RoleList.filter(function (a) {
                        return a.isVip == (t % 3 == 2) && a.name != e.roleName;
                    }), i = k.getRandomItem(a);
                    this.showModel(i), this.showDialog(i), this.refreshUI(i), f.playerData.changeCustomCount += 1,
                        1 == f.playerData.changeCustomCount && _.show("x100");
                }
            }, {
                key: "startCallback",
                value: function () {
                    var e = this;
                    this.isVipCustom ? C.showVideoByReport("使用VIP顾客", function () {
                        e.startGame();
                    }) : this.startGame();
                }
            }, {
                key: "startGame",
                value: function () {
                    f.playerData.roleIndex += 1, l.hide(), R.startGame(), R.setRole(this.roleName, this.taskId),
                        L.setMainCameraPos(h.peelFruit, function () {
                            V.show(0), C.report("Level_start", {
                                level: R.currPart
                            });
                        });
                }
            }], [{
                key: "show",
                value: function () {
                    TY.LayaCore.UI.show(g.Urls.CustomerUI);
                }
            }, {
                key: "hide",
                value: function () {
                    TY.LayaCore.UI.hide(g.Urls.CustomerUI);
                }
            }]), l;
        }(v), Y = function (e) {
            o(l, e);
            var s = r(l);
            function l() {
                var e;
                return t(this, l), (e = s.apply(this, arguments)).modal = !0, e.dataList = null,
                    e;
            }
            return a(l, [{
                key: "UIPack",
                get: function () {
                    return g.Pack.Main;
                }
            }, {
                key: "UICom",
                get: function () {
                    return g.Res.GetAwardUI;
                }
            }, {
                key: "onInit",
                value: function () {
                    i(n(l.prototype), "onInit", this).call(this), this.sortingOrder = 10, this.bindBtnCallback("sure"),
                        this.texLoad = this.contentPane.getChild("n22").asLoader, this.nameLabel = this.contentPane.getChild("title").asTextField;
                }
            }, {
                key: "onShown",
                value: function () {
                    i(n(l.prototype), "onShown", this).call(this), this.dataList = this.data, this.dataList.length <= 0 ? this.hide() : this.showAward();
                }
            }, {
                key: "onHide",
                value: function () {
                    i(n(l.prototype), "onHide", this).call(this);
                }
            }, {
                key: "showAward",
                value: function () {
                    var e = this.dataList.shift();
                    if (this.nameLabel.text = "" + e, "x" == e[0]) {
                        I.play22();
                        var t = parseInt(e.substring(1));
                        console.log("coin:", t), f.playerData.money += t;
                        var a = m.getPropIconUrl("金币");
                        this.texLoad.url = a;
                    } else {
                        console.log(e);
                        var i = k.getBigIconUrlByName(e);
                        this.texLoad.url = i, console.log("url:", i), f.playerData.addSkin(e), I.play24();
                    }
                }
            }, {
                key: "sureCallback",
                value: function () {
                    this.dataList.length > 0 ? this.showAward() : (this.hide(), l.callbackOn && l.callbackOn(),
                        l.callbackOn = null);
                }
            }], [{
                key: "show",
                value: function (e, t) {
                    l.callbackOn = t, TY.LayaCore.UI.show(g.Urls.GetAwardUI, e);
                }
            }, {
                key: "hide",
                value: function () {
                    TY.LayaCore.UI.hide(g.Urls.GetAwardUI);
                }
            }]), l;
        }(v);
        Y.callbackOn = null;
        var F = function (e) {
            o(l, e);
            var s = r(l);
            function l() {
                return t(this, l), s.apply(this, arguments);
            }
            return a(l, [{
                key: "UIPack",
                get: function () {
                    return g.Pack.Main;
                }
            }, {
                key: "UICom",
                get: function () {
                    return g.Res.DisplayUI;
                }
            }, {
                key: "onInit",
                value: function () {
                    i(n(l.prototype), "onInit", this).call(this), this.countLabel = this.contentPane.getChild("count").asTextField,
                        this.foodList = this.contentPane.getChild("foodList").asList, this.foodList.itemRenderer = Laya.Handler.create(this, this.itemRenderer, null, !1),
                        this.bindBtnCallback("back", "delete", "randomAdd");
                }
            }, {
                key: "onShown",
                value: function () {
                    i(n(l.prototype), "onShown", this).call(this);
                }
            }, {
                key: "onHide",
                value: function () {
                    i(n(l.prototype), "onHide", this).call(this);
                }
            }, {
                key: "backCallback",
                value: function () {
                    console.log("backCallback"), l.hide();
                }
            }, {
                key: "deleteCallback",
                value: function () {
                    console.log("deleteCallback");
                }
            }, {
                key: "randomAddCallback",
                value: function () { }
            }, {
                key: "itemRenderer",
                value: function (e, t) { }
            }, {
                key: "onClickItem",
                value: function (e) { }
            }], [{
                key: "show",
                value: function () {
                    TY.LayaCore.UI.show(g.Urls.DisplayUI);
                }
            }, {
                key: "hide",
                value: function () {
                    TY.LayaCore.UI.hide(g.Urls.DisplayUI);
                }
            }]), l;
        }(v), G = function (e) {
            o(l, e);
            var s = r(l);
            function l() {
                var e;
                return t(this, l), (e = s.apply(this, arguments)).modal = !0, e;
            }
            return a(l, [{
                key: "UIPack",
                get: function () {
                    return g.Pack.Main;
                }
            }, {
                key: "UICom",
                get: function () {
                    return g.Res.EggTipUI;
                }
            }, {
                key: "onInit",
                value: function () {
                    i(n(l.prototype), "onInit", this).call(this), this.bindBtnCallback("close"), this.eggtip = this.contentPane.getChild("title").asTextField;
                }
            }, {
                key: "onShown",
                value: function () {
                    i(n(l.prototype), "onShown", this).call(this), this.eggtip.text = this.data;
                }
            }, {
                key: "onHide",
                value: function () {
                    i(n(l.prototype), "onHide", this).call(this);
                }
            }, {
                key: "closeCallback",
                value: function () {
                    this.hide();
                }
            }], [{
                key: "show",
                value: function (e) {
                    TY.LayaCore.UI.show(g.Urls.EggTipUI, e);
                }
            }, {
                key: "hide",
                value: function () {
                    TY.LayaCore.UI.hide(g.Urls.EggTipUI);
                }
            }]), l;
        }(v), H = function (e) {
            o(l, e);
            var s = r(l);
            function l() {
                var e;
                return t(this, l), (e = s.apply(this, arguments)).modal = !0, e;
            }
            return a(l, [{
                key: "UIPack",
                get: function () {
                    return g.Pack.Main;
                }
            }, {
                key: "UICom",
                get: function () {
                    return g.Res.EggUI;
                }
            }, {
                key: "onInit",
                value: function () {
                    i(n(l.prototype), "onInit", this).call(this), this.bindBtnCallback("close", "first", "second", "third", "four");
                }
            }, {
                key: "onShown",
                value: function () {
                    i(n(l.prototype), "onShown", this).call(this), this.refreshBtn();
                }
            }, {
                key: "onHide",
                value: function () {
                    i(n(l.prototype), "onHide", this).call(this);
                }
            }, {
                key: "closeCallback",
                value: function () {
                    this.hide();
                }
            }, {
                key: "firstCallback",
                value: function () {
                    var e = this, t = f.playerData.EggData;
                    null == t["冰面"] ? C.showVideoByReport("彩蛋提示", function () {
                        G.show("成功领取在线补给礼包"), t["冰面"] = 1, f.playerData.EggData = t, e.refreshBtn();
                    }) : G.show("成功领取在线补给礼包");
                }
            }, {
                key: "secondCallback",
                value: function () {
                    var e = this, t = f.playerData.EggData;
                    null == t.x100 ? C.showVideoByReport("彩蛋提示", function () {
                        G.show("成功更换一位顾客"), t.x100 = 1, f.playerData.EggData = t, e.refreshBtn();
                    }) : G.show("成功更换一位顾客");
                }
            }, {
                key: "thirdCallback",
                value: function () {
                    var e = this, t = f.playerData.EggData;
                    null == t["金色皇冠"] ? C.showVideoByReport("彩蛋提示", function () {
                        G.show("成功接待一位VIP顾客"), t["金色皇冠"] = 1, f.playerData.EggData = t, e.refreshBtn();
                    }) : G.show("成功接待一位VIP顾客");
                }
            }, {
                key: "fourCallback",
                value: function () {
                    var e = this;
                    this.contentPane.getChild("four").asCom.getController("isAd");
                    var t = f.playerData.EggData;
                    null == t["金色铲刀"] ? C.showVideoByReport("彩蛋提示", function () {
                        G.show("成功接待10名顾客"), t["金色铲刀"] = 1, f.playerData.EggData = t, e.refreshBtn();
                    }) : G.show("成功接待10名顾客");
                }
            }, {
                key: "refreshBtn",
                value: function () {
                    for (var e = ["first", "second", "third", "four"], t = ["冰面", "x100", "金色皇冠", "金色铲刀"], a = f.playerData.EggData, i = 0; i < e.length; i++) this.contentPane.getChild(e[i]).asButton.getController("isAd").selectedIndex = 0 | a[t[i]];
                }
            }], [{
                key: "show",
                value: function () {
                    Advertisement.insertAdverV3();
                    TY.LayaCore.UI.show(g.Urls.EggUI);
                }
            }, {
                key: "hide",
                value: function () {
                    TY.LayaCore.UI.hide(g.Urls.EggUI);
                }
            }]), l;
        }(v), W = function (e) {
            o(l, e);
            var s = r(l);
            function l() {
                var e;
                return t(this, l), (e = s.apply(this, arguments)).modal = !0, e.lotteryProbability = [{
                    award: "怪兽手套",
                    probaby: 0
                }, {
                    award: "500金币",
                    probaby: 5
                }, {
                    award: "100金币",
                    probaby: 75
                }, {
                    award: "1500金币",
                    probaby: 1
                }, {
                    award: "200金币",
                    probaby: 10
                }, {
                    award: "800金币",
                    probaby: 5
                }, {
                    award: "1000金币",
                    probaby: 2
                }, {
                    award: "2000金币",
                    probaby: 2
                }], e._proValue = 0, e;
            }
            return a(l, [{
                key: "UIPack",
                get: function () {
                    return g.Pack.Main;
                }
            }, {
                key: "UICom",
                get: function () {
                    return g.Res.LotteryUI;
                }
            }, {
                key: "proValue",
                get: function () {
                    return this._proValue;
                },
                set: function (e) {
                    this._proValue = e, 0 == this._proValue && (this._proValue = .001), this.progressBar.value = 100 * this._proValue;
                }
            }, {
                key: "onInit",
                value: function () {
                    i(n(l.prototype), "onInit", this).call(this), this.progressBar = this.contentPane.getChild("n7").asProgress,
                        this.explain = this.contentPane.getChild("n25").asTextField, this.corona = this.contentPane.getChild("n2").asCom,
                        this.bindBtnCallback("back", "free", "video");
                }
            }, {
                key: "onShown",
                value: function () {
                    Advertisement.insertAdverV3();
                    i(n(l.prototype), "onShown", this).call(this), this.corona.rotation = 0, this.refreshUI()/*,TY.LayaCore.SDK.showBanner()*/;
                }
            }, {
                key: "onHide",
                value: function () {
                    i(n(l.prototype), "onHide", this).call(this)/*, TY.LayaCore.SDK.hideBanner()*/;
                }
            }, {
                key: "backCallback",
                value: function () {
                    l.hide();
                }
            }, {
                key: "freeCallback",
                value: function () {
                    f.playerData.lotteryFreeCount -= 1, this.startLottery();
                }
            }, {
                key: "videoCallback",
                value: function () {
                    var e = this;
                    C.showVideoByReport("抽奖", function () {
                        e.startLottery();
                    });
                }
            }, {
                key: "startLottery",
                value: function () {
                    var e = this;
                    f.playerData.lotterySumCount += 1, this.corona.rotation = 0;
                    var t = 100 * Math.random(), a = 0, i = -1;
                    if (f.playerData.lotterySumCount < 3) {
                        for (var n = 0; n < this.lotteryProbability.length; n++) if (t < (a += this.lotteryProbability[n].probaby)) {
                            i = n;
                            break;
                        }
                    } else i = 0, f.playerData.lotterySumCount = 0;
                    console.log("抽中什么奖了啊:", i), i < 0 && (i = 1);
                    var o = 1080 + 45 * i;

                    this.setBtnTouch(!1),
                        fgui.GTween.to(0, 1, 2).onUpdate(function (t) {
                            var a = t.value.x;
                            e.corona.rotation = -o * a;
                            console.log("抽i将时间：", a);
                        }).onComplete(function () {
                            if (console.log("抽奖结束"), e.setBtnTouch(!0), 0 == i) Y.show(["怪兽手套"], null), C.report("Get_skin", {
                                unlock: "看视频获得",
                                stage: "抽奖界面",
                                id: "怪兽手套"
                            }); else {
                                var t = e.lotteryProbability[i].award;
                                t = t.replace("金币", "");
                                var a = parseInt(t);
                                Y.show(["x" + a], null);
                            }
                            e.refreshUI();
                        });
                }
            }, {
                key: "setBtnTouch",
                value: function (e) {
                    this.backBtn.touchable = e, this.freeBtn.touchable = e, this.videoBtn.touchable = e;
                }
            }, {
                key: "refreshUI",
                value: function () {
                    f.playerData.lotteryFreeCount > 0 ? (this.freeBtn.visible = !0, this.videoBtn.visible = !1) : (this.freeBtn.visible = !1,
                        this.videoBtn.visible = !0), this.explain.text = 3 - f.playerData.lotterySumCount + "次后必得特殊奖励",
                        this.proValue = f.playerData.lotterySumCount / 3;
                }
            }], [{
                key: "show",
                value: function () {
                    TY.LayaCore.UI.show(g.Urls.LotteryUI);
                }
            }, {
                key: "hide",
                value: function () {
                    TY.LayaCore.UI.hide(g.Urls.LotteryUI);
                }
            }]), l;
        }(v), z = function (e) {
            o(l, e);
            var s = r(l);
            function l() {
                var e;
                return t(this, l), (e = s.apply(this, arguments)).modal = !0, e;
            }
            return a(l, [{
                key: "UIPack",
                get: function () {
                    return g.Pack.Main;
                }
            }, {
                key: "UICom",
                get: function () {
                    return g.Res.SettingUI;
                }
            }, {
                key: "onInit",
                value: function () {
                    i(n(l.prototype), "onInit", this).call(this), this.bindBtnCallback("sound", "effect", "ysxy", "yhxy", "back"),
                        this.soundC1 = this.soundBtn.getController("c1"), this.effectC1 = this.effectBtn.getController("c1");
                }
            }, {
                key: "onShown",
                value: function () {
                    "true" == f.playerData.sound ? this.soundC1.selectedIndex = 0 : this.soundC1.selectedIndex = 1,
                        "true" == f.playerData.shake ? this.effectC1.selectedIndex = 0 : this.effectC1.selectedIndex = 1;
                }
            }, {
                key: "backCallback",
                value: function () {
                    I.playClick(), this.hide();
                }
            }, {
                key: "soundCallback",
                value: function () {
                    I.playClick(), "true" == f.playerData.sound ? (this.soundC1.selectedIndex = 1, f.playerData.sound = "false",
                        I.stopAllSound()) : (this.soundC1.selectedIndex = 0, f.playerData.sound = "true",
                            I.playDefaultBgm());
                }
            }, {
                key: "effectCallback",
                value: function () {
                    I.playClick(), "true" == f.playerData.shake ? (f.playerData.shake = "false", this.effectC1.selectedIndex = 1,
                        Laya.SoundManager.soundVolume = 0) : (f.playerData.shake = "true", this.effectC1.selectedIndex = 0,
                            Laya.SoundManager.soundVolume = 1);
                }
            }, {
                key: "ysxyCallback",
                value: function () { }
            }, {
                key: "yhxyCallback",
                value: function () { }
            }], [{
                key: "show",
                value: function (e) {
                    TY.LayaCore.UI.show(g.Urls.SettingUI, null, e);
                }
            }, {
                key: "hide",
                value: function () {
                    TY.LayaCore.UI.hide(g.Urls.SettingUI);
                }
            }]), l;
        }(v), K = [1, 2, 3], X = function (e) {
            o(l, e);
            var s = r(l);
            function l() {
                return t(this, l), s.apply(this, arguments);
            }
            return a(l, [{
                key: "UIPack",
                get: function () {
                    return g.Pack.Main;
                }
            }, {
                key: "UICom",
                get: function () {
                    return g.Res.ShopUI;
                }
            }, {
                key: "onInit",
                value: function () {
                    i(n(l.prototype), "onInit", this).call(this), this.typeCtrl = this.contentPane.getController("tab1"),
                        this.typeCtrl.on(fairygui.Events.STATE_CHANGED, this, this.onChanged), this.bindBtnCallback("back", "random", "more"),
                        this.foodList = this.contentPane.getChild("list").asList;
                    for (var e = 0; e < this.foodList.numChildren; e++) this.foodList.getChildAt(e).asCom.getChild("list").asList.itemRenderer = Laya.Handler.create(this, this["itemRenderer" + e], null, !1);
                }
            }, {
                key: "onShown",
                value: function () {
                    Advertisement.insertAdverV3();
                    i(n(l.prototype), "onShown", this).call(this), this.onChanged();
                }
            }, {
                key: "onHide",
                value: function () {
                    i(n(l.prototype), "onHide", this).call(this);
                }
            }, {
                key: "backCallback",
                value: function () {
                    console.log("backCallback"), l.hide();
                }
            }, {
                key: "randomCallback",
                value: function () {
                    console.log("randomAddCallback");
                }
            }, {
                key: "moreCallback",
                value: function () {
                    console.log("moreCallback");
                }
            }, {
                key: "onChanged",
                value: function () {
                    var e = this, t = null;
                    switch (this.typeCtrl.selectedIndex) {
                        case 0:
                            t = k.glove;
                            break;

                        case 1:
                            t = k.shovel;
                            break;

                        case 2:
                            t = k.bowl;
                            break;

                        case 3:
                            t = k.material;
                            break;

                        case 4:
                            t = k.syrup;
                            break;

                        case 5:
                            t = k.panel;
                            break;

                        case 6:
                            t = k.ornament;
                    }
                    for (var a = function (a) {
                        var i = e.foodList.getChildAt(a).asCom, n = i.getChild("list").asList, o = t.filter(function (e) {
                            return e.rare == K[a];
                        });
                        switch (K[a]) {
                            case 1:
                                e.commonList = o;
                                break;

                            case 2:
                                e.rareList = o;
                                break;

                            case 3:
                                e.eggList = o;
                        }
                        n.numItems = o.length, n.resizeToFit(), i.height = n.height + 42;
                    }, i = 0; i < K.length; i++) a(i);
                }
            }, {
                key: "itemRenderer0",
                value: function (e, t) {
                    t.setInfo(this.commonList[e], "商店", this.setDefaultProp);
                    var a = this.commonList[e], i = k.getKeyByTypeid(a.type);
                    f.playerData.playPropConfig[i] ? a.name == f.playerData.playPropConfig[i] && t.selectThis() : 0 == e && t.selectThis();
                }
            }, {
                key: "itemRenderer1",
                value: function (e, t) {
                    t.setInfo(this.rareList[e], "商店", this.setDefaultProp);
                    var a = this.rareList[e], i = k.getKeyByTypeid(a.type);
                    a.name == f.playerData.playPropConfig[i] && t.selectThis();
                }
            }, {
                key: "itemRenderer2",
                value: function (e, t) {
                    t.setInfo(this.eggList[e], "商店", this.setDefaultProp);
                    var a = this.eggList[e], i = k.getKeyByTypeid(a.type);
                    a.name == f.playerData.playPropConfig[i] && t.selectThis();
                }
            }, {
                key: "setDefaultProp",
                value: function (e) {
                    var t = k.getKeyByTypeid(e.type);
                    f.playerData.setPlayPropConfig(t, e.name) && (1 == e.type ? f.playerData.doGuideTask(1) : 2 == e.type ? f.playerData.doGuideTask(2) : 3 == e.type ? f.playerData.doGuideTask(3) : 7 == e.type && f.playerData.doGuideTask(4));
                }
            }], [{
                key: "show",
                value: function () {
                    TY.LayaCore.UI.show(g.Urls.ShopUI);
                }
            }, {
                key: "hide",
                value: function () {
                    TY.LayaCore.UI.hide(g.Urls.ShopUI);
                }
            }]), l;
        }(v), J = function (e) {
            o(l, e);
            var s = r(l);
            function l() {
                var e;
                return t(this, l), (e = s.apply(this, arguments)).modal = !0, e.dayCtrlList = [],
                    e.awardList = [100, "屠龙刀", 200, 300, 400, 666, "电脑机箱"], e;
            }
            return a(l, [{
                key: "UIPack",
                get: function () {
                    return g.Pack.Main;
                }
            }, {
                key: "UICom",
                get: function () {
                    return g.Res.SignUI;
                }
            }, {
                key: "onInit",
                value: function () {
                    i(n(l.prototype), "onInit", this).call(this), this.bindBtnCallback("give", "video", "back"),
                        this.c1 = this.contentPane.getController("c1");
                    for (var e = 1; e <= 7; e++) {
                        var t = this.contentPane.getChild("" + e).asCom.getController("status");
                        this.dayCtrlList.push(t);
                    }
                }
            }, {
                key: "onShown",
                value: function () {
                    Advertisement.insertAdverV3();
                    i(n(l.prototype), "onShown", this).call(this), this.refreshUI()/*, TY.LayaCore.SDK.showBanner()*/;
                }
            }, {
                key: "onHide",
                value: function () {
                    i(n(l.prototype), "onHide", this).call(this)/*, TY.LayaCore.SDK.hideBanner()*/;
                }
            }, {
                key: "refreshUI",
                value: function () {
                    for (var e = f.playerData.signCount, t = 0; t < 7; t++) t < e ? this.dayCtrlList[t].selectedIndex = 0 : t == e && f.playerData.todayCanSign ? this.dayCtrlList[t].selectedIndex = 1 : this.dayCtrlList[t].selectedIndex = 2;
                    f.playerData.todayCanSign ? (this.c1.selectedIndex = 1 == e || 6 == e ? 1 : 0, this.giveBtn.visible = !0,
                        this.videoBtn.visible = !0) : (this.giveBtn.visible = !1, this.videoBtn.visible = !1),
                        e >= 7 && (this.giveBtn.visible = !1, this.videoBtn.visible = !1);
                }
            }, {
                key: "backCallback",
                value: function () {
                    this.hide();
                }
            }, {
                key: "giveCallback",
                value: function () {
                    this.getAward(!1);
                }
            }, {
                key: "videoCallback",
                value: function () {
                    var e = this;
                    C.showVideoByReport("签到", function () {
                        e.getAward(!0);
                    });
                }
            }, {
                key: "getAward",
                value: function (e) {
                    var t = f.playerData.signCount;
                    if (1 == t || 6 == t) Y.show([String(this.awardList[t])], null); else {
                        var a = Number(this.awardList[t]);
                        e && (a *= 2), Y.show(["x" + a], null);
                    }
                    f.playerData.signCount++, f.playerData.todayCanSign = !1, this.refreshUI(), this.hide();
                }
            }], [{
                key: "show",
                value: function () {
                    TY.LayaCore.UI.show(g.Urls.SignUI);
                }
            }, {
                key: "hide",
                value: function () {
                    TY.LayaCore.UI.hide(g.Urls.SignUI);
                }
            }]), l;
        }(v), j = function (e) {
            o(l, e);
            var s = r(l);
            function l() {
                var e;
                return t(this, l), (e = s.apply(this, arguments)).modal = !0, e;
            }
            return a(l, [{
                key: "UIPack",
                get: function () {
                    return g.Pack.Main;
                }
            }, {
                key: "UICom",
                get: function () {
                    return g.Res.GetGuideTaskRewardUI;
                }
            }, {
                key: "onInit",
                value: function () {
                    i(n(l.prototype), "onInit", this).call(this), this.bindBtnCallback("close");
                }
            }, {
                key: "onShown",
                value: function () {
                    i(n(l.prototype), "onShown", this).call(this), f.playerData.money += 100;
                }
            }, {
                key: "onHide",
                value: function () {
                    i(n(l.prototype), "onHide", this).call(this);
                }
            }, {
                key: "closeCallback",
                value: function () {
                    this.hide();
                }
            }], [{
                key: "show",
                value: function () {
                    TY.LayaCore.UI.show(g.Urls.GetGuideTaskRewardUI);
                }
            }, {
                key: "hide",
                value: function () {
                    TY.LayaCore.UI.hide(g.Urls.GetGuideTaskRewardUI);
                }
            }]), l;
        }(v), Q = function (e) {
            o(l, e);
            var s = r(l);
            function l() {
                var e;
                return t(this, l), (e = s.apply(this, arguments)).modal = !0, e;
            }
            return a(l, [{
                key: "UIPack",
                get: function () {
                    return g.Pack.Main;
                }
            }, {
                key: "UICom",
                get: function () {
                    return g.Res.GuideTaskUI;
                }
            }, {
                key: "onInit",
                value: function () {
                    i(n(l.prototype), "onInit", this).call(this), this.bindBtnCallback("close"), this.list = this.contentPane.getChild("list").asList,
                        this.list.on(fgui.Events.CLICK_ITEM, this, this.ClickItem);
                }
            }, {
                key: "onShown",
                value: function () {
                    i(n(l.prototype), "onShown", this).call(this), this.initList();
                }
            }, {
                key: "onHide",
                value: function () {
                    i(n(l.prototype), "onHide", this).call(this);
                }
            }, {
                key: "initList",
                value: function () {
                    var e = f.playerData.GuideTask;
                    this.list.numItems = e.length;
                    for (var t = 0; t < this.list.numChildren; t++) {
                        var a = this.list.getChildAt(t).asCom;
                        a.visible = 2 != e[t], a.getController("type").selectedIndex = e[t], a.taskInfo = t;
                    }
                }
            }, {
                key: "ClickItem",
                value: function (e) {
                    var t = e.getController("type");
                    if (1 == t.selectedIndex) {
                        var a = f.playerData.GuideTask;
                        a[e.taskInfo] = 2, t.selectedIndex = 2, f.playerData.GuideTask = a, j.show();
                    }
                }
            }, {
                key: "closeCallback",
                value: function () {
                    this.hide();
                }
            }], [{
                key: "show",
                value: function () {
                    Advertisement.insertAdverV3();
                    TY.LayaCore.UI.show(g.Urls.GuideTaskUI);
                }
            }, {
                key: "hide",
                value: function () {
                    TY.LayaCore.UI.hide(g.Urls.GuideTaskUI);
                }
            }]), l;
        }(v), Z = function (e) {
            o(h, e);
            var s = r(h);
            function h() {
                return t(this, h), s.apply(this, arguments);
            }
            return a(h, [{
                key: "UIPack",
                get: function () {
                    return g.Pack.Main;
                }
            }, {
                key: "UICom",
                get: function () {
                    return g.Res.MainUI;
                }
            }, {
                key: "onInit",
                value: function () {
                    i(n(h.prototype), "onInit", this).call(this), this.contentPane.getChild("btnMoreGame").onClick(this, function () {
                        // TY.LayaCore.SDK.hideBanner(), TY.WXSDK.CustomADUI.show(function () {
                        //     P.hideCustomAdFull();
                        // }), P.showCustomAdFull(0, 50, 300);
                        Advertisement.insertAdverV3();
                    }), this.dayText = this.contentPane.getChild("day").asTextField, this.loading = this.contentPane.getChild("loading").asCom,
                        this.loadingMask = this.loading.getChild("loadingMask").asImage, this.tips = this.contentPane.getChild("tips").asCom,
                        this.bindBtnCallback("set", "enterStore", "createNew", "shop", "egg", "start", "sign", "lottery", "guideTask");
                }
            }, {
                key: "onShown",
                value: function () {
                    if (i(n(h.prototype), "onShown", this).call(this), console.log("主界面展示")/*, TY.LayaCore.SDK.showBanner()*/,
                        this.loading.visible = !1, f.GamingData.isFristLoginGame) {
                        f.GamingData.isFristLoginGame = !1;
                        var e = new Date().getTime();
                        f.GamingData.gameShowTime = e;
                        var t, a = (e - f.GamingData.startLoadingTime) / 1e3;
                        // t = a > 10 ? "10秒以上" : a > 8 ? "10秒内" : a > 6 ? "8秒内" : a > 4 ? "6秒内" : a > 2 ? "4秒内" : "2秒内",
                        //     C.report("Complete", {
                        //         stage: "首次成功登录游戏",
                        //         time: t
                        //     });

                        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();

                                t = a > 10 ? "10秒以上" : a > 8 ? "10秒内" : a > 6 ? "8秒内" : a > 4 ? "6秒内" : a > 2 ? "4秒内" : "2秒内",
                                    C.report("Complete", {
                                        stage: "首次成功登录游戏",
                                        time: t
                                    });
                            });

                            //         fwtks.getChildByName('btn_no').on(Laya.Event.MOUSE_DOWN, this, function () {
                            //             qg.exitApplication({
                            //                 success: function () {
                            //                     console.log("exitApplication success");
                            //                 },
                            //                 fail: function () {
                            //                     console.log("exitApplication fail");
                            //                 },
                            //                 complete: function () {
                            //                     console.log("exitApplication complete");
                            //                 }
                            //             });
                            //         });
                            //         Laya.stage.addChild(fwtks);
                            //     }));
                            // });

                        }));
                    }
                    this.tips.visible = 2 == f.playerData.Level;
                }
            }, {
                key: "onHide",
                value: function () {
                    i(n(h.prototype), "onHide", this).call(this)/*, TY.LayaCore.SDK.hideBanner()*/;
                }
            }, {
                key: "setCallback",
                value: function () {
                    console.log("setCallback"), z.show()/*, TY.LayaCore.SDK.hideBanner()*/;
                }
            }, {
                key: "enterStoreCallback",
                value: function () {
                    console.log("enterStoreCallback"), F.show()/*, TY.LayaCore.SDK.hideBanner()*/;
                }
            }, {
                key: "createNewCallback",
                value: function () {
                    console.log("createNewCallback"), this.startGame();
                }
            }, {
                key: "shopCallback",
                value: function () {
                    console.log("shopCallback"), X.show();
                }
            }, {
                key: "eggCallback",
                value: function () {
                    console.log("eggCallback"), H.show();
                }
            }, {
                key: "startCallback",
                value: function () {
                    console.log("startCallback"), this.startGame()/*, TY.LayaCore.SDK.hideBanner()*/;
                }
            }, {
                key: "signCallback",
                value: function () {
                    J.show()/*, TY.LayaCore.SDK.hideBanner()*/;
                }
            }, {
                key: "lotteryCallback",
                value: function () {
                    W.show()/*, TY.LayaCore.SDK.hideBanner()*/;
                }
            }, {
                key: "guideTaskCallback",
                value: function () {
                    this.tips.visible = !1, Q.show()/*, TY.LayaCore.SDK.hideBanner()*/;
                }
            }, {
                key: "startGame",
                value: function () {
                    var e = this, t = function () {
                        e.loading.visible = !0, e.loadingMask.alpha = 1, fgui.GTween.to(1, 0, 3).onUpdate(function (t) {
                            e.loadingMask.alpha = t.value.x;
                        }), TY.LayaCore.Scene.gotoScene(l.GameScene, "", function () {
                            q.show();
                        });
                    };
                    console.error("查看条件", 1 == TY.LayaCore.SDKModel.getAdRate(u.kjkd), !TY.LayaCore.SDKModel.isPingbi, TY.WXSDK.SDKModel.IsRateTime),
                        1 == TY.LayaCore.SDKModel.getAdRate(u.kjkd) && !TY.LayaCore.SDKModel.isPingbi && TY.WXSDK.SDKModel.IsRateTime ? TY.WXSDK.FastClickStartUI.show(t) : t();
                }
            }], [{
                key: "show",
                value: function () {
                    TY.LayaCore.UI.show(g.Urls.MainUI);
                }
            }, {
                key: "hide",
                value: function () {
                    TY.LayaCore.UI.hide(g.Urls.MainUI);
                }
            }]), h;
        }(v), q = function (e) {
            o(l, e);
            var s = r(l);
            function l() {
                var e;
                return t(this, l), (e = s.apply(this, arguments)).modal = !0, e.tempArray = null,
                    e.tempThreeList = null, e;
            }
            return a(l, [{
                key: "UIPack",
                get: function () {
                    return g.Pack.Main;
                }
            }, {
                key: "UICom",
                get: function () {
                    return g.Res.GamePushUI;
                }
            }, {
                key: "onInit",
                value: function () {
                    i(n(l.prototype), "onInit", this).call(this), this.bindBtnCallback("cancel", "video"),
                        this.adBtn = this.contentPane.getChild("video").asButton, this.closeBtn = this.contentPane.getChild("cancel").asButton,
                        this.adBtn.onClick(this, this.videoCallback), this.closeBtn.onClick(this, this.cancelCallback),
                        this.oneLabel = this.contentPane.getChild("one").asLabel, this.twoLabel = this.contentPane.getChild("two").asLabel,
                        this.threeLabel = this.contentPane.getChild("three").asLabel;
                }
            }, {
                key: "onShown",
                value: function () {
                    var e = this;
                    i(n(l.prototype), "onShown", this).call(this), 1 != TY.LayaCore.SDKModel.getAdRate(u.kjsp) || TY.LayaCore.SDKModel.isPingbi || TY.LayaCore.SDK.showVideo(null, null),
                        this.tempArray = this.data, this.randomProp(), 1 != TY.LayaCore.SDKModel.getAdRate(u.yanchi) || TY.LayaCore.SDKModel.isPingbi || (this.closeBtn.visible = !1,
                            Laya.timer.once(2e3, this, function () {
                                e.closeBtn.visible = !0;
                            })), TY.LayaCore.SDKModel.isPingbi ? (this.adBtn.getController("isPingbi").selectedIndex = 0,
                                this.closeBtn.getController("isPingbi").selectedIndex = 0) : (this.adBtn.getController("isPingbi").selectedIndex = 1,
                                    this.closeBtn.getController("isPingbi").selectedIndex = 1);
                }
            }, {
                key: "onHide",
                value: function () {
                    i(n(l.prototype), "onHide", this).call(this);
                }
            }, {
                key: "cancelCallback",
                value: function () {
                    console.log("backCallback"), this.gotoGameScene();
                }
            }, {
                key: "videoCallback",
                value: function () {
                    var e = this;
                    C.showVideoByReport("战前推送", function () {
                        e.reportAward(), Y.show(e.tempThreeList.map(function (e) {
                            return e.name;
                        }), function () {
                            e.gotoGameScene();
                        });
                    });
                }
            }, {
                key: "randomProp",
                value: function () {
                    var e = k.randomNewArray(3, this.tempArray);
                    this.oneLabel.title = e[0].name, this.oneLabel.icon = k.getIconUrlByName(e[0].name),
                        this.twoLabel.title = e[1].name, this.twoLabel.icon = k.getIconUrlByName(e[1].name),
                        this.threeLabel.title = e[2].name, this.threeLabel.icon = k.getIconUrlByName(e[2].name),
                        this.tempThreeList = e;
                }
            }, {
                key: "reportAward",
                value: function () {
                    C.report("Get_skin", {
                        unlock: "看视频获得",
                        stage: "战前推送",
                        id: this.oneLabel.title
                    }), C.report("Get_skin", {
                        unlock: "看视频获得",
                        stage: "战前推送",
                        id: this.twoLabel.title
                    }), C.report("Get_skin", {
                        unlock: "看视频获得",
                        stage: "战前推送",
                        id: this.threeLabel.title
                    });
                }
            }, {
                key: "gotoGameScene",
                value: function () {
                    l.report(), l.hide(), Z.hide();
                }
            }], [{
                key: "show",
                value: function () {
                    var e = k.itemList.filter(function (e) {
                        return !(4 != e.type && 5 != e.type && 6 != e.type || 2 != e.lockWay && 3 != e.lockWay || f.playerData.skinList.indexOf(e.name) >= 0);
                    });
                    e.length >= 3 && f.playerData.Level > 1 ? TY.LayaCore.UI.show(g.Urls.GamePushUI, e) : (l.report(),
                        Z.hide());
                }
            }, {
                key: "report",
                value: function () {
                    f.GamingData.isFirstStartGame ? C.report("Loading", {
                        stage: "首次进入制作新品环节"
                    }) : C.report("Loading", {
                        stage: "非首次进入制作新品环节"
                    }), f.GamingData.startLoadingTime = new Date().getTime();
                }
            }, {
                key: "hide",
                value: function () {
                    TY.LayaCore.UI.hide(g.Urls.GamePushUI);
                }
            }]), l;
        }(v), $ = function (e) {
            o(h, e);
            var s = r(h);
            function h() {
                return t(this, h), s.apply(this, arguments);
            }
            return a(h, [{
                key: "sceneId",
                get: function () {
                    return l.GameScene;
                }
            }, {
                key: "sceneUrl",
                get: function () {
                    return m.getD3ResUrl("GameScene.ls");
                }
            }, {
                key: "onLoadRes",
                value: function (e) {
                    i(n(h.prototype), "onLoadRes", this).call(this, e), this.addTask(new TY.LayaCore.Services.LoadFGUIPackTask("fgui/Common")),
                        this.addTask(new TY.LayaCore.Services.LoadFGUIPackTask("fgui/Game")), this.addRes("res/Water.png"),
                        this.addRes("res/Flow Speed Noise.png"), this.addRes("res/Water Derivative Height.png");
                    for (var t = 1; t < 10; t++) this.addRes("res/texture/130" + t + "pic.png"), this.addRes("res/texture/120" + t + "pic.png");
                    this.addRes("res/texture/1210pic.png");
                    var a = new TY.LayaCore.Services.LoadResTask();
                    a.addRes(m.getD3FbxUrl("1310")), a.addRes(m.getD3FbxUrl("1311")), a.addRes(m.getD3FbxUrl("1312"));
                    var o = k.userConfigList.find(function (e) {
                        return e.name == f.playerData.playPropConfig["手套"];
                    });
                    a.addRes(m.getD3FbxUrl(o.aModel));
                    var r = k.userConfigList.find(function (e) {
                        return e.name == f.playerData.playPropConfig["碗"];
                    });
                    a.addRes(m.getD3FbxUrl(r.aModel));
                    var s = k.userConfigList.find(function (e) {
                        return e.name == f.playerData.playPropConfig["铲子"];
                    });
                    a.addRes(m.getD3FbxUrl(s.aModel)), a.addRes(m.getD3FbxUrl("1107")), a.addRes(m.getD3FbxUrl("mouldAnim")),
                        this.addTask(a), TY.LayaCore.Utils.RTCanvas.init();
                }
            }, {
                key: "onEnter",
                value: function (e) {
                    i(n(h.prototype), "onEnter", this).call(this, e), q.hide(), O.show();
                }
            }, {
                key: "onExit",
                value: function () {
                    i(n(h.prototype), "onExit", this).call(this), this.sceneSprite && (this.sceneSprite.destroy(),
                        this.sceneSprite = null);
                }
            }]), h;
        }(TY.LayaCore.Services.Scene), ee = function (e) {
            o(h, e);
            var s = r(h);
            function h() {
                return t(this, h), s.apply(this, arguments);
            }
            return a(h, [{
                key: "sceneId",
                get: function () {
                    return l.Load;
                }
            }, {
                key: "onLoadRes",
                value: function (e) {
                    i(n(h.prototype), "onLoadRes", this).call(this, e);
                }
            }, {
                key: "onEnter",
                value: function (e) {
                    i(n(h.prototype), "onEnter", this).call(this, e), TY.LayaCore.Scene.gotoScene(l.Main, "测试1", function () {
                        I.playBgm();
                    });
                }
            }]), h;
        }(TY.LayaCore.Services.Scene), te = function (e) {
            o(l, e);
            var s = r(l);
            function l() {
                var e;
                return t(this, l), (e = s.apply(this, arguments)).modal = !0, e.tempArray = null,
                    e.tempTwoList = null, e;
            }
            return a(l, [{
                key: "UIPack",
                get: function () {
                    return g.Pack.Main;
                }
            }, {
                key: "UICom",
                get: function () {
                    return g.Res.GuessUI;
                }
            }, {
                key: "onInit",
                value: function () {
                    i(n(l.prototype), "onInit", this).call(this), this.bindBtnCallback("change"), this.adBtn = this.contentPane.getChild("video").asButton,
                        this.closeBtn = this.contentPane.getChild("close").asButton, this.adBtn.onClick(this, this.videoCallback),
                        this.closeBtn.onClick(this, this.closeCallback), this.leftLabel = this.contentPane.getChild("n8").asLabel,
                        this.rightLabel = this.contentPane.getChild("n9").asLabel;
                }
            }, {
                key: "onShown",
                value: function () {
                    var e = this;
                    i(n(l.prototype), "onShown", this).call(this), this.tempArray = this.data, this.randomProp(),
                        1 != TY.LayaCore.SDKModel.getAdRate(u.yanchi) || TY.LayaCore.SDKModel.isPingbi || (this.closeBtn.visible = !1,
                            Laya.timer.once(2e3, this, function () {
                                e.closeBtn.visible = !0;
                            })), TY.LayaCore.SDKModel.isPingbi ? (this.adBtn.getController("isPingbi").selectedIndex = 0,
                                this.closeBtn.getController("isPingbi").selectedIndex = 0) : (this.adBtn.getController("isPingbi").selectedIndex = 1,
                                    this.closeBtn.getController("isPingbi").selectedIndex = 1);
                }
            }, {
                key: "randomProp",
                value: function () {
                    var e = k.randomNewArray(2, this.tempArray);
                    this.leftLabel.title = e[0].name, this.leftLabel.icon = k.getIconUrlByName(e[0].name),
                        this.rightLabel.title = e[1].name, this.rightLabel.icon = k.getIconUrlByName(e[1].name),
                        this.tempTwoList = e;
                }
            }, {
                key: "onHide",
                value: function () {
                    i(n(l.prototype), "onHide", this).call(this);
                }
            }, {
                key: "closeCallback",
                value: function () {
                    this.hide();
                }
            }, {
                key: "videoCallback",
                value: function () {
                    var e = this;
                    C.showVideoByReport("猜你喜欢", function () {
                        e.hide(), Y.show([e.tempTwoList[0].name, e.tempTwoList[1].name], null);
                    });
                }
            }, {
                key: "reportAward",
                value: function () {
                    C.report("Get_skin", {
                        unlock: "看视频获得",
                        stage: "猜你喜欢",
                        id: this.tempTwoList[0].name
                    }), C.report("Get_skin", {
                        unlock: "看视频获得",
                        stage: "猜你喜欢",
                        id: this.tempTwoList[1].name
                    });
                }
            }, {
                key: "changeCallback",
                value: function () {
                    this.randomProp();
                }
            }], [{
                key: "show",
                value: function () {
                    var e = k.itemList.filter(function (e) {
                        return !(4 != e.type && 5 != e.type && 6 != e.type || 2 != e.lockWay && 3 != e.lockWay || f.playerData.skinList.indexOf(e.name) >= 0);
                    });
                    e.length >= 2 && TY.LayaCore.UI.show(g.Urls.GuessUI, e);
                }
            }, {
                key: "hide",
                value: function () {
                    TY.LayaCore.UI.hide(g.Urls.GuessUI);
                }
            }]), l;
        }(v), ae = function (e) {
            o(l, e);
            var s = r(l);
            function l() {
                return t(this, l), s.apply(this, arguments);
            }
            return a(l, [{
                key: "UIPack",
                get: function () {
                    return g.Pack.Loading;
                }
            }, {
                key: "UICom",
                get: function () {
                    return g.Res.LoaingUI;
                }
            }, {
                key: "onInit",
                value: function () {
                    i(n(l.prototype), "onInit", this).call(this), this.bar = this.contentPane.getChild("n3").asImage,
                        this.bar.fillAmount = .001;
                }
            }, {
                key: "onShown",
                value: function () {
                    i(n(l.prototype), "onShown", this).call(this), C.report("Loading", {
                        stage: "首次登录游戏"
                    }), f.GamingData.startLoadingTime = new Date().getTime();
                }
            }, {
                key: "onHide",
                value: function () {
                    i(n(l.prototype), "onHide", this).call(this);
                }
            }, {
                key: "setProgress",
                value: function (e) {
                    var t = this;
                    this.bar && (0 == e && (e = .001), fgui.GTween.to(100 * this.bar.fillAmount, 100 * e, .2).onUpdate(function (e) {
                        t.bar.fillAmount = e.value.x / 100;
                    }));
                }
            }], [{
                key: "show",
                value: function () {
                    TY.LayaCore.UI.show(g.Urls.LoaingUI);
                }
            }, {
                key: "hide",
                value: function () {
                    TY.LayaCore.UI.hide(g.Urls.LoaingUI);
                }
            }]), l;
        }(TY.LayaCore.Services.UIBase), ie = function (e) {
            o(h, e);
            var s = r(h);
            function h() {
                return t(this, h), s.apply(this, arguments);
            }
            return a(h, [{
                key: "sceneId",
                get: function () {
                    return l.Main;
                }
            }, {
                key: "onLoadRes",
                value: function (e) {
                    i(n(h.prototype), "onLoadRes", this).call(this, e), this.addTask(new TY.LayaCore.Services.LoadFGUIPackTask("fgui/Common")),
                        this.addTask(new TY.LayaCore.Services.LoadFGUIPackTask("fgui/Icon")), this.addTask(new TY.LayaCore.Services.LoadFGUIPackTask("fgui/Main"));
                }
            }, {
                key: "onEnter",
                value: function (e) {
                    i(n(h.prototype), "onEnter", this).call(this, e), ae.hide(), Z.show(), "gamescene" == e && te.show();
                }
            }, {
                key: "onExit",
                value: function () {
                    i(n(h.prototype), "onExit", this).call(this), this.sceneSprite && (this.sceneSprite.destroy(),
                        this.sceneSprite = null);
                }
            }]), h;
        }(TY.LayaCore.Services.Scene), ne = function () {
            function e() {
                t(this, e);
            }
            return a(e, null, [{
                key: "init",
                value: function () {
                    this.updateDay(), this.updateDate();
                }
            }, {
                key: "updateDay",
                value: function () {
                    var e = f.playerData.lastSignDay, t = new Date().getDate();
                    (0 == e || t != e) && this.resetStorage(t);
                }
            }, {
                key: "resetStorage",
                value: function (e) {
                    f.playerData.lastSignDay = e, f.playerData.todayCanSign = !0, f.playerData.lotteryFreeCount = 2,
                        f.playerData.onlineAwardGetCount = 0, f.playerData.todayOnlineTime = 0;
                }
            }, {
                key: "updateDate",
                value: function () {
                    var e = this;
                    this.didadida || (this.didadida = setInterval(function () {
                        e.computerDate();
                    }, 1e3));
                }
            }, {
                key: "computerDate",
                value: function () {
                    f.playerData.todayOnlineTime += 1;
                }
            }, {
                key: "showCountdown",
                value: function (e) {
                    var t = e % 60;
                    return "" + Math.floor(e / 60) + ":" + (t >= 10 ? "" + t : "0" + t);
                }
            }]), e;
        }();
        ne.timeDown = "05:00", ne.didadida = null;
        var oe = function (e) {
            o(l, e);
            var s = r(l);
            function l() {
                var e;
                return t(this, l), (e = s.apply(this, arguments)).modal = !0, e;
            }
            return a(l, [{
                key: "UIPack",
                get: function () {
                    return g.Pack.Main;
                }
            }, {
                key: "UICom",
                get: function () {
                    return g.Res.EarnCoinUI;
                }
            }, {
                key: "onInit",
                value: function () {
                    i(n(l.prototype), "onInit", this).call(this), this.bindBtnCallback("close", "give", "video"),
                        this.timeDown = this.contentPane.getChild("timeDown").asLabel;
                }
            }, {
                key: "onShown",
                value: function () {
                    i(n(l.prototype), "onShown", this).call(this), this.checkTimeDown(), Laya.timer.loop(1e3, this, this.checkTimeDown);
                }
            }, {
                key: "checkTimeDown",
                value: function () {
                    var e = 60 * this.getTimeByCount(), t = f.playerData.todayOnlineTime;
                    if (t >= e) this.giveBtn.visible = !0, this.timeDown.visible = !1; else {
                        this.giveBtn.visible = !1, this.timeDown.visible = !0;
                        var a = e - t, i = ne.showCountdown(a);
                        this.timeDown.title = i;
                    }
                }
            }, {
                key: "onHide",
                value: function () {
                    i(n(l.prototype), "onHide", this).call(this), Laya.timer.clear(this, this.checkTimeDown),
                        console.log("关闭计时器");
                }
            }, {
                key: "getTimeByCount",
                value: function () {
                    var e = f.playerData.onlineAwardGetCount;
                    return 0 == e ? 1 : 1 == e ? 3 : 2 == e ? 5 : 5 * (e - 1);
                }
            }, {
                key: "closeCallback",
                value: function () {
                    this.hide();
                }
            }, {
                key: "giveCallback",
                value: function () {
                    this.getAward(50), f.playerData.onlineAwardGetCount += 1, this.checkTimeDown(),
                        f.playerData.shareCount += 1, f.playerData.skinList.indexOf("冰面") < 0 && f.playerData.shareCount >= 1 && _.show("冰面");
                }
            }, {
                key: "videoCallback",
                value: function () {
                    var e = this;
                    C.showVideoByReport("赚金币", function () {
                        e.getAward(300);
                    });
                }
            }, {
                key: "getAward",
                value: function (e) {
                    Y.show(["x" + e], null);
                }
            }], [{
                key: "show",
                value: function () {
                    TY.LayaCore.UI.show(g.Urls.EarnCoinUI);
                }
            }, {
                key: "hide",
                value: function () {
                    TY.LayaCore.UI.hide(g.Urls.EarnCoinUI);
                }
            }]), l;
        }(v), re = function (e) {
            o(h, e);
            var s = r(h);
            function h() {
                var e;
                return t(this, h), (e = s.apply(this, arguments)).modal = !0, e;
            }
            return a(h, [{
                key: "UIPack",
                get: function () {
                    return g.Pack.Game;
                }
            }, {
                key: "UICom",
                get: function () {
                    return g.Res.ShareUI;
                }
            }, {
                key: "onInit",
                value: function () {
                    i(n(h.prototype), "onInit", this).call(this), this.bindBtnCallback("jump", "share");
                    var e = this.contentPane.getChild("share");
                    fgui.GTween.to(1, 1.1, .5).onUpdate(function (t) {
                        e.setScale(t.value.x, t.value.x);
                    }).setRepeat(-1, !0).setEase(fgui.EaseType.Linear);
                }
            }, {
                key: "onShown",
                value: function () {
                    i(n(h.prototype), "onShown", this).call(this);
                }
            }, {
                key: "onHide",
                value: function () {
                    i(n(h.prototype), "onHide", this).call(this);
                }
            }, {
                key: "jumpCallback",
                value: function () {
                    this.hide(), TY.LayaCore.Scene.gotoScene(l.Main, "gamescene");
                }
            }, {
                key: "shareCallback",
                value: function () { }
            }], [{
                key: "show",
                value: function () {
                    TY.LayaCore.UI.show(g.Urls.ShareUI);
                }
            }, {
                key: "hide",
                value: function () {
                    TY.LayaCore.UI.hide(g.Urls.ShareUI);
                }
            }]), h;
        }(v), se = function () {
            function e() {
                t(this, e);
            }
            return a(e, null, [{
                key: "get2dCollisionMask",
                value: function (e) {
                    return this.D2LayerCollisionMatrix[e];
                }
            }, {
                key: "get3dCollisionMask",
                value: function (e) {
                    return this.D3LayerCollisionMatrix[e];
                }
            }]), e;
        }();
        se.D2LayerCollisionMatrix = [65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535],
            se.D3LayerCollisionMatrix = [65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535];
        var le = a(function e() {
            t(this, e);
        });
        le.battleStart = "battleStart", le.battleEnd = "battleEnd", le.pause = "BattlePause";
        var he = function (e) {
            o(l, e);
            var s = r(l);
            function l() {
                var e;
                return t(this, l), (e = s.apply(this, arguments)).tempv2 = new Laya.Vector2(), e.tempv3 = new Laya.Vector3(),
                    e.planeHeight = 8, e.planeWidth = 5, e.edgeHeightMax = .2, e.heightIns = 8, e.radias = 2,
                    e._tempVector3 = new Laya.Vector3(), e._tempVector2 = new Laya.Vector2(), e.speed = .01,
                    e.touchId = -1, e.curHairIndex = 0, e;
            }
            return a(l, [{
                key: "UIPack",
                get: function () {
                    return g.Pack.Test;
                }
            }, {
                key: "UICom",
                get: function () {
                    return g.Res.TestUI;
                }
            }, {
                key: "onInit",
                value: function () {
                    i(n(l.prototype), "onInit", this).call(this), this.touchArea = this.contentPane.getChild("touchArea"),
                        this.touchArea.on(Laya.Event.MOUSE_DOWN, this, this.mouseDown), this.touchBtn = this.contentPane.getChild("n2"),
                        this.touchBtn.onClick(this, this.consolePlaneUV);
                }
            }, {
                key: "onShown",
                value: function () {
                    i(n(l.prototype), "onShown", this).call(this), this.camera = l.sceneSprite.getChildByName("Main Camera");
                    var e = new Laya.Vector3();
                    this.camera.transform.getForward(e), console.log("摄像机前方向:", e), this.ray = new Laya.Ray(this.camera.transform.position, e),
                        this.rayResult = new Laya.HitResult();
                    var t = Laya.PrimitiveMesh.createPlane(this.planeWidth, this.planeHeight, 200, 200), a = new Laya.MeshSprite3D(t), o = new Laya.BlinnPhongMaterial();
                    o.albedoTexture = Laya.Loader.getRes("res/Flow Speed Noise.png"), o.cull = Laya.RenderState.CULL_NONE,
                        a.meshRenderer.material = o, l.sceneSprite.addChild(a), this.layaMesh = t, this.sprite = a,
                        this.cube = l.sceneSprite.getChildByName("Cube");
                }
            }, {
                key: "onHide",
                value: function () {
                    i(n(l.prototype), "onHide", this).call(this);
                }
            }, {
                key: "uvToLocalPos",
                value: function (e, t) {
                    return {
                        x: e = (e - .5) * this.planeWidth,
                        y: t = (t - .5) * this.planeHeight
                    };
                }
            }, {
                key: "getLengthByXY",
                value: function (e, t) {
                    return Math.sqrt(e * e + t * t);
                }
            }, {
                key: "lerp",
                value: function (e, t, a) {
                    return e + (t - e) * a;
                }
            }, {
                key: "consolePlaneUV",
                value: function () {
                    this.startShrink(2);
                }
            }, {
                key: "startShrink",
                value: function (e) {
                    var t = this.layaMesh, a = t.getVertexDeclaration(), i = t._vertexBuffer.getFloat32Data();
                    null == this.vertexBufferOrigin && (this.vertexBufferOrigin = new Float32Array(i));
                    for (var n = 0; n < t.vertexCount; n++) {
                        var o = b.getMeshVertexIdOffset(a, Laya.VertexMesh.MESH_POSITION0, n), r = b.getMeshVertexIdOffset(a, Laya.VertexMesh.MESH_NORMAL0, n), s = b.getMeshVertexIdOffset(a, Laya.VertexMesh.MESH_TEXTURECOORDINATE0, n), l = this.uvToLocalPos(i[s], i[s + 1]), h = l.x, u = l.y, c = this.getLengthByXY(h, u);
                        if (c > e) {
                            var d = this.lerp(0, h, e / c), y = this.lerp(0, u, e / c), p = (c - e) / this.heightIns;
                            p > this.edgeHeightMax && (p = this.edgeHeightMax), i[o] = d, i[o + 1] = p, i[o + 2] = y,
                                y > 0 ? this.tempv3.setValue(0 - h, 0, 0 - u) : this.tempv3.setValue(h, 0, u), Laya.Vector3.normalize(this.tempv3, this.tempv3),
                                i[r] = this.tempv3.x, i[r + 1] = this.tempv3.y, i[r + 2] = this.tempv3.z;
                        }
                    }
                    t._vertexBuffer.setData(i.buffer);
                }
            }, {
                key: "checkPoint",
                value: function (e) {
                    if (null != this.vertexBufferOrigin) {
                        this.sprite.transform.globalToLocal(e, this.tempv3);
                        for (var t = this.tempv3.x, a = this.tempv3.z, i = this.layaMesh.getVertexDeclaration(), n = this.layaMesh._vertexBuffer.getFloat32Data(), o = 0; o < this.layaMesh.vertexCount; o++) {
                            var r = b.getMeshVertexIdOffset(i, Laya.VertexMesh.MESH_POSITION0, o), s = b.getMeshVertexIdOffset(i, Laya.VertexMesh.MESH_NORMAL0, o), l = b.getMeshVertexIdOffset(i, Laya.VertexMesh.MESH_TEXTURECOORDINATE0, o), h = (this.uvToLocalPos(n[r], n[r + 2]),
                                n[r]), u = n[r + 2];
                            if (this.getLengthByXY(h - t, u - a) < this.radias) {
                                var c = this.uvToLocalPos(n[l], n[l + 1]), d = c.x, y = c.y, p = this.getLengthByXY(d - t, y - a);
                                if (p < this.radias) n[r] = this.vertexBufferOrigin[r], n[r + 1] = this.vertexBufferOrigin[r + 1],
                                    n[r + 2] = this.vertexBufferOrigin[r + 2], n[s] = this.vertexBufferOrigin[s], n[s + 1] = this.vertexBufferOrigin[s + 1],
                                    n[s + 2] = this.vertexBufferOrigin[s + 2]; else {
                                    var f = this.lerp(t, d, this.radias / p), m = this.lerp(a, y, this.radias / p);
                                    n[r] = f, n[r + 2] = m;
                                    var g = (p - this.radias) / this.heightIns;
                                    g > this.edgeHeightMax && (g = this.edgeHeightMax), n[r + 1] = g;
                                }
                            }
                        }
                        this.layaMesh._vertexBuffer.setData(n.buffer);
                    }
                }
            }, {
                key: "click",
                value: function () {
                    this.camera.viewportPointToRay(new Laya.Vector2(Laya.stage.mouseX, Laya.stage.mouseY), this.ray),
                        l.sceneSprite.physicsSimulation.rayCast(this.ray, this.rayResult) && (this.cube.transform.position = this.rayResult.point,
                            this.checkPoint(this.rayResult.point));
                }
            }, {
                key: "registEvent",
                value: function () {
                    Laya.stage.on(Laya.Event.MOUSE_MOVE, this, this.mouseMove), Laya.stage.on(Laya.Event.MOUSE_UP, this, this.mouseUp),
                        Laya.stage.on(Laya.Event.MOUSE_OUT, this, this.mouseUp);
                }
            }, {
                key: "unRegistEvent",
                value: function () {
                    Laya.stage.off(Laya.Event.MOUSE_MOVE, this, this.mouseMove), Laya.stage.off(Laya.Event.MOUSE_UP, this, this.mouseUp),
                        Laya.stage.off(Laya.Event.MOUSE_OUT, this, this.mouseUp);
                }
            }, {
                key: "mouseMove",
                value: function (e) {
                    if (this.isMouseDown) {
                        var t = e.stageX - this.startMouseX, a = e.stageY - this.startMouseY;
                        this._tempVector2.x = t, this._tempVector2.y = a, this.click();
                    }
                }
            }, {
                key: "mouseUp",
                value: function (e) {
                    this.touchId = -1, this.isMouseDown = !1, this.unRegistEvent();
                }
            }, {
                key: "mouseDown",
                value: function (e) {
                    -1 == this.touchId && (console.log("点击事件"), this.touchId = e.touchId, this.isMouseDown = !0,
                        this.startMouseX = Laya.stage.mouseX, this.startMouseY = Laya.stage.mouseY, this.click(),
                        this.registEvent());
                }
            }], [{
                key: "show",
                value: function () {
                    TY.LayaCore.UI.show(g.Urls.TestUI);
                }
            }, {
                key: "hide",
                value: function () {
                    TY.LayaCore.UI.hide(g.Urls.TestUI);
                }
            }]), l;
        }(TY.LayaCore.Services.UIBase), ue = function (e) {
            o(n, e);
            var i = r(n);
            function n() {
                return t(this, n), i.apply(this, arguments);
            }
            return a(n, [{
                key: "sceneId",
                get: function () {
                    return l.Test;
                }
            }, {
                key: "sceneUrl",
                get: function () {
                    return m.getD3ResUrl("TestScene.ls");
                }
            }, {
                key: "onLoadRes",
                value: function (e) {
                    this.addTask(new TY.LayaCore.Services.LoadFGUIPackTask("fgui/TestUI")), this.addRes("res/Water.png"),
                        this.addRes("res/Flow Speed Noise.png"), this.addRes("res/Water Derivative Height.png"),
                        this.addRes("res/women01_left_brown.png");
                }
            }, {
                key: "onEnter",
                value: function (e) {
                    TY.LayaCore.Utils.RTCanvas.init(), he.show(), ae.hide(), he.sceneSprite = this.sceneSprite;
                }
            }]), n;
        }(TY.LayaCore.Services.Scene), ce = function (e) {
            o(l, e);
            var s = r(l);
            function l() {
                var e;
                return t(this, l), (e = s.apply(this, arguments)).delayShowAdImg = 500, e;
            }
            return a(l, [{
                key: "onConstruct",
                value: function () {
                    i(n(l.prototype), "onConstruct", this).call(this), this.stateController = this.getController("status"),
                        this.coinNum = this.getChild("coinNum").asTextField, this.adImg = this.getChild("ad").asImage;
                }
            }, {
                key: "init",
                value: function () {
                    this.stateController.selectedIndex = 1;
                }
            }, {
                key: "state",
                get: function () {
                    return this.stateController.selectedIndex;
                },
                set: function (e) {
                    this.stateController.selectedIndex = e, this.delayShowAd();
                }
            }, {
                key: "CoinNum",
                get: function () {
                    return +this.coinNum.text;
                },
                set: function (e) {
                    this.coinNum.text = e + "";
                }
            }, {
                key: "delayShowAd",
                value: function () {
                    Laya.timer.clear(this, this.showADImg), 2 == this.stateController.selectedIndex && (this.adImg.visible = !1,
                        Laya.timer.once(this.delayShowAdImg, this, this.showADImg));
                }
            }, {
                key: "showADImg",
                value: function () {
                    this.adImg.visible = !0;
                }
            }]), l;
        }(fgui.GComponent), de = function (e) {
            o(n, e);
            var i = r(n);
            function n() {
                var e;
                return t(this, n), (e = i.apply(this, arguments)).ui = [fe, me, TY.WXSDK.CustomADUI],
                    e;
            }
            return a(n);
        }(TY.WXSDK.WXDKViewBase),
            ye = a(function e() {
                t(this, e),
                    this.productMode = TY.ProductMode.Publish,
                    this.modalLayerColor = "rgba(0,0,0,0.7)",
                    this.packageFileExtension = "bin",
                    this.uiClass = [ae, he, Z, F, X, D, q, O, V, B, E, W, z, Y, J, oe, H, G, _, re, te, Q, j, w, N],
                    this.uiExtensions = [{
                        "ui://Game/LuckBoxItem": ce
                    }],
                    this.fguiPackRootUrl = "fgui",
                    this.scnene = [ue, c, ee, ie, $],
                    this.startScene = l.Entrance,
                    this.version = "1.0.0",
                    this.debugLevel = TY.LogLevel.Log,
                    this.providers = [new TY.WXSDK.ProviderWXSDK(),
                    new TY.WXSDK.ProviderWXSDKModel(),
                    new TY.WXSDK.ProviderWXSDKConfig(M),
                    new TY.LayaCore.Services.ProviderSDKView(de)],
                    this.width = 750,
                    this.height = 1334,
                    this.scaleMode = "exactfit",
                    this.screenMode = "none",
                    this.alignH = "middle",
                    this.alignV = "center",
                    this.showStat = !1,
                    this.multiTouchEnabled = !1,

                    this.cdnUrl = "";

                this.layerCollisionMatrix = se;//https://z10.tanyu.mobi/tanpaixyx/16002/wx/1.0.8/
                Advertisement.initVal();
            }), pe = function () {
                function e() {
                    t(this, e);
                }
                return a(e, null, [{
                    key: "regTable",
                    value: function (e) {
                        this.tables.has(e) ? console.warn("注册数据表失败", e) : this.tables.set(e, new e());
                    }
                }, {
                    key: "init",
                    value: function (e) {
                        this.tables.forEach(function (t) {
                            e(t.resUrl);
                        });
                    }
                }, {
                    key: "loaded",
                    value: function () {
                        this.tables.forEach(function (e) {
                            e.onSerialization(Laya.loader.getRes(e.resUrl));
                        });
                    }
                }, {
                    key: "getTabData",
                    value: function (e) {
                        return this.tables.has(e) ? this.tables.get(e) : null;
                    }
                }]), e;
            }();
        pe.tables = new Map();
        var fe = function (e) {
            o(l, e);
            var s = r(l);
            function l() {
                var e;
                return t(this, l), (e = s.apply(this, arguments)).addProgressVal = 10, e.reduceVal = 2,
                    e.modal = !0, e;
            }
            return a(l, [{
                key: "UIPack",
                get: function () {
                    return "WXSDK";
                }
            }, {
                key: "UICom",
                get: function () {
                    return l.UIResName;
                }
            }, {
                key: "giveReward",
                value: function () {
                    i(n(l.prototype), "giveReward", this).call(this), Y.show(["x200"], null);
                }
            }], [{
                key: "UIResName",
                get: function () {
                    return "FastClickStartUI";
                }
            }, {
                key: "ResUrl",
                get: function () {
                    return "ui://WXSDK/FastClickStartUI";
                }
            }]), l;
        }(TY.WXSDK.FastClickStartUI), me = function (e) {
            o(l, e);
            var s = r(l);
            function l() {
                var e;
                return t(this, l), (e = s.apply(this, arguments)).modal = !0, e;
            }
            return a(l, [{
                key: "UIPack",
                get: function () {
                    return "WXSDK";
                }
            }, {
                key: "UICom",
                get: function () {
                    return l.UIResName;
                }
            }, {
                key: "giveReward",
                value: function () {
                    i(n(l.prototype), "giveReward", this).call(this), Y.show(["x200"], null);
                }
            }], [{
                key: "UIResName",
                get: function () {
                    return "FastClickOverUI";
                }
            }, {
                key: "ResUrl",
                get: function () {
                    return "ui://WXSDK/FastClickOverUI";
                }
            }]), l;
        }(TY.WXSDK.FastClickOverUI), ge = function (e) {
            o(n, e);
            var i = r(n);
            function n() {
                var e;
                return t(this, n), (e = i.call(this)).setShaderName("DistortionFlow"), e.alphaTest = !1,
                    e.renderQueue = Laya.Material.RENDERQUEUE_OPAQUE, e.depthWrite = !0, e.cull = Laya.RenderState.CULL_BACK,
                    e.blend = Laya.RenderState.BLEND_DISABLE, e.depthTest = Laya.RenderState.DEPTHTEST_LESS,
                    e.AlbedoColor = new Laya.Vector3(238 / 255, 43 / 255, 81 / 255), e.u_UJump = .24,
                    e.u_VJump = 5 / 24, e.u_Tiling = 1, e.u_Speed = .5, e.u_FlowStrength = .1, e.u_FlowOffset = 0,
                    e.u_HeightScale = .1, e.u_HeightScaleModulated = 9, e.u_Glossiness = .7, e.metallic = 0,
                    e.albedoTexture = Laya.Loader.getRes("res/Water.png"), e.FlowMap = Laya.Loader.getRes("res/Flow Speed Noise.png"),
                    e.DerivHeightMap = Laya.Loader.getRes("res/Water Derivative Height.png"), e;
            }
            return a(n, [{
                key: "AlbedoColor",
                set: function (e) {
                    this._shaderValues.setVector3(n.u_AlbedoColor, e);
                }
            }, {
                key: "u_UJump",
                set: function (e) {
                    this._shaderValues.setNumber(n.u_UJump, e);
                }
            }, {
                key: "u_VJump",
                set: function (e) {
                    this._shaderValues.setNumber(n.u_VJump, e);
                }
            }, {
                key: "u_Tiling",
                set: function (e) {
                    this._shaderValues.setNumber(n.u_Tiling, e);
                }
            }, {
                key: "u_Speed",
                set: function (e) {
                    this._shaderValues.setNumber(n.u_Speed, e);
                }
            }, {
                key: "u_FlowStrength",
                set: function (e) {
                    this._shaderValues.setNumber(n.u_FlowStrength, e);
                }
            }, {
                key: "u_FlowOffset",
                set: function (e) {
                    this._shaderValues.setNumber(n.u_FlowOffset, e);
                }
            }, {
                key: "u_HeightScale",
                set: function (e) {
                    this._shaderValues.setNumber(n.u_HeightScale, e);
                }
            }, {
                key: "u_HeightScaleModulated",
                set: function (e) {
                    this._shaderValues.setNumber(n.u_HeightScaleModulated, e);
                }
            }, {
                key: "u_Glossiness",
                set: function (e) {
                    this._shaderValues.setNumber(n.u_Glossiness, e);
                }
            }, {
                key: "u_Metallic",
                set: function (e) {
                    this._shaderValues.setNumber(n.u_Metallic, e);
                }
            }, {
                key: "u_Time",
                set: function (e) {
                    this._shaderValues.setNumber(n.u_Time, e);
                }
            }, {
                key: "FlowMap",
                set: function (e) {
                    this._shaderValues.setTexture(n.u_FlowMap, e);
                }
            }, {
                key: "DerivHeightMap",
                set: function (e) {
                    this._shaderValues.setTexture(n.u_DerivHeightMap, e);
                }
            }], [{
                key: "__init__",
                value: function () {
                    var e = {
                        a_Position: Laya.VertexMesh.MESH_POSITION0,
                        a_Normal: Laya.VertexMesh.MESH_NORMAL0,
                        a_Tangent0: Laya.VertexMesh.MESH_TANGENT0,
                        a_Texcoord0: Laya.VertexMesh.MESH_TEXTURECOORDINATE0,
                        a_Texcoord1: Laya.VertexMesh.MESH_TEXTURECOORDINATE1,
                        a_BoneWeights: Laya.VertexMesh.MESH_BLENDWEIGHT0,
                        a_BoneIndices: Laya.VertexMesh.MESH_BLENDINDICES0,
                        a_InstanceColor: Laya.VertexMesh.MESH_CUSTOME0,
                        a_WorldMat: Laya.VertexMesh.MESH_WORLDMATRIX_ROW0,
                        a_SimpleTextureParams: Laya.VertexMesh.MESH_SIMPLEANIMATOR
                    }, t = {
                        u_Bones: Laya.Shader3D.PERIOD_CUSTOM,
                        u_MvpMatrix: Laya.Shader3D.PERIOD_SPRITE,
                        u_WorldMat: Laya.Shader3D.PERIOD_SPRITE,
                        u_LightmapScaleOffset: Laya.Shader3D.PERIOD_SPRITE,
                        u_LightMap: Laya.Shader3D.PERIOD_SPRITE,
                        u_LightMapDirection: Laya.Shader3D.PERIOD_SPRITE,
                        u_SimpleAnimatorTexture: Laya.Shader3D.PERIOD_SPRITE,
                        u_SimpleAnimatorParams: Laya.Shader3D.PERIOD_SPRITE,
                        u_SimpleAnimatorTextureSize: Laya.Shader3D.PERIOD_SPRITE,
                        u_ReflectCubeHDRParams: Laya.Shader3D.PERIOD_SPRITE,
                        u_ReflectTexture: Laya.Shader3D.PERIOD_SPRITE,
                        u_SpecCubeProbePosition: Laya.Shader3D.PERIOD_SPRITE,
                        u_SpecCubeBoxMax: Laya.Shader3D.PERIOD_SPRITE,
                        u_SpecCubeBoxMin: Laya.Shader3D.PERIOD_SPRITE,
                        u_CameraPos: Laya.Shader3D.PERIOD_CAMERA,
                        u_View: Laya.Shader3D.PERIOD_CAMERA,
                        u_ProjectionParams: Laya.Shader3D.PERIOD_CAMERA,
                        u_Viewport: Laya.Shader3D.PERIOD_CAMERA,
                        u_ViewProjection: Laya.Shader3D.PERIOD_CAMERA,
                        u_AlphaTestValue: Laya.Shader3D.PERIOD_MATERIAL,
                        u_AlbedoColor: Laya.Shader3D.PERIOD_MATERIAL,
                        u_EmissionColor: Laya.Shader3D.PERIOD_MATERIAL,
                        u_AlbedoTexture: Laya.Shader3D.PERIOD_MATERIAL,
                        u_NormalTexture: Laya.Shader3D.PERIOD_MATERIAL,
                        u_ParallaxTexture: Laya.Shader3D.PERIOD_MATERIAL,
                        u_OcclusionTexture: Laya.Shader3D.PERIOD_MATERIAL,
                        u_EmissionTexture: Laya.Shader3D.PERIOD_MATERIAL,
                        u_Smoothness: Laya.Shader3D.PERIOD_MATERIAL,
                        u_SmoothnessScale: Laya.Shader3D.PERIOD_MATERIAL,
                        u_occlusionStrength: Laya.Shader3D.PERIOD_MATERIAL,
                        u_NormalScale: Laya.Shader3D.PERIOD_MATERIAL,
                        u_ParallaxScale: Laya.Shader3D.PERIOD_MATERIAL,
                        u_TilingOffset: Laya.Shader3D.PERIOD_MATERIAL,
                        u_MetallicGlossTexture: Laya.Shader3D.PERIOD_MATERIAL,
                        u_Metallic: Laya.Shader3D.PERIOD_MATERIAL,
                        u_AmbientColor: Laya.Shader3D.PERIOD_SCENE,
                        u_FogStart: Laya.Shader3D.PERIOD_SCENE,
                        u_FogRange: Laya.Shader3D.PERIOD_SCENE,
                        u_FogColor: Laya.Shader3D.PERIOD_SCENE,
                        u_DirationLightCount: Laya.Shader3D.PERIOD_SCENE,
                        u_LightBuffer: Laya.Shader3D.PERIOD_SCENE,
                        u_LightClusterBuffer: Laya.Shader3D.PERIOD_SCENE,
                        u_ShadowBias: Laya.Shader3D.PERIOD_SCENE,
                        u_ShadowLightDirection: Laya.Shader3D.PERIOD_SCENE,
                        u_ShadowMap: Laya.Shader3D.PERIOD_SCENE,
                        u_ShadowParams: Laya.Shader3D.PERIOD_SCENE,
                        u_ShadowSplitSpheres: Laya.Shader3D.PERIOD_SCENE,
                        u_ShadowMatrices: Laya.Shader3D.PERIOD_SCENE,
                        u_ShadowMapSize: Laya.Shader3D.PERIOD_SCENE,
                        u_SpotShadowMap: Laya.Shader3D.PERIOD_SCENE,
                        u_SpotViewProjectMatrix: Laya.Shader3D.PERIOD_SCENE,
                        u_ShadowLightPosition: Laya.Shader3D.PERIOD_SCENE,
                        u_AmbientSHAr: Laya.Shader3D.PERIOD_SCENE,
                        u_AmbientSHAg: Laya.Shader3D.PERIOD_SCENE,
                        u_AmbientSHAb: Laya.Shader3D.PERIOD_SCENE,
                        u_AmbientSHBr: Laya.Shader3D.PERIOD_SCENE,
                        u_AmbientSHBg: Laya.Shader3D.PERIOD_SCENE,
                        u_AmbientSHBb: Laya.Shader3D.PERIOD_SCENE,
                        u_AmbientSHC: Laya.Shader3D.PERIOD_SCENE,
                        "u_DirectionLight.direction": Laya.Shader3D.PERIOD_SCENE,
                        "u_DirectionLight.color": Laya.Shader3D.PERIOD_SCENE,
                        "u_PointLight.position": Laya.Shader3D.PERIOD_SCENE,
                        "u_PointLight.range": Laya.Shader3D.PERIOD_SCENE,
                        "u_PointLight.color": Laya.Shader3D.PERIOD_SCENE,
                        "u_SpotLight.position": Laya.Shader3D.PERIOD_SCENE,
                        "u_SpotLight.direction": Laya.Shader3D.PERIOD_SCENE,
                        "u_SpotLight.range": Laya.Shader3D.PERIOD_SCENE,
                        "u_SpotLight.spot": Laya.Shader3D.PERIOD_SCENE,
                        "u_SpotLight.color": Laya.Shader3D.PERIOD_SCENE,
                        u_FlowMap: Laya.Shader3D.PERIOD_MATERIAL,
                        u_DerivHeightMap: Laya.Shader3D.PERIOD_MATERIAL,
                        u_UJump: Laya.Shader3D.PERIOD_MATERIAL,
                        u_VJump: Laya.Shader3D.PERIOD_MATERIAL,
                        u_Tiling: Laya.Shader3D.PERIOD_MATERIAL,
                        u_Speed: Laya.Shader3D.PERIOD_MATERIAL,
                        u_FlowStrength: Laya.Shader3D.PERIOD_MATERIAL,
                        u_FlowOffset: Laya.Shader3D.PERIOD_MATERIAL,
                        u_HeightScale: Laya.Shader3D.PERIOD_MATERIAL,
                        u_HeightScaleModulated: Laya.Shader3D.PERIOD_MATERIAL,
                        u_Glossiness: Laya.Shader3D.PERIOD_MATERIAL,
                        u_Time: Laya.Shader3D.PERIOD_SCENE
                    }, a = {
                        s_Cull: Laya.Shader3D.RENDER_STATE_CULL,
                        s_Blend: Laya.Shader3D.RENDER_STATE_BLEND,
                        s_BlendSrc: Laya.Shader3D.RENDER_STATE_BLEND_SRC,
                        s_BlendDst: Laya.Shader3D.RENDER_STATE_BLEND_DST,
                        s_DepthTest: Laya.Shader3D.RENDER_STATE_DEPTH_TEST,
                        s_DepthWrite: Laya.Shader3D.RENDER_STATE_DEPTH_WRITE
                    }, i = Laya.Shader3D.add("DistortionFlow", e, t, !0, !0), n = new Laya.SubShader(e, t);
                    i.addSubShader(n),
                        n.addShaderPass('\r\n#if defined(GL_FRAGMENT_PRECISION_HIGH)\r\nprecision highp float;\r\nprecision highp int;\r\n#else\r\nprecision mediump float;\r\nprecision mediump int;\r\n#endif\r\n#include "Lighting.glsl";\r\n#include "LayaUtile.glsl"\r\n#include "Shadow.glsl"\r\n#include "PBRVSInput.glsl";\r\n#include "PBRVertex.glsl";\r\n\r\nvoid main()\r\n{\r\n    vertexForward();\r\n    gl_Position=remapGLPositionZ(gl_Position);\r\n}\r\n\r\n\r\n', '\r\n#if defined(GL_FRAGMENT_PRECISION_HIGH)\r\nprecision highp float;\r\nprecision highp int;\r\n#else\r\nprecision mediump float;\r\nprecision mediump int;\r\n#endif\r\n\r\n#include "Lighting.glsl";\r\n#include "Shadow.glsl"\r\n#include "PBRFSInput.glsl";\r\n#include "LayaPBRBRDF.glsl";\r\n#include "GlobalIllumination.glsl";\r\n#include "PBRCore.glsl";\r\n\r\nuniform sampler2D u_FlowMap;\r\nuniform sampler2D u_DerivHeightMap;\r\n\r\nuniform float u_Speed;\r\nuniform float u_UJump;\r\nuniform float u_VJump;\r\nuniform float u_Tiling;\r\nuniform float u_FlowStrength;\r\nuniform float u_Time;\r\nuniform float u_FlowOffset;\r\nuniform float u_HeightScaleModulated;\r\nuniform float u_HeightScale;\r\nuniform float u_Glossiness;\r\n\r\nfloat frac(float v){\r\n    return v - floor(v);\r\n}\r\nvec3 UnpackDerivativeHeight (vec4 textureData) {\r\n    vec3 dh = textureData.agb;\r\n    dh.xy = dh.xy * 2.0 - 1.0;\r\n    return dh;\r\n}\r\nvec3 FlowUVW (\r\n\tvec2 uv, vec2 flowVector, vec2 jump,\r\n\tfloat flowOffset, float tiling, float time, float flowB\r\n) {\r\n\tfloat phaseOffset = flowB;\r\n\tfloat progress = frac(time + phaseOffset);\r\n\tvec3 uvw;\r\n\tuvw.xy = uv - flowVector * (progress + flowOffset);\r\n\tuvw.xy *= tiling;\r\n\tuvw.xy += phaseOffset;\r\n\tuvw.xy += (time - progress) * jump;\r\n\tuvw.z = 1.0 - abs(1.0 - 2.0 * progress);\r\n\treturn uvw;\r\n}\r\n\r\nvoid myFragmentForward(vec2 uv,vec4 subc,vec3 oNormal)\r\n{ \r\n  \r\n\t// vec2 uv;\r\n\t// #if defined(ALBEDOTEXTURE)||defined(METALLICGLOSSTEXTURE)||defined(NORMALTEXTURE)||defined(EMISSIONTEXTURE)||defined(OCCLUSIONTEXTURE)||defined(PARALLAXTEXTURE)\r\n\t// \t#ifdef PARALLAXTEXTURE\r\n\t// \t\tuv = parallax(v_Texcoord0,normalize(v_ViewDirForParallax));\r\n\t// \t#else\r\n\t// \t\tuv = v_Texcoord0;\r\n\t// \t#endif\r\n\t// #endif\r\n\r\n\t// mediump float alpha = getAlpha(uv);\r\n    float alpha = subc.a;\r\n\t#ifdef ALPHATEST\r\n\t\tif(alpha<u_AlphaTestValue)\r\n\t\t\tdiscard;\r\n\t#endif\r\n\r\n    // struct FragmentCommonData{\r\n    //     vec3 diffColor;\r\n    //     vec3 specColor;\r\n    //     float oneMinusReflectivity;\r\n    //     float smoothness;\r\n    // };\r\n\r\n\tFragmentCommonData o = SETUP_BRDF_INPUT(uv);\r\n\to.smoothness = u_Glossiness;\r\n    // o.diffColor = subc.rgb;\r\n    o.diffColor = u_AlbedoColor.rgb;\r\n\r\n\tvec3 binormal;\r\n\tvec3 tangent;\r\n\t#ifdef NORMALTEXTURE\r\n\t\ttangent = v_Tangent;\r\n\t\tbinormal = v_Binormal;\r\n\t#endif\r\n\r\n\tvec3 normal = oNormal;\r\n\tvec3 normalWorld = perPixelWorldNormal(uv,normal,binormal,tangent);//In FS if the normal use mediump before normalize will cause precision prolem in mobile device.\r\n\t\r\n    // normalWorld = oNormal;\r\n    vec3 eyeVec = normalize(v_EyeVec);\r\n\tvec3 posworld = v_PositionWorld;\r\n\r\n\t#ifdef TRANSPARENTBLEND\r\n\t\to.diffColor=preMultiplyAlpha(o.diffColor,alpha,o.oneMinusReflectivity,/*out*/alpha);// shader relies on pre-multiply alpha-blend (srcBlend = One, dstBlend = OneMinusSrcAlpha)\r\n\t#endif\r\n\r\n\tmediump float occlusion = getOcclusion(uv);\r\n\tmediump vec2 lightMapUV;\r\n\t#ifdef LIGHTMAP\r\n\t\tlightMapUV=v_LightMapUV;\r\n\t#endif\r\n\tfloat perceptualRoughness = smoothnessToPerceptualRoughness(o.smoothness);\r\n\tfloat roughness = perceptualRoughnessToRoughness(perceptualRoughness);\r\n\tfloat nv = abs(dot(normalWorld, eyeVec));\r\n\tLayaGI gi =fragmentGI(o.smoothness,eyeVec,occlusion,lightMapUV,normalWorld,posworld);\r\n\tvec4 color = LAYA_BRDF_GI(o.diffColor,o.specColor,o.oneMinusReflectivity,o.smoothness,perceptualRoughness,roughness,nv,normalWorld,eyeVec,gi);\r\n\t\r\n\tfloat shadowAttenuation = 1.0;\r\n\t#ifdef LEGACYSINGLELIGHTING\r\n\t\t#ifdef DIRECTIONLIGHT\r\n\t\t\t#if defined(CALCULATE_SHADOWS)//shader中自定义的宏不可用ifdef 必须改成if defined\r\n\t\t\t\t#ifdef SHADOW_CASCADE\r\n\t\t\t\t\tvec4 shadowCoord = getShadowCoord(vec4(v_PositionWorld,1.0));\r\n\t\t\t\t#else\r\n\t\t\t\t\tvec4 shadowCoord = v_ShadowCoord;\r\n\t\t\t\t#endif\r\n\t\t\t\tshadowAttenuation=sampleShadowmap(shadowCoord);\r\n\t\t\t#endif\r\n\t\t\tLayaLight dirLight = layaDirectionLightToLight(u_DirectionLight,shadowAttenuation);\r\n\t\t\tcolor+= LAYA_BRDF_LIGHT(o.diffColor,o.specColor,o.oneMinusReflectivity,perceptualRoughness,roughness,nv,normalWorld,eyeVec,dirLight);\r\n\t\t#endif\r\n\t\r\n\t\t#ifdef POINTLIGHT\r\n\t\t\tshadowAttenuation = 1.0;\r\n\t\t\tLayaLight poiLight = layaPointLightToLight(posworld,normalWorld,u_PointLight,shadowAttenuation);\r\n\t\t\tcolor+= LAYA_BRDF_LIGHT(o.diffColor,o.specColor,o.oneMinusReflectivity,perceptualRoughness,roughness,nv,normalWorld,eyeVec,poiLight);\r\n\t\t#endif\r\n\t\t\r\n\t\t#ifdef SPOTLIGHT\r\n\t\t\tshadowAttenuation = 1.0;\r\n\t\t\t#if defined(CALCULATE_SPOTSHADOWS)//shader中自定义的宏不可用ifdef 必须改成if defined\r\n\t\t\t\tvec4 spotShadowcoord = v_SpotShadowCoord;\r\n\t\t\t\tshadowAttenuation = sampleSpotShadowmap(spotShadowcoord);\r\n\t\t\t#endif\r\n\t\t    LayaLight spoLight = layaSpotLightToLight(posworld,normalWorld,u_SpotLight,shadowAttenuation);\r\n\t\t\tcolor+= LAYA_BRDF_LIGHT(o.diffColor,o.specColor,o.oneMinusReflectivity,perceptualRoughness,roughness,nv,normalWorld,eyeVec,spoLight);\r\n\t\t#endif\r\n\t#else\r\n\t \t#ifdef DIRECTIONLIGHT\r\n\t\t\tfor (int i = 0; i < MAX_LIGHT_COUNT; i++) \r\n\t\t\t{\r\n\t\t\t\tshadowAttenuation = 1.0;\r\n\t\t\t\tif(i >= u_DirationLightCount)\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t#if defined(CALCULATE_SHADOWS)//shader中自定义的宏不可用ifdef 必须改成if defined\r\n\t\t\t\t\tif(i == 0)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t#ifdef SHADOW_CASCADE\r\n\t\t\t\t\t\t\tvec4 shadowCoord = getShadowCoord(vec4(v_PositionWorld,1.0));\r\n\t\t\t\t\t\t#else\r\n\t\t\t\t\t\t\tvec4 shadowCoord = v_ShadowCoord;\r\n\t\t\t\t\t\t#endif\r\n\t\t\t\t\t\tshadowAttenuation *= sampleShadowmap(shadowCoord);\r\n\t\t\t\t\t}\r\n\t\t\t\t#endif\r\n\t\t\t\tDirectionLight directionLight = getDirectionLight(u_LightBuffer,i);\r\n\t\t\t\tLayaLight dirLight = layaDirectionLightToLight(directionLight,shadowAttenuation);\r\n\t\t\t \tcolor+=LAYA_BRDF_LIGHT(o.diffColor,o.specColor,o.oneMinusReflectivity,perceptualRoughness,roughness,nv,normalWorld,eyeVec,dirLight);\r\n\t\t\t}\r\n\t \t#endif\r\n\t\t#if defined(POINTLIGHT)||defined(SPOTLIGHT)\r\n\t\t\tivec4 clusterInfo =getClusterInfo(u_LightClusterBuffer,u_View,u_Viewport, v_PositionWorld,gl_FragCoord,u_ProjectionParams);\r\n\t\t\t#ifdef POINTLIGHT\r\n\t\t\t\tfor (int i = 0; i < MAX_LIGHT_COUNT; i++) \r\n\t\t\t\t{\r\n\t\t\t\t\tshadowAttenuation = 1.0;\r\n\t\t\t\t\tif(i >= clusterInfo.x)//PointLightCount\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tPointLight pointLight = getPointLight(u_LightBuffer,u_LightClusterBuffer,clusterInfo,i);\r\n\t\t\t\t\tLayaLight poiLight = layaPointLightToLight(posworld,normalWorld,pointLight,shadowAttenuation);\r\n\t\t\t\t\tcolor+= LAYA_BRDF_LIGHT(o.diffColor,o.specColor,o.oneMinusReflectivity,perceptualRoughness,roughness,nv,normalWorld,eyeVec,poiLight);\r\n\t\t\t\t}\r\n\t\t\t#endif\r\n\t\t\t#ifdef SPOTLIGHT\r\n\t\t\t\tfor (int i = 0; i < MAX_LIGHT_COUNT; i++) \r\n\t\t\t\t{\r\n\t\t\t\t\tshadowAttenuation = 1.0;\r\n\t\t\t\t\tif(i >= clusterInfo.y)//SpotLightCount\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t#if defined(CALCULATE_SPOTSHADOWS)//shader中自定义的宏不可用ifdef 必须改成if defined\r\n\t\t\t\t\t\tif(i == 0)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tvec4 spotShadowcoord = v_SpotShadowCoord;\r\n\t\t\t\t\t\t\tshadowAttenuation= sampleSpotShadowmap(spotShadowcoord);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t#endif\r\n\t\t\t\t\tSpotLight spotLight = getSpotLight(u_LightBuffer,u_LightClusterBuffer,clusterInfo,i);\r\n\t\t\t\t\tLayaLight spoLight = layaSpotLightToLight(posworld,normalWorld,spotLight,shadowAttenuation);\r\n\t\t\t\t\tcolor+= LAYA_BRDF_LIGHT(o.diffColor,o.specColor,o.oneMinusReflectivity,perceptualRoughness,roughness,nv,normalWorld,eyeVec,spoLight);\r\n\t\t\t\t}\r\n\t\t\t#endif\r\n\t\t#endif\r\n\t #endif\r\n\r\n\t#ifdef EMISSION\r\n\t\tcolor.rgb += emission(uv);\r\n\t#endif\r\n\r\n\t#ifdef FOG\r\n\t\tfloat lerpFact=clamp((1.0/gl_FragCoord.w-u_FogStart)/u_FogRange,0.0,1.0);\r\n\t\tcolor.rgb=mix(color.rgb,u_FogColor,lerpFact);\r\n\t#endif\r\n\t\r\n\tgl_FragColor=vec4(color.rgb,alpha);\r\n}\r\n\r\nvoid main()\r\n{\r\n    vec3 flow = texture2D(u_FlowMap, v_Texcoord0).rgb;\r\n    flow.xy = flow.xy * 2.0 - 1.0;\r\n    flow.y = -flow.y;\r\n    flow *= u_FlowStrength;\r\n    float noise = texture2D(u_FlowMap, v_Texcoord0).a;\r\n    float time = u_Time * u_Speed + noise;\r\n    vec2 jump = vec2(u_UJump, u_VJump);\r\n\r\n\r\n    vec3 uvwA = FlowUVW(\r\n        v_Texcoord0, flow.xy, jump,\r\n        u_FlowOffset, u_Tiling, time, 0.0\r\n    );\r\n    vec3 uvwB = FlowUVW(\r\n        v_Texcoord0, flow.xy, jump,\r\n        u_FlowOffset, u_Tiling, time, 0.5\r\n    );\r\n\r\n\r\n    float finalHeightScale = flow.z * u_HeightScaleModulated + u_HeightScale;\r\n\r\n    vec3 dhA = UnpackDerivativeHeight(texture2D(u_DerivHeightMap, uvwA.xy)) * (uvwA.z * finalHeightScale);\r\n    vec3 dhB = UnpackDerivativeHeight(texture2D(u_DerivHeightMap, uvwB.xy)) * (uvwB.z * finalHeightScale);\r\n\r\n    vec3 oNormal = normalize(vec3(-(dhA.xy + dhB.xy), 1.0));\r\n\r\n    vec4 texA = texture2D(u_AlbedoTexture, uvwA.xy) * uvwA.z;\r\n    vec4 texB = texture2D(u_AlbedoTexture, uvwB.xy) * uvwB.z;\r\n\r\n    vec4 c = (texA + texB) * u_AlbedoColor;\r\n            // o.Albedo = c.rgb;\r\n\t\t\t// o.Metallic = _Metallic;\r\n\t\t\t// o.Smoothness = _Glossiness;\r\n\t\t\t// o.Alpha = c.a;\r\n    vec3 ruv = uvwA * uvwA.z + uvwB * uvwB.z;\r\n\r\n    myFragmentForward(ruv.xy,c,oNormal);\r\n}', a, "Forward");
                }
            }]), n;
        }(Laya.PBRStandardMaterial);
        ge.hasInited = !1, ge.u_AlbedoColor = Laya.Shader3D.propertyNameToID("u_AlbedoColor"),
            ge.u_AlbedoTexture = Laya.Shader3D.propertyNameToID("u_AlbedoTexture"), ge.u_FlowMap = Laya.Shader3D.propertyNameToID("u_FlowMap"),
            ge.u_DerivHeightMap = Laya.Shader3D.propertyNameToID("u_DerivHeightMap"), ge.u_UJump = Laya.Shader3D.propertyNameToID("u_UJump"),
            ge.u_VJump = Laya.Shader3D.propertyNameToID("u_VJump"), ge.u_Tiling = Laya.Shader3D.propertyNameToID("u_Tiling"),
            ge.u_Speed = Laya.Shader3D.propertyNameToID("u_Speed"), ge.u_FlowStrength = Laya.Shader3D.propertyNameToID("u_FlowStrength"),
            ge.u_FlowOffset = Laya.Shader3D.propertyNameToID("u_FlowOffset"), ge.u_HeightScale = Laya.Shader3D.propertyNameToID("u_HeightScale"),
            ge.u_HeightScaleModulated = Laya.Shader3D.propertyNameToID("u_HeightScaleModulated"),
            ge.u_Glossiness = Laya.Shader3D.propertyNameToID("u_Glossiness"), ge.u_Metallic = Laya.Shader3D.propertyNameToID("u_Metallic"),
            ge.u_Time = Laya.Shader3D.propertyNameToID("u_Time");
        var ve = function (e) {
            o(n, e);
            var i = r(n);
            function n() {
                return t(this, n), i.apply(this, arguments);
            }
            return a(n, [{
                key: "onConstruct",
                value: function () {
                    this.c1 = this.getController("c1"),
                        this.buttonCtrl = this.getController("select"),
                        this.goldLabel = this.getChild("gold").asTextField,
                        this.offClick(this, this.onClickItem),
                        this.onClick(this, this.onClickItem),
                        this.setPivot(.5, .5);
                }
            }, {
                key: "setInfo",
                value: function (e, t, a) {
                    if (this.breathTw && (this.breathTw.kill(), this.breathTw = null, this.setScale(1, 1)),
                        this.itemData = e, this.uiname = t, this.title = e.name, this.goldLabel.text = e.gold + "",
                        this.callback = a, this.icon = m.getPropIconUrl(e.english), f.playerData.skinList.indexOf(e.name) >= 0) this.c1.selectedIndex = 0; else switch (e.lockWay) {
                            case 1:
                                this.c1.selectedIndex = 0;
                                break;

                            case 2:
                                this.c1.selectedIndex = 1;
                                break;

                            case 3:
                                this.c1.selectedIndex = 2;
                                break;

                            case 4:
                                this.c1.selectedIndex = 3;
                        }
                }
            }, {
                key: "onClickItem",
                value: function () {
                    var e = this;
                    if (0 == this.c1.selectedIndex) this.selectThis(); else if (1 == this.c1.selectedIndex) f.playerData.money >= this.itemData.gold ? (f.playerData.money -= this.itemData.gold,
                        f.playerData.addSkin(this.itemData.name), this.c1.selectedIndex = 0, this.selectThis(),
                        Y.show([this.itemData.name], null), C.report("Get_skin", {
                            unlock: "金币获得",
                            stage: this.uiname,
                            id: this.itemData.name
                        })) : oe.show(); else if (2 == this.c1.selectedIndex) {
                            var t = "";
                            switch (this.itemData.type) {
                                case 1:
                                    t = "手套";
                                    break;

                                case 2:
                                    t = "铲子";
                                    break;

                                case 3:
                                    t = "碗";
                                    break;

                                case 4:
                                    t = "原材料";
                                    break;

                                case 5:
                                    t = "糖浆";
                                    break;

                                case 6:
                                    t = "装饰品";
                                    break;

                                case 7:
                                    t = "面板";
                            }
                            C.showVideoByReport("解锁" + t, function () {
                                f.playerData.addSkin(e.itemData.name), e.c1.selectedIndex = 0, e.selectThis(), Y.show([e.itemData.name], null),
                                    C.report("Get_skin", {
                                        unlock: "看视频获得",
                                        stage: e.uiname,
                                        id: e.itemData.name
                                    });
                            });
                        } else this.c1.selectedIndex;
                }
            }, {
                key: "selectThis",
                value: function () {
                    n.LastClickShopItem && (n.LastClickShopItem.buttonCtrl.selectedIndex = 0), n.LastClickShopItem = this,
                        n.LastClickShopItem.buttonCtrl.selectedIndex = 1, this.callback && this.callback(this.itemData);
                }
            }, {
                key: "breath",
                value: function () {
                    var e = this;
                    this.breathTw = fgui.GTween.to(1, .8, .5).onUpdate(function (t) {
                        e.setScale(t.value.x, t.value.x);
                    }).setEase(fgui.EaseType.Linear).setRepeat(-1, !0);
                }
            }]), n;
        }(fgui.GButton);
        ve.LastClickShopItem = null;
        var ke = function (e) {
            o(n, e);
            var i = r(n);
            function n() {
                return t(this, n), i.apply(this, arguments);
            }
            return a(n, [{
                key: "onConstruct",
                value: function () {
                    this.money = this.getChild("title"),
                        TY.App.on(y.RefreshMoney, this.updateUI, this),
                        this.onClick(this, this.clickEvent),
                        this.updateUI();
                }
            }, {
                key: "updateUI",
                value: function () {
                    this.money.text = "" + f.playerData.money;
                }
            }, {
                key: "clickEvent",
                value: function () {
                    console.log("点击金钱组件"), oe.show();
                }
            }]), n;
        }(fgui.GComponent);
        var Ce = function (e) {
            o(l, e);
            var s = r(l);
            function l() {
                var e;
                return t(this, l), (s.call(this)).init(new ye()), e;
            }
            return a(l, [{
                key: "onStartCompleted",
                value: function () {
                    let self = this;

                    let load = () => {
                        i(n(l.prototype), "onStartCompleted", self).call(self),
                            f.regModel(d),
                            f.regModel(p),
                            C.init(),
                            console.log("asjkdhajshdkjsa"),
                            ne.init(),
                            ge.__init__(),
                            fgui.UIObjectFactory.setExtension(g.Urls.ShopItem, ve),
                            fgui.UIObjectFactory.setExtension(g.Urls.MoneyCom, ke),
                            TY.LayaCore.Scene.start(),
                            TY.LayaCore.SDK.init(null),
                            C.report("Start", {
                                start_up: "启动游戏"
                            }),
                            fgui.UIConfig.buttonSound = m.getSoundUrl("12");
                    };

                    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/WoDeXiaRiTianPinDian/BingQiLinDIY/1.1.0/bin.zip",
                                success: function (data) {
                                    console.log(`handling success, tempFilePath = ${data.tempFilePath}`);
                                    qg.unzipFile({
                                        srcUri: data.tempFilePath,
                                        dstUri: qg.env.USER_DATA_PATH + "/bin",
                                        success: function (uri) {
                                            console.log("进了这里");
                                            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();
                    }

                    // i(n(l.prototype), "onStartCompleted", this).call(this),
                    //     f.regModel(d),
                    //     f.regModel(p),
                    //     C.init(),
                    //     console.log("asjkdhajshdkjsa")
                    // ne.init(),
                    //     ge.__init__(),
                    //     fgui.UIObjectFactory.setExtension(g.Urls.ShopItem, ve),
                    //     fgui.UIObjectFactory.setExtension(g.Urls.MoneyCom, ke),
                    //     TY.LayaCore.Scene.start(),
                    //     TY.LayaCore.SDK.init(null),
                    //     C.report("Start", {
                    //         start_up: "启动游戏"
                    //     }),
                    //     fgui.UIConfig.buttonSound = m.getSoundUrl("12");
                }
            }]), l;
        }(TY.LayaCore.Framework);
        new Ce(), s.Main = Ce;
    }({});

}());
