37 lines
901 B
C#
37 lines
901 B
C#
using Sirenix.OdinInspector;
|
|
using UnityEngine;
|
|
|
|
namespace BlueWater.Tycoons
|
|
{
|
|
public class PowerSwitch : InteractionFurniture
|
|
{
|
|
[SerializeField, Required]
|
|
private Transform _visualLook;
|
|
|
|
// TODO : 추후에 다시 활성화 하는 기능 필요
|
|
[SerializeField]
|
|
private bool _isOpened;
|
|
|
|
protected override void OnEnable()
|
|
{
|
|
TycoonManager.Instance.OnTycoonOpenedEvent += OpenTycoonSwitch;
|
|
base.OnEnable();
|
|
}
|
|
|
|
public override void Interaction()
|
|
{
|
|
TycoonManager.Instance.OnTycoonOpenedEvent?.Invoke();
|
|
}
|
|
|
|
public override bool CanInteraction()
|
|
{
|
|
return !_isOpened;
|
|
}
|
|
|
|
private void OpenTycoonSwitch()
|
|
{
|
|
_isOpened = true;
|
|
_visualLook.localScale = new Vector3(-1f, 1f, 1f);
|
|
}
|
|
}
|
|
} |