32 lines
726 B
C#
32 lines
726 B
C#
|
using UnityEngine;
|
||
|
|
||
|
namespace BlueWater.Tycoons
|
||
|
{
|
||
|
public class PowerSwitch : InteractionFurniture
|
||
|
{
|
||
|
// 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;
|
||
|
}
|
||
|
}
|
||
|
}
|