Firstborn/Library/PackageCache/com.unity.inputsystem@1.5.1/Samples~/DocsExamples/ExamplePlayerInput.cs
Schaken-Mods 9092858a58 updated to the latest editor
I updated everything to the latest Unity Editor. Also realized I had the wrong shaders on my hairs, those are fixed and the hairs look MUCH better!
2023-05-07 17:43:11 -05:00

28 lines
684 B
C#

using UnityEngine;
using UnityEngine.InputSystem;
// This script is designed to have the OnMove and
// OnJump methods called by a PlayerInput component
public class ExamplePlayerInput : MonoBehaviour
{
Vector2 moveAmount;
public void OnMove(InputAction.CallbackContext context)
{
// read the value for the "move" action each event call
moveAmount = context.ReadValue<Vector2>();
}
public void OnJump(InputAction.CallbackContext context)
{
// your jump code goes here.
}
public void Update()
{
// to use the Vector2 value from the "move" action each
// frame, use the "moveAmount" variable here.
}
}