public void PopulateInventory(MerchantInvetoryDetails inventoryList) { ClearInventory(); merchantInvetoryDetails = inventoryList; foreach (var item in inventoryList.InventoryItems) { CreateInventoryItem(item); } }
private void ClearInventory() { merchantInvetoryDetails = null; if (_scrollViewContent == null) { _scrollViewContent = transform.Find("Scroll View/Viewport/Content"); } foreach (Transform child in _scrollViewContent) { Destroy(child.gameObject); } }