Esempio n. 1
0
 private void OnApplicationPause(bool val)
 {
     if (val)
     {
         //game is pause
         //remove sensor event listener
         if (pedometerPlugin != null)
         {
             pedometerPlugin.RemoveSensorListener();
         }
     }
     else
     {
         //game is resume
         //register sensor event listener
         if (pedometerPlugin != null)
         {
             pedometerPlugin.RegisterSensorListener();
         }
     }
 }
Esempio n. 2
0
 private void OnApplicationPause(bool val)
 {
     if (val)
     {
         //game is pause
         //remove sensor event listener
         if (pedometerPlugin != null)
         {
             pedometerPlugin.RemoveSensorListener();
         }
     }
     else
     {
         //game is resume
         //register sensor event listener
         if (pedometerPlugin != null)
         {
             pedometerPlugin.ResetTotalStep();
             //register sensor event listener and pass sensor delay that you want
             pedometerPlugin.RegisterSensorListener(SensorDelay.SENSOR_DELAY_FASTEST);
         }
     }
 }