public void SpawnLoot(List <Item> loot) { _loot = loot; GameObject lootGO = new GameObject(); lootGO.transform.position = transform.position; LootView lootView = lootGO.AddComponent <LootView>(); lootView.Initialize(loot, _lootControl); }
public void SpawnLoot(NetLoot netLoot) { if (Loot.ContainsKey(netLoot.lootID)) { UpdateLoot(netLoot); return; } GameObject lootGO = new GameObject(); LootView lootView = lootGO.AddComponent<LootView>(); lootView.Initialize(netLoot.GetItems(), netLoot.lootID); lootGO.transform.position = netLoot.Position; lootGO.transform.rotation = netLoot.Rotation; Loot.Add(netLoot.lootID, lootView); }