You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Amazing library!
I've found one weird thing. I'm not sure if this is a bug, but ReactiveProperty will ignore changes to its value if the changes happen based on the value pre-subscription.
example bellow
using R3;
using UnityEngine;
public class AsyncTest : MonoBehaviour
{
private readonly ReactiveProperty<int> a = new();
private void Start()
{
var d = Disposable.CreateBuilder();
a.Do(v => Debug.Log($"a {v}")).Do(v =>
{
if (v < 20)
{
a.Value += 1;
}
}).Subscribe().AddTo(ref d);
Debug.Log($"a == 1: {a.CurrentValue == 1}"); // this should be 20, not 1!
a.Value = 0; // this
Debug.Log($"a == 20: {a.CurrentValue == 20}"); // this is correct
d.RegisterTo(destroyCancellationToken);
}
}
The text was updated successfully, but these errors were encountered:
Amazing library!
I've found one weird thing. I'm not sure if this is a bug, but ReactiveProperty will ignore changes to its value if the changes happen based on the value pre-subscription.
example bellow
The text was updated successfully, but these errors were encountered: