neuecc / UniRx

Reactive Extensions for Unity
MIT License
7.09k stars 890 forks source link

Handle Upgrade .NET 4.6 #177

Open neuecc opened 8 years ago

neuecc commented 8 years ago

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.

and others or request, suggest to me?

neuecc commented 8 years ago

Released Ver5.5.0 https://github.com/neuecc/UniRx/releases/tag/5.5.0 is the first experimental release.

mrserverless commented 7 years ago

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.

aelr commented 7 years ago

Another suggestion would be covariance/contravariance. I noticed this comment recently, indicating it was on somebody's mind.

grofit commented 7 years ago

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).

NoxMortem commented 7 years ago

Am I correct, that I need to explicitly use UniRX.Tuple<T1,T2> and UniRx.IObservable where it nameclashes with System.Tuple<T1,T2> and System.IObservable. It seems obvious for me, but I wanted to be sure.

mehmetakbulut commented 6 years ago

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.

grofit commented 6 years ago

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).

cpetry commented 6 years ago

Like @NoxMortem I have trouble using UniRx with .Net 4.6. How exactly do I use FromObservable with the IObserver parameter?

dzmitry-lahoda commented 5 years ago

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.

MartinGonzalez commented 5 years ago

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.