void OnClickOfferingItem(OfferingItemSlot slot) { if (null != slot && slot.isCanUse) { _currentSelect = slot; selectOfferingItem.enabled = true; selectOfferingItem.mainTexture = InJoy.AssetBundles.AssetBundles.Load(slot.itemIcon) as Texture2D; } }
void SetOfferingItem(OfferingData offeringData, bool useTweenEffect) { selectOfferingItem.enabled = false; _currentOfferingData = offeringData; _currentSelect = null; tributesList.Refresh(offeringData, useTweenEffect); offeringItemTips.text = string.Format(Localization.instance.Get("IDS_MESSAGE_OFFERING_HITMONEY"), offeringData.hitMoney); RefreshHCCost(); }
void DoRefresh() { for (int i = 0; i < _currentOfferingData.costItemList.Count; i++) { string itemId = _currentOfferingData.costItemList[i]; ItemData itemData = DataManager.Instance.ItemDataManager.GetItemData(itemId); int itemCount = PlayerInfo.Instance.PlayerInventory.GetItemCount(itemId); OfferingItemSlot slot = tributesSlots[i]; UIEventListener.Get(slot.gameObject).onClick = OnClickOfferingItem; slot.icon.mainTexture = InJoy.AssetBundles.AssetBundles.Load(itemData.iconPath) as Texture2D; slot.count.text = itemCount.ToString(); slot.itemId = itemId; slot.itemCount = itemCount; slot.itemIcon = itemData.iconPath; slot.level = _currentOfferingData.level; slot.isCanUse = (itemCount > 0); } }