public BoxItem.BoxState SetData(HuoYueDuJiangLi data) { this.mData = data; if (this.itemIds == null || this.itemNums == null) { this.itemIds = new List <int>(); this.itemNums = new List <long>(); List <DiaoLuo> dataList = DataReader <DiaoLuo> .DataList; for (int i = 0; i < this.mData.reward.get_Count(); i++) { int num = this.mData.reward.get_Item(i); for (int j = 0; j < dataList.get_Count(); j++) { if (dataList.get_Item(j).ruleId == num) { this.itemIds.Add(dataList.get_Item(j).goodsId); this.itemNums.Add(dataList.get_Item(j).minNum); } } } } int num2 = DailyTaskManager.Instance.getActivityIds.Find((int e) => e == this.mData.id); if (num2 > 0) { this.mBoxState = BoxItem.BoxState.getBox; } else if (this.mData.numericalValue <= DailyTaskManager.Instance.totalActivity) { this.mBoxState = BoxItem.BoxState.canBox; if (this.mBoxFxTrans == null) { this.mBoxFxTrans = new GameObject("BoxFx"); this.mBoxFxTrans.get_transform().set_parent(this.BoxIcon.get_transform()); this.mBoxFxTrans.get_transform().set_localScale(Vector3.get_one()); this.mBoxFxTrans.get_transform().set_localPosition(Vector3.get_zero()); FXSpineManager.Instance.PlaySpine(805, this.mBoxFxTrans.get_transform(), string.Empty, 2001, null, "UI", -3f, 5f, 1f, 1f, false, FXMaskLayer.MaskState.None); } } else { this.mBoxState = BoxItem.BoxState.withoutBox; } this.num.set_text(this.mData.numericalValue.ToString()); if (this.mBoxState == BoxItem.BoxState.getBox) { ResourceManager.SetSprite(this.BoxIcon, ResourceManager.GetIconSprite("dailytask_icon_bag" + (this.mData.id - 100) * 2)); } else { ResourceManager.SetSprite(this.BoxIcon, ResourceManager.GetIconSprite("dailytask_icon_bag" + ((this.mData.id - 100) * 2 - 1))); } this.BoxIcon.GetComponent <Button>().set_interactable(this.mBoxState != BoxItem.BoxState.getBox); if (this.mBoxState != BoxItem.BoxState.canBox && this.mBoxFxTrans != null) { Object.Destroy(this.mBoxFxTrans); this.mBoxFxTrans = null; } return(this.mBoxState); }
private void RefreshSlider() { bool flag = false; for (int i = 0; i < this.mBoxDatas.get_Count(); i++) { BoxItem.BoxState boxState = this.mBoxList[i].SetData(this.mBoxDatas.get_Item(i)); this.mBoxList[i].get_gameObject().SetActive(true); if (!flag) { flag = (boxState == BoxItem.BoxState.canBox); } } int numericalValue = this.mBoxDatas.get_Item(this.mBoxDatas.get_Count() - 1).numericalValue; this.mSlider.set_value((float)DailyTaskManager.Instance.totalActivity / (float)numericalValue); this.mDailyTaskPoint.SetActive(flag); }