Files
M-Gameton-06/Gameton-06/Assets/Gameton/Scripts/Common/PlayerDataManager.cs
2025-02-01 23:09:31 +09:00

28 lines
715 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace TON
{
public class PlayerDataManager : SingletonBase<PlayerDataManager>
{
// 사용자가 생성해둔 플레이어 데이터를 싱글톤으로 전역 사용하기 위함
public List<PlayerData> players { get; private set; }
protected override void Awake()
{
base.Awake();
LoadPlayerData();
}
private void LoadPlayerData()
{
players = JSONLoader.LoadFromResources<List<PlayerData>>("Player");
if (players == null)
{
players = new List<PlayerData>();
}
}
}
}