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

37 lines
1.2 KiB
C#

using UnityEngine;
using Sirenix.OdinInspector;
namespace StarterAssets
{
[HideMonoScript]
public class UICanvasControllerInput : MonoBehaviour
{
// public Vector2 Move { get; private set; } = Vector2.zero;
public Vector2 Move { get; private set; } = Vector2.zero;
public bool Sprint { get; private set; } = false;
public bool Jump { get; private set; } = false;
public bool Attack { get; private set; } = false;
public void VirtualMoveInput(Vector2 value) => Move = value.normalized;
public void VirtualSprintInput(bool value) => Sprint = value;
public void VirtualJumpInput(bool value) => Jump = value;
public void VirtualAttackInput(bool value) => Attack = value;
// #if UNITY_EDITOR
// private void Update()
// {
// if(_pcInput is false)
// return;
// _handler.MoveInput(new Vector2(Input.GetAxis("Horizontal"), Input.GetAxis("Vertical")).normalized);
// _handler.JumpInput(Input.GetKeyDown(KeyCode.Space));
// _handler.SprintInput(Input.GetKey(KeyCode.LeftShift));
// }//Update() end
// #endif
}//class end
}//namespace end