Skip to content

Instantly share code, notes, and snippets.

@TORISOUP
Created March 11, 2015 17:55
Show Gist options
  • Save TORISOUP/88952f23242d4e2a8cba to your computer and use it in GitHub Desktop.
Save TORISOUP/88952f23242d4e2a8cba to your computer and use it in GitHub Desktop.
InputFieldToText
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