private static void InitializeActivePollEmulator() { Console.WriteLine("MikuComfy"); var emulator = new InputEmulator(); emulator.LoopUpdateEmulateInput(); }
private void touchActionDetect() { if (InputEmulator.getTouchDown()) { firstVectorFingerDown = Utils.convertInputVector(myCamera.ScreenToWorldPoint(Input.mousePosition)); // Debug.Log("Finger Position Down : " + firstVectorFingerDown); } if (InputEmulator.getTouchDown()) { lastVectorFingerUp = Input.mousePosition; // Debug.Log("Finger Position Up : " + lastVectorFingerUp); } }
private GameObject getObjectTouch() { if (InputEmulator.getTouchDown()) { RaycastHit hit; Ray ray = myCamera.ScreenPointToRay(myCamera.WorldToScreenPoint(firstVectorFingerDown)); Debug.DrawRay(ray.origin, ray.direction * 10, Color.red); // Instantiate(testCube, firstVectorFingerDown, Quaternion.identity ); if (Physics.Raycast(ray, out hit)) { // Transform objectHit = hit.transform; // Do something with the object that was hit by the raycast. return(hit.transform.gameObject); } return(null); } return(null); }
private void PollInputOverride() { performanceWatch.Restart(); if (emulator == null) { emulator = new InputEmulator() { LogToConsole = false, CheckProcessActiveStopwatch = Stopwatch.StartNew(), }; } if (emulator.CheckProcessActiveStopwatch.Elapsed >= InputEmulator.ProcessActiveCheckInterval) { emulator.IsDivaActive = emulator.MemoryManipulator.IsAttachedProcessActive(); emulator.CheckProcessActiveStopwatch.Restart(); } try { emulator.UpdateEmulatorInputTick(isProcessActive: emulator.IsDivaActive); } catch (Exception exception) { server.ReportException(exception); throw; } if (checkSetCursor) { ShowCursor(); checkSetCursor = false; } performanceWatch.Stop(); if (performanceCounter++ > 120) { //server.ReportMessage($"{performanceWatch.Elapsed.TotalMilliseconds}ms"); performanceCounter = 0; } }