can interact if player has tool selected (in hand))

This commit is contained in:
j.mei7
2022-02-18 20:25:35 +01:00
parent 73669eaa3f
commit 3ff90d47c2
30 changed files with 505 additions and 78 deletions

View File

@@ -0,0 +1,22 @@
using UnityEngine;
using UnityEngine.Rendering.Universal;
public class TestLight : Interactable
{
[Header("Test Light Properties")]
[SerializeField] Color color;
[SerializeField] Light2D globalLight;
public override string GetDescription()
{
if (isInRange())
return "Turn Light " + gameObject.name;
else
return "Light switch not in range";
}
public override void Interact()
{
globalLight.color = color;
Debug.Log("Color set to " + gameObject.name);
}
}