Unirx
1 OnNext & SubScribe
Subject<string> subject = new Subject<string>();
subject.Subscribe(msg => Debug.Log("Subscribe1:" + msg + "\n"));
subject.Subscribe(msg => Debug.Log("Subscribe2:" + msg + "\n"));
subject.Subscribe(msg => Debug.Log("Subscribe3:" + msg + "\n"));
subject.OnNext("hello 001");
subject.OnNext("hello 002");
subject.OnNext("hello 003");Subscribe1:hello 001
Subscribe2:hello 001
Subscribe3:hello 001
Subscribe1:hello 002
Subscribe2:hello 002
Subscribe3:hello 002
Subscribe1:hello 003
Subscribe2:hello 003
Subscribe3:hello 0032 一些示例
2.1 计时器
2.2 Update
2.3 Where
2.4 每秒输出一次
2.5 实现 mvc架构
3 生命周期增强版
4 AddTo
4.1 事件流主动取消注册
4.2 AddTo
5 Subject
6 将事件转为 Observable
6.1 UnityEvent
6.2 event Action
7 MessageBroker
Last updated