diff --git a/Gameton-06/Assets/Gameton/Resources/UI/Prefabs/UI.LobbyUI.prefab b/Gameton-06/Assets/Gameton/Resources/UI/Prefabs/UI.LobbyUI.prefab index 662126f3..5ef8b7f5 100644 --- a/Gameton-06/Assets/Gameton/Resources/UI/Prefabs/UI.LobbyUI.prefab +++ b/Gameton-06/Assets/Gameton/Resources/UI/Prefabs/UI.LobbyUI.prefab @@ -6290,32 +6290,32 @@ MonoBehaviour: pieceParent: {fileID: 4677345320102285489} lineParent: {fileID: 4972187624572129157} roulettePieceData: - - icon: {fileID: 21300000, guid: 7cbd9a8330605ee438bb29392f30bc25, type: 3} + - icon: {fileID: 21300000, guid: 50787c1045972c64690b9a12c89b24e1, type: 3} description: 10 chance: 1 index: 0 weight: 0 - - icon: {fileID: 21300000, guid: a96e49d7f9075574b9dc9b77ca8237a2, type: 3} + - icon: {fileID: 21300000, guid: 50787c1045972c64690b9a12c89b24e1, type: 3} description: 2 chance: 15 index: 0 weight: 0 - - icon: {fileID: 21300000, guid: 7cbd9a8330605ee438bb29392f30bc25, type: 3} + - icon: {fileID: 21300000, guid: 50787c1045972c64690b9a12c89b24e1, type: 3} description: 25 chance: 1 index: 0 weight: 0 - - icon: {fileID: 21300000, guid: 50787c1045972c64690b9a12c89b24e1, type: 3} + - icon: {fileID: 21300000, guid: 21fd0468a7699b744bdac375989cf829, type: 3} description: 400 chance: 72 index: 0 weight: 0 - - icon: {fileID: 21300000, guid: 7cbd9a8330605ee438bb29392f30bc25, type: 3} + - icon: {fileID: 21300000, guid: 50787c1045972c64690b9a12c89b24e1, type: 3} description: 50 chance: 1 index: 0 weight: 0 - - icon: {fileID: 21300000, guid: 21fd0468a7699b744bdac375989cf829, type: 3} + - icon: {fileID: 21300000, guid: 94e9fa1ab055f2c48b4dfb5f02901fee, type: 3} description: 1000 chance: 11 index: 0 diff --git a/Gameton-06/Assets/Gameton/Scripts/UI/RouletteSpin/Roulette.cs b/Gameton-06/Assets/Gameton/Scripts/UI/RouletteSpin/Roulette.cs index 72fa2431..022fc54c 100644 --- a/Gameton-06/Assets/Gameton/Scripts/UI/RouletteSpin/Roulette.cs +++ b/Gameton-06/Assets/Gameton/Scripts/UI/RouletteSpin/Roulette.cs @@ -5,6 +5,7 @@ using System.Collections; namespace TON { + // View ? public class Roulette : MonoBehaviour { [SerializeField] private Transform piecePrefab; // 룰렛에 표시되는 정보 프리팹 @@ -105,7 +106,7 @@ namespace TON Debug.Log($"SelectedIndex:{selectedIndex}, angle:{angle}"); Debug.Log($"left/right/random:{leftOffset}/{rightOffset}/{randomAngle}"); Debug.Log($"targetAngle:{targetangle}"); - + isSpinning = true; StartCoroutine(OnSpin(targetangle, action)); } diff --git a/Gameton-06/Assets/Gameton/Scripts/UI/RouletteSpin/RoulettePiece.cs b/Gameton-06/Assets/Gameton/Scripts/UI/RouletteSpin/RoulettePiece.cs index c1946a5d..69862b3c 100644 --- a/Gameton-06/Assets/Gameton/Scripts/UI/RouletteSpin/RoulettePiece.cs +++ b/Gameton-06/Assets/Gameton/Scripts/UI/RouletteSpin/RoulettePiece.cs @@ -6,6 +6,7 @@ using UnityEngine.UI; namespace TON { + // View? public class RoulettePiece : MonoBehaviour { [SerializeField] private Image imageIcon; diff --git a/Gameton-06/Assets/Gameton/Scripts/UI/RouletteSpin/RoulettePieceData.cs b/Gameton-06/Assets/Gameton/Scripts/UI/RouletteSpin/RoulettePieceData.cs index 5f9b62dc..090362a6 100644 --- a/Gameton-06/Assets/Gameton/Scripts/UI/RouletteSpin/RoulettePieceData.cs +++ b/Gameton-06/Assets/Gameton/Scripts/UI/RouletteSpin/RoulettePieceData.cs @@ -4,6 +4,7 @@ using UnityEngine; namespace TON { + // Model? [System.Serializable] public class RoulettePieceData { diff --git a/Gameton-06/Assets/Gameton/Scripts/UI/RouletteSpin/RoulettePresenter.cs b/Gameton-06/Assets/Gameton/Scripts/UI/RouletteSpin/RoulettePresenter.cs new file mode 100644 index 00000000..daf8575d --- /dev/null +++ b/Gameton-06/Assets/Gameton/Scripts/UI/RouletteSpin/RoulettePresenter.cs @@ -0,0 +1,29 @@ +using System.Collections; +using System.Collections.Generic; +using UniRx; +using UnityEngine; + +namespace TON +{ + public class RoulettePresenter : MonoBehaviour + { + private PlayerDataManager playerDataManager; + + private void Awake() + { + // 싱글톤으로 PlayerDataManager 접근 + playerDataManager = PlayerDataManager.Singleton; + + if (playerDataManager == null) + { + Debug.LogError("PlayerDataManager가 초기화되지 않았습니다."); + } + } + + // 재화 획득 메서드 + public void InsertRouletteResult() + { + + } + } +} diff --git a/Gameton-06/Assets/Gameton/Scripts/UI/RouletteSpin/RoulettePresenter.cs.meta b/Gameton-06/Assets/Gameton/Scripts/UI/RouletteSpin/RoulettePresenter.cs.meta new file mode 100644 index 00000000..efad86a9 --- /dev/null +++ b/Gameton-06/Assets/Gameton/Scripts/UI/RouletteSpin/RoulettePresenter.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f7404ebc47cb7a14aa22c9b25eac2c42 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Gameton-06/Assets/Gameton/Scripts/UI/RouletteSpin/RouletteSpin.cs b/Gameton-06/Assets/Gameton/Scripts/UI/RouletteSpin/RouletteSpin.cs index 78e398c4..559b4c28 100644 --- a/Gameton-06/Assets/Gameton/Scripts/UI/RouletteSpin/RouletteSpin.cs +++ b/Gameton-06/Assets/Gameton/Scripts/UI/RouletteSpin/RouletteSpin.cs @@ -9,9 +9,19 @@ namespace TON { [SerializeField] private Roulette roulette; [SerializeField] private Button buttonSpin; - + + private PlayerDataManager playerDataManager; + private void Awake() { + // 싱글톤으로 PlayerDataManager 접근 + playerDataManager = PlayerDataManager.Singleton; + + if (playerDataManager == null) + { + Debug.LogError("PlayerDataManager가 초기화되지 않았습니다."); + } + buttonSpin.onClick.AddListener(()=> { buttonSpin.interactable = false; @@ -23,7 +33,17 @@ namespace TON { buttonSpin.interactable = true; + // 재화 획득 코드 추가 + playerDataManager.AddGold(int.Parse(selectedData.description)); + + // UI 갱신 코드 추가 + UIManager.Singleton.UpdateCashData(); Debug.Log($"{selectedData.index}:{selectedData.description}"); } + + public class RoulettePresenter + { + + } } } diff --git a/Gameton-06/Assets/Gameton/Scripts/UI/ShopItemUI.cs b/Gameton-06/Assets/Gameton/Scripts/UI/ShopItemUI.cs index 9ad7d22f..3606471f 100644 --- a/Gameton-06/Assets/Gameton/Scripts/UI/ShopItemUI.cs +++ b/Gameton-06/Assets/Gameton/Scripts/UI/ShopItemUI.cs @@ -22,7 +22,6 @@ namespace TON .Subscribe(text => title.text = text) .AddTo(this); presenter.BuyCommand.BindTo(buyButton).AddTo(this); - } [ContextMenu("Bind")] @@ -72,4 +71,4 @@ namespace TON Quantity = quantity; } } -} +} \ No newline at end of file