Hey,
I’m not sure if this is a common issue of just something with my computer, but I am using Unity 5.3.4 and whenever I create a new C# script, the little icon next to the name is blank white and has no C# icon on it. In addition to this, these new scripts don’t open in Visual Studio Community and open in Notepad only. At the end of the scripts’ file directory name, instead of NewBehaviourScript.cs for example, they say NewBehaviourScript.cs - Copy. Does anyone know how to fix this annoying bug? Or have I done something by accident that caused this?
You’ve kind of answered your own question.
There is a numbering and naming convention used for the template files in directory
C:\ProgramFiles\Unity\Editor\Data\Resources\ScriptTemplates\
In your case, template 81 used for C# scripts has the “-Copy” suffix and so each new script file created will have that suffix attached. As such, it will not be recognised as a C# file, which needs to end as filetype .cs.
- Within that template directory, ensure the template is named as:
81-C# Script-NewBehaviourScript.cs.txt
This will correct for any scripts going forward.
- For your existing project scripts, locate the directory under Assets containing the generated script files and rename any containing the suffix “-Copy” by removing that suffix and simply having “.cs” as the filetype.