From 4c46b87a9540006a18734b37c25e2e94b42c4d39 Mon Sep 17 00:00:00 2001 From: Nam Tae Gun Date: Tue, 19 Nov 2024 10:12:01 +0900 Subject: [PATCH] 0.3.4.7 --- Assets/01.Scenes/01.Tycoon.unity | 1 - Assets/02.Scripts/Audio/AudioManager.cs | 5 ++++- Assets/02.Scripts/Item/Cocktail/CocktailDataSo.cs | 14 ++++++-------- .../ScriptableObject/Item/CocktailDataTable.asset | 1 + Assets/02.Scripts/Tycoon/LiquidController.cs | 5 ++--- Assets/02.Scripts/Ui/Tycoon/ManualBook.cs | 8 ++++++-- Assets/05.Prefabs/Maps/Tycoon/NewTycoonMap.prefab | 8 ++++---- 7 files changed, 23 insertions(+), 19 deletions(-) diff --git a/Assets/01.Scenes/01.Tycoon.unity b/Assets/01.Scenes/01.Tycoon.unity index f7671edfa..2b30a75ef 100644 --- a/Assets/01.Scenes/01.Tycoon.unity +++ b/Assets/01.Scenes/01.Tycoon.unity @@ -10564,7 +10564,6 @@ MonoBehaviour: _liquidObject: {fileID: -7612237390858616641, guid: 231c2f369e2946745a955eb49243702b, type: 3} _garnishObject: {fileID: 5803694563079548352, guid: f051d09e1e3043d4285ae8e0ff4c4f12, type: 3} _liquidsPerSecond: 100 - _maxLiquidCount: 300 _colorLerpSpeed: 0.5 _colorIntensity: 2 _reachedLerpPosition: {x: -10.5, y: 4} diff --git a/Assets/02.Scripts/Audio/AudioManager.cs b/Assets/02.Scripts/Audio/AudioManager.cs index d9fe9bae2..8fa3b5ab1 100644 --- a/Assets/02.Scripts/Audio/AudioManager.cs +++ b/Assets/02.Scripts/Audio/AudioManager.cs @@ -131,10 +131,13 @@ namespace BlueWater.Audios if (ignoreTimeScale) { - availableSfxAudioSource.pitch = duration.HasValue ? value.length / duration.Value : 1f; + // TimeScale의 영향을 받지 않는 pitch 설정 + _sfxPitchDictionary[availableSfxAudioSource] = duration.HasValue ? value.length / duration.Value : 1f; + availableSfxAudioSource.pitch = _sfxPitchDictionary[availableSfxAudioSource]; } else { + // TimeScale의 영향을 받는 pitch 설정 _sfxPitchDictionary[availableSfxAudioSource] = duration.HasValue ? value.length / duration.Value : 1f; availableSfxAudioSource.pitch = _sfxPitchDictionary[availableSfxAudioSource] * Time.timeScale; } diff --git a/Assets/02.Scripts/Item/Cocktail/CocktailDataSo.cs b/Assets/02.Scripts/Item/Cocktail/CocktailDataSo.cs index f59e128ab..db48d0bcb 100644 --- a/Assets/02.Scripts/Item/Cocktail/CocktailDataSo.cs +++ b/Assets/02.Scripts/Item/Cocktail/CocktailDataSo.cs @@ -8,6 +8,9 @@ namespace BlueWater.Items [CreateAssetMenu(fileName = "CocktailDataTable", menuName = "ScriptableObjects/CocktailDataTable")] public class CocktailDataSo : DataSo { + [field: SerializeField] + public int MaxLiquidCount { get; private set; } = 300; + protected override void OnEnable() { base.OnEnable(); @@ -18,15 +21,10 @@ namespace BlueWater.Items return; } #endif - - var liquidController = FindAnyObjectByType(); - if (liquidController) + + foreach (var element in _datas.Values) { - var maxLiquidAmount = liquidController.GetMaxLiquidCount(); - foreach (var element in _datas.Values) - { - element.ValidIngredients = element.GetValidIngredients(maxLiquidAmount); - } + element.ValidIngredients = element.GetValidIngredients(MaxLiquidCount); } } } diff --git a/Assets/02.Scripts/ScriptableObject/Item/CocktailDataTable.asset b/Assets/02.Scripts/ScriptableObject/Item/CocktailDataTable.asset index 517426fd2..cf986cbf9 100644 --- a/Assets/02.Scripts/ScriptableObject/Item/CocktailDataTable.asset +++ b/Assets/02.Scripts/ScriptableObject/Item/CocktailDataTable.asset @@ -285,3 +285,4 @@ MonoBehaviour: k__BackingField: 0 k__BackingField: {fileID: 21300000, guid: ee344f47787d148448bd3373235281b6, type: 3} k__BackingField: [] + k__BackingField: 300 diff --git a/Assets/02.Scripts/Tycoon/LiquidController.cs b/Assets/02.Scripts/Tycoon/LiquidController.cs index 1de4e98ff..602f67240 100644 --- a/Assets/02.Scripts/Tycoon/LiquidController.cs +++ b/Assets/02.Scripts/Tycoon/LiquidController.cs @@ -80,9 +80,6 @@ namespace BlueWater [SerializeField, Tooltip("초당 생성되는 액체 수(ml)")] private int _liquidsPerSecond = 100; - [SerializeField] - private int _maxLiquidCount = 300; - [SerializeField, Range(0f, 1f), Tooltip("목표 색상으로 변경되는데 걸리는 시간")] private float _colorLerpSpeed = 0.5f; @@ -131,6 +128,7 @@ namespace BlueWater private bool _isPouring; private bool _isCompleted; private float _elapsedTime = float.PositiveInfinity; + private int _maxLiquidCount; private int _instanceLiquidCount; private float _currentLiquidAmount; private float _liquidReachedTime; @@ -184,6 +182,7 @@ namespace BlueWater _completeCocktailImage.enabled = false; _completeText.enabled = false; _instanceLiquidCount = 0; + _maxLiquidCount = ItemManager.Instance.CocktailDataSo.MaxLiquidCount; SetCurrentAmount(0f); } diff --git a/Assets/02.Scripts/Ui/Tycoon/ManualBook.cs b/Assets/02.Scripts/Ui/Tycoon/ManualBook.cs index cdf33831e..7ec06b53b 100644 --- a/Assets/02.Scripts/Ui/Tycoon/ManualBook.cs +++ b/Assets/02.Scripts/Ui/Tycoon/ManualBook.cs @@ -1,3 +1,4 @@ +using System; using System.Collections; using System.Collections.Generic; using System.Linq; @@ -61,6 +62,8 @@ namespace BlueWater.Uis _pressQAction = PlayerInputKeyManager.Instance.GetAction(InputActionMaps.TycoonUi, TycoonUiActions.PressQ); _cancelAction = PlayerInputKeyManager.Instance.GetAction(InputActionMaps.TycoonUi, TycoonUiActions.Cancel); + _openManualBookAction.performed += OnOpen; + var allCocktails = ItemManager.Instance.CocktailDataSo.GetData(); _button = new List(allCocktails.Count); foreach (var element in allCocktails.Values) @@ -139,7 +142,6 @@ namespace BlueWater.Uis EventManager.OnLevelUp += UpdateManualBook; LocalizationSettings.SelectedLocaleChanged += OnChangedLocale; - _openManualBookAction.performed += OnOpen; } private void OnDestroy() @@ -175,12 +177,14 @@ namespace BlueWater.Uis public override void Open() { - AudioManager.Instance.PlaySfx(_manualSfxName, ignoreTimeScale: true); + if (!PopupUiController.IsPopupListEmpty()) return; + VisualFeedbackManager.Instance.SetBaseTimeScale(0.0f); PlayerInputKeyManager.Instance.SwitchCurrentActionMap(SwitchMapsOpened); PopupUiController.RegisterPopup(this); _panel.SetActive(true); IsOpened = true; + AudioManager.Instance.PlaySfx(_manualSfxName, ignoreTimeScale: true); } public void OnClose(InputAction.CallbackContext context) diff --git a/Assets/05.Prefabs/Maps/Tycoon/NewTycoonMap.prefab b/Assets/05.Prefabs/Maps/Tycoon/NewTycoonMap.prefab index 38c74d0f3..743cdd43e 100644 --- a/Assets/05.Prefabs/Maps/Tycoon/NewTycoonMap.prefab +++ b/Assets/05.Prefabs/Maps/Tycoon/NewTycoonMap.prefab @@ -10201,7 +10201,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 809828747251277026, guid: 1a59e4ec0cefb354688d7a267e281ffc, type: 3} propertyPath: m_LocalPosition.z - value: -8.1 + value: -7.9 objectReference: {fileID: 0} - target: {fileID: 809828747251277026, guid: 1a59e4ec0cefb354688d7a267e281ffc, type: 3} propertyPath: m_LocalRotation.w @@ -11503,7 +11503,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 809828747251277026, guid: 1a59e4ec0cefb354688d7a267e281ffc, type: 3} propertyPath: m_LocalPosition.z - value: -8.1 + value: -7.9 objectReference: {fileID: 0} - target: {fileID: 809828747251277026, guid: 1a59e4ec0cefb354688d7a267e281ffc, type: 3} propertyPath: m_LocalRotation.w @@ -14044,7 +14044,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 809828747251277026, guid: 1a59e4ec0cefb354688d7a267e281ffc, type: 3} propertyPath: m_LocalPosition.z - value: -8.1 + value: -7.9 objectReference: {fileID: 0} - target: {fileID: 809828747251277026, guid: 1a59e4ec0cefb354688d7a267e281ffc, type: 3} propertyPath: m_LocalRotation.w @@ -15089,7 +15089,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 809828747251277026, guid: 1a59e4ec0cefb354688d7a267e281ffc, type: 3} propertyPath: m_LocalPosition.z - value: -8.1 + value: -7.9 objectReference: {fileID: 0} - target: {fileID: 809828747251277026, guid: 1a59e4ec0cefb354688d7a267e281ffc, type: 3} propertyPath: m_LocalRotation.w