This is a Flatpak for Unity Hub, a manager for Unity projects and installations.
If you use Unity's Visual Studio package it will generate C# solution and project files that you can edit in any IDE supporting SDK-style projects, such as VSCode with Microsoft's C# Extension or Zed with DotRush.
The package will recommend installation of org.freedesktop.Sdk.extension.dotnet and org.freedesktop.Sdk.extension.mono
on startup if you don't have them installed yet to help with this as the .NET support in various IDEs needs the .NET SDK
itself to run. Put differently, these are not necessary to run the Unity Editor or this Flatpak itself.
To install them:
flatpak install dotnet
flatpak install mono
And choose the variant matching the runtime of the Flatpak-ed IDE you use (e.g. if you use VSCode and it's using the FreeDesktop Runtime 25.08, install the .NET and Mono variants for 25.08).
You can choose the .NET SDK version that best matches your workflow and works with the language server you use in your IDE - usually they are pretty backwards compatible so using the latest .NET version tends to work well.
The Flatpak includes a code script in /app/bin/code that will perform a few checks and try to forward requests to
open files in your editor from Unity with VSCode. This works in tandem with the Unity
visualstudio package and should thus automatically
be picked up by Unity.
Because Flatpak is a sandbox, by default UnityHub isn't able to access other applications installed through Flatpak or
your host. Sometimes however you may wish to use another editor than VSCode with Unity in this Flatpak. In the Unity
preferences you can select an additional script or executable for this. By creating such a script in e.g.
~/.var/app/com.unity.UnityHub/.config/unity3d/your-editor-script and using e.g. xdg-open, you could forward a file
open request to the host.
You can follow what your script is printing (or if it is failing) in the Unity Editor.log as you request to open files
from Unity.
The downside of the above is that using another editor not recognized as being VSCode will make you lose C# project
generation as that seems to be tied together in the Unity package. **You can work around this by calling your custom
script code ** and selecting it as executable. This will make Unity automatically select the VSCode option again,
but it will still be using your script. This works at least in Unity 6000.1.2f1 and version 2.0.23 of the editor package.
Take note that pretending to be a VSCode executable will also make Unity pass different options. If you make a Bash
script, for example, the options passed in $@ are e.g.
/home/user/your/project/folder -g /home/user/your/project/folder/Assets/Scripts/YourScript.cs:50:10, so you may
need to strip the line and character numbers if your chosen editor doesn't support them.
To give a concrete example of the above and have C# project generation (for e.g. the DotRush language server) and
to be able to open files from Unity in Zed, you could use the special zed://file URI to open files. For example,
in ~/.var/app/com.unity.UnityHub/.config/unity3d/code:
#!/bin/bash
#
uri=$(python -c 'import sys,pathlib; print(pathlib.Path(sys.argv[1]).resolve().as_uri()[7:])' "$3")
xdg-open zed://file$uri