타이틀 ui 수정 및 캐릭터 선택 화면 추가
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace TON
|
||||
{
|
||||
public class CharaterSelection : MonoBehaviour
|
||||
{
|
||||
public CharaterCreateUI characterCreateUI;
|
||||
|
||||
public void OnSelectMaleCat()
|
||||
{
|
||||
characterCreateUI.SelectCharacter("MaleCat");
|
||||
}
|
||||
|
||||
public void OnSelectFemaleCat()
|
||||
{
|
||||
characterCreateUI.SelectCharacter("FemaleCat");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6a1bd333a114a6e44a077c25d7909b4b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -9,6 +9,7 @@ namespace TON
|
||||
PANEL_START,
|
||||
|
||||
TitleUI,
|
||||
CharaterCreateUI,
|
||||
IngameUI,
|
||||
ControllerUI,
|
||||
LogUI,
|
||||
|
||||
11
Gameton-06/Assets/Gameton/Scripts/Interface/IDamage.cs
Normal file
11
Gameton-06/Assets/Gameton/Scripts/Interface/IDamage.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace TON
|
||||
{
|
||||
public interface IDamage
|
||||
{
|
||||
public void ApplyDamage(float damage);
|
||||
}
|
||||
}
|
||||
11
Gameton-06/Assets/Gameton/Scripts/Interface/IDamage.cs.meta
Normal file
11
Gameton-06/Assets/Gameton/Scripts/Interface/IDamage.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d2251b5474457e74aba5933e1076705c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -21,6 +21,12 @@ namespace TON
|
||||
|
||||
UIManager.Show<IngameUI>(UIList.IngameUI);
|
||||
UIManager.Show<ControllerUI>(UIList.ControllerUI);
|
||||
|
||||
|
||||
string selectedCharacter = PlayerPrefs.GetString("SelectedCharacter", "DefaultCharacter");
|
||||
Debug.Log("선택된 캐릭터: " + selectedCharacter);
|
||||
|
||||
// 선택된 캐릭터에 맞는 오브젝트를 생성하거나 적용하는 코드 작성
|
||||
}
|
||||
public override IEnumerator OnEnd()
|
||||
{
|
||||
|
||||
45
Gameton-06/Assets/Gameton/Scripts/UI/CharaterCreateUI.cs
Normal file
45
Gameton-06/Assets/Gameton/Scripts/UI/CharaterCreateUI.cs
Normal file
@@ -0,0 +1,45 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace TON
|
||||
{
|
||||
public class CharaterCreateUI : UIBase
|
||||
{
|
||||
[SerializeField] private Button createButton; // Create 버튼 참조
|
||||
|
||||
private string selectedCharacter; // 선택한 캐릭터의 타입 저장 (예: "MaleCat", "FemaleCat")
|
||||
|
||||
private void Start()
|
||||
{
|
||||
// 처음에는 버튼을 비활성화
|
||||
createButton.interactable = false;
|
||||
}
|
||||
|
||||
public void SelectCharacter(string characterType)
|
||||
{
|
||||
selectedCharacter = characterType;
|
||||
createButton.interactable = true; // 캐릭터가 선택되면 버튼 활성화
|
||||
|
||||
}
|
||||
|
||||
public void OnClickCreateButton()
|
||||
{
|
||||
if (string.IsNullOrEmpty(selectedCharacter))
|
||||
{
|
||||
Debug.Log("캐릭터를 선택하세요!");
|
||||
return;
|
||||
}
|
||||
|
||||
// 선택된 캐릭터 정보를 저장 (다음 씬에서도 사용할 수 있도록)
|
||||
PlayerPrefs.SetString("SelectedCharacter", selectedCharacter);
|
||||
// TODO: 생성한 캐릭터를 어떻게 저장할지???
|
||||
|
||||
|
||||
// 씬 변경
|
||||
UIManager.Hide<CharaterCreateUI>(UIList.CharaterCreateUI);
|
||||
Main.Singleton?.ChangeScene(SceneType.Ingame);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ce1a1854c76bcd140a71eb36d9308221
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -8,7 +8,11 @@ namespace TON
|
||||
{
|
||||
public void OnClickStartButton()
|
||||
{
|
||||
Main.Singleton?.ChangeScene(SceneType.Ingame);
|
||||
// Main.Singleton?.ChangeScene(SceneType.Ingame);
|
||||
|
||||
// TODO: 현재 가지고 있는 캐릭터가 없다면 CharaterCreateUI 를 보여주고
|
||||
UIManager.Show<CharaterCreateUI>(UIList.CharaterCreateUI);
|
||||
// TODO: 캐릭터가 있다면 내 캐릭터 목록에서 선택할 수 있도록 함
|
||||
}
|
||||
|
||||
public void OnClickExitButton()
|
||||
|
||||
Reference in New Issue
Block a user