0

Recently I started using Rider for Scripting in Unity. It's fine but when I switch to some script (very small weight), it doesn't show any code highlighting (except blue):

enter image description here

The same code in other script which can work:

enter image description here

For work reasons it is not possible for me to delete the current script. I've tried to reinstall and checked my Settings, but still couldn't fix it.


EDIT: Thanks for the note, here is my other information:

  1. Unity Setting:
    Preferences - External Tools - External Script Editor - Rider 213.6461.51

  2. Open Script:
    Double-click on the script in Unity to open it

  3. Same script, each keyword is highlighted in VS Studio 2019

  4. My Unity version is 2018.4.1f1, Rider version is 2021.3

Does anyone know how to solve this problem?

LazyOne
  • 158,824
  • 45
  • 388
  • 391
  • In fact, it affected me more than that——In scripts that lack code highlighting, most of the code is white – JustOneCoin Jan 04 '22 at 06:40
  • How exactly do you open your scripts? Via double click in the assets in Unity? Which Unity version do you use? Is the [rider package](https://docs.unity3d.com/Packages/com.unity.ide.rider@2.0/manual/using-the-jetbrains-rider-editor-package.html) installed in your project via the package manager? And is Rider configured as your external script editor tool? – derHugo Jan 04 '22 at 06:48
  • Sorry that I neglected to add this information, I have added it into my question. – JustOneCoin Jan 04 '22 at 10:28

1 Answers1

1

I have solved the problem.It appears that Rider updates the naming conventions when opening certain scripts.

The immediate solution is:Suppose one of your script files has code highlighting disabled, Open the script in Rider, and you will see the word OFF in the upper right corner.Click it, you will see:

enter image description here All you have to do is change "None" to "All Problems".