예제 #1
0
 /// <summary>
 /// Public method used by a toggle on the canvas. It simulates a gaze on the phone while the user is actively in the messaging view.
 /// </summary>
 /// <param name="isViewing">Is the recipient viewing the messaging thread?</param>
 public void OnActiveView(bool isViewing)
 {
     if (isViewing) //if the recipient is viewing the messages
     {
         //play haptics
         if (Vibration.HasVibrator())
         {
             hapticRoutine = VibrateHeartBeat(); //store an instance of the coroutine for later use
             StartCoroutine(hapticRoutine);
         }
     }
     else
     {
         //stop haptics
         if (Vibration.HasVibrator())
         {
             StopCoroutine(hapticRoutine);
         }
     }
 }
 private void PhoneAdeTakVibrator()
 {
     text4.text = "PHONE HAS VIBRATOR: " + Vibration.HasVibrator().ToString().ToUpper();
 }