unity 3d命令行参数

Options

As mentioned above, the editor and also built games can optionally be supplied with additional commands and information on startup. This is done using the following command line options:-

-assetServerUpdate <IP[:port] projectName username password [r <revision>]>Force an update of the project in the Asset Server given by IP:port. The port is optional and if not given it is assumed to be the standard one (10733). It is advisable to use this command in conjunction with the -projectPath argument to ensure you are working with the correct project. If no project name is given then the last project opened by Unity is used. If no project exists at the path given by -projectPath then one is created automatically.
-batchmodeRun Unity in batch mode. This should always be used in conjunction with the other command line arguments as it ensures no pop up windows appear and eliminates the need for any human intervention. When an exception occurs during execution of script code, asset server updates fail or other operations fail Unity will immediately exit with return code 1. Note that in batch mode, Unity will send a minimal version of its log output to the console. However, the Log Files still contain the full log information. Note that opening a project in batch mode whilst the Editor has the same project open is not supported. Only a single instance of Unity can run at a time.
-buildLinux32Player <pathname>Build a 32-bit standalone Linux player (e.g. -buildLinux32Player path/to/your/build).
-buildLinux64Player <pathname>Build a 64-bit standalone Linux player (e.g. -buildLinux64Player path/to/your/build).
-buildLinuxUniversalPlayer <pathname>Build a combined 32-bit and 64-bit standalone Linux player (e.g. -buildLinuxUniversalPlayer path/to/your/build).
-buildOSXPlayer <pathname>Build a 32-bit standalone Mac OSX player (e.g. -buildOSXPlayer path/to/your/build.app).
-buildOSX64Player <pathname>Build a 64-bit standalone Mac OSX player (e.g. -buildOSX64Player path/to/your/build.app).
-buildOSXUniversalPlayer <pathname>Build a combined 32-bit and 64-bit standalone Mac OSX player (e.g. -buildOSXUniversalPlayer path/to/your/build.app).
-buildTarget <name>Allows the selection of an active build target before a project is loaded. Possible options are: win32, win64, osx, linux, linux64, ios, android, web, webstreamed, webgl, xbox360, xboxone, ps3, ps4, psp2, wsa, wp8, bb10, tizen, samsungtv.
-buildWebPlayer <pathname>Build a WebPlayer (e.g. -buildWebPlayer path/to/your/build).
-buildWebPlayerStreamed <pathname>Build a streamed WebPlayer (e.g. -buildWebPlayerStreamed path/to/your/build).
-buildWindowsPlayer <pathname>Build a 32-bit standalone Windows player (e.g. -buildWindowsPlayer path/to/your/build.exe).
-buildWindows64Player <pathname>Build a 64-bit standalone Windows player (e.g. -buildWindows64Player path/to/your/build.exe).
-createProject <pathname>Create an empty project at the given path.
-executeMethod <ClassName.MethodName>Execute the static method as soon as Unity is started, the project is open and after the optional asset server update has been performed. This can be used to do continous integration, perform Unit Tests, make builds, prepare some data, etc. If you want to return an error from the commandline process you can either throw an exception which will cause Unity to exit with 1 or else call EditorApplication.Exit with a non-zero code. If you want to pass parameters you can add them to the command line and retrieve them inside the method using System.Environment.GetCommandLineArgs. To use -executeMethod, you need to place the enclosing script in an Editor folder. The method to be executed must be defined as static.
-exportPackage <exportAssetPath1 exportAssetPath2 ExportAssetPath3 exportFileName>Exports a package given a path (or set of given paths). exportAssetPath is a folder (relative to to the Unity project root) to export from the Unity project and exportFileName is the package name. Currently, this option can only export whole folders at a time. This command normally needs to be used with the -projectPath argument.
-force-d3d9 (Windows only)Make the editor use Direct3D 9 for rendering. This is the default, so normally there’s no reason to pass it.
-force-d3d11 (Windows only)Make the editor use Direct3D 11 for rendering.
-force-opengl (Windows only)Make the editor use OpenGL 2.1 for rendering, even if Direct3D is available. Normally Direct3D is used but OpenGL is used if Direct3D 9.0c is not available.
-force-glcore (Windows only)Make the editor use OpenGL core profile for rendering. The editor tries to use on the best OpenGL version available and all OpenGL extensions exposed by the OpenGL drivers. If the platform isn’t supported, Direct3D is used.
-force-glcoreXY (Windows only)Similar to -force-glcore but request a specific OpenGL context version. Accepted values for XY: 32, 33, 40, 41, 42, 43, 44 or 45.
-force-clamped (Windows only)Used together with -force-glcoreXY, but it prevents checking for additional OpenGL extensions allowing to run between platforms with the same code paths
-force-freeMake the editor run as if there is a free Unity license on the machine, even if a Unity Pro license is installed.
-importPackage <pathname>Import the given package. No import dialog is shown.
-logFile <pathname>Specify where the Editor or Windows/Linux/OSX standalone log file will be written.
-silent-crashesDon’t display crash dialog.
-nographicsWhen running in batch mode, do not initialize graphics device at all. This makes it possible to run your automated workflows on machines that don’t even have a GPU (automated workflows only work, when you have a window in focus, otherwise you can’t send simulated input commands). Please note -nographics will not allow you to bake GI on OSX, since Enlighten requires GPU acceleration.
-password <password>The password of the user – needed when activating. This option is new in Unity 5.1.
-projectPath <pathname>Open the project at the given path.
-quitQuit the Unity editor after other commands have finished executing. Note that this can cause error messages to be hidden (but they will show up in the Editor.log file).
-returnlicenseReturn the currently active license to the license server. Please allow a few seconds before license file is removed, as Unity needs to communicate with the license server. This option is new in Unity 5.0.
-serial <serial>Activates Unity with the specified serial key. It is recommended to pass “-batchmode -quit” arguments as well, in order to quit Unity when done, if using this for automated activation of Unity. Please allow a few seconds before license file is created, as Unity needs to communicate with the license server. Make sure that License file folder exists, and has appropriate permissions before running Unity with this argument. In case activation fails, see the Editor.log for info. This option is new in Unity 5.0.
-username <username>Enters a username into the log in form during activation of the Unity editor.
-password <password>Enters a password into the log in form during activation of the Unity editor.
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值