public override void OnInteract(PlayerController player) { base.OnInteract(player); EntityItem.DropItem( player.Entities, transform.position + new Vector3(0, 4f, 0), Table.GetDrop() ); }
public override void OnInteract(PlayerController player) { base.OnInteract(player); if (!player.Inventory.RemoveItem(new ItemCoin(1))) { var statusManager = GameObject.FindGameObjectWithTag("StatusManager") .GetComponent <UIStatusManager>(); statusManager.AddText("You need a coin to take a drink from the vending machine.", 3f); return; } EntityItem.DropItem( player.Entities, transform.position + new Vector3(0, 2f, 0), Table.GetDrop() ); }