This commit is contained in:
hho210 2024-10-31 14:50:31 +09:00
commit 7a7c4dd846
16 changed files with 91 additions and 31 deletions

View File

@ -3774,7 +3774,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastTarget: 0
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:

View File

@ -9619,7 +9619,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastTarget: 0
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:

View File

@ -15,7 +15,12 @@ namespace BlueWater.BehaviorTrees.Actions
public override TaskStatus OnUpdate()
{
return _crew.IsCompletedMission() ? TaskStatus.Success : TaskStatus.Running;
if (_crew.CrewInteraction != null)
{
return _crew.CrewInteraction.CanInteractionCrew() ? TaskStatus.Running : TaskStatus.Failure;
}
return _crew.IsCompletedMission() ? TaskStatus.Success : TaskStatus.Failure;
}
}
}

View File

@ -16,9 +16,9 @@ namespace BlueWater.BehaviorTrees.Actions
public override void OnStart()
{
if (_serverCrew.OrderedCustomer && _serverCrew.OrderedCustomer.CanInteractionCrew())
if (_serverCrew.OrderedCustomer)
{
_serverCrew.OrderedCustomer.IsMatchedServer = true;
_serverCrew.OrderedCustomer.TryMatchedServer();
}
if (_serverCrew.CrewInteraction != null)

View File

@ -43,7 +43,7 @@ namespace BlueWater.Npcs.Crews.Cleaner
public override bool IsCompletedMission()
{
return CrewInteraction == null && !IsCleaningFloor && !IsCleaningTable;
return !IsCleaningFloor && !IsCleaningTable;
}
public void SetIsCleaningFloor(bool value) => IsCleaningFloor = value;

View File

@ -63,7 +63,7 @@ namespace BlueWater.Npcs.Crews.Server
public override bool IsCompletedMission()
{
return CrewInteraction == null && !OrderedCustomer && CurrentPickupItem == null && !IsServing;
return !OrderedCustomer && CurrentPickupItem == null && !IsServing;
}
public void OnMission(ICrewInteraction crewInteraction, Customer orderedCustomer, ActionType actionType)

View File

@ -90,7 +90,7 @@ namespace BlueWater.Npcs.Customers
public float InteractionRadius { get; private set; } = 2f;
[field: SerializeField]
public string InteractionMessage { get; set; }
public string InteractionMessage { get; private set; }
[SerializeField]
private Vomiting _vomiting;
@ -106,22 +106,22 @@ namespace BlueWater.Npcs.Customers
public CocktailData OrderedCocktailData { get; private set; }
[field: SerializeField]
public Bill CurrentBill { get; set; }
public Bill CurrentBill { get; private set; }
[field: SerializeField]
public bool IsMatchedServer { get; set; }
public bool IsMatchedServer { get; private set; }
[field: SerializeField]
public bool IsReceivedItem { get; set; }
public bool IsReceivedItem { get; private set; }
[field: SerializeField]
public bool IsOrderedSucceed { get; set; }
public bool IsOrderedSucceed { get; private set; }
[SerializeField]
private CustomerInteractionType _customerInteractionType;
public bool IsMoving { get; private set; }
public bool IsVomited { get; set; }
public bool IsVomited { get; private set; }
private Vector3 _currentDirection = Vector3.right;
@ -475,6 +475,15 @@ namespace BlueWater.Npcs.Customers
return CurrentTableSeat && !IsReceivedItem;
}
public void TryMatchedServer()
{
if (!CanInteractionCrew()) return;
IsMatchedServer = true;
}
public void SetCurrentBill(Bill bill) => CurrentBill = bill;
#endregion
}
}

View File

@ -107,5 +107,33 @@ namespace BlueWater
action.Enable();
}
}
public void EnableAction(string actionName)
{
if (IsNullCurrentPlayerInput()) return;
var action = _currentPlayerInput.currentActionMap.FindAction(actionName);
if (action == null)
{
Debug.Log($"현재 Action Map인 {_currentPlayerInput.currentActionMap}에는 {actionName} Action이 존재하지 않습니다");
return;
}
action.Enable();
}
public void DisableAction(string actionName)
{
if (IsNullCurrentPlayerInput()) return;
var action = _currentPlayerInput.currentActionMap.FindAction(actionName);
if (action == null)
{
Debug.Log($"현재 Action Map인 {_currentPlayerInput.currentActionMap}에는 {actionName} Action이 존재하지 않습니다");
return;
}
action.Disable();
}
}
}

View File

@ -27,6 +27,13 @@ namespace BlueWater.Tycoons
Initialize();
}
protected override void Start()
{
base.Start();
EventManager.OnCleaningAll += Destroy;
}
private void Update()
{
if (InteractionCanvas.BalloonUi.IsWaitTimeOver())
@ -69,6 +76,11 @@ namespace BlueWater.Tycoons
}
}
}
private void OnDestroy()
{
EventManager.OnCleaningAll -= Destroy;
}
public void Initialize()
{

View File

@ -60,7 +60,6 @@ public class TycoonGameOver : MonoBehaviour
_shipRectTransform = _ship.GetComponent<RectTransform>();
originalPosition = _shipRectTransform.anchoredPosition;
}
private void OnDestroy()
{
EventManager.OnDead -= GameOver_Start;
@ -77,6 +76,8 @@ public class TycoonGameOver : MonoBehaviour
// 코루틴 정의
IEnumerator MoveObject()
{
VisualFeedbackManager.Instance.SetBaseTimeScale(0.0f);
PlayerInputKeyManager.Instance.DisableAction("Manual");
_panel.SetActive(true);
// 2.0초 동안은 흔들리기만 함
float timer = 0f;

View File

@ -148,7 +148,7 @@ namespace BlueWater.Uis
{
if (_tween == null)
{
Debug.LogError("게이지 리셋 오류");
Debug.LogError("BalloonUi 게이지 리셋 오류");
return;
}

View File

@ -192,7 +192,7 @@ namespace BlueWater
{
if (_sliderTween == null)
{
Debug.LogError("게이지 리셋 오류");
Debug.LogError("Bill 게이지 리셋 오류");
return;
}

View File

@ -54,7 +54,7 @@ namespace BlueWater.Uis
{
var instance = Instantiate(_billPrefab, _spawnLocation);
instance.Initialize(customer, _spawnPosition, _billInfos[0].Position);
customer.CurrentBill = instance;
customer.SetCurrentBill(instance);
var newKeyValuePair = new KeyValuePair<Customer, Bill>(customer, instance);
_customerBills.Add(newKeyValuePair);
}

View File

@ -6,7 +6,6 @@ using BlueWater.Tycoons;
using BlueWater.Uis;
using TMPro;
using UnityEngine;
using UnityEngine.Serialization;
using UnityEngine.UI;
public class ManualBook : SwitchActionPopupUi
@ -78,20 +77,22 @@ public class ManualBook : SwitchActionPopupUi
SelectedItem(_button[0]);
}
public override void Open()
{
base.Open();
VisualFeedbackManager.Instance.SetBaseTimeScale(0.0f);
PlayerInputKeyManager.Instance.SwitchCurrentActionMap(SwitchMapsOpened);
PopupUiController.RegisterPopup(this);
ShowUi();
IsOpened = true;
}
public override void Close()
{
gameObject.SetActive(false);
HideUi();
PopupUiController.UnregisterPopup(this);
IsOpened = false;
PlayerInputKeyManager.Instance.SwitchCurrentActionMap(SwitchMapsClosed);
IsOpened = false;
if (!PopupUiController.IsPopupListEmpty()) return;
@ -202,9 +203,11 @@ public class ManualBook : SwitchActionPopupUi
}
}
private void UpdateManualBook(LevelData levelData)
{
Update_Cocktails();
}
public void ShowUi() => gameObject.SetActive(true);
public void HideUi() => gameObject.SetActive(false);
}

View File

@ -53,16 +53,17 @@ namespace BlueWater.Uis
public override void Open()
{
transform.SetAsLastSibling();
ShowUi();
PopupUiController.RegisterPopup(this);
IsOpened = true;
VisualFeedbackManager.Instance.SetBaseTimeScale(0.0f);
PlayerInputKeyManager.Instance.DisableAction("Manual");
PopupUiController.RegisterPopup(this);
ShowUi();
IsOpened = true;
}
public override void Close()
{
HideUi();
PlayerInputKeyManager.Instance.EnableAction("Manual");
PopupUiController.UnregisterPopup(this);
IsOpened = false;

View File

@ -28,16 +28,17 @@ public class Upgrade_Popup : PopupUi
public override void Open()
{
transform.SetAsLastSibling();
ShowUi();
PopupUiController.RegisterPopup(this);
IsOpened = true;
VisualFeedbackManager.Instance.SetBaseTimeScale(0.0f);
PlayerInputKeyManager.Instance.DisableAction("Manual");
PopupUiController.RegisterPopup(this);
ShowUi();
IsOpened = true;
}
public override void Close()
{
HideUi();
PlayerInputKeyManager.Instance.EnableAction("Manual");
PopupUiController.UnregisterPopup(this);
IsOpened = false;