Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Unity Future .NET Development Status

Discussion in 'Experimental Scripting Previews' started by JoshPeterson, Apr 13, 2021.

  1. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,334
    Now you have just made all code more verbose and clunky, and broken backwards compatibility. I don't quite know what you gained?
     
  2. steego

    steego

    Joined:
    Jul 15, 2010
    Posts:
    969
    Another fun thing I recently came across, if all you have is an interface reference, you have to cast it to component to check it for null
    Code (csharp):
    1.  
    2. IMyInterface? thing = GetThingSomehow();
    3. Destroy(objectThatHasThing);
    4. if (thing == null) ThisIsNotNull();
    5. if (thing is Component component && component == null) ItsActuallyNull();
    6.  
     
  3. BlackclawsK

    BlackclawsK

    Joined:
    Jan 9, 2019
    Posts:
    100
    Ah, no I don't mean to replace GameObject, but to introduce a wrapper that does not do fake null for _its_ GameObject reference stored in actualObject. Since the wrapper is something the engine gives you it can just set the reference to true null on destruction of the GameObject/Behaviour.
     
  4. JoNax97

    JoNax97

    Joined:
    Feb 4, 2016
    Posts:
    611
    Hey, maybe I'm asking something utterly stupid but, is there a definite technical reason why .NET doesn't allow overriding the implementation of the
    is null 
    / coalescence operators?

    If there's not, maybe Unity could 'just' talk Microsoft into allowing it? that way Unity can continue with its unique setup in a way consistent with the modern C# landscape
     
  5. Neto_Kokku

    Neto_Kokku

    Joined:
    Feb 15, 2018
    Posts:
    1,751
    UnityEngine.Object is a wrapper already: it contains an internal reference to a C++ object, which is the thing that can be actually destroyed. What the null comparison and bool cast operators do is ask the C++ side if that reference is still valid (not null and not marked for destruction).

    In terms of nullability, UnityEngine.Object types are similar to working with IDisposable types: just checking if the reference is null is not enough and you still need to deal with the possibility of references to disposed objects
     
  6. BlackclawsK

    BlackclawsK

    Joined:
    Jan 9, 2019
    Posts:
    100
    The way the custom null check works is by overriding the comparison operator for UnityEngine.Object to other objects.

    is null as well as ?? _cannot_ fall back on these operators as they are fundamentally doing something different, namely checking for true null.

    Essentially the object is not true null and only due to the comparison operator returns true when compared to null. Its just a completely different concept. Is null as well as ?? are language keywords. Its the same as asking dotnet to implement custom switch statements for types.

    In general its actually _good_ that you have a way to easily check for true null using "is null". The problem I see right now is that for example GetComponent returns a non-null value in Editor in weird circumstances.
     
  7. bene82

    bene82

    Joined:
    Jun 11, 2020
    Posts:
    10
    In my opinion the Unity "fake" null and Nullable Reference Annotations are two different things.
    But even if you thing about it as same things then you will find that it does not matter.


    1. Unity "fake" null

    The Unity "fake" null object is a real C# object, which does not have a reference to an internal native C++ object.
    So you can access all members defined in C# (own script code) but you cannot access members which defines Unity (MissingReferenceException will be thrown).
    Unity overloads operators `==` and `!=`. The result of these operators depends on existence the native C++ object.

    If the native C++ object does not exist then there is not a reason to use the real C# object. For you, there is not difference between the real null and the Unity "fake" null object.
    This is the reason why Unity overloads these operators.


    2. Nullable Reference Annotations

    See the declaration `public Component? GetComponent(Type type);`.

    The declaration says that the `GetComponent` method returns null (real null) or a object which is instance of the type. The documentation says exactly that.
    If you call the method with a type which the GameObject does not have, then the method returns null (real null) else the method returns a C# object.
    The declaration says nothing about overloading operators of the object. Even if you overload operators that (object == null -> true) and (object != null -> true),
    which is absolute nonsense, the contract `Component?` is still valid because the returned object is instance of the Component!
    No matter if the object has or does not have a reference to a native C++ object.


    3. Usage

    Code (CSharp):
    1. SampleMonoBehaviour com = null;
    2.  
    3. Debug.Log("GetComponent");
    4. com = GetComponent<SampleMonoBehaviour>();
    5.  
    6. Debug.Log($"com == null: {com == null}"); // False
    7. Debug.Log($"com != null: {com != null}"); // True
    8. Debug.Log($"com is object: {com is object}"); // True
    9.  
    10. Debug.Log("Destroy");
    11. DestroyImmediate(com);
    12.  
    13. Debug.Log($"com == null: {com == null}"); // True
    14. Debug.Log($"com != null: {com != null}"); // False
    15. Debug.Log($"com is object: {com is object}"); // True because com is the Unity "fake" null
    16. // If you call com.GetComponent<Transform>() then MissingReferenceException will be thrown.
    17.  
    18. Debug.Log("Null");
    19. com = null;
    20.  
    21. Debug.Log($"com == null: {com == null}"); // True
    22. Debug.Log($"com != null: {com != null}"); // False
    23. Debug.Log($"com is object: {com is object}"); // False because com is the real null
    24. // If you call com.GetComponent<Transform>() then NullReferenceException will be thrown. Note difference with the Unity "fake" null.
    25.  
    26. Debug.Log("GetComponent");
    27. com = GetComponent<SampleMonoBehaviour>();
    28.  
    29. Debug.Log($"com == null: {com == null}"); // True
    30. Debug.Log($"com != null: {com != null}"); // False
    31. Debug.Log($"com is object: {com is object}"); // False because com is the real null
    As you can see, if the real C# object does not have a reference to a native C++ object then the `GetComponent` method returns real null.

    Edit: If call GetComponent<MeshCollider>() on a Gameobject that does not have one attached _in the editor_ that is the important part. The methot returns the Unity "fake" null object!

    But even the Unity "fake" null object will be returned, you still write if (com != null) ... and the result will be same.
     
    Last edited: Mar 17, 2022
    Huszky likes this.
  8. Mindstyler

    Mindstyler

    Joined:
    Aug 29, 2017
    Posts:
    248
    If the returned object (non null) get's destroyed before you access it, and you then check with coaelescing or is null (because with nullable annotations you CAN NOT ask anyone to use the operator overloads for null checking), you will get exceptions.
     
  9. TheZombieKiller

    TheZombieKiller

    Joined:
    Feb 8, 2013
    Posts:
    265
    Minor side note: TryGetComponent will never give you a fake null object, so you can use that to implement this method without paying the cost of an allocation in the editor.
     
  10. Mindstyler

    Mindstyler

    Joined:
    Aug 29, 2017
    Posts:
    248
    yeah, TryGetComponent is different. That's why we don't have a custom 'override' for that one. Only for GetComponent
     
  11. print_helloworld

    print_helloworld

    Joined:
    Nov 14, 2016
    Posts:
    231
    Hard to believe, I think majority of unity users aren't aware and aren't interested in being aware in something that pretty much only us try hards are interested. I'm more for an optional amsdef advocate for this because being backwards compatible with majority is more important to unity. And it also allows this behaviour to become different for people who need this and would take advantage of it.
     
  12. bene82

    bene82

    Joined:
    Jun 11, 2020
    Posts:
    10
    Could you please give a code, where Component.GetComponent<T>() returns the Unity "fake" object? My test does not prove that. See my fifth post back.

    Thanks
     
  13. BlackclawsK

    BlackclawsK

    Joined:
    Jan 9, 2019
    Posts:
    100
    Just run GetComponent<MeshCollider>() on a Gameobject that does not have one attached _in the editor_ that is the important part.

    Code (CSharp):
    1. var nothing = GetComponent<MeshCollider>();
    2. Debug.Log(nothing is null);
    3. Debug.Log(nothing is not null);
    4. Debug.Log(nothing == null);
    5. Debug.Log(nothing != null);
    And there is a difference between runtime and editor for the results of those debug statements.
     
  14. TheZombieKiller

    TheZombieKiller

    Joined:
    Feb 8, 2013
    Posts:
    265
    If you ask me, users not being aware of it is part of the problem. They can run into the issues and either not understand what is wrong, or worse: not even notice the issue because they didn't hit the case during testing.

    It's a fundamental design issue that makes a set of C# language features unsafe to use without any obvious explanation for why, and further separates the Unity development experience from the rest of the .NET ecosystem.

    "x == null" to check for a destroyed object was never a good idea, it's counter to how null references function in C# and is not an obvious "is this destroyed" check unless you are already familiar with Unity -- other APIs rightfully do not do this because it's confusing.

    I definitely understand the backwards compatibility argument but it doesn't need to be a hard break immediately, that's what a deprecation process is for.
     
  15. Mindstyler

    Mindstyler

    Joined:
    Aug 29, 2017
    Posts:
    248
    Code (CSharp):
    1.  
    2. private void NullableFailure()
    3.     {
    4.         TestComponent? comp = GetComponent<TestComponent>();
    5.  
    6.         if (comp is not null)
    7.         {
    8.             comp.MyIntProperty = 10;
    9.         }
    10.  
    11.         DoOtherStuff(comp);
    12.  
    13.         if (comp is null)
    14.         {
    15.             ThisBreaksNow();
    16.         }
    17.  
    18.         return comp ?? ComponentInCaseOfNull; // this also breaks
    19.  
    20.         void DoOtherStuff(TestComponent? component)
    21.         {
    22.             Destroy(component);
    23.         }
    24.     }
    25.  
     
  16. bene82

    bene82

    Joined:
    Jun 11, 2020
    Posts:
    10
    It seems that the "is" language construct does not use the operator overloading. This is the same problem as the "??" operator and the construct cannot be used.
     
  17. Mindstyler

    Mindstyler

    Joined:
    Aug 29, 2017
    Posts:
    248
    Exactly. It cannot be used as long as there is a custom operator overload for unity objects. That inherently makes nullability annotations pointless
     
  18. Mindstyler

    Mindstyler

    Joined:
    Aug 29, 2017
    Posts:
    248
    It also would not break backwards compatibility. x == null would point to the system.object operator which also still return the expected boolean value
     
  19. Mindstyler

    Mindstyler

    Joined:
    Aug 29, 2017
    Posts:
    248
    the operator overload breaks:
    ??
    ??=
    unityObject?.Method() // ? suffix
    is null
    is not null
    pattern matching

    and this list will only get longer with new c# version releases
     
    Flavelius likes this.
  20. bene82

    bene82

    Joined:
    Jun 11, 2020
    Posts:
    10
    I disagree because the `Component?` contract is not broken. Moreover, it is clear that no other check except `com == null` or `(bool)com` can be used. It does not matter if the method returns true or fake null. In some cases returns true null in some returns fake null.
     
    Last edited: Mar 17, 2022
  21. Mindstyler

    Mindstyler

    Joined:
    Aug 29, 2017
    Posts:
    248
    Then the annotation is pointless because that only matters for true null. If i still have to use == to check for null then having the annotation provides 0 benefit
     
  22. bene82

    bene82

    Joined:
    Jun 11, 2020
    Posts:
    10
    Well, maybe the nullable effect is questionable with this method if you want to be notified that you have to check if the return value is null or not. I think a programmer should be notified about null check because true null can be returned! The programmer must use == when the nullable annotation is or is not and the nullable annotation does not change that.

    But one method is not the whole Unity. Nullable annotations are not for one method.

    The ==, is, ?? problem is for another discussion.

    Edit:
    If a method returns null (true null) then the method should say it. The GetComponent method says it in it's API description. And there are situations where real null is returned. If you do not check null and call some member the NullReferenceException will be thrown. The fact that Unity limits the use of null check does not change the fact that a null check is needed.
    Declaration information (language construct) is always better then documentation information.
    Nullable annotation warnings are optional.
     
    Last edited: Mar 17, 2022
    oli-2019 likes this.
  23. print_helloworld

    print_helloworld

    Joined:
    Nov 14, 2016
    Posts:
    231
    Yea ultimately I agree, anyone writing c# should assume the most basic c# logic is the way youd expect to without having to guess or research. But backwards compatability would take priority for me so the deprecation process is pretty spot on. Unity should make an analyzer that points at places where a seemingly vanilla null check should be replaced with an `IsDestroyed` check instead (since not all cases of `is null` or `?` or `??` break). Also isn't there already a thread for this specific topic?
     
  24. bene82

    bene82

    Joined:
    Jun 11, 2020
    Posts:
    10
    Is there a use case for this behavior? I mean, if is required the fake null object when the component has not been attached to the game object.
     
  25. Huszky

    Huszky

    Joined:
    Mar 25, 2018
    Posts:
    109
    Just to chime in:
    Whether or not the nullability behavior should change in unity, adding nullable annotations to the current API surface should be done. Just to stay with the current example: GetComponent<T> (and other overloads) should return T? . It does not matter which way you want to check for null the returned value should be checked for null (if you care about catching problems around objects being null).
    Now the other problem is already solved: how do you enforce proper null checks in unity? The tooling needs to be better. Right now, the Microsoft.Unity.Analyzers analyzer (which is included by default when using the visual studio (code) package) already has warnings if you use unsupported nullability features with objects inheriting from UnityEngine.Object. Just as an example the other day I had an issue with this, reported it and it will be fixed in the next release https://github.com/microsoft/Microsoft.Unity.Analyzers/issues/204 . Also the Rider (resharper) unity plugin also warns you when use do something you should not. The problem is that analyzers like this should be provided by unity and not by third parties.

    What I have encountered multiple times, which is a far worse consequence of the current null behavior: when you pass a component as an interface nothing will hint at using bad nullability check.
     
    goncalo-vasconcelos likes this.
  26. xoofx

    xoofx

    Unity Technologies

    Joined:
    Nov 5, 2016
    Posts:
    417
    On the topic of nullable reference types, we have previously mentioned this here
    and more recently here

    We agree that we would like to bring this support, but it is also enough disruptive that it will require not just a small pragma to activate this feature but potentially a lot more work and wide impacts (API updaters, changes in the Unity code base in thousands of places...etc).

    Regarding the capacity of the teams, we are focused for now on the migration to CoreCLR and improving the C# compilation story by standardizing it. Once we will have settled these two big challenges, we will be able to think about the problem of migration to support nullable reference types. Stay tuned.
     
    erdostamasa, KinanGH, iBener and 17 others like this.
  27. ScottKane

    ScottKane

    Joined:
    Aug 24, 2019
    Posts:
    81
    Obviously this would be waaaaay down the line, but once you have current .NET (6, 7, 8 or whatever) support and CoreCLR, it would be really cool if you could implement razor over your markup/stylesheet (UXML/USS) UI toolkit to effectively give us Blazor for Unity UI. This would be a game changer for most C# web developers working in the .NET ecosystem today.
     
    erdostamasa, AliAlbarrak and Huszky like this.
  28. KeinZantezuken

    KeinZantezuken

    Joined:
    Mar 28, 2017
    Posts:
    53
    If I'm not mistaken GDC is over. We still missing the blog post?
    I despise this "event exclusibty" bullshit with all my soul. One of the many ugly faces of this industry.

    Elaborate how is this possible with classic approach of single logic (single playerloop thread) thread? How do you see component getting destroyed right after a call to `GetComponent()` and you immediate nullcheck on the same stack frame? It can't be GC, because, even if skip everything else, we already have reference on the current loaded stack frame.
     
    Last edited: Mar 26, 2022
  29. NotaNaN

    NotaNaN

    Joined:
    Dec 14, 2018
    Posts:
    325
    Let me highlight the quote for you. ;)
     
    JoNax97 likes this.
  30. Max-om

    Max-om

    Joined:
    Aug 9, 2017
    Posts:
    499
    Doesn't need to be razor. Can be a proprietary MVVM/MVC solution too.
     
  31. Nexer8

    Nexer8

    Joined:
    Dec 10, 2017
    Posts:
    271
    Any news on this? Possibility of it coming to Unity 2022.1? Gonna have to resolve to hacky workarounds until covariance is supported.
     
  32. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,931
    This is not something that we have actively considered yet. I suspect that will be on the table once the move to new .NET is complete though, but we've not delved into the technical details about it yet so I can't speak with much certainty.
     
  33. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,931
    No, we don't expect to get covariant return type support until we ship CoreCLR as a JIT runtime. The version of Mono we ship from the mono/mono repository does not have covariant return type support, and adding it would not be worthwhile. A faster path to get it is to focus on a CoreCLR player, which is what we are doing now.

    We don't have a release date set yet for the CoreCLR player, but I'll update here as soon as we do.
     
    Anthiese, NotaNaN, JesOb and 2 others like this.
  34. BlackclawsK

    BlackclawsK

    Joined:
    Jan 9, 2019
    Posts:
    100
    This is a prime example for where source generators are a massive boon. The whole Razor ecosystem is scheduled to move towards them at some future point to massively reduce tooling required. You can already read in arbitrary files and create code behind for them, so this is just another step in that direction.

    We already have some source generators working magic for us in the background (for various features), they aren't yet at the point where they are fit for public consumption but we might release a few at some point in the future that can help when working with Uxml files.

    The main "blocker" right now is that uxml files aren't added to the AdditionalFiles but instead are added to the None group therefore you need to manually add them for them to be available to source generators. Making that configurable would make it easier to develop source generators for general uxml files.
     
  35. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,931
    Cool! A big part of our strategy is to "unlock" the power of the .NET ecosystem by making tools like source generators work out of the box with Unity.
     
    VolodymyrBS, JesOb and NotaNaN like this.
  36. AlishGi

    AlishGi

    Joined:
    Mar 28, 2022
    Posts:
    3
    Do you have any plan to integrate Unity with MAUI in .net 6?
    I want to use Unity in part of my program
    Since MAUI is still under development
    Can you work with the MAUI team to enable the integration and use of Unity and its models in MAUI apps?
     
  37. runner78

    runner78

    Joined:
    Mar 14, 2015
    Posts:
    792
    One has to keep in mind that unity is a c++ engine hosting .NET and not a standalone .NET application. The only thing I can think of is a MAUI application that uses Unity as a library.
    However, MAUI only works on Windows, macOS, iOS and Android, no Linux and other platforms.
    I also find it a bit difficult to implement MAUI in Unity, MAUI also manages windows and message loops and rendering, which would then collide with Unity and generate a lot of overhead.

    The same would also apply to razor, for which Unity would need an integrated browser, again with overhead and larger installation sizes.

    These platforms are also designed for websites or apps, not games. The performance could be excellent for their original use cases, but may not be sufficient for games (for example: GUI rendering 10ms in web or apps would be quite fast, but much too slow in games)
     
    Anthiese likes this.
  38. Huszky

    Huszky

    Joined:
    Mar 25, 2018
    Posts:
    109
    In the last 4 years I have been working as a unity developer but, I have not made a single game - I create business applications with it. Having a more competent UI system would be really beneficial for a lot of people. Also keep in mind that blazor is not browser only- the blazor renderimg engine could be used to outpu ugui element not just html
     
    bdovaz and AliAlbarrak like this.
  39. m-yukio

    m-yukio

    Joined:
    Dec 22, 2016
    Posts:
    8
    I am trying to use gRPC for .NET with Unity 2021.2.11f1.
    After incorporating it by trial and error and communicating, an error occurred related to "HTTP / 2 Connection Preface".
    When I checked the communication contents with Wireshark, it was not communicated with HTTP/2.

    It seems that you should use SocketsHttpHandler instead of HttpClientHandler, but it doesn't seem to be implemented in Unity 2021.2.11f1?
    It did not exist in netstandard (2.1.0.0) in the Visual Studio assembly browser.

    Does that mean that Unity's SocketsHttpHandler implementation isn't in time?
     
  40. AlishGi

    AlishGi

    Joined:
    Mar 28, 2022
    Posts:
    3
    Thanks for the reply.
    Today, the design and building of applications have expanded and more 3D models are needed.
    Currently with webview2 we can render and run Blazor in MAUI
    This is a great option for web developers.
    Which can use both html css or XAML for UI and C# or js with access to operating system api for logic

    I do not know if it is possible to get WebGL output from Unity and run it in WebView2 or not?

    On the other hand, Unity is limited in accessing the operating system api. While xamarin/maui is more advanced
    Using Unity in MAUI can complement each other.

    And keep in mind that Unity is not just for the game
    Working the Unity team with the MAUI team can do amazing things.

    (Tizen support will be added soon https://github.com/dotnet/maui/pull/2360
    and Linux support is also set to be added by the community https://github.com/jsuarezruiz/maui-linux)
     
    Last edited: Mar 29, 2022
  41. runner78

    runner78

    Joined:
    Mar 14, 2015
    Posts:
    792
    WebView2 is simple a wrapper for the OS buld-in browser, Edge on Windows, Safari on macOS/iOS. Theoretically it should be possible to display a webGL build in WebView2.

    MAUI WebView was mainly made to make web technologies usable for native apps, and that's lighter than e.g. electron.Unity is already natively available for all platforms. And a MAUI integration with the way via webGL would not be the right way, maybe more similar to the current "Unity as Library", that would be more efficient.

    But that would not work in any of the variants that you could use the models and API from Unity in MAUI and vice versa. Both applications ran independently and would only communicate with each other via an API interface.
     
  42. m-yukio

    m-yukio

    Joined:
    Dec 22, 2016
    Posts:
    8
    After all, SocketsHttpHandler is not implemented.
    Currently, HTTP/2 communication is not possible with gRPC for .NET.
    Thank you.
     
  43. AlishGi

    AlishGi

    Joined:
    Mar 28, 2022
    Posts:
    3
    @runner78
    Yes, running it as a library can give us more access via API interface.
    @JoshPeterson
    What is your view on integrating and using Unity in MAUI in .net6/7/8 ?
    This can be a huge option for .NET developers
     
  44. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,931
    This is not something we have considered yet. I won't rule it out, but we also have a good bit of work ahead of us to get Unity to work with the new .NET ecosystem. We plan to focus on that first before considering MAUI support.

    In the meantime, you may want to consider Unity-as-a-library, which some platforms support: https://unity.com/features/unity-as-a-library.
     
  45. ScottKane

    ScottKane

    Joined:
    Aug 24, 2019
    Posts:
    81
    I am a bigger fan of adopting widely used technology...why reinvent the wheel kind of thing. I don't think we need any more proprietary tech until everything else is sorted (CoreCLR, NET 6/7). And if past proprietary tech is anything to go off, the docs will be non-existent vs just going with the razor engine most people using C# have at least some knowledge of. As well as fitting with the general idea of bringing web devs into Unity.

    I'm not sure when this was last brought up, but it would be super nice if Unity would just give us control of our project files instead of generating on every rebuild. They should be able to achieve anything the current generation achieves by just attaching some build targets to a csproj file that we provide.

    Speaking from experience, the Unity workflow of throwing any dll's into Assets/ may have been cool before nuget, but it aged like milk in the sun. I don't care if this is an opt-in feature, but Unity can't really say they are part of the whole "One .NET" initiative when they don't even support the ecosystem used in the rest of .NET.

    All my web C# dev friends that have been interested in Unity instantly recoil when the realise they can't pull in their bread and butter nuget packages along with dependency injection. I've been using MSBuild4Unity which brings things closer, it's just sad that products like this even have to exist.

    Also multiple assembly errors on using packages that come in the editor is a big pain point, that's kind of a Unity implementation detail that we shouldn't know or care less about. Funnily enough using nuget for engine/editor code would solve this too, but guess I'm missing something.

    I don't think it's too much to ask that I can create and maintain my own solution/projects, I'm a big boy.
     
  46. ScottKane

    ScottKane

    Joined:
    Aug 24, 2019
    Posts:
    81
    Actually this has already been done fairly easily, take a look at Xamarin blazor bindings/MAUI blazor bindings. they effectively just mock a browser window and present it as a native component. Which is basically the same as the Unity UI toolkit if I'm not mistaken.
     
    Huszky likes this.
  47. ScottKane

    ScottKane

    Joined:
    Aug 24, 2019
    Posts:
    81
    You have to use Grpc.Client.Web on the client and use Grpc.AspNetCore.Web on the server, this will allow the client to communicate over HTTP 1 which is needed in Unity. I just finished getting this working in a brand new 2022.1.0b13 project. I would recommend using a version of Unity that supports netstandard2.1 as this makes compatibility waaaaaaaaay easier. I'm not even entirely sure you would get it to run in netstandard2.0.

    Also worth noting my server is a separate .NET 6 API that I just added a step at the end of every Unity build to also run MSBuild on the server.
     
    Last edited: Mar 31, 2022
  48. m-yukio

    m-yukio

    Joined:
    Dec 22, 2016
    Posts:
    8
    Thank you.
    I'm already doing HTTP/2 communication with gRPC C# core-library and gRPC-Go, and gRPC C# core-library doesn't support mac IL2CPP and console games, so I'm investigating the transition to gRPC for .NET.
    I wait for Unity update.
     
  49. runner78

    runner78

    Joined:
    Mar 14, 2015
    Posts:
    792
    As far as I know, the UI Toolkit doesn't. It renders the UI with meshes and shaders within the Unity graphics API. Otherwise Worldspace UI would be difficult in the future, since each Worldspace UI would then be an independent browser window/tab.

    MAUI mocks no browser window, WebView2 is a browser window (in contrast to electron, which includes chromium, MAUI uses the OS integrated browser engine)

    There is an experimental native Blazor binding, but as far as I know it's just a combination of Xamarin.Forms and the Blazor syntax, but as far as I know it's not part of the first MAUI release. So MAUI with Blazor needs MAUI itself, ASP.NET for the internal Blazor hosting and the external browser for the rendering, totally unsuitable for a GAME ui in my opinion.
     
    Tanner555, Saniell, Neonlyte and 3 others like this.
  50. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,931
    We are planning to make this change. More details are coming in a blog post soon, but the idea is to use csproj/msbuild directly in Unity.