「Unity/R3/UniRxから移植」の版間の差分
提供: 初心者エンジニアの簡易メモ
(→ObserveEveryValueChangedはEveryValueChangedへ) |
|||
行21: | 行21: | ||
参考:https://qiita.com/toRisouP/items/4344fbcba7b7e8d8ce16 | 参考:https://qiita.com/toRisouP/items/4344fbcba7b7e8d8ce16 | ||
+ | |||
+ | ==Observable.Createの置換== | ||
+ | <pre> | ||
+ | // UniRx | ||
+ | IObservable<int> isCompletedsAsObservable = Observable.Create<int>(observer => | ||
+ | { | ||
+ | return Disposable.Empty; | ||
+ | }); | ||
+ | // R3 | ||
+ | Observable<int> isCompletedsAsObservable = Observable.Create<int>(observer => | ||
+ | { | ||
+ | return Disposable.Empty; | ||
+ | }); | ||
+ | </pre> |
2024年4月2日 (火) 07:48時点における版
using置換
- using UniRx; + using R3; - using UniRx.Triggers; + using R3.Triggers; - using System;
参考:https://zenn.dev/tkada/articles/a96258e080056a
ObserveEveryValueChangedはEveryValueChangedへ
// UniRx transform.ObserveEveryValueChanged(_ => _.Count).Subscribe(count => Debug.Log(count)); // R3 Observable.EveryValueChanged(transform, _ => _.Count) .Subscribe(count => Debug.Log(count));
参考:https://qiita.com/toRisouP/items/4344fbcba7b7e8d8ce16
Observable.Createの置換
// UniRx IObservable<int> isCompletedsAsObservable = Observable.Create<int>(observer => { return Disposable.Empty; }); // R3 Observable<int> isCompletedsAsObservable = Observable.Create<int>(observer => { return Disposable.Empty; });