fix: 캐릭터 최초 생성 시에 발생하는 exception 처리
This commit is contained in:
@@ -23,8 +23,7 @@ namespace TON
|
||||
public void Initalize()
|
||||
{
|
||||
LoadPlayerData();
|
||||
// 현재 플레이어 1개만 사용하므로 0번째 인덱스의 플레이어 데이터를 사용
|
||||
PlayerPrefs.SetInt("SelectedPlayerIndex", 0);
|
||||
// PlayerPrefs.SetInt("SelectedPlayerIndex", 0);
|
||||
}
|
||||
|
||||
private void LoadPlayerData()
|
||||
@@ -88,12 +87,13 @@ namespace TON
|
||||
|
||||
public void SetCurrentUserData()
|
||||
{
|
||||
int characterId = PlayerPrefs.GetInt("SelectedPlayerIndex", -1);
|
||||
if (characterId > -1)
|
||||
if (playersData.Count > 0)
|
||||
{
|
||||
player = playersData[characterId];
|
||||
// 현재 플레이어 1개만 사용하므로 0번째 인덱스의 플레이어 데이터를 사용
|
||||
PlayerPrefs.SetInt("SelectedPlayerIndex", 0);
|
||||
player = playersData[0];
|
||||
// FIXME: 테스트를 위해 캐릭터 레벨 강제 적용함
|
||||
player.level = 15;
|
||||
// player.level = 15;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user