private async void GetFriendActInfo() { UINetLoadingComponent.showNetLoading(); G2C_FriendActInfo g2cFrd = (G2C_FriendActInfo)await SessionComponent.Instance.Session.Call(new C2G_FriendActInfo() { UId = PlayerInfoComponent.Instance.uid }); UINetLoadingComponent.closeNetLoading(); notGetcount = 0; GetNoGetCount(g2cFrd); if (notGetcount != 0) { Game.Scene.GetComponent <UIComponent>().Get(UIType.UIMain).GetComponent <UIMainComponent>().SetRedTip(3, true, notGetcount); } else { Game.Scene.GetComponent <UIComponent>().Get(UIType.UIMain).GetComponent <UIMainComponent>().SetRedTip(3, false); } ShowText.text = g2cFrd.ConsumCount.ToString() + "/" + count; LeftTxt.text = "次数" + "<Color=#F5E724FF>" + (g2cFrd.GetCount) + "/" + count + "</Color>"; if (g2cFrd.GetCount >= 5) { GetBtn.enabled = false; GetBtn.GetComponent <Image>().color = Color.grey; } else { GetBtn.enabled = true; GetBtn.GetComponent <Image>().color = Color.white; } }
private int GetNoGetCount(G2C_FriendActInfo info) { if (info.ConsumCount >= 5 && info.GetCount < 5) { if (((int)(info.ConsumCount / 5)) >= (5 - info.GetCount)) { notGetcount = 5 - info.GetCount; } else { notGetcount = (int)(info.ConsumCount / 5); } } else { notGetcount = 0; } return(notGetcount); }