mirror of
https://github.com/DerTyp7/example-top-down-unity.git
synced 2025-10-30 12:57:08 +01:00
added test light switches and hold progress circle
This commit is contained in:
22
Assets/Scripts/TestLight.cs
Normal file
22
Assets/Scripts/TestLight.cs
Normal 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);
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user