룰렛 MVP 패턴 구현중

This commit is contained in:
Mingu Kim
2025-06-29 21:43:05 +09:00
parent 8d0e2ee53e
commit 19b64ec46e
5 changed files with 39 additions and 22 deletions

View File

@@ -12,7 +12,7 @@ namespace TON
[SerializeField] private Button buttonSpin;
private PlayerDataManager playerDataManager;
// Todo : Presenter 변수
private RoulettePresenter roulettePresenter;
private void Awake()
{
@@ -29,25 +29,13 @@ namespace TON
buttonSpin.interactable = false;
roulette.Spin(EndOfSpin);
});
// Presenter 생성
}
private void EndOfSpin(RoulettePieceData selectedData)
{
buttonSpin.interactable = true;
// 재화 획득 코드 추가
playerDataManager.AddGold(int.Parse(selectedData.description));
// UI 갱신 코드 추가
UIManager.Singleton.UpdateCashData();
Debug.Log($"{selectedData.index}:{selectedData.description}");
}
public class RoulettePresenter
{
roulettePresenter.InsertRouletteResult(selectedData);
}
}
}