I'm applying reactive programming to the Unity3D project.
Entering a character in InputField enables the button and disables it if there are no characters. Can this logic be processed in one stream using UniRx.Observable?
inputID.OnValueChangedAsObservable()
.Where(x => string.IsNullOrEmpty(x) == false)
.Subscribe(_ => buttonLogin.gameObject.SetActive(true));
inputID.OnValueChangedAsObservable()
.Where(x => string.IsNullOrEmpty(x) == true)
.Subscribe(_ => buttonLogin.gameObject.SetActive(false));
Can combine these two logics into one logic?
Please reply. Thank you.