【Unity】【UniRx】ReactiveDictionary で辞書を監視する

using UnityEngine;
using UniRx;

public class Sample : MonoBehaviour
{
    private ReactiveDictionary<int, string> _intDictionary = new ReactiveDictionary<int, string>();
    
    private void Start()
    {
        // 辞書を購読する
        this._intDictionary
            .ObserveAdd()
            .Subscribe(value =>
            {
                Debug.Log($"[Add]Key={value.Key},Value={value.Value}");
            });
        this._intDictionary
            .ObserveRemove()
            .Subscribe(value =>
            {
                Debug.Log($"[Remove]Key={value.Key},Value={value.Value}");
            });
        this._intDictionary
            .ObserveReplace()
            .Subscribe(value =>
            {
                Debug.Log($"[Replace]Key={value.Key},NewValue={value.NewValue},OldValue={value.OldValue}");
            });
        this._intDictionary
            .ObserveReset()
            .Subscribe(value =>
            {
                Debug.Log($"[Reset]");
            });
            

        // 値を変える
        this._intDictionary.Add(0, "1st");
        this._intDictionary.Add(1, "2nd");
        this._intDictionary.Add(2, "3rd");
        this._intDictionary.Remove(0);
        this._intDictionary.Clear();
    }
}