Open wodndb opened 3 years ago
Hi there,
I found some other example on github using .ToReactiveProperty()
method over IntReactiveProperty
field.
The Rider IDE suggested 2 solutions:
IntReactiveProperty
to IReadOnlyReactiveProperty
as you mentioned, andas ReactiveProperty<int>
And these 2 solutions make new 2 problems:
SetValueAndForceNotify(0)
method over that IntReactiveProperty
. And it's impossible to call it if I change IntReactiveProperty
to IReadOnlyReactiveProperty
NullReferenceException: Object reference not set to an instance of an object
when I start the gameI'm super confused 🤯😁
I find example code (Examples/Sample12_ReactiveProperty.cs) in UniRx v7.1.0
In this example code, type of IsDead
is IReadOnlyReactiveProperty<bool>
.
I think that it's an answer for this issue.
Also Rider IDE 2021.2.1 suggested this.
Hi,
I want to study about MV(R)P Pattern based UniRx. So I test MV(R)P Example in readme.
ToReactiveProperty
method returnIReadOnlyReactiveProperty<T>
. However IsDead property in Enemy class isReactiveProperty<T>
. So source code in example is not working.I change a type of IsDead to
IReadOnlyReactiveProperty<bool>
and the code works well without error.Modified source code.
Actually I can't be sure that this source code is right...
Could anybody feedback this source code and update the example?
Thanks.