Skip to content

Instantly share code, notes, and snippets.

@divide-by-zero
Created July 15, 2016 11:52
Show Gist options
  • Save divide-by-zero/ae2d82b5f4db7d03e14e93a708484723 to your computer and use it in GitHub Desktop.
Save divide-by-zero/ae2d82b5f4db7d03e14e93a708484723 to your computer and use it in GitHub Desktop.
Unity標準UIのInputFieldはScroll出来ないので対処法 ref: http://qiita.com/divideby_zero/items/7cb32ac1c0b74be9ba6c
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.UI;
public class ScrollableInputField : MonoBehaviour
{
[SerializeField]
private InputField _targetInputField;
[SerializeField]
private Button _guardButton;
public UnityEvent OnFocus = new UnityEvent();
void Start ()
{
_guardButton.onClick.AddListener(() =>
{
_targetInputField.ActivateInputField();
OnFocus.Invoke();
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment