Global Game Jam 2022
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

44 lines
820 B

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);
}
}