Created
March 11, 2015 17:55
-
-
Save TORISOUP/88952f23242d4e2a8cba to your computer and use it in GitHub Desktop.
InputFieldToText
This file contains 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 UniRx; | |
using UnityEngine.UI; | |
namespace UniRxSamples | |
{ | |
public class InputFieldToText : MonoBehaviour | |
{ | |
[SerializeField] | |
private InputField inputField; | |
[SerializeField] | |
private Text text; | |
private void Start() | |
{ | |
inputField.onValueChange | |
.AsObservable() | |
.Where(word => word.Length > 3) | |
.Subscribe(word => | |
{ | |
text.text = word; | |
}); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment