Files
example-top-down-unity/Assets/Scripts/TreeInteraction.cs
j.mei7 f5f3154c95 tool
2022-02-22 21:31:04 +01:00

27 lines
535 B
C#

using UnityEngine;
public class TreeInteraction : Harvestable
{
[SerializeField]
Item dropItem;
public override string GetDescription()
{
if (isInRange())
return "Baum muss weg";
else
return "Tree is not in range";
}
public override void Interact()
{
if (!isHarvested)
{
Debug.Log("Harvest BAUM");
Inventory.PlayerInstance.Add(dropItem, Random.Range(1, 10));
isHarvested = true;
}
}
}