リポジトリ
使用例
using UniSoftwareKeyboardArea;
using UnityEngine;
using UnityEngine.UI;
public class Test : MonoBehaviour
{
public CanvasScaler m_canvasScaler;
public RectTransform m_rectTransform;
private void Update()
{
var rate = m_canvasScaler.referenceResolution.y / Screen.height;
var pos = m_rectTransform.anchoredPosition;
pos.y = SoftwareKeyboardArea.GetHeight( true ) * rate;
m_rectTransform.anchoredPosition = pos;
}
private void OnGUI()
{
GUILayout.Label( SoftwareKeyboardArea.GetHeight( true ).ToString() );
}
}
謝辞
- このリポジトリは下記のサイト様を参考にさせていただいております