neuecc / UniRx

Reactive Extensions for Unity
MIT License
7.1k stars 889 forks source link

[Bug] Odd behaviour in ReactiveProperty #483

Open crystalbyte opened 3 years ago

crystalbyte commented 3 years ago

Running the latest version of UniRx , just found this image

I don't think null should count as a value, shouldn't it?

daveparoxe commented 3 years ago

I think it's because the value is a destroyed UnityEngine.Object. Unity fakes null for destroyed Object. That's why you can check if an object is destroyed by using "obj == null". If you really want to check if the value is null and not just fake null you can use ReferenceEquals(obj, null).