Skip to content

Instantly share code, notes, and snippets.

@miyaoka
Last active August 29, 2015 14:23
Show Gist options
  • Save miyaoka/aa419249ec5d4cd94ce6 to your computer and use it in GitHub Desktop.
Save miyaoka/aa419249ec5d4cd94ce6 to your computer and use it in GitHub Desktop.
transform.childCount to ReactiveProperty
//子オブジェクト数の変更を監視
var childCount =
transform
.ObserveEveryValueChanged (t => t.childCount)
.ToReactiveProperty ();
childCount
.Subscribe(c => hoge);
// transformに子オブジェクトが無い(transform.childCount == 0)状態で開始したとき
// UniRx4.8: OnNext発生する
// UniRx4.8.1: OnNext発生しない
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment