스테이지 선택 영역 로직 적용
This commit is contained in:
@@ -1,15 +1,43 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace TON
|
||||
{
|
||||
public class StageEntryUI : UIBase
|
||||
{
|
||||
|
||||
[SerializeField] private Button playButton; // Play 버튼 참조
|
||||
|
||||
private int currentSelectStage;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
playButton.interactable = false;
|
||||
}
|
||||
|
||||
public void OnClickBackButton()
|
||||
{
|
||||
UIManager.Show<LobbyUI>(UIList.LobbyUI);
|
||||
UIManager.Hide<StageEntryUI>(UIList.StageEntryUI);
|
||||
}
|
||||
|
||||
public void OnClickStageButton(int stage)
|
||||
{
|
||||
currentSelectStage = stage;
|
||||
if (currentSelectStage != 0)
|
||||
{
|
||||
playButton.interactable = true;
|
||||
}
|
||||
}
|
||||
|
||||
public void OnClickPlayButton()
|
||||
{
|
||||
if (currentSelectStage == 0)
|
||||
return;
|
||||
|
||||
Debug.Log("OnClickPlayButton::::" + currentSelectStage);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace TON
|
||||
{
|
||||
public class StageEntryUI_SlotItem : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private int index;
|
||||
private StageEntryUI stageEntryUI;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
// 상위 오브젝트에서 CharacterSelectUI 찾기
|
||||
stageEntryUI = FindObjectOfType<StageEntryUI>();
|
||||
|
||||
// 버튼 클릭 이벤트 등록
|
||||
GetComponent<Button>().onClick.AddListener(OnClickStage);
|
||||
}
|
||||
|
||||
public void OnClickStage()
|
||||
{
|
||||
stageEntryUI.OnClickStageButton(index);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6fbbb12042f0b9342a568f0b015f8892
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user