From 37612b8dbee2c8e3ca78a27d11ca2d77f2891d9b Mon Sep 17 00:00:00 2001 From: NTG_Lenovo Date: Thu, 10 Oct 2024 14:44:37 +0900 Subject: [PATCH] =?UTF-8?q?0.3.1.0=20=EC=97=85=EB=8D=B0=EC=9D=B4=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Customer/Action/SetTableSeatDirection.cs | 2 - Assets/02.Scripts/Character/Npc/Customer.cs | 7 +- .../Character/Player/PlayerHealthPoint.cs | 3 +- Assets/02.Scripts/EventManager.cs | 2 +- .../ScriptableObject/StageData.asset | 2 +- Assets/02.Scripts/Tycoon/LiquidController.cs | 4 +- Assets/02.Scripts/Tycoon/TycoonStatus.cs | 7 +- .../Ui/Combat/PlayerHealthPointUi.cs | 7 +- Assets/02.Scripts/Ui/Tycoon/BalloonUi.cs | 5 -- Assets/02.Scripts/Ui/Tycoon/Bill.cs | 3 + Assets/02.Scripts/Ui/Tycoon/BillInfo.cs | 3 + Assets/02.Scripts/Ui/Tycoon/BillUi.cs | 34 +++++++- .../05.Prefabs/Maps/Tycoon/TycoonMap.prefab | 84 ------------------- .../Interactions/CustomerTable3.prefab | 9 +- ProjectSettings/ProjectSettings.asset | 2 +- 15 files changed, 61 insertions(+), 113 deletions(-) diff --git a/Assets/02.Scripts/BehaviorTree/Npc/Customer/Action/SetTableSeatDirection.cs b/Assets/02.Scripts/BehaviorTree/Npc/Customer/Action/SetTableSeatDirection.cs index 060afec87..5b0fcc5da 100644 --- a/Assets/02.Scripts/BehaviorTree/Npc/Customer/Action/SetTableSeatDirection.cs +++ b/Assets/02.Scripts/BehaviorTree/Npc/Customer/Action/SetTableSeatDirection.cs @@ -19,8 +19,6 @@ namespace BlueWater.BehaviorTrees.Actions public override TaskStatus OnUpdate() { _customer.SetTableSeatPositionAndDirection(); - _customer.CurrentTableSeat.OccupySeat(); - _customer.CurrentTableSeat.UnreserveSeat(); return TaskStatus.Success; } } diff --git a/Assets/02.Scripts/Character/Npc/Customer.cs b/Assets/02.Scripts/Character/Npc/Customer.cs index 7fa0ec2ad..73ea897fc 100644 --- a/Assets/02.Scripts/Character/Npc/Customer.cs +++ b/Assets/02.Scripts/Character/Npc/Customer.cs @@ -258,6 +258,8 @@ namespace BlueWater.Npcs.Customers public void SetTableSeatPositionAndDirection() { transform.position = CurrentTableSeat.SeatTransform.position; + CurrentTableSeat.OccupySeat(); + CurrentTableSeat.UnreserveSeat(); SetCurrentDirection(CurrentTableSeat.TableDirection); } @@ -367,9 +369,10 @@ namespace BlueWater.Npcs.Customers { CurrentTableSeat.CleanTable(); } - + + var gold = CurrentLevelData.Gold * TycoonManager.Instance.TycoonStatus.GoldMultiplier; PayMoneyParticle.Play(); - PayMoneyUi.PayMoney(CurrentLevelData.Gold); + PayMoneyUi.PayMoney((int)gold); TycoonManager.Instance.TycoonStatus.CurrentExp += CurrentLevelData.Exp; TycoonManager.Instance.TycoonStatus.CurrentGold += CurrentLevelData.Gold; } diff --git a/Assets/02.Scripts/Character/Player/PlayerHealthPoint.cs b/Assets/02.Scripts/Character/Player/PlayerHealthPoint.cs index 58b5d9305..be329db73 100644 --- a/Assets/02.Scripts/Character/Player/PlayerHealthPoint.cs +++ b/Assets/02.Scripts/Character/Player/PlayerHealthPoint.cs @@ -62,9 +62,10 @@ namespace BlueWater.Players // Methods public void SetMaxHealthPoint(int changedHealthPoint) { + var previousMaxHealthPoint = MaxHealthPoint; var newChangedHealthPoint = Mathf.Clamp(changedHealthPoint, 0, 10); MaxHealthPoint = newChangedHealthPoint; - EventManager.OnMaxHealthChanged?.Invoke(newChangedHealthPoint); + EventManager.OnMaxHealthChanged?.Invoke(previousMaxHealthPoint, newChangedHealthPoint); } public void SetCurrentHealthPoint(int changedHealthPoint) diff --git a/Assets/02.Scripts/EventManager.cs b/Assets/02.Scripts/EventManager.cs index e62d34480..14b430f62 100644 --- a/Assets/02.Scripts/EventManager.cs +++ b/Assets/02.Scripts/EventManager.cs @@ -14,7 +14,7 @@ namespace BlueWater public static Action FadeInOut; // Player - public static Action OnMaxHealthChanged; + public static Action OnMaxHealthChanged; public static Action OnHealthChanged; public static Action OnDead; diff --git a/Assets/02.Scripts/ScriptableObject/StageData.asset b/Assets/02.Scripts/ScriptableObject/StageData.asset index f17ec2d0c..900047734 100644 --- a/Assets/02.Scripts/ScriptableObject/StageData.asset +++ b/Assets/02.Scripts/ScriptableObject/StageData.asset @@ -13,7 +13,7 @@ MonoBehaviour: m_Name: StageData m_EditorClassIdentifier: k__BackingField: 5 - k__BackingField: 100 + k__BackingField: 10 k__BackingField: 30 k__BackingField: 20 k__BackingField: 30 diff --git a/Assets/02.Scripts/Tycoon/LiquidController.cs b/Assets/02.Scripts/Tycoon/LiquidController.cs index c47ff22f5..1d6558473 100644 --- a/Assets/02.Scripts/Tycoon/LiquidController.cs +++ b/Assets/02.Scripts/Tycoon/LiquidController.cs @@ -486,12 +486,10 @@ namespace BlueWater _completeCocktailImage.enabled = true; _completeText.enabled = true; - // 1. 플레이어 음료 들기 - EventManager.OnCocktailCompleted?.Invoke(matchingCocktail); - yield return new WaitForSeconds(1f); HidePanel(); + EventManager.OnCocktailCompleted?.Invoke(matchingCocktail); } /// diff --git a/Assets/02.Scripts/Tycoon/TycoonStatus.cs b/Assets/02.Scripts/Tycoon/TycoonStatus.cs index 1cf463f96..fc6114114 100644 --- a/Assets/02.Scripts/Tycoon/TycoonStatus.cs +++ b/Assets/02.Scripts/Tycoon/TycoonStatus.cs @@ -120,11 +120,8 @@ namespace BlueWater.Tycoons get => _currentGold; set { - var previousGold = _currentGold; - var addedGold = (int)((value - previousGold) * _goldMultiplier); - var newGold = previousGold + addedGold; - EventManager.OnChangeGold?.Invoke(newGold); - _currentGold = newGold; + _currentGold = value; + EventManager.OnChangeGold?.Invoke(value); } } diff --git a/Assets/02.Scripts/Ui/Combat/PlayerHealthPointUi.cs b/Assets/02.Scripts/Ui/Combat/PlayerHealthPointUi.cs index 130ce63ae..5ecac86b4 100644 --- a/Assets/02.Scripts/Ui/Combat/PlayerHealthPointUi.cs +++ b/Assets/02.Scripts/Ui/Combat/PlayerHealthPointUi.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using BlueWater.Tycoons; using Sirenix.OdinInspector; using UnityEngine; using UnityEngine.UI; @@ -70,10 +71,12 @@ namespace BlueWater.Uis } } - public void SetMaxHealthPoint(int changedMaxHealthPoint) + public void SetMaxHealthPoint(int previousMaxHealthPoint, int changedMaxHealthPoint) { - _maxHeartCount = changedMaxHealthPoint; + var addedMaxHealthPoint = changedMaxHealthPoint - previousMaxHealthPoint; + _maxHeartCount = Mathf.CeilToInt(changedMaxHealthPoint * 0.5f); InitializeHealthPoint(); + TycoonManager.Instance.TycoonStatus.CurrentPlayerHealth += addedMaxHealthPoint * 2; } public void SetCurrentHealthPoint(int changedHealthPoint) diff --git a/Assets/02.Scripts/Ui/Tycoon/BalloonUi.cs b/Assets/02.Scripts/Ui/Tycoon/BalloonUi.cs index 8fc858d34..e51b1fb33 100644 --- a/Assets/02.Scripts/Ui/Tycoon/BalloonUi.cs +++ b/Assets/02.Scripts/Ui/Tycoon/BalloonUi.cs @@ -167,11 +167,6 @@ namespace BlueWater.Uis public bool IsWaitTimeOver() => _isOrdered && _isWaitTimeOver; public bool IsFoodReceive() => _isItemReceived; - public void CancelOrder() - { - _tableSeat.VacateSeat(); - } - public void ReceiveItem(IPickup pickupItem) { _tween.Kill(); diff --git a/Assets/02.Scripts/Ui/Tycoon/Bill.cs b/Assets/02.Scripts/Ui/Tycoon/Bill.cs index 485a867cd..2d31a093c 100644 --- a/Assets/02.Scripts/Ui/Tycoon/Bill.cs +++ b/Assets/02.Scripts/Ui/Tycoon/Bill.cs @@ -50,6 +50,7 @@ namespace BlueWater _maxDistance = Vector3.Distance(_rect.anchoredPosition, billInfoPosition0); _slider.value = 1f; _orderImage.sprite = customer.OrderedCocktailData.Sprite; + _tableNumberText.text = customer.CurrentTableSeat.TableNumber.ToString(); var sliderSequence = DOTween.Sequence(); sliderSequence.Append(_slider.DOValue(0f, customer.CurrentLevelData.HurryTime) @@ -78,6 +79,7 @@ namespace BlueWater CurrentBillInfo = billInfo; CurrentBillInfo.IsEmpty = false; + CurrentBillInfo.IsMoving = true; var distance = Vector3.Distance(_rect.anchoredPosition, CurrentBillInfo.Position); var moveTime = Mathf.Lerp(0.2f, 1f, distance / _maxDistance); @@ -95,6 +97,7 @@ namespace BlueWater private void OnArrivedTarget() { + CurrentBillInfo.IsMoving = false; var randomZ = Random.Range(-15f, 15f); var arrivedSequence = DOTween.Sequence(); diff --git a/Assets/02.Scripts/Ui/Tycoon/BillInfo.cs b/Assets/02.Scripts/Ui/Tycoon/BillInfo.cs index bfc0869dc..d2299cfe1 100644 --- a/Assets/02.Scripts/Ui/Tycoon/BillInfo.cs +++ b/Assets/02.Scripts/Ui/Tycoon/BillInfo.cs @@ -8,6 +8,9 @@ namespace BlueWater { [field: SerializeField] public bool IsEmpty = true; + + [field: SerializeField] + public bool IsMoving; [field: SerializeField] public Vector3 Position { get; private set; } diff --git a/Assets/02.Scripts/Ui/Tycoon/BillUi.cs b/Assets/02.Scripts/Ui/Tycoon/BillUi.cs index 56d11c4cd..5aa8ef052 100644 --- a/Assets/02.Scripts/Ui/Tycoon/BillUi.cs +++ b/Assets/02.Scripts/Ui/Tycoon/BillUi.cs @@ -1,3 +1,4 @@ +using System.Collections; using System.Collections.Generic; using BlueWater.Npcs.Customers; using Sirenix.OdinInspector; @@ -26,6 +27,7 @@ namespace BlueWater private Dictionary _customerBillDictionary = new(); private bool _isMovedChain; + private bool _isActivating; private const string Move = "Move"; @@ -51,7 +53,7 @@ namespace BlueWater private void OrderResult(Customer customer, bool isSucceed) { - if (_customerBillDictionary.TryGetValue(customer, out Bill bill)) + if (_customerBillDictionary.TryGetValue(customer, out var bill)) { bill.OrderResult(isSucceed, UpdateBillInfo); _customerBillDictionary.Remove(customer); @@ -76,7 +78,8 @@ namespace BlueWater } } } - Invoke(nameof(StopChainAnimation), 1f); + + StopChainAnimation(); } private void PlayChainAnimation() @@ -87,10 +90,35 @@ namespace BlueWater private void StopChainAnimation() { - if (!_isMovedChain) return; + if (!_isMovedChain || _isActivating) return; + + StartCoroutine(nameof(StopChainAnimationCoroutine)); + } + + private IEnumerator StopChainAnimationCoroutine() + { + _isActivating = true; + while (true) + { + var isMoving = false; + foreach (var element in _billInfos) + { + if (!element.IsMoving) continue; + + isMoving = true; + } + + if (!isMoving) + { + break; + } + + yield return null; + } _chain.AnimationState.ClearTrack(0); _isMovedChain = false; + _isActivating = false; } } } diff --git a/Assets/05.Prefabs/Maps/Tycoon/TycoonMap.prefab b/Assets/05.Prefabs/Maps/Tycoon/TycoonMap.prefab index 846a9616a..35ce07c46 100644 --- a/Assets/05.Prefabs/Maps/Tycoon/TycoonMap.prefab +++ b/Assets/05.Prefabs/Maps/Tycoon/TycoonMap.prefab @@ -2218,18 +2218,6 @@ PrefabInstance: serializedVersion: 3 m_TransformParent: {fileID: 1582116343231843844} m_Modifications: - - target: {fileID: 809828747251277026, guid: 8d99c5b5242b8da41ba9b1410a70cd1d, type: 3} - propertyPath: m_LocalScale.x - value: 0.9 - objectReference: {fileID: 0} - - target: {fileID: 809828747251277026, guid: 8d99c5b5242b8da41ba9b1410a70cd1d, type: 3} - propertyPath: m_LocalScale.y - value: 0.9 - objectReference: {fileID: 0} - - target: {fileID: 809828747251277026, guid: 8d99c5b5242b8da41ba9b1410a70cd1d, type: 3} - propertyPath: m_LocalScale.z - value: 0.9 - objectReference: {fileID: 0} - target: {fileID: 809828747251277026, guid: 8d99c5b5242b8da41ba9b1410a70cd1d, type: 3} propertyPath: m_LocalPosition.x value: -5 @@ -4204,18 +4192,6 @@ PrefabInstance: serializedVersion: 3 m_TransformParent: {fileID: 1582116343231843844} m_Modifications: - - target: {fileID: 809828747251277026, guid: 8d99c5b5242b8da41ba9b1410a70cd1d, type: 3} - propertyPath: m_LocalScale.x - value: 0.9 - objectReference: {fileID: 0} - - target: {fileID: 809828747251277026, guid: 8d99c5b5242b8da41ba9b1410a70cd1d, type: 3} - propertyPath: m_LocalScale.y - value: 0.9 - objectReference: {fileID: 0} - - target: {fileID: 809828747251277026, guid: 8d99c5b5242b8da41ba9b1410a70cd1d, type: 3} - propertyPath: m_LocalScale.z - value: 0.9 - objectReference: {fileID: 0} - target: {fileID: 809828747251277026, guid: 8d99c5b5242b8da41ba9b1410a70cd1d, type: 3} propertyPath: m_LocalPosition.x value: 2.5 @@ -5074,18 +5050,6 @@ PrefabInstance: serializedVersion: 3 m_TransformParent: {fileID: 1582116343231843844} m_Modifications: - - target: {fileID: 809828747251277026, guid: 8d99c5b5242b8da41ba9b1410a70cd1d, type: 3} - propertyPath: m_LocalScale.x - value: 0.9 - objectReference: {fileID: 0} - - target: {fileID: 809828747251277026, guid: 8d99c5b5242b8da41ba9b1410a70cd1d, type: 3} - propertyPath: m_LocalScale.y - value: 0.9 - objectReference: {fileID: 0} - - target: {fileID: 809828747251277026, guid: 8d99c5b5242b8da41ba9b1410a70cd1d, type: 3} - propertyPath: m_LocalScale.z - value: 0.9 - objectReference: {fileID: 0} - target: {fileID: 809828747251277026, guid: 8d99c5b5242b8da41ba9b1410a70cd1d, type: 3} propertyPath: m_LocalPosition.x value: 5 @@ -5622,18 +5586,6 @@ PrefabInstance: serializedVersion: 3 m_TransformParent: {fileID: 1582116343231843844} m_Modifications: - - target: {fileID: 809828747251277026, guid: 8d99c5b5242b8da41ba9b1410a70cd1d, type: 3} - propertyPath: m_LocalScale.x - value: 0.9 - objectReference: {fileID: 0} - - target: {fileID: 809828747251277026, guid: 8d99c5b5242b8da41ba9b1410a70cd1d, type: 3} - propertyPath: m_LocalScale.y - value: 0.9 - objectReference: {fileID: 0} - - target: {fileID: 809828747251277026, guid: 8d99c5b5242b8da41ba9b1410a70cd1d, type: 3} - propertyPath: m_LocalScale.z - value: 0.9 - objectReference: {fileID: 0} - target: {fileID: 809828747251277026, guid: 8d99c5b5242b8da41ba9b1410a70cd1d, type: 3} propertyPath: m_LocalPosition.x value: 2.5 @@ -5700,18 +5652,6 @@ PrefabInstance: serializedVersion: 3 m_TransformParent: {fileID: 1582116343231843844} m_Modifications: - - target: {fileID: 809828747251277026, guid: 8d99c5b5242b8da41ba9b1410a70cd1d, type: 3} - propertyPath: m_LocalScale.x - value: 0.9 - objectReference: {fileID: 0} - - target: {fileID: 809828747251277026, guid: 8d99c5b5242b8da41ba9b1410a70cd1d, type: 3} - propertyPath: m_LocalScale.y - value: 0.9 - objectReference: {fileID: 0} - - target: {fileID: 809828747251277026, guid: 8d99c5b5242b8da41ba9b1410a70cd1d, type: 3} - propertyPath: m_LocalScale.z - value: 0.9 - objectReference: {fileID: 0} - target: {fileID: 809828747251277026, guid: 8d99c5b5242b8da41ba9b1410a70cd1d, type: 3} propertyPath: m_LocalPosition.x value: -2.5 @@ -5922,18 +5862,6 @@ PrefabInstance: serializedVersion: 3 m_TransformParent: {fileID: 1582116343231843844} m_Modifications: - - target: {fileID: 809828747251277026, guid: 8d99c5b5242b8da41ba9b1410a70cd1d, type: 3} - propertyPath: m_LocalScale.x - value: 0.9 - objectReference: {fileID: 0} - - target: {fileID: 809828747251277026, guid: 8d99c5b5242b8da41ba9b1410a70cd1d, type: 3} - propertyPath: m_LocalScale.y - value: 0.9 - objectReference: {fileID: 0} - - target: {fileID: 809828747251277026, guid: 8d99c5b5242b8da41ba9b1410a70cd1d, type: 3} - propertyPath: m_LocalScale.z - value: 0.9 - objectReference: {fileID: 0} - target: {fileID: 809828747251277026, guid: 8d99c5b5242b8da41ba9b1410a70cd1d, type: 3} propertyPath: m_LocalPosition.x value: 0 @@ -7010,18 +6938,6 @@ PrefabInstance: serializedVersion: 3 m_TransformParent: {fileID: 1582116343231843844} m_Modifications: - - target: {fileID: 809828747251277026, guid: 8d99c5b5242b8da41ba9b1410a70cd1d, type: 3} - propertyPath: m_LocalScale.x - value: 0.9 - objectReference: {fileID: 0} - - target: {fileID: 809828747251277026, guid: 8d99c5b5242b8da41ba9b1410a70cd1d, type: 3} - propertyPath: m_LocalScale.y - value: 0.9 - objectReference: {fileID: 0} - - target: {fileID: 809828747251277026, guid: 8d99c5b5242b8da41ba9b1410a70cd1d, type: 3} - propertyPath: m_LocalScale.z - value: 0.9 - objectReference: {fileID: 0} - target: {fileID: 809828747251277026, guid: 8d99c5b5242b8da41ba9b1410a70cd1d, type: 3} propertyPath: m_LocalPosition.x value: -2.5 diff --git a/Assets/05.Prefabs/Props/Furniture/Interactions/CustomerTable3.prefab b/Assets/05.Prefabs/Props/Furniture/Interactions/CustomerTable3.prefab index 3fd6d0ff6..52169bdb8 100644 --- a/Assets/05.Prefabs/Props/Furniture/Interactions/CustomerTable3.prefab +++ b/Assets/05.Prefabs/Props/Furniture/Interactions/CustomerTable3.prefab @@ -61,6 +61,7 @@ MonoBehaviour: k__BackingField: {fileID: 3939857914763977653} k__BackingField: {fileID: 8752266548893034047} TableDirection: {x: -1, y: 0, z: 0} + TableNumber: 0 _foodImage: {fileID: 21300000, guid: 514247b5965aef447b13b5da95f3281a, type: 3} _dirtyImage: {fileID: 21300000, guid: cda1d961a563b6143a024170ed6f0f44, type: 3} --- !u!1 &1352874222752200122 @@ -300,6 +301,7 @@ MonoBehaviour: k__BackingField: {fileID: 1356178426752869258} k__BackingField: {fileID: 4724775134085759924} TableDirection: {x: 1, y: 0, z: 0} + TableNumber: 0 _foodImage: {fileID: 21300000, guid: 514247b5965aef447b13b5da95f3281a, type: 3} _dirtyImage: {fileID: 21300000, guid: cda1d961a563b6143a024170ed6f0f44, type: 3} --- !u!1 &6493535781353555306 @@ -690,15 +692,15 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 7986070582027999988, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} propertyPath: m_LocalScale.x - value: 3 + value: 1 objectReference: {fileID: 0} - target: {fileID: 7986070582027999988, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} propertyPath: m_LocalScale.y - value: 3 + value: 1 objectReference: {fileID: 0} - target: {fileID: 7986070582027999988, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} propertyPath: m_LocalScale.z - value: 3 + value: 1 objectReference: {fileID: 0} - target: {fileID: 7986070582027999988, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} propertyPath: m_LocalPosition.x @@ -790,6 +792,7 @@ MonoBehaviour: _tableSeats: - {fileID: 6383913593085221228} - {fileID: 6277647266874368514} + _tableNumber: 0 --- !u!210 &3389074959205472123 SortingGroup: m_ObjectHideFlags: 0 diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset index 8245e18f5..7ff14e494 100644 --- a/ProjectSettings/ProjectSettings.asset +++ b/ProjectSettings/ProjectSettings.asset @@ -140,7 +140,7 @@ PlayerSettings: loadStoreDebugModeEnabled: 0 visionOSBundleVersion: 1.0 tvOSBundleVersion: 1.0 - bundleVersion: 0.3.0.6 + bundleVersion: 0.3.1.0 preloadedAssets: - {fileID: -944628639613478452, guid: 4ed6540e2f7ce234888adf8deff1f241, type: 3} metroInputSource: 0