public void SendRankInfoReq(RankingType.ENUM type) { NetworkManager.Send(new RankInfoReq { rankingType = (int)type }, ServerType.Data); }
protected override void ReleaseSelf(bool calledDestroy) { if (SystemConfig.IsReleaseResourceOn && calledDestroy) { this.Current = RankingType.ENUM.Lv; this.SetBtnCurrent(this.Current); this.lastCurrent = (RankingType.ENUM) 0; base.ReleaseSelf(true); } }
private void InitData() { for (int i = 0; i < base.FindTransform("Buttons").get_childCount(); i++) { ButtonCustom component = base.FindTransform("Buttons").GetChild(i).GetComponent <ButtonCustom>(); component.onClickCustom = new ButtonCustom.VoidDelegateObj(this.OnClickRankingType); this.btns.Add(component); } this.Current = RankingType.ENUM.Lv; this.lastCurrent = (RankingType.ENUM) 0; }
private void OnClickRankingType(GameObject go) { int num = this.btns.FindIndex((ButtonCustom e) => e.get_gameObject() == go); if (num >= 0 && this.btns.get_Count() > num) { this.Current = num + RankingType.ENUM.Lv; if (this.lastCurrent == this.Current) { return; } this.UpdateType(); } }
private void SetBtnLightAndDim(RankingType.ENUM btnType, string btnIcon, bool isLight) { int num = btnType - RankingType.ENUM.Lv; if (num >= 0 && num < this.btns.get_Count()) { ButtonCustom buttonCustom = this.btns.get_Item(num); if (buttonCustom != null) { ResourceManager.SetSprite(buttonCustom.get_transform().GetComponent <Image>(), ResourceManager.GetIconSprite(btnIcon)); buttonCustom.get_transform().FindChild("btnText").GetComponent <Text>().set_color((!isLight) ? this.COLOR_LIGHT_NO : this.COLOR_LIGHT); } } }
private void SetBtnCurrent(RankingType.ENUM btnType) { this.SetBtnLightAndDim(this.lastCurrent, "fenleianniu_2", false); this.SetBtnLightAndDim(btnType, "fenleianniu_1", true); }
private void UpdateType() { this.SetBtnCurrent(this.Current); RankingManager.Instance.SendRankInfoReq(this.Current); this.lastCurrent = this.Current; }