Created
July 7, 2015 09:23
-
-
Save hacha/8bfb174f9722492a83d1 to your computer and use it in GitHub Desktop.
こういうコンポーネントを持つオブジェクトを、ストリーム発火前にDestoryするとUniRx内でInvalidOperationExceptionが発生するっぽい
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
using UnityEngine; | |
using System.Collections; | |
using UniRx; | |
using UniRx.Triggers; | |
public class Test : MonoBehaviour | |
{ | |
void Start () | |
{ | |
var key = this.UpdateAsObservable() | |
.Where(_ => Input.GetKeyDown(KeyCode.A)) | |
.First() | |
.Subscribe(_ => Debug.Log("test")); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
First() は空のストリームではエラーだ、空かどうかが判明するのは OnComplete() のときだ。