This is my first time using Git. So I'm practicing to get used to using Git. However, the following problems occurred:
Like this, I uploaded a script called csEvent to Git.
The script called csEvent is a script created by another Unity project of the same version.
And in 'GitHub Desktop', I clicked 'Pull origin'.
As far as I know, this should automatically create scripts downloaded from Git in the Unity project, but it's not.
Unity does not recognize the script because it is created in an external folder, not in the Assets folder.
How can I get Unity to recognize the script automatically?
CodePudding user response:
C# files need to be Assets folder (e.g. Assets\Code), as well as adhering to Using external version control systems with Unity. In your case you also missing a corresponding csEvent.meta. However once you move your C# file into Assets Unity will discover it and create the .meta file for you. The latter should be added to Git, don't let Unity create it all the time otherwise you can run into reference issues (normally not a problem for code but it is for artwork, prefabs, shaders and so forth).