스킬 슬롯 제어 로직 테스트

This commit is contained in:
aube.lee
2025-02-08 00:25:30 +09:00
parent a68e2b7479
commit 14a53032e0
5 changed files with 99 additions and 59 deletions

View File

@@ -319,9 +319,9 @@ MonoBehaviour:
m_OnClick: m_OnClick:
m_PersistentCalls: m_PersistentCalls:
m_Calls: m_Calls:
- m_Target: {fileID: 0} - m_Target: {fileID: 5127688379423261843}
m_TargetAssemblyTypeName: TON.ControllerUI, Assembly-CSharp m_TargetAssemblyTypeName: TON.ControllerUI_SkillButton, Assembly-CSharp
m_MethodName: m_MethodName: OnClickSkillButton
m_Mode: 1 m_Mode: 1
m_Arguments: m_Arguments:
m_ObjectArgument: {fileID: 0} m_ObjectArgument: {fileID: 0}
@@ -387,7 +387,7 @@ RectTransform:
m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 0} 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} m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &3911793054694365059 --- !u!222 &3911793054694365059
CanvasRenderer: CanvasRenderer:
@@ -417,7 +417,7 @@ MonoBehaviour:
m_OnCullStateChanged: m_OnCullStateChanged:
m_PersistentCalls: m_PersistentCalls:
m_Calls: [] m_Calls: []
m_Sprite: {fileID: 21300000, guid: 025c9ba6b08ea3949857d5bb397099fd, type: 3} m_Sprite: {fileID: 21300000, guid: 65e980f711cedc341853e618aacaad5d, type: 3}
m_Type: 0 m_Type: 0
m_PreserveAspect: 0 m_PreserveAspect: 0
m_FillCenter: 1 m_FillCenter: 1

View File

@@ -117,10 +117,16 @@ MonoBehaviour:
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
joystick: {fileID: 7288066023221573359} joystick: {fileID: 7288066023221573359}
buttons: [] buttons:
- {fileID: 2829166192458660942}
- {fileID: 3177755080651955962}
- {fileID: 3967442941689525696}
skillButtons: skillButtons:
keys: keys: 000000000100000002000000
values: [] values:
- Value: {fileID: 1708453278417668396}
- Value: {fileID: 2084944479451016088}
- Value: {fileID: 574669408038666402}
--- !u!1 &4244698586613034378 --- !u!1 &4244698586613034378
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -768,27 +774,33 @@ PrefabInstance:
propertyPath: m_Name propertyPath: m_Name
value: Skill Button value: Skill Button
objectReference: {fileID: 0} 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_RemovedComponents: []
m_RemovedGameObjects: [] m_RemovedGameObjects: []
m_AddedGameObjects: [] m_AddedGameObjects: []
m_AddedComponents: [] m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: f023329ca96ab444ca7c60781e310d59, type: 3} 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 --- !u!224 &8257009192460294745 stripped
RectTransform: RectTransform:
m_CorrespondingSourceObject: {fileID: 3622686016877026920, guid: f023329ca96ab444ca7c60781e310d59, type: 3} m_CorrespondingSourceObject: {fileID: 3622686016877026920, guid: f023329ca96ab444ca7c60781e310d59, type: 3}
@@ -1049,27 +1061,33 @@ PrefabInstance:
propertyPath: m_Name propertyPath: m_Name
value: Skill Button value: Skill Button
objectReference: {fileID: 0} 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_RemovedComponents: []
m_RemovedGameObjects: [] m_RemovedGameObjects: []
m_AddedGameObjects: [] m_AddedGameObjects: []
m_AddedComponents: [] m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: f023329ca96ab444ca7c60781e310d59, type: 3} 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 --- !u!224 &7123232125577925591 stripped
RectTransform: RectTransform:
m_CorrespondingSourceObject: {fileID: 3622686016877026920, guid: f023329ca96ab444ca7c60781e310d59, type: 3} m_CorrespondingSourceObject: {fileID: 3622686016877026920, guid: f023329ca96ab444ca7c60781e310d59, type: 3}
@@ -1171,27 +1189,33 @@ PrefabInstance:
propertyPath: m_Name propertyPath: m_Name
value: Skill Button value: Skill Button
objectReference: {fileID: 0} 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_RemovedComponents: []
m_RemovedGameObjects: [] m_RemovedGameObjects: []
m_AddedGameObjects: [] m_AddedGameObjects: []
m_AddedComponents: [] m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: f023329ca96ab444ca7c60781e310d59, type: 3} 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 --- !u!224 &7602178571154501987 stripped
RectTransform: RectTransform:
m_CorrespondingSourceObject: {fileID: 3622686016877026920, guid: f023329ca96ab444ca7c60781e310d59, type: 3} m_CorrespondingSourceObject: {fileID: 3622686016877026920, guid: f023329ca96ab444ca7c60781e310d59, type: 3}

View File

@@ -33,6 +33,7 @@ namespace TON
joystick = ControllerUI.Instance.joystick; joystick = ControllerUI.Instance.joystick;
ControllerUI.Instance.linkedCharactor = this; ControllerUI.Instance.linkedCharactor = this;
attackCollider.EnableCollider(false); // 기본 공격 Enable 비활성화 attackCollider.EnableCollider(false); // 기본 공격 Enable 비활성화
Initialize(); Initialize();

View File

@@ -16,15 +16,14 @@ namespace TON
public CharacterBase linkedCharactor { get; set; } public CharacterBase linkedCharactor { get; set; }
public Button[] buttons; // UI 버튼 (3개) public Button[] buttons; // UI 버튼 (3개)
[SerializeField] [SerializeField]
private SerializableDictionary<int, ControllerUI_SkillButton> skillButtons; private SerializableDictionary<int, ControllerUI_SkillButton> skillButtons;
private List<SkillData> skillDatas; private List<SkillData> skillDatas;
public void Initalize() public void Initalize()
{ {
int characterLevel = PlayerDataManager.Singleton.player.level; int characterLevel = PlayerDataManager.Singleton.player.level;
skillDatas = SkillDataManager.Singleton.skillDatas; skillDatas = SkillDataManager.Singleton.skillDatas;
@@ -49,7 +48,9 @@ namespace TON
buttons[i].interactable = true; // 사용 가능 buttons[i].interactable = true; // 사용 가능
SkillData skillData = skillDatas.Find(skill => skill.slotNumber == i); SkillData skillData = skillDatas.Find(skill => skill.slotNumber == i);
skillButtons[i].skillData = skillData;
skillButtons[i].linkedCharactor = linkedCharactor;
skillButtons[i].Initalize(skillData);
} }
else else

View File

@@ -7,10 +7,24 @@ namespace TON
{ {
public class ControllerUI_SkillButton : MonoBehaviour public class ControllerUI_SkillButton : MonoBehaviour
{ {
public CharacterBase linkedCharactor { get; set; }
public SkillData skillData; public SkillData skillData;
public Image lockImage; 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);
}
}
} }
}