Root Dependency

If you want your namespaces to be autogenerated for you.

In your csproj file for Assembly-CSharp you can add
MyRPG
This will add MyRPG in all automatically created namespaces.
Further if you have Resharper for Visual Studio or if you are using Jetbrains Rider you can
then right click on folders like the Scripts folder and choose Properties. There you can set if the folder should be included in namespaces.

After that you can right click the Scripts folder and choose Refactor/Adjust Namespaces and it will set your namespaces to MyRPG.Characters instead of MyRPG.Scripts.Character

Edit: Unity overwrites any changes to the csproj file so RootNamespace doesn’t work. Be careful if you only use the folders inside Scripts to generate your namespace as things like Camera will clash with other things.

1 Like

You can also also set the root namespace in the Project settings under Editor

1 Like

Privacy & Terms