WangJi
WangJi

Reputation: 388

is there any way to manage dependency in unity using git?

I create a Unity project and using fungus for my conversation system. My problem is there are lots of files to commit to git! Most of them come from fungus toolset.

Can I manage it like nodejs? just like I only commit a dependency list file, (such as package.json) and clone project then run some build command? (such as npm install)?

Thank you for help, I'm newbie for unity.

Upvotes: 0

Views: 163

Answers (1)

Jan Thomä
Jan Thomä

Reputation: 13632

I may be a bit late to the party, but you can do this using Unity's package manager. First you need to create a package that can live in your git repo. This package needs a package.json that has all the information that the package manager needs. The rest of the files are just laid out as if they were inside of the assets folder. Have a look at my Nanoject repo which uses this approach to create a reusable package that can be included in your unity projects.

You should be able to have HTTP(s) access to your git repo. Now you can reference that package by adding it to your manifest.json (e.g if your package is on GitHub):

"dependencies" : {
    "com.example.your-package": "https://github.com/com.example/the-package.git#2.0.0"
}

Upvotes: 2

Related Questions