This commit is contained in:
Janis Meister
2023-02-24 19:43:36 +01:00
parent f85588e144
commit e1f1e1712d
3 changed files with 16 additions and 2 deletions

View File

@@ -3,9 +3,24 @@ using UnityEngine;
[CreateAssetMenu(fileName = "Hoe", menuName = "Harvestdale/Tools/Hoe", order = 0)]
public class Hoe : Tool
{
GameObject player;
private void Start()
{
player = GameObject.FindGameObjectWithTag("Player");
}
private Vector3 GetVector3IntInMouseDirection()
{
Vector3 direction = (player.transform.position - GridBuildingSystem.Instance.GetSnappedMousePosition()).normalized;
Debug.Log(direction);
return direction;
}
public override void OnUse()
{
Debug.Log("Hoe on use");
GetVector3IntInMouseDirection();
}

View File

@@ -59,7 +59,6 @@ public class PlayerController : MonoBehaviour
else
{
Debug.Log("Not in range");
}
}