Two bugs found in Unity Rider Plugin
Hi.
I've recently found two bugs when using Rider and Unity I've figured I'd let you know.
The first one is connected to UnityEngine.Assert() method. When this method throws errors in Unity from a prefab asset the default behavior (when Rider plugin is not enabled) is that double-clicking this error message in Console will open the Prefab Editor. This doesn't happen when the Rider plugin is enabled which makes it hard to locate the assets that are throwing the assertion error.
---
The second one is connected to using
PlayerSettings.SetScriptingDefineSymbolsForGroup()
If you change the ScriptingDefineSymbols from a script they will not refresh in Rider, and RIder will be showing the #if macros as disabled when in fact they are not. If you edit the defined symbols from the default Project Settings window they are refreshed correctly.
For this bug, I've found a workaround. After changing the define symbols via the method above you also need to invoke this code
var riderScriptEditor = new SerializedObject(RiderScriptEditorData.instance);
riderScriptEditor.Update();
riderScriptEditor.FindProperty("HasChanges").boolValue = true;
riderScriptEditor.ApplyModifiedProperties();
CodeEditor.CurrentEditor.SyncAll();
But this code relies on modifying the HasChanges property that's set as internal so I don't think this is the desired behavior.
Please sign in to leave a comment.
Wow, thanks man. This bug killed me.
Hello,
Could you please provide sample solutions for the issues so we could see the usecase? You can attach it with a new issue on our bug tracker. Thank you in advance!
Hi,
After updating the Rider plugin I've noticed that the
to
so if you're using the 2.0.7 version then remember to make this change.
I've also created the bug report on issue tracker Olga Diakonova with a project reproducing both bug, and my fix for it.
https://youtrack.jetbrains.com/issue/RIDER-49947?_ga=2.63854636.269623988.1598448214-1266402305.1586238172
But I'm glad to note that the issue with UnityEngine.Assert() method is fixed though.
Hello Mateusz,
Thank you for the report and repro solution. As developer said that fix should be available in Rider package 2.0.8.