using System.Collections; using System.Collections.Generic; using Unity.VisualScripting; using UnityEngine; public class DeviceManager : MonoBehaviour { // Start is called before the first frame update void Start() { devices = new List(); UDE_API.UDE_Init(); UDE_API.StartEnumDevices(); } private float time = 3; private List devices; // Update is called once per frame void Update() { if (time < 0) { if (devices.Count < 2) { devices = UDE_API.GetDeviceList(); return; } UDE_API.StopEnumDevices(); //if (string.IsNullOrEmpty(Com_L.DeviceName)) //{ // if (devices[0].Contains("L")) // { // Com_L.DeviceName = devices[0]; // } // else // { // Com_L.DeviceName = devices[1]; // } // time = 3; // return; //} //if (string.IsNullOrEmpty(Com_R.DeviceName)) //{ // if (devices[0].Contains("R")) // { // Com_R.DeviceName = devices[0]; // } // else // { // Com_R.DeviceName = devices[1]; // } // time = 4; //} } if (time > 3) { return; } time -= Time.deltaTime; } }