DroneSimulator/DeviceInfo.cs

31 lines
583 B
C#

using TMPro;
using UnityEngine;
using UnityEngine.InputSystem;
public class DeviceInfo : MonoBehaviour
{
[SerializeField] private TMP_Text _text;
void Update()
{
if (DebugMode.IsWork)
{
ShowInfo();
}
}
private void ShowInfo()
{
_text.text = InputController.UseDevice.name;
byte[] bytes = (byte[])InputController.UseDevice.ReadValueAsObject();
Debug.Log(bytes.Length);
for (int i = 0; i < bytes.Length; i++)
{
_text.text += $"{i} = {bytes[i]} \n";
}
}
}