- Check Unity version of Stardeus
Find [Stardeus install path]/UnityPlayer.dll
and look at the version information.
At time of writing it's Unity 2021.1.19
-
If you don't already have the matching version of Unity Editor, download it from https://unity3d.com/get-unity/download/archive In this case, we need download 2021.1.19. Choose Unity Editor 64-bit.
-
Make a backup of
[Stardeus install path]/UnityPlayer.dll
and[Stardeus install path]/Stardeus.exe
-
After downloading extract the following files from
[UnpackFolder]\Editor\Data\PlaybackEngines\windowsstandalonesupport\Variations\win64_development_mono\
UnityPlayer.dll -> [Stardeus install path]/UnityPlayer.dll
WinPixEventRuntime.dll -> [Stardeus install path]/WinPixEventRuntime.dll
WindowsPlayer.exe -> [Stardeus install path]/Stardeus.exe
-
Delete the downloaded Unity Editor files if you don't want them.
-
Edit
[Stardeus install path]/Stardeus_Data/boot.config:
wait-for-managed-debugger=1
player-connection-debug=1
- Install VSCode and the unity.unity-debug extension in addition to standard C# dev extensions eg:
- unity.unity-debug
- ms-dotnettools.csharp
- fudge.auto-using
-
Open your mod in VSCode and edit
.vscode/mod.csproj
. ChangeDebugType
fromnone
toportable
-
Rebuild your mod
-
Run
[Stardeus install path]/Stardeus.exe
then you will see a dialog with message "You can attach a managed debugger now if you want"
If you run it directly rather than through Steam, cancel the first dialog and wait for Steam to relaunch it and it'll show the dialog again.
- In VSCode, open the command pallet (Ctrl+Shift+P) and select Unity Attach Debugger.
My hostname is Study so I see two options like WindowsPlayer(Study)...
. Choose the one without the :0
suffix.
You can also add an entry to launch.json like:
{
"name": "WindowsPlayer(Study)",
"type": "unity",
"request": "launch"
},
- Not working? If VSCode can't find any Unity processes, there's something preventing the debugger from recieving the multicast packets from the game. In my case disabling a virtual network adapter fixed it.
Happy debugging.
Note that breakpoints set in the [RuntimeInitializeOnLoadMethod]
methods don't appear to work.