private void DestroyTributeRewardItem() { for (int i = 0; i < _TributeRewardItems.Count; ++i) { GuildTributeRewardItem TributeRewardItem = _TributeRewardItems[i]; if (TributeRewardItem == null) { continue; } DestroyImmediate(TributeRewardItem.gameObject); } _TributeRewardItems.Clear(); }
//=================================================================================== // // Method // //=================================================================================== public void SetData(DATA_GUILD_TRIBUTE._enTributeEnum enTribute) { DestroyTributeRewardItem(); DATA_GUILD_TRIBUTE GuildTributeData = CDATA_GUILD_TRIBUTE.Get(enTribute); if (GuildTributeData == null) { #if DEBUG_LOG Debug.Log("<color=red> CDATA_GUILD_TRIBUTE.Get(enTribute) is Null </color>"); #endif return; } Dictionary <int, DATA_REWARD_NEW> RewardData = CDATA_REWARD_NEW.Get(GuildTributeData.enTributeReward); if (RewardData == null) { #if DEBUG_LOG Debug.Log("<color=red> CDATA_REWARD_NEW.Get(GuildTributeData.enTributeReward) is Null </color>"); #endif return; } foreach (KeyValuePair <int, DATA_REWARD_NEW> data in RewardData) { DATA_REWARD_NEW reward = data.Value; if (reward == null) { continue; } GuildTributeRewardItem TributeRewardItem = UIResourceMgr.CreatePrefab <GuildTributeRewardItem>(BUNDLELIST.PREFABS_UI_GUILD, _ItemInfoGrid.transform, "GuildTributeRewardItem"); TributeRewardItem.Init(reward); _TributeRewardItems.Add(TributeRewardItem); } ResetPosition(); }