Two bugs found in Unity Rider Plugin

Answered

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. 

0
5 comments
Avatar
Permanently deleted user

Wow, thanks man. This bug killed me.

0

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!

0
Avatar
Permanently deleted user

Hi,

After updating the Rider plugin I've noticed that the

riderScriptEditor.FindProperty("HasChanges").boolValue = true;

to

riderScriptEditor.FindProperty("hasChanges").boolValue = true;

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

0
Avatar
Permanently deleted user

But I'm glad to note that the issue with UnityEngine.Assert() method is fixed though.

0

Hello Mateusz,

Thank you for the report and repro solution. As developer said that fix should be available in Rider package 2.0.8.

0

Please sign in to leave a comment.