Пример #1
0
 // Use this for initialization
 void Awake()
 {
     btn_Confirm = XUIUtils.GetCompmentT <Button>(transform, "btn_Confirm");
     btn_Cancel  = XUIUtils.GetCompmentT <Button>(transform, "btn_Cancel");
     XUIUtils.ListenerBtn(btn_Confirm, BtnConfirmOnClick);
     XUIUtils.ListenerBtn(btn_Cancel, BtnCancelOnClick);
 }
Пример #2
0
    public override void OnAwake()
    {
        //   ExcelUtils.Instance.init("Asset/Excel");
        MessageManager.GetInstance.InsertUIDict(this.GetType(), this);
        btn_Close   = XUIUtils.GetCompmentT <Button>(transform, "BackBtn");
        btn_Upgrade = XUIUtils.GetCompmentT <Button>(transform, "UpgradeBtn");
        btn_AddGold = XUIUtils.GetCompmentT <Button>(transform, "glodcountBg/PlusBtn");
        btn_Harvest = XUIUtils.GetCompmentT <Button>(transform, "HarvestBtn");


        slider = XUIUtils.GetCompmentT <Slider>(transform, "SlideImage");

        timer     = XUIUtils.GetCompmentT <Text>(transform, "SlideImage/time");
        level     = XUIUtils.GetCompmentT <Text>(transform, "SlideImage/Level");
        goldcount = XUIUtils.GetCompmentT <Text>(transform, "Treegather/goldcount");
        totalGold = XUIUtils.GetCompmentT <Text>(transform, "glodcountBg/Text");


        XUIUtils.ListenerBtn(btn_Close, BtnCloseOnClick);
        XUIUtils.ListenerBtn(btn_Upgrade, BtnUpgradeOnClick);
        XUIUtils.ListenerBtn(btn_AddGold, BtnAddGoldOnClick);
        XUIUtils.ListenerBtn(btn_Harvest, BtnHarvestOnClick);
        canvasGroup.blocksRaycasts = true;
        moneyTreeOperation         = new MoneyTreeOperation();
        MoneyTreeOpenDto moneyTreeOpenDto = moneyTreeOperation.open(PlayerCache.loginInfo.uid);

        if (moneyTreeOpenDto != null)
        {
            UpdateUI(moneyTreeOpenDto);
        }
    }
Пример #3
0
    public override void OnAwake()
    {
        if (!isAwake)
        {
            MessageManager.GetInstance.InsertUIDict(this.GetType(), this);
            currentGoldTxt = XUIUtils.GetCompmentT <Text>(transform, "currentGold/Text");
            walletGoldTxt  = XUIUtils.GetCompmentT <Text>(transform, "bankGold/Text");
            totalGoldTxt   = XUIUtils.GetCompmentT <Text>(transform, "totalGold/Text");

            DepositInput = XUIUtils.GetCompmentT <InputField>(transform, "Deposit/InputField");
            ExtractInput = XUIUtils.GetCompmentT <InputField>(transform, "Extract/InputField");

            btn_Deposit = XUIUtils.GetCompmentT <Button>(transform, "Deposit/btn_Deposit");
            btn_Extract = XUIUtils.GetCompmentT <Button>(transform, "Extract/btn_Extract");

            btn_ExtractSub = XUIUtils.GetCompmentT <Button>(transform, "Extract/btn_Sub");
            btn_ExtractAdd = XUIUtils.GetCompmentT <Button>(transform, "Extract/btn_Add");
            btn_DepositSub = XUIUtils.GetCompmentT <Button>(transform, "Deposit/btn_Sub");
            btn_DepositAdd = XUIUtils.GetCompmentT <Button>(transform, "Deposit/btn_Add");
            XUIUtils.ListenerBtn(btn_Deposit, BtnDepositOnClick);
            XUIUtils.ListenerBtn(btn_Extract, BtnExtractOnClick);
            XUIUtils.ListenerBtn(btn_ExtractSub, BtnExtractSubOnClick);
            XUIUtils.ListenerBtn(btn_ExtractAdd, BtnExtractAddOnClick);
            XUIUtils.ListenerBtn(btn_DepositSub, BtnDepositSubOnClick);
            XUIUtils.ListenerBtn(btn_DepositAdd, BtnDepositAddOnClick);

            DepositInput.onValueChanged.AddListener(DepositInputValueChange);
            ExtractInput.onValueChanged.AddListener(ExtractInputValueChange);
            isAwake = true;
        }
    }
Пример #4
0
    public override void OnAwake()
    {
        isClickLoginBtn = false;
        key             = "apiunmdw154sof65";
        iv = "asdf9a8fa2fs5sdf";
        GenerateKeyIv(out kv);
        MessageManager.GetInstance.InsertUIDict(this.GetType(), this);
        AddLoginCommand();
        btn_CloseWXLogin = XUIUtils.GetCompmentT <Button>(transform, "ThirdLogin/btn_Close");
        login            = XUIUtils.GetCompmentT <Transform>(transform, "login");
        versionTxt       = XUIUtils.GetCompmentT <Text>(transform, "versionsContentText");
        btn_WXLogin      = XUIUtils.GetCompmentT <Button>(transform, "login/WeChatLoginBtn");

        btn_Login  = XUIUtils.GetCompmentT <Button>(transform, "ThirdLogin/btn_Login");
        thirdLogin = XUIUtils.GetCompmentT <Transform>(transform, "ThirdLogin");

        XUIUtils.ListenerBtn(btn_CloseWXLogin, BtnCloseWXOnClick);
        XUIUtils.ListenerBtn(btn_WXLogin, BtnWXLoginOnClick);
        XUIUtils.ListenerBtn(btn_Login, BtnLoginOnClick);

        //btn_CloseWXLogin.onClick.AddListener(BtnCloseWXOnClick);

        //btn_WXLogin.onClick.AddListener(BtnWXLoginOnClick);
        //btn_Login.onClick.AddListener(BtnLoginOnClick);
        GameObject canvas = GameObject.Find("Canvas");

        loginByWX = canvas.AddComponent <UILoginByWX>();
        if (versionTxt != null)
        {
            versionTxt.text = Application.version;
        }
    }
Пример #5
0
 public override void OnAwake()
 {
     MessageManager.GetInstance.InsertUIDict(this.GetType(), this);
     base.OnAwake();
     startChangeCard          = true;
     changedStartPos          = new Vector3(270, 60, 0);
     exchangeExpend           = new int[] { 1, 2, 3 };
     currentCardIndex         = -1;
     currentExchangeCardCount = 0;
     exchangeTimes            = 1;
     changedCardList          = new List <Transform>();
     ChangeCard    = XUIUtils.GetCompmentT <Transform>(transform, "ChangeCard");
     btn_selfCards = new List <Button>();
     for (int i = 3; i < ChangeCard.childCount; i++)
     {
         btn_selfCards.Add(ChangeCard.GetChild(i).GetComponent <Button>());
     }
     btn_ChangeCard      = XUIUtils.GetCompmentT <Button>(transform, "btn_ChangeCard");
     btn_CloseChangeCard = XUIUtils.GetCompmentT <Button>(transform, "ChangeCard/btn_Close");
     XUIUtils.ListenerBtn(btn_ChangeCard, BtnChangeCardOnClick);
     XUIUtils.ListenerBtn(btn_CloseChangeCard, BtnCloseChangeCardOnClick);
     changedCard = XUIUtils.GetCompmentT <Transform>(transform, "Players/self/Player/ChangedCard");
     CardTrans   = XUIUtils.GetCompmentT <Transform>(transform, "Players/Cards");
     selfChangeCardParentTrans = transform.Find("Players/self/Player/ChangedCard");
     exchangeCardTxt           = XUIUtils.GetCompmentT <Text>(transform, "btn_ChangeCard/countImg/countTxt");
     for (int i = 0; i < btn_selfCards.Count; i++)
     {
         int j = i;
         btn_selfCards[i].onClick.AddListener(delegate() { this.BtnChangeCardOnClick(j); });
     }
 }
Пример #6
0
    // private int[] shopid;
    public override void OnAwake()
    {
        MessageManager.GetInstance.InsertUIDict(this.GetType(), this);

        dimandPanel   = XUIUtils.GetCompmentT <Transform>(transform, "TogglePanel/ZuanShiPanel");
        goldPanel     = XUIUtils.GetCompmentT <Transform>(transform, "TogglePanel/GoldPanel");
        daojuPanel    = XUIUtils.GetCompmentT <Transform>(transform, "TogglePanel/DaojuPanel");
        lianghaoPanel = XUIUtils.GetCompmentT <Transform>(transform, "TogglePanel/LianghaoPanel");
        carPanel      = XUIUtils.GetCompmentT <Transform>(transform, "TogglePanel/CarPanel");

        dimandPanel.gameObject.AddComponent <ZuanShiPanel>();
        goldPanel.gameObject.AddComponent <GoldPanel>();
        daojuPanel.gameObject.AddComponent <DaojuPanel>();
        carPanel.gameObject.AddComponent <CarPanel>();

        ShoptoggleDIC = new Dictionary <ShopType, Toggle>();
        //获取到五个Toggle
        dimandtoggle   = transform.GetChild(5).GetChild(5).GetComponent <Toggle>();
        goldtoggle     = transform.GetChild(5).GetChild(6).GetComponent <Toggle>();
        exchangetoggle = transform.GetChild(5).GetChild(7).GetComponent <Toggle>();
        lianghaotoggle = transform.GetChild(5).GetChild(8).GetComponent <Toggle>();
        cartoggle      = transform.GetChild(5).GetChild(9).GetComponent <Toggle>();
        //存进字典
        ShoptoggleDIC.Add(ShopType.Dimand, dimandtoggle);
        ShoptoggleDIC.Add(ShopType.Golds, goldtoggle);
        ShoptoggleDIC.Add(ShopType.Exchange, exchangetoggle);
        ShoptoggleDIC.Add(ShopType.BeautifulNumber, lianghaotoggle);
        ShoptoggleDIC.Add(ShopType.Cars, cartoggle);
    }
Пример #7
0
    public override void OnAwake()
    {
        if (!isAwake)
        {
            //从表里读取礼物信息

            MessageManager.GetInstance.InsertUIDict(this.GetType(), this);
            giftTable = ShopInit.Instance.GetShopCommodity(100);
            Transform trans = transform.Find("Items/Grid");
            giftNumberList = new Dictionary <int, Text>();
            btn_Pawn       = XUIUtils.GetCompmentT <Button>(transform, "btn_Pawn");
            XUIUtils.ListenerBtn(btn_Pawn, BtnPawnOnClick);
            for (int i = 0; i < giftTable.Count; i++)
            {
                GameObject go  = Resources.Load <GameObject>("Prefabs/Head/gift");
                GameObject obj = Instantiate(go);
                obj.name = "gift_" + i.ToString();
                string path   = "Sprite/Shop/gift/new_gift_" + i.ToString();
                Sprite sprite = Resources.Load <Sprite>(path);
                obj.transform.GetChild(1).GetComponent <Image>().sprite = sprite;
                obj.transform.SetParent(trans);
                obj.transform.localScale = Vector3.one;
                obj.transform.GetChild(2).GetComponent <Text>().text = giftTable[i].name;
                giftNumberList.Add(giftTable[i].id, obj.transform.GetChild(3).GetComponent <Text>());
            }
            canvas  = GameObject.Find("Canvas").transform;
            isAwake = true;
        }
    }
Пример #8
0
    public override void OnAwake()
    {
        MessageManager.GetInstance.InsertUIDict(this.GetType(), this);
        //从表里读取礼物信息
        giftTable = ShopInit.Instance.GetShopCommodity(100);
        btn_Close = XUIUtils.GetCompmentT <Button>(transform, "btn_Close");
        XUIUtils.ListenerBtn(btn_Close, BtnCloseOnClick);
        Transform trans = transform.Find("Items/Grid");

        giftNumberList = new Dictionary <int, Text>();

        for (int i = 0; i < giftTable.Count; i++)
        {
            int        j   = i;
            GameObject go  = Resources.Load <GameObject>("Prefabs/Friend/sendGiftItem");
            GameObject obj = Instantiate(go);
            obj.name = "gift_" + i.ToString();
            string path   = "Sprite/Shop/gift/new_gift_" + i.ToString();
            Sprite sprite = Resources.Load <Sprite>(path);
            obj.transform.GetChild(1).GetComponent <Image>().sprite = sprite;
            obj.transform.SetParent(trans);
            obj.transform.localScale = Vector3.one;
            obj.transform.GetChild(2).GetComponent <Text>().text = giftTable[i].selling.ToString();
            //添加点击事件
            obj.transform.GetChild(1).gameObject.AddComponent <Button>().onClick.AddListener(delegate() { this.BtnSendGiftOnClick(giftTable[j].id); });

            giftNumberList.Add(giftTable[i].id, obj.transform.GetChild(2).GetComponent <Text>());
        }
    }
Пример #9
0
 public override void OnAwake()
 {
     DiceTcpOperation = new GameDiceTcpRoomOperation();
     base.OnAwake();
     btn_Kick = XUIUtils.GetCompmentT <Button>(transform, "btn_Kick");
     XUIUtils.ListenerBtn(btn_Kick, BtnKickOnClick);
 }
Пример #10
0
    public override void OnStart()
    {
        btn_Close = XUIUtils.GetCompmentT <Button>(transform, "btn_Close");

        //添加按钮点击事件

        XUIUtils.ListenerBtn(btn_Close, BtnCloseOnClick);
    }
Пример #11
0
    public override void OnStart()
    {
        btn_Close = XUIUtils.GetCompmentT <Button>(transform, "btn_Close");
        btn_Get   = XUIUtils.GetCompmentT <Button>(transform, "btn_Pay");

        XUIUtils.ListenerBtn(btn_Close, BtnCloseOnClick);
        XUIUtils.ListenerBtn(btn_Get, BtnGetOnClick);
    }
Пример #12
0
    public override void OnAwake()
    {
        MessageManager.GetInstance.InsertUIDict(this.GetType(), this);
        btn_Confirm = XUIUtils.GetCompmentT <Button>(transform, "btn_Confirm");
        tipsContent = XUIUtils.GetCompmentT <Text>(transform, "content");

        XUIUtils.ListenerBtn(btn_Confirm, BtnConfirmOnClick);
    }
Пример #13
0
 public override void OnAwake()
 {
     MessageManager.GetInstance.InsertUIDict(this.GetType(), this);
     btn_No     = XUIUtils.GetCompmentT <Button>(transform, "btn_No");
     btn_GoShop = XUIUtils.GetCompmentT <Button>(transform, "btn_Yes");
     XUIUtils.ListenerBtn(btn_No, BtnCloseOnClick);
     XUIUtils.ListenerBtn(btn_GoShop, BtnGoShopOnClick);
 }
Пример #14
0
 private void Awake()
 {
     btn_confirm = XUIUtils.GetCompmentT <Button>(transform, "btn_Ok");
     XUIUtils.ListenerBtn(btn_confirm, BtnConfirmOnClick);
     transform.localScale = Vector3.zero;
     transform.DOScale(Vector3.one, 0.2f);
     transform.SetAsLastSibling();
 }
Пример #15
0
 // Use this for initialization
 public override void Awake()
 {
     base.Awake();
     rawImage    = XUIUtils.GetCompmentT <RawImage>(transform, "QRcode");
     OpenWxSaner = XUIUtils.GetCompmentT <Button>(transform, "SaveQRcode");
     XUIUtils.ListenerBtn(OpenWxSaner, GotoWxScner);
     btn_Close = XUIUtils.GetCompmentT <Button>(transform, "btn_Close");
     XUIUtils.ListenerBtn(btn_Close, BtnCloseOnClick);
 }
Пример #16
0
 public override void OnAwake()
 {
     if (!isAwake)
     {
         MessageManager.GetInstance.InsertUIDict(this.GetType(), this);
         ContentParent = XUIUtils.GetCompmentT <Transform>(transform, "ScrollRect/viewer/content");
         isAwake       = true;
     }
 }
Пример #17
0
 public override void OnAwake()
 {
     base.OnAwake();
     MessageManager.GetInstance.InsertUIDict(this.GetType(), this);
     startEarnTrans  = XUIUtils.GetCompmentT <Transform>(transform, "StartEarnGoldPanel");
     earnRecordTrans = XUIUtils.GetCompmentT <Transform>(transform, "EarnRecordPanel");
     startEarnTrans.gameObject.AddComponent <UIStartEarnGoldPanel>();
     earnRecordTrans.gameObject.AddComponent <UIEarnRecordPanel>();
 }
Пример #18
0
 public override void OnStart()
 {
     btn_Close  = XUIUtils.GetCompmentT <Button>(transform, "btn_Close");
     btn_Search = XUIUtils.GetCompmentT <Button>(transform, "btn_Search");
     inputUID   = XUIUtils.GetCompmentT <InputField>(transform, "InputField");
     //添加按钮点击事件
     XUIUtils.ListenerBtn(btn_Close, BtnCloseOnClick);
     XUIUtils.ListenerBtn(btn_Search, BtnSearchOnClick);
 }
Пример #19
0
    // Use this for initialization

    void Awake()
    {
        MessageManager.GetInstance.InsertUIDict(this.GetType(), this);
        //落牌位置数组初始化
        FallCardPosList = new RectTransform[5];
        //牌背面链表初始化
        cardBackList = new List <GameObject>(15);
        //牌型链表初始化
        cardTypeList = new Dictionary <int, Sprite>(7);
        //牌型显示链表初始化
        cardtypeShowlist = new List <Image>(4);
        cardTypeShowList = new Dictionary <int, Image>(4);
        cardDict         = new Dictionary <int, Sprite>();
        RedpagList       = new List <GameObject>();
        RedpagselectList = new List <Button>();
        //输赢图片链表初始化
        resultList = new Sprite[2];
        //输赢图片位置链表初始化
        ResultTrList = new List <Image>(4);
        resultTrList = new Dictionary <int, Image>(4);
        //获取发牌位置
        DealCardPos = XUIUtils.GetCompmentT <RectTransform>(transform, "DealCardPos");
        //获取加载牌的父物体
        parentT = XUIUtils.GetCompmentT <RectTransform>(transform, "FallCardPos");
        //获取牌背面预设物
        cardBack = Resources.Load("Prefabs/Game/WanRenChang/CardBack", typeof(GameObject)) as GameObject;

        //牌背面图片
        cardBackImg = cardBack.GetComponent <Image>().sprite;
        //遍历牌型显示链表给元素添加值
        for (int i = 1; i <= 4; i++)
        {
            Image image = XUIUtils.GetCompmentT <Image>(transform, "CardTypePos/CardType" + i);
            cardTypeShowList.Add(i, image);
            cardtypeShowlist.Add(image);
        }
        //遍历牌型链表给元素添加值
        for (int i = 1; i < 8; i++)
        {
            Sprite sprite = GameTools.Instance.GetSpriteAtlas("Sprite/WanRenChang/CardType/CardType", "cardtype" + i);
            cardTypeList.Add(i, sprite);
        }

        //遍历输赢图片位置链表给元素添加值
        for (int i = 0; i < 4; i++)
        {
            Image image = XUIUtils.GetCompmentT <Image>(transform, "BetArea/betarea" + i + "/Result" + i);
            ResultTrList.Add(image);
            resultTrList.Add(i, image);
        }
        //遍历输赢图片链表给元素添加值
        for (int i = 0; i < 2; i++)
        {
            Sprite sprite = Resources.Load <Sprite>("Sprite/WanRenChang/result" + i);
            resultList[i] = sprite;
        }
    }
Пример #20
0
 // Use this for initialization
 void Start()
 {
     btn_Failure = XUIUtils.GetCompmentT <Button>(transform, "btn_Failure");
     btn_Success = XUIUtils.GetCompmentT <Button>(transform, "btn_Success");
     btn_Close   = XUIUtils.GetCompmentT <Button>(transform, "btn_Close");
     XUIUtils.ListenerBtn(btn_Failure, BtnFailureOnClick);
     XUIUtils.ListenerBtn(btn_Success, BtnSuccessOnClcik);
     XUIUtils.ListenerBtn(btn_Close, BtnCloseOnClick);
 }
Пример #21
0
 public override void OnAwake()
 {
     base.OnAwake();
     MessageManager.GetInstance.InsertUIDict(this.GetType(), this);
     sysTrans   = XUIUtils.GetCompmentT <Transform>(transform, "ToggleGroup/systemTaskPanel");
     everyTrans = XUIUtils.GetCompmentT <Transform>(transform, "ToggleGroup/everyTaskPanel");
     sysTrans.gameObject.AddComponent <UISysTaskPanel>();
     sysTrans.gameObject.AddComponent <UIEveryTaskPanel>();
 }
Пример #22
0
    public void Awake()
    {
        btn_Refuse  = XUIUtils.GetCompmentT <Button>(transform, "btn_Refuse");
        btn_Confirm = XUIUtils.GetCompmentT <Button>(transform, "btn_Confirm");
        content     = XUIUtils.GetCompmentT <Text>(transform, "content");

        XUIUtils.ListenerBtn(btn_Refuse, BtnRefuseOnClick);
        XUIUtils.ListenerBtn(btn_Confirm, BtnConfirmOnClick);
    }
Пример #23
0
    // Use this for initialization
    private void Start()
    {
        // btn_ChangeHeadImg = XUIUtils.GetCompmentT<Button>(transform, "headimage/btn_ChangeHeadImg");
        GameObject HeadPanelTrans = GameObject.Find("HeadPanel");

        if (HeadPanelTrans != null)
        {
            headImg = XUIUtils.GetCompmentT <Image>(HeadPanelTrans.transform, "ToggleGroup/userinfoPanel/headimage");
        }
    }
Пример #24
0
    //public Transform enemyTrans;
    public override void OnAwake()
    {
        base.OnAwake();
        MessageManager.GetInstance.InsertUIDict(this.GetType(), this);
        friendTrans = XUIUtils.GetCompmentT <Transform>(transform, "ToggleGroup/MyFriendPanel");
        friendTrans.gameObject.AddComponent <UIMyFriendPanel>();

        //enemyTrans = XUIUtils.GetCompmentT<Transform>(transform, "ToggleGroup/MyEnemyPanel");
        //enemyTrans.gameObject.AddComponent<UIMyEnemyPanel>();
    }
Пример #25
0
    public override void OnAwake()
    {
        base.OnAwake();

        MessageManager.GetInstance.InsertUIDict(this.GetType(), this);
        btn_refresh = XUIUtils.GetCompmentT <Button>(transform, "btn_refresh");
        XUIUtils.ListenerBtn(btn_refresh, BtnRefreshOnClick);
        canvas   = GameObject.Find("Canvas").transform;
        posTrans = transform.Find("Items/ItemList").transform;
    }
Пример #26
0
    // Use this for initialization
    private void Awake()
    {
        btn_Close  = XUIUtils.GetCompmentT <Button>(transform, "btn_Close");
        btn_AliPay = XUIUtils.GetCompmentT <Button>(transform, "btn_AliPay");
        btn_WxPay  = XUIUtils.GetCompmentT <Button>(transform, "btn_WxPay");

        XUIUtils.ListenerBtn(btn_Close, BtnCloseOnClick);
        XUIUtils.ListenerBtn(btn_AliPay, BtnAliPayOnClick);
        XUIUtils.ListenerBtn(btn_WxPay, BtnWxPayOnClick);
    }
Пример #27
0
 public override void OnAwake()
 {
     base.OnAwake();
     MessageManager.GetInstance.InsertUIDict(this.GetType(), this);
     canvas          = GameObject.Find("Canvas").transform;
     goldRankTrans   = XUIUtils.GetCompmentT <Transform>(transform, "WealthRankPanel");
     renPinRankTrans = XUIUtils.GetCompmentT <Transform>(transform, "CharacterRankPanel");
     goldRankTrans.gameObject.AddComponent <UIGoldRankPanel>();
     renPinRankTrans.gameObject.AddComponent <UIRenPinRankPanel>();
 }
Пример #28
0
 private void Awake()
 {
     if (isAwake)
     {
         btn_SendMsg       = XUIUtils.GetCompmentT <Button>(transform.parent, "btn_SendMsg");
         btn_Expression    = XUIUtils.GetCompmentT <Button>(transform.parent, "btn_Expression");
         btn_Color         = XUIUtils.GetCompmentT <Button>(transform.parent, "btn_Color");
         contentInputField = XUIUtils.GetCompmentT <InputField>(transform.parent, "contentInputField");
         isAwake           = true;
     }
 }
Пример #29
0
    public override void OnAwake()
    {
        base.OnAwake();
        MessageManager.GetInstance.InsertUIDict(this.GetType(), this);
        inviteCodeInput = XUIUtils.GetCompmentT <InputField>(transform, "InputField");
        btn_Close       = XUIUtils.GetCompmentT <Button>(transform, "btn_Close");
        btn_GetAward    = XUIUtils.GetCompmentT <Button>(transform, "btn_GetAward");

        XUIUtils.ListenerBtn(btn_Close, BtnCloseOnClick);
        XUIUtils.ListenerBtn(btn_GetAward, BtnGetAwardOnClick);
    }
Пример #30
0
    public override void OnAwake()
    {
        AwardList    = new List <RebateDialDataTable>();
        AwardImaList = new List <Sprite>();
        endtime      = 1f;
        AwardIndex   = 0;
        rolltimes    = 4;
        times        = 0;
        MessageManager.GetInstance.InsertUIDict(this.GetType(), this);
        AwardPosList = new List <Transform>();
        //获取抽奖按钮添加点击事件
        drawBtn = XUIUtils.GetCompmentT <Button>(transform, "RebateRouletteBG/ExtractionBtn");
        XUIUtils.ListenerBtn(drawBtn, DrawOnclick);
        //获取返回按钮添加点击事件
        backBtn = XUIUtils.GetCompmentT <Button>(transform, "RebateRouletteBG/BackBtn");
        XUIUtils.ListenerBtn(backBtn, BackBtnOnClick);
        //获取奖品父物体
        extractionBG    = XUIUtils.GetCompmentT <Transform>(transform, "RebateRouletteBG/ExtractionBG");
        LightImageTrams = XUIUtils.GetCompmentT <Transform>(transform, "RebateRouletteBG/kuangImage");
        //给奖励物品链表赋值
        for (int i = 0; i < 8; i++)
        {
            RebateDialDataTable table = RebateDialDataTable.get(i + 1);
            AwardList.Add(table);
        }
        //给奖品位置链表赋值
        for (int i = 0; i < 8; i++)
        {
            //将所有奖励的tranform加入List
            AwardPosList.Add(extractionBG.GetChild(i));
            extractionBG.GetChild(i).GetChild(0).GetComponent <Image>().sprite = GameTools.Instance.GetSpriteAtlas("Sprite/StoreGoodsIma/StoreGoodsAtlas", AwardList[i].awardId.ToString());
            extractionBG.GetChild(i).GetChild(1).GetComponent <Text>().text    = AwardList[i].num.ToString();
        }

        //获取到万人争霸投注量
        wanrenBet = XUIUtils.GetCompmentT <Text>(transform, "RebateRouletteBG/FirstWay/WanrenBet/wanrenBet");
        //获取到天天乐投注量
        daydayBet = XUIUtils.GetCompmentT <Text>(transform, "RebateRouletteBG/FirstWay/DaydayBet/daydaybet");
        //获取到摇摇乐投注量
        teeterBet = XUIUtils.GetCompmentT <Text>(transform, "RebateRouletteBG/FirstWay/TeeterBet/teeterbet");
        //获取到抽奖次数
        drawCount = XUIUtils.GetCompmentT <Text>(transform, "RebateRouletteBG/ExtractionBtn/timeTxt");
        //总投注
        totalBet = XUIUtils.GetCompmentT <Text>(transform, "RebateRouletteBG/FirstWay/TotalBet/totalbet");
        //已抽奖次数
        alreadyTimes = XUIUtils.GetCompmentT <Text>(transform, "RebateRouletteBG/todayDoneTimes");
        TopUpNum     = XUIUtils.GetCompmentT <Text>(transform, "RebateRouletteBG/SecondWay/TodayPayTotal/todayPayTotal");
        betcountText = XUIUtils.GetCompmentT <Text>(transform, "RebateRouletteBG/BET/betcountText");
        init();
        rebateDialOperation = new RebateDialOperation();
        rebateDialInfoDto   = rebateDialOperation.dialInfo(PlayerCache.loginInfo.uid);
        UpdateRebateRouletteData(rebateDialInfoDto);
    }