void StartInteract() { if (!container) { return; } if (container.name == "LootChest") { int[] loot = container.GetComponent <Container>().Loot(); Debug.Log("Loot: "); Debug.Log("Coins: " + loot[0]); Debug.Log("Potions: " + loot[1]); Debug.Log("Grenades: " + loot[2]); Debug.Log("Ammunition: " + loot[3]); Inventory inventory = GetComponent <Inventory>(); inventory.AddCoins(loot[0]); inventory.AddPotions(loot[1]); inventory.AddGrenades(loot[2]); inventory.AddAmmunition(loot[3]); inventory.AddFood(loot[4]); } else if (container.name == "HumanTrader") { StartTraiding(); } }