CapersProject/Assets/02.Scripts/DDD/Prop/Furniture/Bell.cs

56 lines
1.2 KiB
C#
Raw Normal View History

2025-02-24 11:55:35 +00:00
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;
}
2025-02-27 05:29:11 +00:00
public override void Interaction()
{
base.Interaction();
GameManager.Instance.CurrentTycoonPlayer.IsCleaningMold = true;
}
public override void CancelInteraction()
{
base.CancelInteraction();
GameManager.Instance.CurrentTycoonPlayer.IsCleaningMold = false;
}
2025-02-24 11:55:35 +00:00
public override bool CanInteraction()
{
return !_activatedBell;
}
public void RingedBell()
{
_activatedBell = true;
EventManager.InvokeRingedBell(transform.position);
}
private void EndBell()
{
_activatedBell = false;
}
}
}