private IEnumerator loadItem(RewardCategory rewardCategory, DReward reward) { AssetRequest <GameObject> assetRequest = Content.LoadAsync(RewardPopupConstants.RewardPopupItemContentKey); yield return(assetRequest); GameObject itemGO = UnityEngine.Object.Instantiate(assetRequest.Asset); itemGO.transform.SetParent(ItemPanel, worldPositionStays: false); item = itemGO.GetComponent <RewardPopupRewardItem>(); RewardPopupRewardItem rewardPopupRewardItem = item; rewardPopupRewardItem.IconLoadCompleteAction = (Action <RewardPopupRewardItem>)Delegate.Combine(rewardPopupRewardItem.IconLoadCompleteAction, new Action <RewardPopupRewardItem>(OnItemLoadComplete)); item.LoadItem(rewardCategory, reward); }
private void createRewardItem(DReward rewardData, GameObject rewardItemPrefab) { RewardPopupRewardItem component = UnityEngine.Object.Instantiate(rewardItemPrefab, RewardContainer.transform, worldPositionStays: false).GetComponent <RewardPopupRewardItem>(); component.LoadItem(rewardData.Category, rewardData, allowMemberLockOverlay: true, showItemName: true); }