public static DeviceState GetState(int index) { DeviceState retState = new DeviceState(); #if !UNITY_EDITOR && UNITY_WSA lock (DeviceConnect.states) { if (index >= 0 && index < DeviceConnect.states.Count) { lock (DeviceConnect.states[index]) { retState.AssignFrom(DeviceConnect.states[index], false); } } } #endif return(retState); }
private static void OpenDevice(string dId) { DeviceState newState = null; lock (states) { foreach (DeviceState ds in states) { if (ds.DeviceId == dId) { return; } } newState = new DeviceState(); states.Add(newState); } if (newState != null) { newState.OpenDevice(dId); } }