Using Unity Package Manager

The tools developed by the project team can be hosted in the remote warehouse, and other projects can also use them.

Create your own plugin directory under the Unity project Assets

Runtime code and editor code, create the corresponding assembly, and package.json file

package.json content: you can refer to the official one, name and version are required fields, and dependent packages must be locally

{
    "name": "com.upmdemo",
    "displayName": "upmdemo",
    "description": "test",
    "version": "1.0.0",
    "license": "MIT",
    "dependencies": {
    //依赖的别的包
    "包名name" :"版本号"
 }
}

Install git on the computer, right click on the plug-in directory folder

For the first submission after the warehouse is created, you need to enter the account name and password (follow the prompts to enter the command)

 

First time submission steps:

  1. git init (initialize warehouse)
  2. git add . (The . here means to add all files, and you can also customize the addition)
  3. git commit -m 'added comment information'
  4. git remote add origin ‘url’
  5. git push -u origin master

Here, use right-click paste when pasting the url

Subsequent Submission Steps

git pull (pull online code, generally used for multi-person development, if personal development can be submitted directly, the command can be omitted)

git add . (Add all files to the git temporary storage area)

git commit -m 'comment information' (the contents of the temporary storage area are added to the local warehouse, and the actual effect is to add comment information)

git push -u origin master (submit the code to the remote warehouse, if it is the default master branch, you can also use it directly: git push)

Then install it through GitUrl in UnityPackageManager, and enter the warehouse address

If there is an update later, modify the version number 1.0.0 --> 1.0.1, and submit it to the warehouse with git.

You can update to the latest here.

SVN submission needs to submit the following difference files, generally these two will change

In this way, it is very convenient to use plug-ins developed by individuals or project teams.

Guess you like

Origin blog.csdn.net/hnzmdlhc/article/details/131076026