Unity3D 登陆页激活输入框后半屏显示

我们需要获得InputField是否被激活,这样就可以用来做很多事情。

代码引用

//判断inputfiled是否被激活
    private bool isFocusOnInputField ()
    {
        if (EventSystem.current.currentSelectedGameObject == null)
            return false;
        if (EventSystem.current.currentSelectedGameObject.GetComponent () != null)
            return true;
        return false;
    }

你可能感兴趣的:(Unity3D 登陆页激活输入框后半屏显示)