public void OnHotkey(Script_MenuController.InventoryStates state, int slotIndex) { if (Input.GetButtonDown(Const_KeyCodes.Effect1)) { Debug.Log($"Hot Key 1; slotIndex: {slotIndex}; state: {state}"); HandleHotKey(Const_KeyCodes.Effect1, state, slotIndex); } else if (Input.GetButtonDown(Const_KeyCodes.Effect2)) { Debug.Log($"Hot Key 2; slotIndex: {slotIndex}; state: {state}"); HandleHotKey(Const_KeyCodes.Effect2, state, slotIndex); } else if (Input.GetButtonDown(Const_KeyCodes.Effect3)) { Debug.Log($"Hot Key 3; slotIndex: {slotIndex}; state: {state}"); HandleHotKey(Const_KeyCodes.Effect3, state, slotIndex); } else if (Input.GetButtonDown(Const_KeyCodes.Effect4)) { Debug.Log($"Hot Key 4; slotIndex: {slotIndex}; state: {state}"); HandleHotKey(Const_KeyCodes.Effect4, state, slotIndex); } else if (Input.GetButtonDown(Const_KeyCodes.Effect5)) { Debug.Log($"Hot Key 5; slotIndex: {slotIndex}; state: {state}"); HandleHotKey(Const_KeyCodes.Effect5, state, slotIndex); } else if (Input.GetButtonDown(Const_KeyCodes.Effect6)) { Debug.Log($"Hot Key 6; slotIndex: {slotIndex}; state: {state}"); HandleHotKey(Const_KeyCodes.Effect6, state, slotIndex); } else if (Input.GetButtonDown(Const_KeyCodes.Effect7)) { Debug.Log($"Hot Key 7; slotIndex: {slotIndex}; state: {state}"); HandleHotKey(Const_KeyCodes.Effect7, state, slotIndex); } else if (Input.GetButtonDown(Const_KeyCodes.Effect8)) { Debug.Log($"Hot Key 8; slotIndex: {slotIndex}; state: {state}"); HandleHotKey(Const_KeyCodes.Effect8, state, slotIndex); } else if (Input.GetButtonDown(Const_KeyCodes.Effect9)) { Debug.Log($"Hot Key 9; slotIndex: {slotIndex}; state: {state}"); HandleHotKey(Const_KeyCodes.Effect9, state, slotIndex); } }
private void HandleHotKey(string keyCode, Script_MenuController.InventoryStates state, int slotIndex) { switch (state) { case (Script_MenuController.InventoryStates.Inventory): HandleInventoryHotKey(keyCode, slotIndex); break; case (Script_MenuController.InventoryStates.Equipment): HandleEquipmentHotKey(keyCode, slotIndex); break; default: break; } }