public static LootPopup Create(Vector3 position, string itemName, Transform prefabLootPopup) { Transform lootPopupTransform = Instantiate(prefabLootPopup, position, Quaternion.identity); LootPopup lootPopup = lootPopupTransform.GetComponent <LootPopup>(); lootPopup.Setup(itemName); return(lootPopup); }
// Create a damage popup public static LootPopup Create(Vector3 position, int experienceAmount, Transform prefabLootPopup) { Transform lootPopupTransform = Instantiate(prefabLootPopup, position, Quaternion.identity); LootPopup lootPopup = lootPopupTransform.GetComponent <LootPopup>(); lootPopup.Setup(experienceAmount); return(lootPopup); }