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 }
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); } }
private void OnDestroy() { instance = null; threadSafeCallbacks.Clear(); }
void OnDestroy() { instance = null; }