CapersProject/Assets/02.Scripts/Prop/Tycoon/BartenderTable.cs

47 lines
1.6 KiB
C#
Raw Normal View History

2024-10-27 09:44:22 +00:00
using System;
2024-10-20 17:21:39 +00:00
using BlueWater.Interfaces;
2024-10-27 09:44:22 +00:00
using BlueWater.Npcs.Crews;
using BlueWater.Npcs.Crews.Server;
2024-10-20 17:21:39 +00:00
namespace BlueWater.Tycoons
{
public class BartenderTable : ServingTable
{
2024-10-22 12:41:31 +00:00
public override void Interaction()
{
// 테이블의 칵테일을 가져가는 경우
if (CurrentPickupItem != null)
{
2024-10-29 12:17:00 +00:00
CurrentTycoonPlayer.TycoonPickupHandler.PickupItem(CurrentPickupItem, true);
2024-10-22 12:41:31 +00:00
CurrentTycoonPlayer.InteractionCanvas.BalloonUi.SetItemImage(CurrentPickupItem);
CocktailGlassImage.enabled = false;
InteractionCanvas.BalloonUi.DiscardItem();
CurrentPickupItem = null;
2024-10-27 09:44:22 +00:00
OrderedCustomer = null;
2024-10-22 12:41:31 +00:00
}
}
2024-10-20 17:21:39 +00:00
public override bool CanInteraction()
{
2024-11-04 12:22:07 +00:00
return CurrentPickupItem != null && !CurrentTycoonPlayer.TycoonPickupHandler.IsPickedUpAnything();
2024-10-22 12:41:31 +00:00
}
2024-10-27 09:44:22 +00:00
public override bool CanInteractionCrew(Crew crew = null)
2024-10-22 12:41:31 +00:00
{
2024-10-27 09:44:22 +00:00
var servingCrew = (ServerCrew)crew;
if (!servingCrew)
{
throw new Exception("상호작용 오브젝트 오류");
}
return servingCrew.CurrentActionType == ActionType.TakeCocktail && CurrentPickupItem != null && OrderedCustomer;
2024-10-20 17:21:39 +00:00
}
public void CompleteMakingCocktail(IPickup cocktailData)
{
CurrentPickupItem = cocktailData;
CocktailGlassImage.enabled = true;
InteractionCanvas.BalloonUi.SetItemImage(CurrentPickupItem);
}
}
}