- Home /
Editor Settings: C# Project Generation: Root namespace has no effect
Since Version 5.2 there is a new setting in the Editor Settings called "root namespace". I haven't found any other documentation than "sets the project root namespace" about it, however, I would assume, that this puts all newly created C# scripts in the namespace which I defined there. I just doesn't seem to work. I haven't noticed any change whatsoever.
Am I misunderstanding the feature or what is it supposed to do? I'd really like to be able to have all my new scripts be put in a default namespace. I know that I can change the default script template, but when working in a team over several months and upgrading Unity versions, this is actually still rather cumbersome.
Thanks!
Answer by atamocius · Jan 26, 2016 at 12:26 PM
In Visual Studio (with VSTU installed), when you add a C# file using the "Solution Explorer", you will notice that the "root namespace" is applied.
It is just weird that this does not work when you add a file using the "Unity Project Explorer" or when you add a script directly inside Unity.
I am using Unity 5.3.1 and VS 2015.
Answer by HargrimCsorcon · Feb 15, 2017 at 12:03 PM
You can edit script template and write your default namespace there. In Windows: ...\Unity\Editor\Data\Resources\ScriptTemplates\81-C# Script-NewBehaviourScript.cs.txt
Haha I love it! Now I can finally stylize my default/starting scripts :P thank you!
Your answer
Follow this Question
Related Questions
mouse project settings 0 Answers
Is it safe to add my own asset files to the ProjectSettings folder or even into the settings files? 0 Answers
Can you use the 'Version' under Player settings across the game? 1 Answer
Gravity y is stronger than x 0 Answers
(Solved)What could change the EditorBuildSettings when creating a build... 2 Answers