37 lines
903 B
C#
37 lines
903 B
C#
![]() |
using BlueWater.Uis;
|
||
|
using UnityEngine;
|
||
|
|
||
|
namespace BlueWater.Tycoons
|
||
|
{
|
||
|
public class Brewing : InteractionFurniture
|
||
|
{
|
||
|
[SerializeField]
|
||
|
private string _currentDrinkIdx;
|
||
|
|
||
|
[SerializeField]
|
||
|
private int _currentQuantity;
|
||
|
|
||
|
public override void Interaction()
|
||
|
{
|
||
|
var brewingUi = TycoonUiManager.Instance.BrewingUi;
|
||
|
brewingUi.SetBrewing(this);
|
||
|
brewingUi.Open(TycoonUiManager.Instance.PopupUiList);
|
||
|
}
|
||
|
|
||
|
public override bool CanInteraction()
|
||
|
{
|
||
|
return !IsOpened;
|
||
|
}
|
||
|
|
||
|
public void SetDrink(string idx, int quantity)
|
||
|
{
|
||
|
_currentDrinkIdx = idx;
|
||
|
_currentQuantity += quantity;
|
||
|
}
|
||
|
|
||
|
public bool IsEmptyDrink()
|
||
|
{
|
||
|
return string.IsNullOrEmpty(_currentDrinkIdx) || _currentQuantity <= 0;
|
||
|
}
|
||
|
}
|
||
|
}
|