Пример #1
0
        public async void Awake()
        {
            await HttpReqUtil.Req(NetConfig.getInstance().getWebUrl() + "files/chat.json", ChatConfig.getInstance().init);

            ReferenceCollector rc = this.GetParent <UI>().GameObject.GetComponent <ReferenceCollector>();

            ExpressionBtn  = rc.Get <GameObject>("ExpressionBtn").GetComponent <Button>();
            ShortBtn       = rc.Get <GameObject>("ShortBtn").GetComponent <Button>();
            Mask           = rc.Get <GameObject>("Mask").GetComponent <Button>();
            ExceptionTxt   = rc.Get <GameObject>("ExceptionTxt").GetComponent <Text>();
            ExpressionGrid = ExpressionBtn.transform.Find("Select_Btn/Scroll/ExpressionGrid").gameObject;
            ShortGrid      = ShortBtn.transform.Find("Select_Btn/Scroll/ShortGrid").gameObject;

            ExpressionBtn.onClick.Add(() => { CreatExpressions(); });

            CommonUtil.SetTextFont(this.GetParent <UI>().GameObject);

            Mask.onClick.Add(() =>
            {
                CloseOrOpenChatUI(false);
            });

            ShortBtn.onClick.Add(() => { CreateChatItems(); });

            ExpressionItem = CommonUtil.getGameObjByBundle(UIType.UIExpression);
            ChatItem       = CommonUtil.getGameObjByBundle(UIType.UIChatItem);
            isOpen         = false;

            //选中表情包界面
            CreatExpressions();
        }
Пример #2
0
        public void Awake()
        {
            ReferenceCollector rc = GetParent <UI>().GameObject.GetComponent <ReferenceCollector>();

            ChengjiuItemBtn = rc.Get <GameObject>("ChengjiuItemBtn");
            Complete        = rc.Get <GameObject>("Complete");

            CommonUtil.SetTextFont(this.GetParent <UI>().GameObject);

            ChengjiuItemBtn.GetComponent <Button>().onClick.Add(() =>
            {
                if (info.IsComplete)
                {
                    if (!info.IsGet)
                    {
                        //未领取
                        info.IsGet = true;
                        GetReward();
                    }
                    else
                    {
                        //显示提示框
                        Game.Scene.GetComponent <UIComponent>().Get(UIType.UIChengjiu)
                        .GetComponent <UIChengjiuComponent>().SetDetail(info, true);
                    }
                }
                else
                {
                    //显示提示框
                    Game.Scene.GetComponent <UIComponent>().Get(UIType.UIChengjiu)
                    .GetComponent <UIChengjiuComponent>().SetDetail(info, false);
                }
            });
        }
Пример #3
0
        public void Awake()
        {
            ReferenceCollector rc = GetParent <UI>().GameObject.GetComponent <ReferenceCollector>();

            title      = rc.Get <GameObject>("Title").GetComponent <Text>();
            content    = rc.Get <GameObject>("Content").GetComponent <Text>();
            itemGrid   = rc.Get <GameObject>("ItemGrid");
            date       = rc.Get <GameObject>("Date").GetComponent <Text>();
            flag       = rc.Get <GameObject>("Flag");
            get        = rc.Get <GameObject>("Get").GetComponent <Button>();
            Delete     = rc.Get <GameObject>("Delete").GetComponent <Button>();
            readBtn    = rc.Get <GameObject>("ReadBtn").GetComponent <Button>();
            rewardItem = CommonUtil.getGameObjByBundle(UIType.UIRewardItem);

            CommonUtil.SetTextFont(this.GetParent <UI>().GameObject);

            readBtn.onClick.Add(() =>
            {
                //ReadEmail();
            });

            //获得奖励
            get.onClick.Add(() =>
            {
                GetItem();
            });

            //删除邮件
            Delete.onClick.Add(() =>
            {
                DeleteMail();
            });
        }
Пример #4
0
        public void Awake()
        {
            ReferenceCollector rc = this.GetParent <UI>().GameObject.GetComponent <ReferenceCollector>();

            RoomIdTxt  = rc.Get <GameObject>("RoomIdTxt").GetComponent <Text>();
            EnterBtn   = rc.Get <GameObject>("EnterBtn").GetComponent <Button>();
            juTxt      = rc.Get <GameObject>("juTxt").GetComponent <Text>();
            huaTxt     = rc.Get <GameObject>("huaTxt").GetComponent <Text>();
            FriendGrid = rc.Get <GameObject>("FriendGrid");

            CommonUtil.SetTextFont(this.GetParent <UI>().GameObject);

            icon = CommonUtil.getGameObjByBundle(UIType.UIFriendIcon);

            EnterBtn.onClick.Add(() =>
            {
                //向服务器发送消息
                if (info.IsPublic == 1)
                {
                    //公开房间
                    JoinRoom();
                }
                else if (info.IsPublic == 2)
                {
                    //私密房间
                    Game.Scene.GetComponent <UIComponent>().Create(UIType.UIJoinRoom);
                }
            });
        }
Пример #5
0
        public void initData()
        {
            isTimerEnd = false;

            ReferenceCollector rc = this.GetParent <UI>().GameObject.GetComponent <ReferenceCollector>();

            Button_close = rc.Get <GameObject>("Button_close").GetComponent <Button>();
            Button_back  = rc.Get <GameObject>("Button_back").GetComponent <Button>();
            Button_jixu  = rc.Get <GameObject>("Button_jixu").GetComponent <Button>();

            winPlayer    = rc.Get <GameObject>("winPlayer");
            otherPlayer1 = rc.Get <GameObject>("otherPlayer1");
            otherPlayer2 = rc.Get <GameObject>("otherPlayer2");
            otherPlayer3 = rc.Get <GameObject>("otherPlayer3");

            playerList.Clear();
            playerList.Add(otherPlayer1);
            playerList.Add(otherPlayer2);
            playerList.Add(otherPlayer3);

            Text_daojishi = rc.Get <GameObject>("Text_daojishi").GetComponent <Text>();

            Button_close.onClick.Add(onClick_close);
            Button_back.onClick.Add(onClick_Back);
            Button_jixu.onClick.Add(onClick_jixu);

            CommonUtil.SetTextFont(Button_close.transform.parent.gameObject);
            UIAnimation.ShowLayer(Button_close.transform.parent.gameObject);
        }
Пример #6
0
        public void Awake()
        {
            ReferenceCollector rc = this.GetParent <UI>().GameObject.GetComponent <ReferenceCollector>();

            this.changeTableBtn = rc.Get <GameObject>("ChangeTableBtn").GetComponent <Button>();
            this.readyBtn       = rc.Get <GameObject>("ReadyBtn").GetComponent <Button>();
            this.weChatBtn      = rc.Get <GameObject>("WeChat").GetComponent <Button>();
            this.roomIdObj      = rc.Get <GameObject>("RoomId");

            this.head         = rc.Get <GameObject>("Head");
            this.readyTimeout = rc.Get <GameObject>("ReadyTimeout");
            this.timeText     = this.readyTimeout.transform.Find("timeText").GetComponent <Text>();

            HeadPanel[0] = head.Get <GameObject>("Bottom");
            HeadPanel[1] = head.Get <GameObject>("Right");
            HeadPanel[2] = head.Get <GameObject>("Top");
            HeadPanel[3] = head.Get <GameObject>("Left");

            this.changeTableBtn.onClick.Add(OnChangeTable);
            this.readyBtn.onClick.Add(OnReady);
            weChatBtn.onClick.Add(OnInviteWeChat);

            CommonUtil.SetTextFont(this.GetParent <UI>().GameObject);

            timeOut = 20;
            SetTimeOut();

            UI uiRoom = Game.Scene.GetComponent <UIComponent>().Get(UIType.UIRoom);

            this.uiRoomComponent = uiRoom.GetComponent <UIRoomComponent>();
        }
Пример #7
0
        public void Awake()
        {
            ReferenceCollector rc = this.GetParent <UI>().GameObject.GetComponent <ReferenceCollector>();

            Grid       = rc.Get <GameObject>("Grid");
            CloseBtn   = rc.Get <GameObject>("CloseBtn").GetComponent <Button>();
            Player1Txt = rc.Get <GameObject>("Player1Txt").GetComponent <Text>();
            Player2Txt = rc.Get <GameObject>("Player2Txt").GetComponent <Text>();
            Player3Txt = rc.Get <GameObject>("Player3Txt").GetComponent <Text>();
            Player4Txt = rc.Get <GameObject>("Player4Txt").GetComponent <Text>();

            CommonUtil.SetTextFont(this.GetParent <UI>().GameObject);

            textList.Add(Player1Txt);
            textList.Add(Player2Txt);
            textList.Add(Player3Txt);
            textList.Add(Player4Txt);
            item = CommonUtil.getGameObjByBundle(UIType.UIFriendDetail);

            CloseBtn.onClick.Add(() =>
            {
                Game.Scene.GetComponent <UIComponent>().Remove(UIType.UIFriendRoomDetail);
            });

            UIAnimation.ShowLayer(this.GetParent <UI>().GameObject);
        }
Пример #8
0
        public void Awake()
        {
            ReferenceCollector rc = this.GetParent <UI>().GameObject.GetComponent <ReferenceCollector>();

            //倒计时
            this.timeText = rc.Get <GameObject>("TimeText").GetComponent <Text>();
            StartTimeDown();

            //4个玩家
            UI             uiRoom         = Game.Scene.GetComponent <UIComponent>().Get(UIType.UIRoom);
            GamerComponent gamerComponent = uiRoom.GetComponent <GamerComponent>();

            this.gamers = gamerComponent.GetAll();
            plays       = new List <Text>();
            for (int i = 1; i < 5; i++)
            {
                plays.Add(rc.Get <GameObject>("Play" + i).GetComponent <Text>());
            }

            //退出
            this.cancelBtn = rc.Get <GameObject>("CancelBtn").GetComponent <Button>();
            this.sureBtn   = rc.Get <GameObject>("SureBtn").GetComponent <Button>();

            cancelBtn.onClick.Add(OnCancel);
            sureBtn.onClick.Add(OnSure);

            cancelCount = 0;
            SetPlayInfo();

            CommonUtil.SetTextFont(this.GetParent <UI>().GameObject);
        }
Пример #9
0
        public void Awake()
        {
            ReferenceCollector rc = GetParent <UI>().GameObject.GetComponent <ReferenceCollector>();

            ReturnBtn   = rc.Get <GameObject>("ReturnBtn").GetComponent <Button>();
            Grid        = rc.Get <GameObject>("Grid");
            CurProgress = rc.Get <GameObject>("CurProgress").GetComponent <Text>();
            Detail      = rc.Get <GameObject>("Detail");
            ChengIcon   = rc.Get <GameObject>("ChengIcon").GetComponent <Image>();
            CloseBtn    = rc.Get <GameObject>("CloseBtn").GetComponent <Button>();
            ContentTxt  = rc.Get <GameObject>("ContentTxt").GetComponent <Text>();
            NameTxt     = rc.Get <GameObject>("NameTxt").GetComponent <Text>();
            ProgressTxt = rc.Get <GameObject>("ProgressTxt").GetComponent <Text>();
            RewardTxt   = rc.Get <GameObject>("RewardTxt").GetComponent <Text>();
            item        = CommonUtil.getGameObjByBundle(UIType.UIChengjiuItem);
            AlGet       = rc.Get <GameObject>("AlGet");

            CommonUtil.SetTextFont(this.GetParent <UI>().GameObject);

            //返回
            ReturnBtn.onClick.Add(() => { Game.Scene.GetComponent <UIComponent>().Remove(UIType.UIChengjiu); });

            //关闭详细页面
            CloseBtn.onClick.Add(() => { Detail.SetActive(false); });

            RequestChengjiuList();
        }
Пример #10
0
        public void Start()
        {
            ReferenceCollector rc = this.GetParent <UI>().GameObject.GetComponent <ReferenceCollector>();

            View        = rc.Get <GameObject>("View").GetComponent <Button>();
            AccountGrid = rc.Get <GameObject>("AccountGrid");
            TimeTxt     = rc.Get <GameObject>("TimeTxt").GetComponent <Text>();
            DateTxt     = rc.Get <GameObject>("DateTxt").GetComponent <Text>();
            RoomIdTxt   = rc.Get <GameObject>("RoomIdTxt").GetComponent <Text>();
            ScoreTxt    = rc.Get <GameObject>("ScoreTxt").GetComponent <Text>();
            Result      = rc.Get <GameObject>("Result").GetComponent <Image>();

            item = CommonUtil.getGameObjByBundle(UIType.UIFriendRoomTxt);

            CommonUtil.SetTextFont(this.GetParent <UI>().GameObject);

            View.onClick.Add(() =>
            {
                Game.Scene.GetComponent <UIComponent>().Create(UIType.UIFriendRoomDetail);
                if (GameUtil.GetComponentByType <UIFriendRoomDetailComponent>(UIType.UIFriendRoomDetail) != null)
                {
                    GameUtil.GetComponentByType <UIFriendRoomDetailComponent>(UIType.UIFriendRoomDetail).SetInfo(info);
                }
            });
        }
Пример #11
0
        public void Awake()
        {
            ReferenceCollector rc = this.GetParent <UI>().GameObject.GetComponent <ReferenceCollector>();

            AllScoreTxt = rc.Get <GameObject>("AllScoreTxt").GetComponent <Text>();
            NameTxt     = rc.Get <GameObject>("NameTxt").GetComponent <Text>();

            CommonUtil.SetTextFont(this.GetParent <UI>().GameObject);
        }
Пример #12
0
        public void initData()
        {
            ReferenceCollector rc = this.GetParent <UI>().GameObject.GetComponent <ReferenceCollector>();

            btn_close = rc.Get <GameObject>("Button_close").GetComponent <Button>();

            btn_close.onClick.Add(onClick_Close);

            CommonUtil.SetTextFont(btn_close.transform.parent.gameObject);
            UIAnimation.ShowLayer(btn_close.transform.parent.gameObject);
        }
Пример #13
0
        public void Awake()
        {
            ReferenceCollector rc = this.GetParent <UI>().GameObject.GetComponent <ReferenceCollector>();

            chatObjArr[0] = rc.Get <GameObject>("ChatB");
            chatObjArr[1] = rc.Get <GameObject>("ChatR");
            chatObjArr[2] = rc.Get <GameObject>("ChatT");
            chatObjArr[3] = rc.Get <GameObject>("ChatL");

            CommonUtil.SetTextFont(this.GetParent <UI>().GameObject);
        }
Пример #14
0
        public void Awake()
        {
            this.ItemCard = this.GetParent <UI>().GameObject;
            Button         button         = this.ItemCard.GetComponent <Button>();
            UI             uiRoom         = Game.Scene.GetComponent <UIComponent>().Get(UIType.UIRoom);
            GamerComponent gamerComponent = uiRoom.GetComponent <GamerComponent>();

            this.handCardsComponent = gamerComponent.LocalGamer.GetComponent <HandCardsComponent>();
            button.onClick.RemoveAllListeners();
            button.onClick.Add(() => { OnClick(); });

            CommonUtil.SetTextFont(this.GetParent <UI>().GameObject);
        }
Пример #15
0
        public void Awake()
        {
            ReferenceCollector rc = GetParent <UI>().GameObject.GetComponent <ReferenceCollector>();

            UIChatItem = rc.Get <GameObject>("UIChatItem").GetComponent <Button>();
            ChatTxt    = rc.Get <GameObject>("ChatTxt").GetComponent <Text>();

            UIChatItem.GetComponent <Button>().onClick.Add(() =>
            {
                RequestChat();
            });
            CommonUtil.SetTextFont(this.GetParent <UI>().GameObject);
        }
        public void Awake(string content)
        {
            ReferenceCollector rc = this.GetParent <UI>().GameObject.GetComponent <ReferenceCollector>();

            CloseBtn  = rc.Get <GameObject>("CloseBtn").GetComponent <Button>();
            SureBtn   = rc.Get <GameObject>("SureBtn").GetComponent <Button>();
            CancelBtn = rc.Get <GameObject>("CancelBtn").GetComponent <Button>();
            TipTxt    = rc.Get <GameObject>("TipTxt").GetComponent <Text>();

            CommonUtil.SetTextFont(this.GetParent <UI>().GameObject);

            TipTxt.text = content;
        }
Пример #17
0
        public async void Awake()
        {
            // 获取配置文件
            {
                string fileName = "otherConfig-" + PlatformHelper.GetVersionName() + ".json";
                await HttpReqUtil.Req(NetConfig.getInstance().getWebUrl() + "files/" + fileName, OtherConfig.getInstance().init);
            }

            ToastScript.clear();
            Instance = this;
            initData();
            CommonUtil.SetTextFont(panel_start.transform.parent.gameObject);
        }
Пример #18
0
        public void Awake()
        {
            ReferenceCollector rc = GetParent <UI>().GameObject.GetComponent <ReferenceCollector>();

            UIActivityTitle = rc.Get <GameObject>("UIActivityTitle").GetComponent <Button>();
            TitleTxt        = rc.Get <GameObject>("TitleTxt").GetComponent <Text>();
            CommonUtil.SetTextFont(this.GetParent <UI>().GameObject);
            UIActivityTitle.onClick.Add(() =>
            {
                OnClick(info.id);
            });

            UIActivityTitle.GetComponent <Image>().color = Color.red;
        }
Пример #19
0
        public async void Start()
        {
            try
            {
                await HttpReqUtil.Req(NetConfig.getInstance().getWebUrl() + "files/activity.json", ActivityConfig.getInstance().init);

                ReferenceCollector rc = GetParent <UI>().GameObject.GetComponent <ReferenceCollector>();
                returnBtn    = rc.Get <GameObject>("ReturnBtn").GetComponent <Button>();
                ActivityGrid = rc.Get <GameObject>("ActivityGrid");
                NoticeBtn    = rc.Get <GameObject>("NoticeBtn").GetComponent <Button>();
                ActivityBtn  = rc.Get <GameObject>("ActivityBtn").GetComponent <Button>();
                Panel        = rc.Get <GameObject>("Panel");
                Activity     = rc.Get <GameObject>("Activity");
                Notice       = rc.Get <GameObject>("Notice");
                noticeItem   = CommonUtil.getGameObjByBundle(UIType.UINoticeItem);
                activityItem = CommonUtil.getGameObjByBundle(UIType.UIActivityItem);
                Grid         = rc.Get <GameObject>("Grid");

                CommonUtil.SetTextFont(this.GetParent <UI>().GameObject);

                GetActivityItemList();

                //返回
                returnBtn.onClick.Add(() =>
                {
                    Game.Scene.GetComponent <UIComponent>().Remove(UIType.UIActivity);
                });

                //点击显示通知栏
                NoticeBtn.onClick.Add(() =>
                {
                    NoticeBtn.transform.GetChild(0).gameObject.SetActive(true);
                    ActivityBtn.transform.GetChild(0).gameObject.SetActive(false);
                    Notice.SetActive(true);
                    Activity.SetActive(false);
                    CreateNoticeItems();
                });

                //点击显示活动栏
                ActivityBtn.onClick.Add(() =>
                {
                    GetActivityItemList();
                });
            }
            catch (Exception e)
            {
                Log.Error(e);
            }
        }
Пример #20
0
        public void initData()
        {
            ReferenceCollector rc = this.GetParent <UI>().GameObject.GetComponent <ReferenceCollector>();

            Button_OK    = rc.Get <GameObject>("Button_OK").GetComponent <Button>();
            Button_close = rc.Get <GameObject>("Button_close").GetComponent <Button>();

            InputField_content = rc.Get <GameObject>("InputField_content").GetComponent <InputField>();

            Button_OK.onClick.Add(onClickOK);
            Button_close.onClick.Add(onClickClose);

            CommonUtil.SetTextFont(Button_OK.transform.parent.gameObject);
            UIAnimation.ShowLayer(Button_OK.transform.parent.gameObject);
        }
Пример #21
0
        public void initData()
        {
            ReferenceCollector rc = this.GetParent <UI>().GameObject.GetComponent <ReferenceCollector>();

            Button_cancel = rc.Get <GameObject>("Button_cancel").GetComponent <Button>();
            Button_HuaFei = rc.Get <GameObject>("Button_HuaFei").GetComponent <Button>();
            Button_Key    = rc.Get <GameObject>("Button_Key").GetComponent <Button>();

            Button_HuaFei.onClick.Add(onClick_huafei5);
            Button_Key.onClick.Add(onClick_duihuanyuanbao);
            Button_cancel.onClick.Add(onClick_close);

            CommonUtil.SetTextFont(Button_HuaFei.transform.parent.gameObject);
            UIAnimation.ShowLayer(Button_HuaFei.transform.parent.gameObject);
        }
Пример #22
0
        public void Start()
        {
            ReferenceCollector rc = this.GetParent <UI>().GameObject.GetComponent <ReferenceCollector>();

            JoinRoom       = rc.Get <GameObject>("JoinRoom");
            CloseJoinRoom  = rc.Get <GameObject>("CloseJoinRoom").GetComponent <Button>();
            ANewBtn        = rc.Get <GameObject>("ANewBtn").GetComponent <Button>();
            DeleteBtn      = rc.Get <GameObject>("DeleteBtn").GetComponent <Button>();
            InputCountGrid = rc.Get <GameObject>("InputCountGrid");
            EnterTxt       = rc.Get <GameObject>("EnterTxt").GetComponent <Text>();

            curRoomId = 0;
            for (int i = 0; i < 10; ++i)
            {
                string name = "inputCount" + i;
                Button go   = rc.Get <GameObject>(name).GetComponent <Button>();
                clickBtns.Add(go);
            }
            clickBtns.Distinct();

            //关闭
            CloseJoinRoom.onClick.Add(() =>
            {
                ClearText();
                Game.Scene.GetComponent <UIComponent>().Remove(UIType.UIJoinRoom);
            });

            AddClick();

            DeleteBtn.onClick.Add(() =>
            {
                if (curEnterValue.Length > 0)
                {
                    int index = builder.ToString().LastIndexOf(space);
                    builder.Remove(index - 1, 5);
                    curEnterValue = builder.ToString();
                    EnterTxt.text = curEnterValue;
                }
            });

            ANewBtn.onClick.Add(() =>
            {
                ClearText();
            });

            CommonUtil.SetTextFont(this.GetParent <UI>().GameObject);
            UIAnimation.ShowLayer(this.GetParent <UI>().GameObject);
        }
Пример #23
0
        public void initData(string uid)
        {
            ReferenceCollector rc = this.GetParent <UI>().GameObject.GetComponent <ReferenceCollector>();

            Button_OK    = rc.Get <GameObject>("Button_OK").GetComponent <Button>();
            Button_close = rc.Get <GameObject>("Button_close").GetComponent <Button>();

            Text_uid      = rc.Get <GameObject>("Text_uid").GetComponent <Text>();
            Text_uid.text = uid;

            Button_OK.onClick.Add(onClickOK);
            Button_close.onClick.Add(onClickClose);

            CommonUtil.SetTextFont(Button_OK.transform.parent.gameObject);
            UIAnimation.ShowLayer(Button_OK.transform.parent.gameObject);
        }
Пример #24
0
        public void Awake()
        {
            ReferenceCollector rc = GetParent <UI>().GameObject.GetComponent <ReferenceCollector>();

            uiBagItem = rc.Get <GameObject>("UIBagItem");
            countTxt  = rc.Get <GameObject>("CountTxt").GetComponent <Text>();
            uiBagBgL  = rc.Get <GameObject>("UIBagBgL");
            uiBagIcon = rc.Get <GameObject>("UIBagIcon").GetComponent <Image>();

            CommonUtil.SetTextFont(this.GetParent <UI>().GameObject);

            uiBagItem.GetComponent <Button>().onClick.Add(() =>
            {
                //显示物品信息
                Game.Scene.GetComponent <UIComponent>().Get(UIType.UIBag).GetComponent <UIBagComponent>().SetItemInfo(item);
            });
        }
Пример #25
0
        public void Awake()
        {
            ReferenceCollector rc = GetParent <UI>().GameObject.GetComponent <ReferenceCollector>();

            returnBtn   = rc.Get <GameObject>("ReturnBtn").GetComponent <Button>();
            grid        = rc.Get <GameObject>("Grid");
            progressTxt = rc.Get <GameObject>("ProgressTxt").GetComponent <Text>();

            CommonUtil.SetTextFont(this.GetParent <UI>().GameObject);

            returnBtn.onClick.Add(() =>
            {
                Game.Scene.GetComponent <UIComponent>().Remove(UIType.UITask);
            });

            taskItem = CommonUtil.getGameObjByBundle(UIType.UITaskItem);
            GetTaskInfoList();
        }
Пример #26
0
        public async void Start()
        {
            ReferenceCollector rc = this.GetParent <UI>().GameObject.GetComponent <ReferenceCollector>();

            #region CreateRoom

            SureBtn      = rc.Get <GameObject>("SureBtn").GetComponent <Button>();
            RoomTypeGrid = rc.Get <GameObject>("RoomTypeGrid").GetComponent <ToggleGroup>();
            JuGrid       = rc.Get <GameObject>("JuGrid").GetComponent <ToggleGroup>();
            HuaGrid      = rc.Get <GameObject>("HuaGrid").GetComponent <ToggleGroup>();

            #endregion

            OwnKeyTxt = rc.Get <GameObject>("OwnKeyTxt").GetComponent <Text>();

            huaItem  = CommonUtil.getGameObjByBundle(UIType.UIHuaTypeToggle);
            juItem   = CommonUtil.getGameObjByBundle(UIType.UIJuTypeToggle);
            typeItem = CommonUtil.getGameObjByBundle(UIType.UITypeToggle);

            CloseCreateRoom = rc.Get <GameObject>("CloseCreateRoom").GetComponent <Button>();

            //选择房主开房还是AA制

            //确定创建房间
            SureBtn.onClick.Add(() =>
            {
                {
                    //确定创建房间:向服务器发送消息
                    CreateRoom();
                }
            });

            //关闭创建房间UI
            CloseCreateRoom.onClick.Add(() => { Game.Scene.GetComponent <UIComponent>().Remove(UIType.UICreateFriendRoom); });

            CommonUtil.SetTextFont(this.GetParent <UI>().GameObject);

            Init();
            curHua  = 1;
            curJu   = 4;
            curType = 1;
            curKey  = 3;
            UIAnimation.ShowLayer(this.GetParent <UI>().GameObject);
        }
Пример #27
0
        public void initData()
        {
            ReferenceCollector rc = this.GetParent <UI>().GameObject.GetComponent <ReferenceCollector>();

            Button_ChouJiang = rc.Get <GameObject>("Button_ChouJiang").GetComponent <Button>();
            Button_close     = rc.Get <GameObject>("Button_close").GetComponent <Button>();
            Button_wenhao    = rc.Get <GameObject>("Button_wenhao").GetComponent <Button>();

            Image_bg   = rc.Get <GameObject>("Image_bg");
            xingyunzhi = rc.Get <GameObject>("xingyunzhi");
            Item       = rc.Get <GameObject>("Item");

            Button_ChouJiang.onClick.Add(onClick_ChouJiang);
            Button_close.onClick.Add(onClickClose);
            Button_wenhao.onClick.Add(showGuiZe);

            Image_bg.transform.Find("Text_tip1/Btn_share").GetComponent <Button>().onClick.Add(onClickShare);

            for (int i = 0; i < ZhuanPanConfig.getInstance().getZhuanPanInfoList().Count; i++)
            {
                ZhuanPanInfo zhuanpanInfo = ZhuanPanConfig.getInstance().getZhuanPanInfoList()[i];
                GameObject   item         = Item.transform.Find("Item_" + zhuanpanInfo.itemId).gameObject;

                if (zhuanpanInfo.prop_id == 1)
                {
                    item.transform.Find("Image_icon").GetComponent <Image>().sprite = CommonUtil.getSpriteByBundle("image_zhuanpan", "icon_gold");
                    item.transform.Find("Text_reward").GetComponent <Text>().text   = ("金币" + (int)zhuanpanInfo.prop_num);
                }
                else if (zhuanpanInfo.prop_id == 3)
                {
                    item.transform.Find("Image_icon").GetComponent <Image>().sprite = CommonUtil.getSpriteByBundle("image_zhuanpan", "icon_huafei");
                    item.transform.Find("Text_reward").GetComponent <Text>().text   = ("话费" + zhuanpanInfo.prop_num + "元");
                }
            }

            if (OtherData.getIsShiedShare())
            {
                Image_bg.transform.Find("Text_tip1").localScale = Vector3.zero;
            }

            CommonUtil.SetTextFont(Button_close.transform.parent.gameObject);
            UIAnimation.ShowLayer(Button_close.transform.parent.gameObject);
        }
Пример #28
0
        public void initData()
        {
            ReferenceCollector rc = this.GetParent <UI>().GameObject.GetComponent <ReferenceCollector>();

            Button_OK         = rc.Get <GameObject>("Button_OK").GetComponent <Button>();
            Button_YanZhengMa = rc.Get <GameObject>("Button_YanZhengMa").GetComponent <Button>();
            Button_back       = rc.Get <GameObject>("Button_back").GetComponent <Button>();

            inputField_Phone      = rc.Get <GameObject>("InputField_Phone").GetComponent <InputField>();
            inputField_YanZhengMa = rc.Get <GameObject>("InputField_YanZhengMa").GetComponent <InputField>();

            text_yanzhengmadaojishi = rc.Get <GameObject>("Text_yanzhengmadaojishi").GetComponent <Text>();

            Button_OK.onClick.Add(onClickBindPhone);
            Button_YanZhengMa.onClick.Add(onClickGetPhoneCode);
            Button_back.onClick.Add(onClickBack);

            CommonUtil.SetTextFont(Button_OK.transform.parent.gameObject);
        }
Пример #29
0
        public void Awake()
        {
            ReferenceCollector rc = this.GetParent <UI>().GameObject.GetComponent <ReferenceCollector>();

            HuaTypeToggle = rc.Get <GameObject>("HuaTypeToggle").GetComponent <Toggle>();
            ValueTxt      = rc.Get <GameObject>("ValueTxt").GetComponent <Text>();

            CommonUtil.SetTextFont(this.GetParent <UI>().GameObject);

            HuaTypeToggle.onValueChanged.Add((isOn) =>
            {
                if (isOn)
                {
                    //选择类型
                    //Log.Debug("===" + beilv + "===");
                    Game.Scene.GetComponent <UIComponent>().Get(UIType.UICreateFriendRoom).GetComponent <UICreateFriendRoomComponent>().SetCurHua(beilv);
                }
            });
        }
Пример #30
0
        public void Awake()
        {
            ReferenceCollector rc = this.GetParent <UI>().GameObject.GetComponent <ReferenceCollector>();

            RoomTxt    = rc.Get <GameObject>("RoomTxt").GetComponent <Text>();;
            TimeTxt    = rc.Get <GameObject>("TimeTxt").GetComponent <Text>();
            Player1Txt = rc.Get <GameObject>("Player1Txt").GetComponent <Text>();
            Player2Txt = rc.Get <GameObject>("Player2Txt").GetComponent <Text>();
            Player3Txt = rc.Get <GameObject>("Player3Txt").GetComponent <Text>();
            Player4Txt = rc.Get <GameObject>("Player4Txt").GetComponent <Text>();

            CommonUtil.SetTextFont(this.GetParent <UI>().GameObject);

            textList.Add(Player1Txt);
            textList.Add(Player2Txt);
            textList.Add(Player3Txt);
            textList.Add(Player4Txt);

            JuTxt = rc.Get <GameObject>("JuTxt").GetComponent <Text>();
        }