public static void DropItem(Vector3 position, ItemSurrogate item) { ItemDrop drop = Instantiate(instance.DropPrefab) as ItemDrop; drop.transform.position = position; drop.SetItem(item); }
public static void DropItem(Vector3 position, ItemSurrogate item) { if (instance == null) { Debug.LogError("There is no ItemDropper in the world."); return; } ItemDrop drop = Instantiate(instance.DropPrefab) as ItemDrop; drop.transform.position = position; drop.SetItem(item); }
private void Awake() { drop = GetComponent <ItemDrop> (); }