Open neuecc opened 8 years ago
Released Ver5.5.0 https://github.com/neuecc/UniRx/releases/tag/5.5.0 is the first experimental release.
hi @neuecc not sure if you are already aware of the plugin: https://bitbucket.org/alexzzzz/unity-c-5.0-and-6.0-integration/ which adds support for C# 5, 6, and 7 to be used.
It's pretty cool, features such as async/await
, local functions
and tuples
etc can all be made available in Unity on 5.5
and 5.6beta
.
Another suggestion would be covariance/contravariance. I noticed this comment recently, indicating it was on somebody's mind.
I did ask this in chat but no one seems to be biting at the moment, as part of the 4.6 update is there any chance to use some of the .net System.Reactive
assemblies? as currently unirx provides a load of good stuff which overlaps heavily with what System.Reactive
provides (i.e linq), so given the 4.6 update will the standard System.Reactive
assemblies work with unity, and if so could we just have unirx depend upon those for some of the stuff (reducing the amount of code you need to maintain)?
As for me the value with UniRx comes from the unity specific extensions (EveryUpdate etc), UI/MB hooks as well as ReactiveProperties and MessageBroker, so if there was a way to keep compatibility with the normal .net rx libs and just add the unity specific helpers on top of that, it would make it far easier to maintain this lib going forward as about 75% of your codebase vanishes and is delegated to the normal .net one (assuming it works in unity).
Am I correct, that I need to explicitly use UniRX.Tuple<T1,T2> and UniRx.IObservable
Just wanted to echo what @grofit said. It would be great if we can install System.Reactive
as the base for ReactiveX and then extend it with UniRx
.
@NoxMortem I believe if you are using 2017.2+ and UniRx 5.5.0+, you can just use the types within the System
namespace. If you are using an earlier version, then it might make sense to use the old UniRx types.
Any updates on using more default rx and extending it with unirx?
There have been mentions on the gitter chat that there would be some GC issues doing this, but most of them seem to point to the .net Observable implementations, so I am not sure if a quick fix for this would be to just do as the JSON.Net chaps do and just use same namespaces as the default .net ones? Then this way if you are using .net the dll referenced would work fine, and if you used unirx the same namespaces would be available via the scripts (or nuget package, not sure if thats maintained).
Like @NoxMortem I have trouble using UniRx with .Net 4.6. How exactly do I use FromObservable with the IObserver parameter?
i see that unirx for net standard is compiled with observable from system https://github.com/neuecc/UniRx/blob/e015962d01a07a82bfa81d87e4429e679bb5a517/Assets/Plugins/UniRx/Scripts/System/IObservable.cs . i guess it may be possible to drop this cs file in some nearest future as unity now .net standard 2.0 and seems will be 2.1 either.
I'm having a weird situation, where in two different projects, same Unity version, same UniRx version, I'm having the ambiguous CancellationToken error only in one of them. I've changed to 4.x and 3.x and there is no difference.
How can be that possible?
EDIT: I found what was the problem, Firebase brings a Unity.Task dll and creates the ambiguous.
Upgraded Mono/.Net in Editor on 5.5.0b4 https://forum.unity3d.com/threads/upgraded-mono-net-in-editor-on-5-5-0b4.433541/
Unity has been starting .NET Framework upgrade.
System.IObservable<T>, IObserver<T>
instead ofUniRx.IObservable<T>, IObserver<T>
System.Tuple
instad ofUniRx.Tuple
(but lost ValueType tuple, should we create other tuple?)System.IProgress<T>
instead ofUniRx.Progress
System.Threading.CancellationToken
instead ofUniRx.CancellationToken
GetAwaiter
to UniRx for supports async/await for IObservableUniRxSynchronizationContext
to support async/await completlyand others or request, suggest to me?