2026-04-13 스킬시스템 진행중
This commit is contained in:
@@ -26,12 +26,16 @@ public class InputManager : MonoBehaviour
|
||||
public event Action OnNormalAttackEvent;
|
||||
public event Action OnHeavyAttackEvent;
|
||||
public event Action OnInteractionEvent;
|
||||
public event Action OnKeyDown_SlotQEvent;
|
||||
public event Action OnKeyDown_SlotEEvent;
|
||||
public event Action OnKeyDown_SlotREvent;
|
||||
public event Action OnKeyDown_SlotTEvent;
|
||||
public event Action OnKeyDown_SlotFEvent;
|
||||
public event Action OnKeyDown_SlotGEvent;
|
||||
public event Action<InputState> OnKeyDown_SlotQEvent;
|
||||
public event Action<InputState> OnKeyDown_SlotEEvent;
|
||||
public event Action<InputState> OnKeyDown_SlotREvent;
|
||||
public event Action<InputState> OnKeyDown_SlotTEvent;
|
||||
public event Action<InputState> OnKeyDown_SlotFEvent;
|
||||
public event Action<InputState> OnKeyDown_SlotGEvent;
|
||||
public event Action<InputState> OnAreaConfirmEvent; // Remote 스킬 범위 확정
|
||||
|
||||
// 범위 지정 중 기본 공격 차단용 플래그 (SkillModule이 제어)
|
||||
public bool SuppressNormalAttack { get; set; }
|
||||
|
||||
|
||||
//키조작
|
||||
@@ -119,6 +123,8 @@ public void SetCharacterInputMap(string mapName)
|
||||
BindActionCharacter("UseSlot_F",OnKeyDown_Slot);
|
||||
BindActionCharacter("UseSlot_G",OnKeyDown_Slot);
|
||||
|
||||
BindActionCharacter("AreaConfirm", OnAreaConfirm);
|
||||
|
||||
BindActionCharacter("Interaction", OnInteraction);
|
||||
|
||||
BindActionCharacter("OnkeyDown_IKey", OnKeyDown_IKey);
|
||||
@@ -224,6 +230,7 @@ private void OnDodge(InputAction.CallbackContext ctx)
|
||||
|
||||
private void OnNormalAttack(InputAction.CallbackContext ctx)
|
||||
{
|
||||
if (SuppressNormalAttack) return;
|
||||
OnNormalAttackEvent?.Invoke();
|
||||
}
|
||||
|
||||
@@ -238,11 +245,40 @@ private void OnInteraction(InputAction.CallbackContext ctx)
|
||||
OnInteractionEvent?.Invoke();
|
||||
}
|
||||
|
||||
private void OnAreaConfirm(InputAction.CallbackContext ctx)
|
||||
{
|
||||
if (ctx.started)
|
||||
OnAreaConfirmEvent?.Invoke(InputState.Started);
|
||||
}
|
||||
|
||||
private void OnKeyDown_Slot(InputAction.CallbackContext ctx)
|
||||
{
|
||||
if(ctx.started)
|
||||
if (ctx.started)
|
||||
{
|
||||
|
||||
if (ctx.action.name == "UseSlot_Q")
|
||||
{
|
||||
OnKeyDown_SlotQEvent?.Invoke(InputState.Started);
|
||||
}
|
||||
else if (ctx.action.name == "UseSlot_E")
|
||||
{
|
||||
OnKeyDown_SlotEEvent?.Invoke(InputState.Started);
|
||||
}
|
||||
else if (ctx.action.name == "UseSlot_R")
|
||||
{
|
||||
OnKeyDown_SlotREvent?.Invoke(InputState.Started);
|
||||
}
|
||||
else if (ctx.action.name == "UseSlot_T")
|
||||
{
|
||||
OnKeyDown_SlotTEvent?.Invoke(InputState.Started);
|
||||
}
|
||||
else if (ctx.action.name == "UseSlot_F")
|
||||
{
|
||||
OnKeyDown_SlotFEvent?.Invoke(InputState.Started);
|
||||
}
|
||||
else if (ctx.action.name == "UseSlot_G")
|
||||
{
|
||||
OnKeyDown_SlotGEvent?.Invoke(InputState.Started);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -109,6 +109,14 @@ public void OnSceneLoaded(Scene scene, LoadSceneMode mode)
|
||||
InputManager.Instance.OnLookEvent += CurrentCharacterController.LookInput;
|
||||
InputManager.Instance.OnDodgeEvent += CurrentCharacterController.DodgeInput;
|
||||
|
||||
//스킬 범위 확정 (Remote 스킬)
|
||||
SkillModule sm = CurrentCharacter.GetComponent<SkillModule>();
|
||||
if (sm != null)
|
||||
{
|
||||
InputManager.Instance.OnAreaConfirmEvent -= sm.AreaConfirmInput;
|
||||
InputManager.Instance.OnAreaConfirmEvent += sm.AreaConfirmInput;
|
||||
}
|
||||
|
||||
//공격매핑
|
||||
//InputManager.Instance.OnNormalAttackEvent;
|
||||
//InputManager.Instance.OnHeavyAttackEvent;
|
||||
@@ -134,6 +142,40 @@ private void ApplyCharacterInfo(PlayerCharacterController pcc, UserCharacter uc)
|
||||
pcc.PlayerCharacterIdentity.IsDefaultControl = uc.DefaultControl;
|
||||
}
|
||||
|
||||
public void BindSlotAction(string slotName,Action<InputState> slotUseAction)
|
||||
{
|
||||
if (slotName == "UseSlot_Q")
|
||||
{
|
||||
InputManager.Instance.OnKeyDown_SlotQEvent -= slotUseAction;
|
||||
InputManager.Instance.OnKeyDown_SlotQEvent += slotUseAction;
|
||||
}
|
||||
else if (slotName == "UseSlot_E")
|
||||
{
|
||||
InputManager.Instance.OnKeyDown_SlotEEvent -= slotUseAction;
|
||||
InputManager.Instance.OnKeyDown_SlotEEvent += slotUseAction;
|
||||
}
|
||||
else if (slotName == "UseSlot_R")
|
||||
{
|
||||
InputManager.Instance.OnKeyDown_SlotREvent -= slotUseAction;
|
||||
InputManager.Instance.OnKeyDown_SlotREvent += slotUseAction;
|
||||
}
|
||||
else if (slotName == "UseSlot_T")
|
||||
{
|
||||
InputManager.Instance.OnKeyDown_SlotTEvent -= slotUseAction;
|
||||
InputManager.Instance.OnKeyDown_SlotTEvent += slotUseAction;
|
||||
}
|
||||
else if (slotName == "UseSlot_F")
|
||||
{
|
||||
InputManager.Instance.OnKeyDown_SlotFEvent -= slotUseAction;
|
||||
InputManager.Instance.OnKeyDown_SlotFEvent += slotUseAction;
|
||||
}
|
||||
else if (slotName == "UseSlot_G")
|
||||
{
|
||||
InputManager.Instance.OnKeyDown_SlotGEvent -= slotUseAction;
|
||||
InputManager.Instance.OnKeyDown_SlotGEvent += slotUseAction;
|
||||
}
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
if(InputManager.Instance != null)
|
||||
|
||||
Reference in New Issue
Block a user