Пример #1
0
        private Vibrations()
        {
            try {
#if UNITY_ANDROID && !UNITY_EDITOR
                mVibro = new AndroidVibrations();
#elif (UNITY_IOS || UNITY_IPHONE) && !UNITY_EDITOR
                mVibro = new IosVibrations();
#endif
                if (mVibro == null)
                {
                    mVibro = new DefaultVibrationsAsLog();
                    //Debug.Log("Initialized default log vibration system");
                }
            } catch (Exception ex) {
                throw new Exception("Vibrations constructor must be called after the Player is initialized", ex);
            }
        }
Пример #2
0
 public Vibrations()
 {
     try {
         if (AndroidVibrations.IsActive())
         {
             vibro = new AndroidVibrations();
         }
         else
         {
             vibro = new DefaultVibrationsAsLog();
             MonoBehaviour.print("Initialized default log vibration system");
         }
     }
     catch (Exception ex) {
         throw new Exception("Vibrations constructor must be called after the Player is initialized", ex);
     }
 }