feat: 게임 플레이어 로그인 후 재화 데이터 가져오도록 적용

This commit is contained in:
aube.lee
2025-02-27 22:40:53 +09:00
parent ae4b555dd5
commit fca3a699c6
8 changed files with 213 additions and 14 deletions

View File

@@ -1,7 +1,7 @@
using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;
using UnityEngine.SceneManagement;
namespace TON
{
@@ -18,7 +18,18 @@ namespace TON
// 상점 : 골드/생선
private void OnEnable()
{
// Scene activeScene = UnityEditor.SceneManagement.EditorSceneManager.GetActiveScene();
SetCashAmount();
SetObjectActive();
}
private void SetCashAmount()
{
goldObject.GetComponentInChildren<TextMeshProUGUI>().text = $"{PlayerDataManager.Singleton.goldAmount}";
fishObject.GetComponentInChildren<TextMeshProUGUI>().text = $"{PlayerDataManager.Singleton.fishAmount}";
}
private void SetObjectActive()
{
SceneType activeScene = Main.Singleton.currentSceneType;
if (activeScene == SceneType.Lobby)
@@ -42,7 +53,6 @@ namespace TON
settingObject.SetActive(false);
parseObject.SetActive(false);
}
}
public void OnClickSettingButton()