void Worker() { while (true) { state.Enqueue(ICadeNative.GetState()); Thread.Sleep(timeStep); } }
void SetActive(bool value) { if (active != value) { active = value; ICadeNative.SetActive(active); if (active) { StartWorker(); InputManager.AttachDevice(device); } else { StopWorker(); InputManager.DetachDevice(device); } } }