32 lines
911 B
C#
32 lines
911 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.InputSystem;
|
|
|
|
[CreateAssetMenu(fileName = "KeyboardInput", menuName = "PlayerInput/KeyboardInput")]
|
|
public class KeyboardPlayerInput : PlayerInputReference
|
|
{
|
|
public InputActionReference BoostInput;
|
|
public InputActionReference HorizontalInput;
|
|
|
|
private DeviceDisconnectController deviceDisconnect;
|
|
|
|
public override bool Boost()
|
|
{
|
|
Debug.Log($"{BoostInput}:{BoostInput.action}:{BoostInput.action.inProgress}");
|
|
return BoostInput.action.inProgress;
|
|
}
|
|
|
|
public override float Horizontal()
|
|
{
|
|
return -HorizontalInput.action.ReadValue<Vector2>().x;
|
|
}
|
|
|
|
public override void Init()
|
|
{
|
|
GameManager.Instance.OnStartGame();
|
|
deviceDisconnect = FindObjectOfType<DeviceDisconnectController>();
|
|
deviceDisconnect.enabled = false;
|
|
}
|
|
}
|