Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Question Adding assets from manager does not include scripts in my project.

Discussion in 'Editor & General Support' started by smurftra, May 20, 2023.

  1. smurftra

    smurftra

    Joined:
    Jan 16, 2018
    Posts:
    9
    Not sure how to best describe this:

    Everytime I import an asset from the package manager in my project, I can see the scripts in the unity editor, but they are never part of my project's solution. I can't access any classed.

    I did try with a new project and it does not have that behavior, so I know it's my current project that is at fault, but I can't find any project or editor settings I might have changed.

    (Right now trying to add the Fishnet asset, but my code can't find the NetworkBehavior class)

    Any tips on how to fix this would be appreciated, thank you!

    (Trying to avoid recreating my project from scratch, as it's quite big at the moment)
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,971
    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.

    Other times it requires you also nuke the userprefs and .vsconfig and other crufty low-value high-hassle files that Visual Studio tends to slowly damage over time, then try the above trick.

    Barring all that, move on to other ideas:

    https://forum.unity.com/threads/intellisense-not-working-with-visual-studio-fix.836599/

    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://forum.unity.com/threads/no-suggestions-in-vscode.955197/#post-6227874
     
  3. smurftra

    smurftra

    Joined:
    Jan 16, 2018
    Posts:
    9
    Thank you I will try all of that. I don't think the issue is intellisense, as the files are just not in the visual studio solution, only in the unity editor. If I Include them in project manually, then they don't seem to be properly imported: They won't compile and any 'using' declaration is said not to exist. It's the weirdest thing.
     
  4. spiney199

    spiney199

    Joined:
    Feb 11, 2021
    Posts:
    6,016
    Does the code come in its own assembly definition? Usually you need your own assembly definition that references the other one for this to work.