캐릭터 데이터 불러오기 및 캐릭터 선택 / 생성 화면 간의 이동 로직 적용
This commit is contained in:
@@ -6,16 +6,29 @@ namespace TON
|
||||
{
|
||||
public class TitleUI : UIBase
|
||||
{
|
||||
public CharaterSelectUI charaterSelectUI;
|
||||
|
||||
public void OnClickStartButton()
|
||||
{
|
||||
// Main.Singleton?.ChangeScene(SceneType.Ingame);
|
||||
UIManager.Hide<TitleUI>(UIList.TitleUI);
|
||||
|
||||
// TODO: 현재 가지고 있는 캐릭터가 없다면 CharaterCreateUI 를 보여주고
|
||||
UIManager.Show<CharaterCreateUI>(UIList.CharaterCreateUI);
|
||||
// TODO: 캐릭터가 있다면 내 캐릭터 목록에서 선택할 수 있도록 함
|
||||
List<PlayerData> players = JSONLoader.LoadFromResources<List<PlayerData>>("Player");
|
||||
|
||||
if (players == null)
|
||||
{
|
||||
// 현재 가지고 있는 캐릭터가 없다면 CharaterCreateUI 를 보여주고
|
||||
UIManager.Show<CharaterCreateUI>(UIList.CharaterCreateUI);
|
||||
}
|
||||
else
|
||||
{
|
||||
// 캐릭터가 있다면 내 캐릭터 목록에서 선택할 수 있도록 함
|
||||
charaterSelectUI.SetPlayerDatas(players);
|
||||
UIManager.Show<CharaterSelectUI>(UIList.CharaterSelectUI);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void OnClickExitButton()
|
||||
{
|
||||
Main.Singleton?.SystemQuit();
|
||||
|
||||
Reference in New Issue
Block a user