Unity/UniRx/Subject
サンプル
using UniRx;
Subject<string> subject = new Subject<string>();
// イベント登録
subject.Subscribe(msg => Debug.Log("msg1:" + msg));
// イベント発行
subject.OnNext("hello");
ログ
msg1:hello
using UniRx;
Subject<string> subject = new Subject<string>();
// イベント登録
subject.Subscribe(msg => Debug.Log("msg1:" + msg));
// イベント発行
subject.OnNext("hello");
ログ
msg1:hello
|
|