SlimeInput.cs (776B)
1 using Slimecing.Characters; 2 using UnityEngine; 3 using UnityEngine.InputSystem; 4 5 namespace Slimecing.InputSystem 6 { 7 public class SlimeInput : TakesInput, SlimeControls.IVsGameplayActions 8 { 9 [SerializeField] private CharacterMovementController _characterMovementController; 10 11 public void OnHorizontal(InputAction.CallbackContext context) 12 { 13 if (_characterMovementController == null) return; 14 _characterMovementController.GetMoveInputH(context.ReadValue<float>()); 15 } 16 17 public void OnVertical(InputAction.CallbackContext context) 18 { 19 if (_characterMovementController == null) return; 20 _characterMovementController.GetMoveInputV(context.ReadValue<float>()); 21 } 22 } 23 }