0

This is my first time using Git. So I'm practicing to get used to using Git. However, the following problems occurred:

enter image description here Like this, I uploaded a script called csEvent to Git.

enter image description here The script called csEvent is a script created by another Unity project of the same version.

enter image description here And in 'GitHub Desktop', I clicked 'Pull origin'.

enter image description here

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.

enter image description here

How can I get Unity to recognize the script automatically?

1

1 Answer 1

1

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).

Not the answer you're looking for? Browse other questions tagged or ask your own question.