public async void Awake() { ReferenceCollector rc = this.GetParent <UI>().GameObject.GetComponent <ReferenceCollector>(); prompt = rc.Get <GameObject>("Prompt").GetComponent <Text>(); name = rc.Get <GameObject>("Name").GetComponent <Text>(); money = rc.Get <GameObject>("Money").GetComponent <Text>(); level = rc.Get <GameObject>("Level").GetComponent <Text>(); //添加进入房间匹配事件 //... //添加新的匹配目标 //... //获取玩家数据 A1001_GetUserInfo_C2G GetUserInfo_Req = new A1001_GetUserInfo_C2G(); A1001_GetUserInfo_G2C GetUserInfo_Ack = (A1001_GetUserInfo_G2C)await SessionComponent.Instance.Session.Call(GetUserInfo_Req); //显示用户名和用户等级 name.text = GetUserInfo_Ack.Userinfo.UserName; money.text = GetUserInfo_Ack.Userinfo.Money.ToString(); level.text = GetUserInfo_Ack.Userinfo.Level.ToString(); //显示用户名和用户等级 // name.text = GetUserInfo_Ack.NickName; }
public async void Awake() { ReferenceCollector rc = this.GetParent <UI>().GameObject.GetComponent <ReferenceCollector>(); prompt = rc.Get <GameObject>("Prompt").GetComponent <Text>(); name = rc.Get <GameObject>("Name").GetComponent <Text>(); money = rc.Get <GameObject>("Money").GetComponent <Text>(); level = rc.Get <GameObject>("Level").GetComponent <Text>(); phone = rc.Get <GameObject>("Phone").GetComponent <Text>(); email = rc.Get <GameObject>("Email").GetComponent <Text>(); sex = rc.Get <GameObject>("Sex").GetComponent <Text>(); title = rc.Get <GameObject>("Title").GetComponent <Text>(); rc.Get <GameObject>("SetUserInfo").GetComponent <Button>().onClick.Add(OnSetUserInfo); //获取玩家数据 A1001_GetUserInfo_C2G GetUserInfo_Req = new A1001_GetUserInfo_C2G(); A1001_GetUserInfo_G2C GetUserInfo_Ack = (A1001_GetUserInfo_G2C)await SessionComponent.Instance.Session.Call(GetUserInfo_Req); //显示用户名和用户等级 name.text = GetUserInfo_Ack.UserName; money.text = GetUserInfo_Ack.Money.ToString(); level.text = GetUserInfo_Ack.Level.ToString(); phone.text = GetUserInfo_Ack.Phone.ToString(); email.text = GetUserInfo_Ack.Email; sex.text = GetUserInfo_Ack.Sex; title.text = GetUserInfo_Ack.Title; //添加进入房间匹配事件 //... //添加新的匹配目标 //... }
public async void Awake() { Debug.Log("大厅组件获取成功"); ReferenceCollector rc = this.GetParent <UI>().GameObject.GetComponent <ReferenceCollector>(); mJwelNumText = rc.Get <GameObject>("JwelNumText").GetComponent <Text>(); mNameText = rc.Get <GameObject>("NameText").GetComponent <Text>(); mIdText = rc.Get <GameObject>("IdText").GetComponent <Text>(); rc.Get <GameObject>("JwelAddBtn").GetComponent <Button>().onClick.Add(() => JwelAddBtnOnClick()); rc.Get <GameObject>("ShopBtn").GetComponent <Button>().onClick.Add(() => JwelAddBtnOnClick()); rc.Get <GameObject>("HeadMaskBtn").GetComponent <Button>().onClick.Add(() => HeadMaskBtnOnClick()); rc.Get <GameObject>("ServiceBtn").GetComponent <Button>().onClick.Add(() => ServiceBtnOnClick()); rc.Get <GameObject>("AnnouncementBtn").GetComponent <Button>().onClick.Add(() => AnnouncementBtnOnClick()); rc.Get <GameObject>("SetBtn").GetComponent <Button>().onClick.Add(() => SetBtnOnClick()); rc.Get <GameObject>("RuleBtn").GetComponent <Button>().onClick.Add(() => RuleBtnOnClick()); rc.Get <GameObject>("CreateRoomBtn").GetComponent <Button>().onClick.Add(() => CreateRoomBtnOnClick()); rc.Get <GameObject>("JoinRoomBtn").GetComponent <Button>().onClick.Add(() => JoinRoomBtnOnClick()); rc.Get <GameObject>("MatchBtn").GetComponent <Button>().onClick.Add(() => MatchBtnOnClick()); Debug.Log("大厅组件获取成功"); //获取玩家数据 A1001_GetUserInfo_C2G GetUserInfo_Req = new A1001_GetUserInfo_C2G(); A1001_GetUserInfo_G2C GetUserInfo_Ack = (A1001_GetUserInfo_G2C)await SessionComponent.Instance.Session.Call(GetUserInfo_Req); //显示用户名和用户等级 mJwelNumText.text = GetUserInfo_Ack.Jwel.ToString(); mNameText.text = GetUserInfo_Ack.UserName; mIdText.text = GetUserInfo_Ack.UserInfoId; Debug.Log("显示信息成功"); }
public async void Awake() { ReferenceCollector rc = this.GetParent <UI>().GameObject.GetComponent <ReferenceCollector>(); GameObject quitButton = rc.Get <GameObject>("Quit"); GameObject readyButton = rc.Get <GameObject>("Ready"); mJewelQuantityText = rc.Get <GameObject>("JewelQuantityText").GetComponent <Text>(); mBeansQuantityText = rc.Get <GameObject>("BeansQuantityText").GetComponent <Text>(); mNameText = rc.Get <GameObject>("NameText").GetComponent <Text>(); mIdText = rc.Get <GameObject>("IdText").GetComponent <Text>(); mBesansON = rc.Get <GameObject>("BesansON"); mBesansOFF = rc.Get <GameObject>("BesansOFF"); mJewelON = rc.Get <GameObject>("JewelON"); mJewelOFF = rc.Get <GameObject>("JewelOFF"); mJewelBtn = rc.Get <GameObject>("JewelBtn"); mBesansBtn = rc.Get <GameObject>("BesansBtn"); mJewelBtn.GetComponent <Button>().onClick.Add(() => JewelShop()); mBesansBtn.GetComponent <Button>().onClick.Add(() => BeansShop()); rc.Get <GameObject>("BeansGetBtn").GetComponent <Button>().onClick.Add(() => BeansShop()); rc.Get <GameObject>("JewelGetBtn").GetComponent <Button>().onClick.Add(() => JewelShop()); rc.Get <GameObject>("ExitBtn").GetComponent <Button>().onClick.Add(() => ExitBtnOnClick()); //添加商品版面 BesansGroup = rc.Get <GameObject>("BesansGroupGo"); this.BesansGroupGo[0] = BesansGroup.Get <GameObject>("CommodityItemGo1"); this.BesansGroupGo[1] = BesansGroup.Get <GameObject>("CommodityItemGo2"); this.BesansGroupGo[2] = BesansGroup.Get <GameObject>("CommodityItemGo3"); this.BesansGroupGo[3] = BesansGroup.Get <GameObject>("CommodityItemGo4"); this.BesansGroupGo[4] = BesansGroup.Get <GameObject>("CommodityItemGo5"); this.BesansGroupGo[5] = BesansGroup.Get <GameObject>("CommodityItemGo6"); this.BesansGroupGo[6] = BesansGroup.Get <GameObject>("CommodityItemGo7"); this.BesansGroupGo[7] = BesansGroup.Get <GameObject>("CommodityItemGo8"); JewlGroup = rc.Get <GameObject>("JewlGroupGo"); this.JewlGroupGo[0] = JewlGroup.Get <GameObject>("CommodityItemGo1"); this.JewlGroupGo[1] = JewlGroup.Get <GameObject>("CommodityItemGo2"); this.JewlGroupGo[2] = JewlGroup.Get <GameObject>("CommodityItemGo3"); this.JewlGroupGo[3] = JewlGroup.Get <GameObject>("CommodityItemGo4"); this.JewlGroupGo[4] = JewlGroup.Get <GameObject>("CommodityItemGo5"); this.JewlGroupGo[5] = JewlGroup.Get <GameObject>("CommodityItemGo6"); this.JewlGroupGo[6] = JewlGroup.Get <GameObject>("CommodityItemGo7"); this.JewlGroupGo[7] = JewlGroup.Get <GameObject>("CommodityItemGo8"); //获取玩家数据 A1001_GetUserInfo_C2G GetUserInfo_Req = new A1001_GetUserInfo_C2G(); A1001_GetUserInfo_G2C GetUserInfo_Ack = (A1001_GetUserInfo_G2C)await SessionComponent.Instance.Session.Call(GetUserInfo_Req); //显示用户名和用户等级 mJewelQuantityText.text = GetUserInfo_Ack.Jwel.ToString(); mBeansQuantityText.text = GetUserInfo_Ack.Douzi.ToString(); mNameText.text = GetUserInfo_Ack.UserName; mIdText.text = GetUserInfo_Ack.UserInfoId; Debug.Log("显示信息成功"); }
private async void GetUserInfo() { A1001_GetUserInfo_C2G GetUserInfo_Req = new A1001_GetUserInfo_C2G(); A1001_GetUserInfo_G2C GetUserInfo_Ack = await SessionComponent.Instance.Session.Call(GetUserInfo_Req) as A1001_GetUserInfo_G2C; //显示用户名和用户等级 //name.text = GetUserInfo_Ack.NickName; name.text = GetUserInfo_Ack.UserName; money.text = GetUserInfo_Ack.Money.ToString(); level.text = GetUserInfo_Ack.Level.ToString(); phone.text = GetUserInfo_Ack.Phone.ToString(); email.text = GetUserInfo_Ack.Email; sex.text = GetUserInfo_Ack.Sex; title.text = GetUserInfo_Ack.Title; }
public async void Awake() { ReferenceCollector rc = this.GetParent <UI>().GameObject.GetComponent <ReferenceCollector>(); prompt = rc.Get <GameObject>("Prompt").GetComponent <Text>(); name = rc.Get <GameObject>("Name").GetComponent <Text>(); level = rc.Get <GameObject>("Level").GetComponent <Text>(); //添加事件 rc.Get <GameObject>("Moba5V5").GetComponent <Button>().onClick.Add(OnStartMatchMoba5V5); rc.Get <GameObject>("Landlords").GetComponent <Button>().onClick.Add(OnStartMatchLandlords); //添加新的匹配目标 //获取玩家数据 A1001_GetUserInfo_C2G GetUserInfo_Req = new A1001_GetUserInfo_C2G(); A1001_GetUserInfo_G2C GetUserInfo_Ack = (A1001_GetUserInfo_G2C)await SessionComponent.Instance.Session.Call(GetUserInfo_Req); //显示用户名和用户等级 name.text = GetUserInfo_Ack.UserName; level.text = GetUserInfo_Ack.UserLevel.ToString(); }
public async void Awake() { ReferenceCollector rc = this.GetParent <UI>().GameObject.GetComponent <ReferenceCollector>(); //初始化组件 mNameText = rc.Get <GameObject>("NameText").GetComponent <Text>(); mDouzi = rc.Get <GameObject>("douziText").GetComponent <Text>(); mJewe = rc.Get <GameObject>("JeweText").GetComponent <Text>(); mIdText = rc.Get <GameObject>("IdText").GetComponent <Text>(); //按钮获取事件 rc.Get <GameObject>("ShopBtn").GetComponent <Button>().onClick.Add(() => ShopBtnOnClick()); rc.Get <GameObject>("CloseBtn").GetComponent <Button>().onClick.Add(() => CloseBtnOnClick()); Debug.Log("信息组件初始化成功"); //获取玩家信息 A1001_GetUserInfo_C2G GetUserInfo_Req = new A1001_GetUserInfo_C2G(); A1001_GetUserInfo_G2C GetUserInfo_Ack = (A1001_GetUserInfo_G2C)await SessionComponent.Instance.Session.Call(GetUserInfo_Req); mNameText.text = GetUserInfo_Ack.UserName; mDouzi.text = GetUserInfo_Ack.Douzi.ToString(); mJewe.text = GetUserInfo_Ack.Jwel.ToString(); mIdText.text = GetUserInfo_Ack.UserInfoId; }