Slide 19
Slide 19 text
一例の紹介:時間経過によるイベント開始
private void Start()
{
StartCoroutine(HogeCoroutine());
}
private IEnumerator HogeCoroutine()
{
while(true)
{
yield return new WaitForSeconds(1);
// 1秒ごとの処理
Debug.Log(“1秒ごとの処理”);
}
}
private void Start()
{
// 1秒ごとの処理
Observable.Interval(TimeSpan.FromSeconds(1))
.Subscribe(_ => Debug.Log(“1秒ごとの処理”));
}
before after(UniRx使用)