Script in Editor cannot access Project scripts

Hi there!

I found an issue on Editor a Script cannot access any code of the project itself!

it seem like it in difference project, How ever if I wrote a wrong script it still found it wrong.

such as if I call no have variable in project class in editor script
the editor script still know it wrong…

It’s annoying yes, but not as annoying as double-posting about such a simple issue.

Instead, select the message in the console and look at the call stack below it.

Google for how to read callstacks in Unity to see if a) it is your error, or b) just something unrelated to you.

But no have any error log at all, it just show a red line on Visual studio and cannot access any class of project itself, if I write some class name it just show a black text that is…

This may help you with intellisense and possibly other Visual Studio integration problems:

Sometimes the fix is as simple as doing Assets → Open C# Project from Unity. Other times it requires more.

https://discussions.unity.com/t/778503

Also, try update the VSCode package inside of Unity: Window → Package Manager → Search for Visual Studio Code Editor → Press the Update button

Also, this: https://discussions.unity.com/t/805330/7

Did you see, even I have a class SkillActiveType in this project But in editor script still cannot access

Well, we don’t see where your ItemEditor script is located. However since you do have both first pass projects, you most likely placed the Item Editor into a first pass folder, so it’s isolated from the normal scripts. First pass folders are the plugins folder as well as the Standard Assets folder. Things in those folders are compiled first. There’s a strict order in which your files are compiled.

  1. The runtime scripts of the first pass are compiled first into the Assemby-CSharp-firstpass assembly.

  2. Next comes the editor scripts that are inside any editor folders inside first pass folders which are compiled into Assembly-CSharp-Editor-firstpass assembly

  3. After that your normal runtime scripts are compiled into the normal Assembly-CSharp assembly

  4. Finally the normal editor scripts are compiled into the Assembly-CSharp-Editor assembly

Of course based on that order only things that are compiled later can access things that are compiled eariler. So normal editor scripts can access everything (group 1,2,3 and of course it’s own group). Normal runtime scripts can access groups 1,2 and 3 (though runtime scripts should never access anything from the editor assembly since that’s not included in a build)

Group 2 can only access things defined in group 1 or 2.

I know how to fix this problem now!
Just go to edit > preference > external tools > recreate project file

this might often happen then Unity made this action to a button already!