69 lines
2.1 KiB
C#
69 lines
2.1 KiB
C#
using System;
|
|
using BlueWater.Interfaces;
|
|
using BlueWater.Items;
|
|
using BlueWater.Npcs.Crews;
|
|
using BlueWater.Npcs.Crews.Server;
|
|
using UnityEngine;
|
|
|
|
namespace BlueWater.Tycoons
|
|
{
|
|
public class BartenderTable : ServingTable
|
|
{
|
|
[SerializeField]
|
|
private Sprite _activeSprite;
|
|
|
|
[SerializeField]
|
|
private Sprite _inactiveSprite;
|
|
|
|
protected override void Awake()
|
|
{
|
|
base.Awake();
|
|
|
|
VisualLook.sprite = _inactiveSprite;
|
|
}
|
|
|
|
public void Active()
|
|
{
|
|
VisualLook.sprite = _activeSprite;
|
|
}
|
|
|
|
public override void Interaction()
|
|
{
|
|
// 테이블의 칵테일을 가져가는 경우
|
|
if (CurrentPickupItem != null)
|
|
{
|
|
CocktailData currentCocktailData = ItemManager.Instance.CocktailDataSo.GetDataByIdx(CurrentPickupItem.Idx);
|
|
EventManager.InvokePickupCocktail(currentCocktailData);
|
|
CocktailGlassImage.sprite = null;
|
|
CocktailGlassImage.enabled = false;
|
|
// InteractionCanvas.BalloonUi.DiscardItem();
|
|
CurrentPickupItem = null;
|
|
OrderedCustomer = null;
|
|
}
|
|
}
|
|
|
|
public override bool CanInteraction()
|
|
{
|
|
return CurrentPickupItem != null && !CurrentTycoonPlayer.TycoonPickupHandler.IsPickedUpAnything();
|
|
}
|
|
|
|
public override bool CanInteractionCrew(Crew crew = null)
|
|
{
|
|
var servingCrew = (ServerCrew)crew;
|
|
if (!servingCrew)
|
|
{
|
|
throw new Exception("상호작용 오브젝트 오류");
|
|
}
|
|
|
|
return servingCrew.CurrentActionType == ActionType.TakeCocktail && CurrentPickupItem != null && OrderedCustomer;
|
|
}
|
|
|
|
public void CompleteMakingCocktail(IPickup cocktailData)
|
|
{
|
|
CurrentPickupItem = cocktailData;
|
|
CocktailGlassImage.sprite = CurrentPickupItem.Sprite;
|
|
CocktailGlassImage.enabled = true;
|
|
// InteractionCanvas.BalloonUi.SetItemImage(CurrentPickupItem);
|
|
}
|
|
}
|
|
} |