From 92c51a2e4bc8a42415f69a46915b06e981a83ec1 Mon Sep 17 00:00:00 2001 From: "aube.lee" Date: Sun, 2 Feb 2025 15:10:41 +0900 Subject: [PATCH] =?UTF-8?q?=EC=8A=A4=ED=85=8C=EC=9D=B4=EC=A7=80=20?= =?UTF-8?q?=EC=84=A0=ED=83=9D=20=EC=98=81=EC=97=AD=20=EB=A1=9C=EC=A7=81=20?= =?UTF-8?q?=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Resources/UI/Prefabs/Stage Slot.prefab | 14 ++++++++++ .../UI/Prefabs/UI.StageEntryUI.prefab | 15 +++++++++- .../Assets/Gameton/Scripts/UI/StageEntryUI.cs | 28 +++++++++++++++++++ .../Scripts/UI/StageEntryUI_SlotItem.cs | 27 ++++++++++++++++++ .../Scripts/UI/StageEntryUI_SlotItem.cs.meta | 11 ++++++++ 5 files changed, 94 insertions(+), 1 deletion(-) create mode 100644 Gameton-06/Assets/Gameton/Scripts/UI/StageEntryUI_SlotItem.cs create mode 100644 Gameton-06/Assets/Gameton/Scripts/UI/StageEntryUI_SlotItem.cs.meta diff --git a/Gameton-06/Assets/Gameton/Resources/UI/Prefabs/Stage Slot.prefab b/Gameton-06/Assets/Gameton/Resources/UI/Prefabs/Stage Slot.prefab index 7952d6cb..a76611ce 100644 --- a/Gameton-06/Assets/Gameton/Resources/UI/Prefabs/Stage Slot.prefab +++ b/Gameton-06/Assets/Gameton/Resources/UI/Prefabs/Stage Slot.prefab @@ -10,6 +10,7 @@ GameObject: m_Component: - component: {fileID: 7857639710680952705} - component: {fileID: 4225804751692156500} + - component: {fileID: 4961787770283683285} m_Layer: 0 m_Name: Stage Slot m_TagString: Untagged @@ -82,6 +83,19 @@ MonoBehaviour: m_OnClick: m_PersistentCalls: m_Calls: [] +--- !u!114 &4961787770283683285 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 387253265420760142} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6fbbb12042f0b9342a568f0b015f8892, type: 3} + m_Name: + m_EditorClassIdentifier: + index: 0 --- !u!1 &7072256940192523073 GameObject: m_ObjectHideFlags: 0 diff --git a/Gameton-06/Assets/Gameton/Resources/UI/Prefabs/UI.StageEntryUI.prefab b/Gameton-06/Assets/Gameton/Resources/UI/Prefabs/UI.StageEntryUI.prefab index bea3de25..f8ece137 100644 --- a/Gameton-06/Assets/Gameton/Resources/UI/Prefabs/UI.StageEntryUI.prefab +++ b/Gameton-06/Assets/Gameton/Resources/UI/Prefabs/UI.StageEntryUI.prefab @@ -253,6 +253,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: c9138cc62a0b4a347a46191cfb0fd7ef, type: 3} m_Name: m_EditorClassIdentifier: + playButton: {fileID: 163394969067314430} --- !u!222 &3081003855718353481 CanvasRenderer: m_ObjectHideFlags: 0 @@ -1163,7 +1164,7 @@ MonoBehaviour: m_Calls: - m_Target: {fileID: 1117665430397923154} m_TargetAssemblyTypeName: TON.StageEntryUI, Assembly-CSharp - m_MethodName: OnClickBackButton + m_MethodName: OnClickPlayButton m_Mode: 1 m_Arguments: m_ObjectArgument: {fileID: 0} @@ -1384,6 +1385,10 @@ PrefabInstance: propertyPath: m_Name value: Stage Slot objectReference: {fileID: 0} + - target: {fileID: 4961787770283683285, guid: 9c3db63c99bd0e9458638b79c344993e, type: 3} + propertyPath: index + value: 1 + objectReference: {fileID: 0} - target: {fileID: 7857639710680952705, guid: 9c3db63c99bd0e9458638b79c344993e, type: 3} propertyPath: m_Pivot.x value: 0.5 @@ -1486,6 +1491,10 @@ PrefabInstance: propertyPath: m_Name value: Stage Slot objectReference: {fileID: 0} + - target: {fileID: 4961787770283683285, guid: 9c3db63c99bd0e9458638b79c344993e, type: 3} + propertyPath: index + value: 2 + objectReference: {fileID: 0} - target: {fileID: 5185707800194162268, guid: 9c3db63c99bd0e9458638b79c344993e, type: 3} propertyPath: m_text value: Stage 2 @@ -1592,6 +1601,10 @@ PrefabInstance: propertyPath: m_Name value: Stage Slot objectReference: {fileID: 0} + - target: {fileID: 4961787770283683285, guid: 9c3db63c99bd0e9458638b79c344993e, type: 3} + propertyPath: index + value: 3 + objectReference: {fileID: 0} - target: {fileID: 5185707800194162268, guid: 9c3db63c99bd0e9458638b79c344993e, type: 3} propertyPath: m_text value: Stage 3 diff --git a/Gameton-06/Assets/Gameton/Scripts/UI/StageEntryUI.cs b/Gameton-06/Assets/Gameton/Scripts/UI/StageEntryUI.cs index 4f4933c7..d24b26a5 100644 --- a/Gameton-06/Assets/Gameton/Scripts/UI/StageEntryUI.cs +++ b/Gameton-06/Assets/Gameton/Scripts/UI/StageEntryUI.cs @@ -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(UIList.LobbyUI); UIManager.Hide(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); + } } } diff --git a/Gameton-06/Assets/Gameton/Scripts/UI/StageEntryUI_SlotItem.cs b/Gameton-06/Assets/Gameton/Scripts/UI/StageEntryUI_SlotItem.cs new file mode 100644 index 00000000..73f0ba91 --- /dev/null +++ b/Gameton-06/Assets/Gameton/Scripts/UI/StageEntryUI_SlotItem.cs @@ -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(); + + // 버튼 클릭 이벤트 등록 + GetComponent