In general, unity can be started by double-clicking an icon on the desktop or by entering a command line (for example, a MacOS terminal or a Windows CMD window), which will accept commands and information at startup. we can make some gadgets to communicate with unity or invoke unity's methods (such as a one-click Package apk, and a third-party tool to package the resources into package packages).
You can find all the command line parameters in the Holy Scriptures: http://game.ceeger.com/Manual/CommandLineArguments.html.
We are learning the simplest unity command parameters, allowing unity to create an empty project in the F Drive and end the program via the console
C: F:\unitycode\dllcode-batchmode-quit
Explain the meaning of the command line above:
Unity.exe |
means to start the Unity program |
CreateProject |
Create a Unity project, followed by the created directory |
Batchmode |
Running the Unity program does not eject the Edtior interface |
Quit |
Complete the Unity program after executing the command |
Second, using the command line to call Unity we wrote the method to make a package out
The first is the code of our own class written in unity:
Public classMyeditor:editor {[MenuItem ("Assets/export mypackge")] Public Static voidmyexportpackge () {//to export a picture into a unitypackage bagAssetdatabase.exportpackage ("Assets/texture/1.png","F:/mypackage.unitypackage", exportpackageoptions.includedependencies); }}
Let's type in the command line (Executemethod class name. Method name executes a method)
C: F: \unitycode\dllcode-quit-batchmode-executemethod myeditor.myexportpackge
And then you can see the exported package under the F-disk.
I'll write it here today (hehe)
Unity command-line arguments