public void SetBtnState(CardBtnState bs) { btnState = bs; if (bs == CardBtnState.BuyCard) { btnLabel.text = StaticLoc.Loc.Get("meg0127"); if (!rewardBtn.isEnabled) { rewardBtn.isEnabled = true; } } else if (bs == CardBtnState.CanReward) { btnLabel.text = StaticLoc.Loc.Get("meg0128"); if (!rewardBtn.isEnabled) { rewardBtn.isEnabled = true; } } else if (bs == CardBtnState.CantReward)// CD中 { btnLabel.text = StaticLoc.Loc.Get("meg0128"); if (rewardBtn.isEnabled) { rewardBtn.isEnabled = false; } } }
void Awake() { monthCard = this; btnState = CardBtnState.BuyCard; // 初始化变量 rewardBtn = btnLabel.transform.parent.GetComponent <UIButton>(); }