From 14a53032e0b778a620a6c31126a6cdef50d89232 Mon Sep 17 00:00:00 2001 From: "aube.lee" Date: Sat, 8 Feb 2025 00:25:30 +0900 Subject: [PATCH] =?UTF-8?q?=EC=8A=A4=ED=82=AC=20=EC=8A=AC=EB=A1=AF=20?= =?UTF-8?q?=EC=A0=9C=EC=96=B4=20=EB=A1=9C=EC=A7=81=20=ED=85=8C=EC=8A=A4?= =?UTF-8?q?=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../UI/Prefabs/Buttons/Skill Button.prefab | 10 +- .../UI/Prefabs/UI.ControllerUI.prefab | 126 +++++++++++------- .../Scripts/Character/CharacterBase.cs | 1 + .../Assets/Gameton/Scripts/UI/ControllerUI.cs | 7 +- .../Scripts/UI/ControllerUI_SkillButton.cs | 14 ++ 5 files changed, 99 insertions(+), 59 deletions(-) diff --git a/Gameton-06/Assets/Gameton/Resources/UI/Prefabs/Buttons/Skill Button.prefab b/Gameton-06/Assets/Gameton/Resources/UI/Prefabs/Buttons/Skill Button.prefab index db9ee765..b09dfde1 100644 --- a/Gameton-06/Assets/Gameton/Resources/UI/Prefabs/Buttons/Skill Button.prefab +++ b/Gameton-06/Assets/Gameton/Resources/UI/Prefabs/Buttons/Skill Button.prefab @@ -319,9 +319,9 @@ MonoBehaviour: m_OnClick: m_PersistentCalls: m_Calls: - - m_Target: {fileID: 0} - m_TargetAssemblyTypeName: TON.ControllerUI, Assembly-CSharp - m_MethodName: + - m_Target: {fileID: 5127688379423261843} + m_TargetAssemblyTypeName: TON.ControllerUI_SkillButton, Assembly-CSharp + m_MethodName: OnClickSkillButton m_Mode: 1 m_Arguments: m_ObjectArgument: {fileID: 0} @@ -387,7 +387,7 @@ RectTransform: m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 100, y: 100} + m_SizeDelta: {x: 80, y: 80} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &3911793054694365059 CanvasRenderer: @@ -417,7 +417,7 @@ MonoBehaviour: m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] - m_Sprite: {fileID: 21300000, guid: 025c9ba6b08ea3949857d5bb397099fd, type: 3} + m_Sprite: {fileID: 21300000, guid: 65e980f711cedc341853e618aacaad5d, type: 3} m_Type: 0 m_PreserveAspect: 0 m_FillCenter: 1 diff --git a/Gameton-06/Assets/Gameton/Resources/UI/Prefabs/UI.ControllerUI.prefab b/Gameton-06/Assets/Gameton/Resources/UI/Prefabs/UI.ControllerUI.prefab index d9c4aa41..1a76ac4e 100644 --- a/Gameton-06/Assets/Gameton/Resources/UI/Prefabs/UI.ControllerUI.prefab +++ b/Gameton-06/Assets/Gameton/Resources/UI/Prefabs/UI.ControllerUI.prefab @@ -117,10 +117,16 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: joystick: {fileID: 7288066023221573359} - buttons: [] + buttons: + - {fileID: 2829166192458660942} + - {fileID: 3177755080651955962} + - {fileID: 3967442941689525696} skillButtons: - keys: - values: [] + keys: 000000000100000002000000 + values: + - Value: {fileID: 1708453278417668396} + - Value: {fileID: 2084944479451016088} + - Value: {fileID: 574669408038666402} --- !u!1 &4244698586613034378 GameObject: m_ObjectHideFlags: 0 @@ -768,27 +774,33 @@ PrefabInstance: propertyPath: m_Name value: Skill Button objectReference: {fileID: 0} - - target: {fileID: 8637807277690663409, guid: f023329ca96ab444ca7c60781e310d59, type: 3} - propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Mode - value: 5 - objectReference: {fileID: 0} - - target: {fileID: 8637807277690663409, guid: f023329ca96ab444ca7c60781e310d59, type: 3} - propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Target - value: - objectReference: {fileID: -4577297331876422106} - - target: {fileID: 8637807277690663409, guid: f023329ca96ab444ca7c60781e310d59, type: 3} - propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_MethodName - value: OnClickSkillButton - objectReference: {fileID: 0} - - target: {fileID: 8637807277690663409, guid: f023329ca96ab444ca7c60781e310d59, type: 3} - propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Arguments.m_StringArgument - value: DarknessBall - objectReference: {fileID: 0} m_RemovedComponents: [] m_RemovedGameObjects: [] m_AddedGameObjects: [] m_AddedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: f023329ca96ab444ca7c60781e310d59, type: 3} +--- !u!114 &574669408038666402 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 5127688379423261843, guid: f023329ca96ab444ca7c60781e310d59, type: 3} + m_PrefabInstance: {fileID: 4670399535607039025} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 35c94c75c6e511048b4a77d3682e1f85, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &3967442941689525696 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 8637807277690663409, guid: f023329ca96ab444ca7c60781e310d59, type: 3} + m_PrefabInstance: {fileID: 4670399535607039025} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!224 &8257009192460294745 stripped RectTransform: m_CorrespondingSourceObject: {fileID: 3622686016877026920, guid: f023329ca96ab444ca7c60781e310d59, type: 3} @@ -1049,27 +1061,33 @@ PrefabInstance: propertyPath: m_Name value: Skill Button objectReference: {fileID: 0} - - target: {fileID: 8637807277690663409, guid: f023329ca96ab444ca7c60781e310d59, type: 3} - propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Mode - value: 5 - objectReference: {fileID: 0} - - target: {fileID: 8637807277690663409, guid: f023329ca96ab444ca7c60781e310d59, type: 3} - propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Target - value: - objectReference: {fileID: -4577297331876422106} - - target: {fileID: 8637807277690663409, guid: f023329ca96ab444ca7c60781e310d59, type: 3} - propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_MethodName - value: OnClickSkillButton - objectReference: {fileID: 0} - - target: {fileID: 8637807277690663409, guid: f023329ca96ab444ca7c60781e310d59, type: 3} - propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Arguments.m_StringArgument - value: FireBall - objectReference: {fileID: 0} m_RemovedComponents: [] m_RemovedGameObjects: [] m_AddedGameObjects: [] m_AddedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: f023329ca96ab444ca7c60781e310d59, type: 3} +--- !u!114 &1708453278417668396 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 5127688379423261843, guid: f023329ca96ab444ca7c60781e310d59, type: 3} + m_PrefabInstance: {fileID: 5808676351208836543} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 35c94c75c6e511048b4a77d3682e1f85, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &2829166192458660942 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 8637807277690663409, guid: f023329ca96ab444ca7c60781e310d59, type: 3} + m_PrefabInstance: {fileID: 5808676351208836543} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!224 &7123232125577925591 stripped RectTransform: m_CorrespondingSourceObject: {fileID: 3622686016877026920, guid: f023329ca96ab444ca7c60781e310d59, type: 3} @@ -1171,27 +1189,33 @@ PrefabInstance: propertyPath: m_Name value: Skill Button objectReference: {fileID: 0} - - target: {fileID: 8637807277690663409, guid: f023329ca96ab444ca7c60781e310d59, type: 3} - propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Mode - value: 5 - objectReference: {fileID: 0} - - target: {fileID: 8637807277690663409, guid: f023329ca96ab444ca7c60781e310d59, type: 3} - propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Target - value: - objectReference: {fileID: -4577297331876422106} - - target: {fileID: 8637807277690663409, guid: f023329ca96ab444ca7c60781e310d59, type: 3} - propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_MethodName - value: OnClickSkillButton - objectReference: {fileID: 0} - - target: {fileID: 8637807277690663409, guid: f023329ca96ab444ca7c60781e310d59, type: 3} - propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Arguments.m_StringArgument - value: IceBall - objectReference: {fileID: 0} m_RemovedComponents: [] m_RemovedGameObjects: [] m_AddedGameObjects: [] m_AddedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: f023329ca96ab444ca7c60781e310d59, type: 3} +--- !u!114 &2084944479451016088 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 5127688379423261843, guid: f023329ca96ab444ca7c60781e310d59, type: 3} + m_PrefabInstance: {fileID: 6612973776956747531} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 35c94c75c6e511048b4a77d3682e1f85, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &3177755080651955962 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 8637807277690663409, guid: f023329ca96ab444ca7c60781e310d59, type: 3} + m_PrefabInstance: {fileID: 6612973776956747531} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!224 &7602178571154501987 stripped RectTransform: m_CorrespondingSourceObject: {fileID: 3622686016877026920, guid: f023329ca96ab444ca7c60781e310d59, type: 3} diff --git a/Gameton-06/Assets/Gameton/Scripts/Character/CharacterBase.cs b/Gameton-06/Assets/Gameton/Scripts/Character/CharacterBase.cs index 72d1b621..e62ffafb 100644 --- a/Gameton-06/Assets/Gameton/Scripts/Character/CharacterBase.cs +++ b/Gameton-06/Assets/Gameton/Scripts/Character/CharacterBase.cs @@ -33,6 +33,7 @@ namespace TON joystick = ControllerUI.Instance.joystick; ControllerUI.Instance.linkedCharactor = this; + attackCollider.EnableCollider(false); // 기본 공격 Enable 비활성화 Initialize(); diff --git a/Gameton-06/Assets/Gameton/Scripts/UI/ControllerUI.cs b/Gameton-06/Assets/Gameton/Scripts/UI/ControllerUI.cs index a925fec9..6ed5c62e 100644 --- a/Gameton-06/Assets/Gameton/Scripts/UI/ControllerUI.cs +++ b/Gameton-06/Assets/Gameton/Scripts/UI/ControllerUI.cs @@ -16,15 +16,14 @@ namespace TON public CharacterBase linkedCharactor { get; set; } public Button[] buttons; // UI 버튼 (3개) + [SerializeField] private SerializableDictionary skillButtons; - private List skillDatas; public void Initalize() { - int characterLevel = PlayerDataManager.Singleton.player.level; skillDatas = SkillDataManager.Singleton.skillDatas; @@ -49,7 +48,9 @@ namespace TON buttons[i].interactable = true; // 사용 가능 SkillData skillData = skillDatas.Find(skill => skill.slotNumber == i); - skillButtons[i].skillData = skillData; + + skillButtons[i].linkedCharactor = linkedCharactor; + skillButtons[i].Initalize(skillData); } else diff --git a/Gameton-06/Assets/Gameton/Scripts/UI/ControllerUI_SkillButton.cs b/Gameton-06/Assets/Gameton/Scripts/UI/ControllerUI_SkillButton.cs index 6abe6a90..ad74cb6a 100644 --- a/Gameton-06/Assets/Gameton/Scripts/UI/ControllerUI_SkillButton.cs +++ b/Gameton-06/Assets/Gameton/Scripts/UI/ControllerUI_SkillButton.cs @@ -7,10 +7,24 @@ namespace TON { public class ControllerUI_SkillButton : MonoBehaviour { + public CharacterBase linkedCharactor { get; set; } + public SkillData skillData; public Image lockImage; + public void Initalize(SkillData skillData) + { + this.skillData = skillData; + // this.linkedCharactor = linkedCharactor; // 씬에서 캐릭터 찾기 + Debug.Log(linkedCharactor.name); + } + public void OnClickSkillButton() + { + linkedCharactor.SkillAttack(skillData.id); + } } + + }