update tùm lum tùm la
This commit is contained in:
25
Assets/Scripts/Interactables/LampInteractable.cs
Normal file
25
Assets/Scripts/Interactables/LampInteractable.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace OnlyScove.Scripts
|
||||
{
|
||||
public class LampInteractable : BaseInteractable
|
||||
{
|
||||
[SerializeField] private Light targetLight;
|
||||
[SerializeField] private bool isOn = true;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
if (targetLight != null)
|
||||
targetLight.enabled = isOn;
|
||||
}
|
||||
|
||||
protected override void PerformInteraction(PlayerStateMachine player)
|
||||
{
|
||||
isOn = !isOn;
|
||||
if (targetLight != null)
|
||||
targetLight.enabled = isOn;
|
||||
|
||||
Debug.Log($"[Lamp] Toggled {(isOn ? "ON" : "OFF")}");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user