|
|
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.InputSystem;
- using NaughtyAttributes;
-
- public class CharacterInputController : MonoBehaviour
- {
-
- [SerializeField,Header("References")]
- private CharacterController2D m_characterController;
-
- [SerializeField]
- private Material m_Darkness;
-
- [ShowNonSerializedField]
- private Vector2 m_movement;
-
- [ShowNonSerializedField]
- private bool m_jump;
-
-
-
- public void OnMove(InputAction.CallbackContext context)
- {
- m_movement = context.ReadValue<Vector2>();
- }
-
- public void OnJump(InputAction.CallbackContext context)
- {
- m_jump = context.ReadValueAsButton();
- }
-
- private void Update()
- {
- m_characterController.Move(m_movement.x,false ,m_jump);
- }
-
-
-
-
-
-
- }
|