CapersProject/Assets/02.Scripts/DDD/Prop/Furniture/Bell.cs
2025-02-24 20:55:35 +09:00

42 lines
839 B
C#

using System;
namespace DDD.Tycoons
{
[Serializable]
public class Bell : InteractionFurniture
{
private bool _activatedBell;
protected override void Start()
{
base.Start();
EventManager.OnEndedBell += EndBell;
HoldingAction = RingedBell;
}
protected override void OnDestroy()
{
base.OnDestroy();
EventManager.OnEndedBell -= EndBell;
}
public override bool CanInteraction()
{
return !_activatedBell;
}
public void RingedBell()
{
_activatedBell = true;
EventManager.InvokeRingedBell(transform.position);
}
private void EndBell()
{
_activatedBell = false;
}
}
}