Created
June 1, 2019 09:52
-
-
Save aprius/f15d77e81e2afad85d6ef7e0bee04e28 to your computer and use it in GitHub Desktop.
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
//Not push first OnNext same ReactiveProperty<T> | |
//Debug.Log("HAHAHA : " + _); not run until Method ChangeCurrent() Call | |
private SubjectProperty<int> _current = new SubjectProperty<int>(); | |
private IDisposable _disposable; | |
public void Start() | |
{ | |
_disposable = _current.Subscribe(_ => | |
{ | |
if (_current.Value > 10) | |
{ | |
_disposable.Dispose(); | |
} | |
Debug.Log("HAHAHA : " + _); | |
_current.Value++; | |
}); | |
} | |
[NaughtyAttributes.Button()] | |
public void ChangeCurrent() | |
{ | |
_current.Value++; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment