void ShowLivelyBoxReward(GuildLivelyRewardRef _livelyRewardRef) { if (boxUI != null) { boxUI.SetData(_livelyRewardRef); } }
public void SetData(GuildLivelyRewardRef _livelyRewardRef) { if (gameObject != null) { gameObject.SetActive(true); } if (labName != null) { labName.text = _livelyRewardRef.name.ToString(); } if (items != null) { items.RefreshItems(_livelyRewardRef.reward, 4, _livelyRewardRef.reward.Count); } if (btnReward != null) { bool haveGot = GameCenter.guildMng.HaveGotLivelyReward(_livelyRewardRef.id); //Debug.Log("haveGot:" + haveGot + ",GameCenter.guildMng.CurLivelyCount:"+GameCenter.guildMng.CurLivelyCount+ ",_livelyRewardRef.need:" + _livelyRewardRef.need); if (haveGot || GameCenter.guildMng.CurLivelyCount < _livelyRewardRef.need) { btnReward.isEnabled = false; } else { btnReward.isEnabled = true; UIEventListener.Get(btnReward.gameObject).onClick = (x) => { GameCenter.guildMng.C2S_ReqLivelyReward(_livelyRewardRef.id); }; } } }
public void SetData(GuildLivelyRewardRef _livelyRewardRef, System.Action <GuildLivelyRewardRef> _OnClick) { if (_livelyRewardRef == null) { return; } OnClickGuildRewardEvent = _OnClick; curGuildLively = _livelyRewardRef; if (livelyAmount != null) { livelyAmount.text = ConfigMng.Instance.GetUItext(138, new string[1] { _livelyRewardRef.need.ToString() }); } ; if (doubleRewardDes != null) { doubleRewardDes.enabled = false; } bool haveGot = GameCenter.guildMng.HaveGotLivelyReward(_livelyRewardRef.id); bool canGet = GameCenter.guildMng.CurLivelyCount >= _livelyRewardRef.need; int curLivelyCount = GameCenter.dailyMustDoMng.CurLivelyCount; if (haveGot) { UIEventListener.Get(gameObject).onClick = null; } else { UIEventListener.Get(gameObject).onClick = OnClickReward; } if (getPic != null) { getPic.enabled = canGet; getPic.IsGray = haveGot ? UISpriteEx.ColorGray.Gray : UISpriteEx.ColorGray.normal; } if (cantGetPic != null) { cantGetPic.enabled = !canGet; //不可领显示 } if (redTipIcon != null) { redTipIcon.enabled = canGet && !haveGot; } }