Ejemplo n.º 1
0
        static internal IKeyboardProvider CreateKeyboardProvider(GvrKeyboard owner)
        {
#if UNITY_EDITOR
            return(new EmulatorKeyboardProvider());
#elif UNITY_ANDROID && UNITY_HAS_GOOGLEVR
            return(new AndroidNativeKeyboardProvider());
#else
            // Other platforms not supported, including iOS and Unity versions w/o the native integraiton.
            Debug.LogWarning("Platform not supported");
            return(new DummyKeyboardProvider());
#endif  // UNITY_EDITOR
        }
        static internal IKeyboardProvider CreateKeyboardProvider(GvrKeyboard owner)
        {
// Use emulator in editor.
#if UNITY_EDITOR
            return(new EmulatorKeyboardProvider());
#elif UNITY_ANDROID
            // Running on an Android device.
            return(new AndroidNativeKeyboardProvider());
#else
            // Other platforms not supported, including iOS and Unity versions w/o the native integraiton.
            Debug.LogWarning("GVR Keyboard not supported on " + Application.platform);
            return(new DummyKeyboardProvider());
#endif  // UNITY_EDITOR
        }
Ejemplo n.º 3
0
 void Awake()
 {
     if (instance != null)
     {
         Debug.LogError("More than one GvrKeyboard instance was found in your scene. "
                        + "Ensure that there is only one GvrKeyboard.");
         enabled = false;
         return;
     }
     instance = this;
     if (keyboardProvider == null)
     {
         keyboardProvider = KeyboardProviderFactory.CreateKeyboardProvider(this);
     }
 }
Ejemplo n.º 4
0
 private void OnDestroy()
 {
     instance = null;
     threadSafeCallbacks.Clear();
 }
Ejemplo n.º 5
0
 void OnDestroy()
 {
     instance = null;
 }