Google Daydream Keyboard Unity UI TextInput?

坚强是说给别人听的谎言 提交于 2019-12-13 07:10:15

问题


I am attempting to create an input field in a google daydream app using the latest Google VR SDK for Unity and Unity 5.4.2.

I am wondering if someone may have insight into integrating the Daydream Keyboard. I can place a canvas and input field but when I run the application on the Pixel and Daydream View, and select the inputfield the standard android keyboard renders.

I am not sure if the Daydream Keyboard needs to be integrated separately in unity.

The Daydream keyboard is installed and is functional on published daydream apps.


回答1:


Nope, the official Daydream Keyboard is not Unity ready, see https://forum.unity3d.com/threads/daydream-keyboard-in-unity.441448/




回答2:


You can download the GoogleVR SDK, and you will find the keyboard demo scene inside GoogleVR/Demos/Scenes. From there, you can use the prefabs given for keyboard.

Apart from this, you can use the free asset "CurvedKeyboard" from asset store.

To handle the android default keyboard, you can do something like this.

  public class SomeClass:MonoBehaviour
{
    private TouchScreenKeyboard defaultKeyboard;
void Start () 
    {
        defaultKeyboard = TouchScreenKeyboard.Open ("", TouchScreenKeyboardType.Default);
        defaultKeyboard.active = false;
}

public void didClickOnTextField()
    {
        defaultKeyboard.active = false;
    }
}


来源:https://stackoverflow.com/questions/40614674/google-daydream-keyboard-unity-ui-textinput

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!