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

30 lines
631 B
C#
Raw Normal View History

2025-02-10 02:13:46 +00:00
using System;
using DDD.Uis.Tycoon;
namespace DDD.Tycoons
{
[Serializable]
2025-02-17 21:47:56 +00:00
public class TycoonSwitch : InteractionFurniture
2025-02-10 02:13:46 +00:00
{
2025-02-14 03:17:41 +00:00
private MenuBoardUi _menuBoardUi;
2025-02-10 02:13:46 +00:00
protected override void Awake()
{
base.Awake();
2025-02-14 03:17:41 +00:00
_menuBoardUi = FindAnyObjectByType<MenuBoardUi>();
2025-02-10 02:13:46 +00:00
}
public override void Interaction()
{
2025-02-17 21:47:56 +00:00
base.Interaction();
EventManager.InvokeTycoonGameStarted();
2025-02-10 02:13:46 +00:00
}
public override bool CanInteraction()
{
2025-02-17 21:47:56 +00:00
return !IsOpened && _menuBoardUi.CanOpen();
2025-02-10 02:13:46 +00:00
}
}
}