Last active
July 8, 2018 13:46
-
-
Save hecres/ed352abfa0c435ea6d0562a027551625 to your computer and use it in GitHub Desktop.
Blog20180708_0
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
public static partial class UnityUIComponentExtensions | |
{ | |
public static IObservable<string> OnDoneAsObservable(this InputField self) | |
{ | |
return self.OnEndEditAsObservable() | |
.Where(_ => TouchScreenKeyboard.isSupported) | |
.Where(_ => self.touchScreenKeyboard.status == TouchScreenKeyboard.Status.Done) | |
.Share(); | |
} | |
public static IObservable<string> OnCanceledAsObservable(this InputField self) | |
{ | |
return self.OnEndEditAsObservable() | |
.Where(_ => TouchScreenKeyboard.isSupported) | |
.Where(_ => self.touchScreenKeyboard.status == TouchScreenKeyboard.Status.Canceled) | |
.Share(); | |
} | |
public static IObservable<string> OnLostFocusAsObservable(this InputField self) | |
{ | |
return self.OnEndEditAsObservable() | |
.Where(_ => TouchScreenKeyboard.isSupported) | |
.Where(_ => self.touchScreenKeyboard.status == TouchScreenKeyboard.Status.LostFocus) | |
.Share(); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment