private void HandleAccelEvent(EmulatorAccelEvent accelEvent)
 {
     lock (state)
     {
         state.accel = ConvertEmulatorAccel(accelEvent.value);
     }
 }
Ejemplo n.º 2
0
 private void ProcessEventAtEndOfFrame(PhoneEvent e) {
   switch (e.Type) {
     case PhoneEvent.Types.Type.MOTION:
       EmulatorTouchEvent touchEvent = new EmulatorTouchEvent(e.MotionEvent, lastDownTimeMs);
       onTouchEvent(touchEvent);
       if (touchEvent.getActionMasked() == EmulatorTouchEvent.Action.kActionDown) {
         lastDownTimeMs = e.MotionEvent.Timestamp;
       }
       break;
     case PhoneEvent.Types.Type.GYROSCOPE:
       EmulatorGyroEvent gyroEvent = new EmulatorGyroEvent(e.GyroscopeEvent);
       onGyroEvent(gyroEvent);
       break;
     case PhoneEvent.Types.Type.ACCELEROMETER:
       EmulatorAccelEvent accelEvent = new EmulatorAccelEvent(e.AccelerometerEvent);
       onAccelEvent(accelEvent);
       break;
     case PhoneEvent.Types.Type.ORIENTATION:
       EmulatorOrientationEvent orientationEvent =
           new EmulatorOrientationEvent(e.OrientationEvent);
       onOrientationEvent(orientationEvent);
       break;
     case PhoneEvent.Types.Type.KEY:
       EmulatorButtonEvent buttonEvent = new EmulatorButtonEvent(e.KeyEvent);
       onButtonEvent(buttonEvent);
       break;
     default:
       Debug.Log("Unsupported PhoneEvent type: " + e.Type);
       break;
   }
 }
Ejemplo n.º 3
0
 private void onAccelEvent(EmulatorAccelEvent e)
 {
     currentAccelEvent = e;
     if (accelEventListenersInternal != null)
     {
         accelEventListenersInternal(e);
     }
 }
Ejemplo n.º 4
0
 private void ProcessEventAtEndOfFrame(PhoneEvent e)
 {
     switch (e.Type) {
     case PhoneEvent.Types.Type.MOTION:
       EmulatorTouchEvent touchEvent = new EmulatorTouchEvent(e.MotionEvent, lastDownTimeMs);
       onTouchEvent(touchEvent);
       if (touchEvent.getActionMasked() == EmulatorTouchEvent.Action.kActionDown) {
     lastDownTimeMs = e.MotionEvent.Timestamp;
       }
       break;
     case PhoneEvent.Types.Type.GYROSCOPE:
       EmulatorGyroEvent gyroEvent = new EmulatorGyroEvent(e.GyroscopeEvent);
       onGyroEvent(gyroEvent);
       break;
     case PhoneEvent.Types.Type.ACCELEROMETER:
       EmulatorAccelEvent accelEvent = new EmulatorAccelEvent(e.AccelerometerEvent);
       onAccelEvent(accelEvent);
       break;
     case PhoneEvent.Types.Type.ORIENTATION:
       EmulatorOrientationEvent orientationEvent =
       new EmulatorOrientationEvent(e.OrientationEvent);
       onOrientationEvent(orientationEvent);
       break;
     case PhoneEvent.Types.Type.KEY:
       EmulatorButtonEvent buttonEvent = new EmulatorButtonEvent(e.KeyEvent);
       onButtonEvent(buttonEvent);
       break;
     default:
       Debug.Log("Unsupported PhoneEvent type: " + e.Type);
       break;
       }
 }
Ejemplo n.º 5
0
 private void onAccelEvent(EmulatorAccelEvent e)
 {
     currentAccelEvent = e;
       if (accelEventListenersInternal != null) {
     accelEventListenersInternal(e);
       }
 }
 private void HandleAccelEvent(EmulatorAccelEvent accelEvent) {
   lock (state) {
     state.accel = ConvertEmulatorAccel(accelEvent.value);
   }
 }