Created
July 15, 2016 11:52
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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