Exemplo n.º 1
0
        private static void InitializeActivePollEmulator()
        {
            Console.WriteLine("MikuComfy");

            var emulator = new InputEmulator();

            emulator.LoopUpdateEmulateInput();
        }
Exemplo n.º 2
0
    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);
        }
    }
Exemplo n.º 3
0
    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);
    }
Exemplo n.º 4
0
        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;
            }
        }