CommandĬreate an empty project at the given path. This page lists the command line arguments you can use to launch and configure Unity Editor and Unity Player instances. You can run the Unity Editor and build Unity applications with additional commands and information on startup. For more information about how to find your Editor’s location path, refer to Install and uninstall Editor versions. Adjust the path in the command if you use Unity Editor installed in a different location. Note: The above instructions assume the relevant Unity Editor is installed in the default location through the Unity Hub. When you launch Unity like this, it receives commands and information on startup, which can be useful for test suites, automated builds and other production tasks. "C:\Program Files\Unity\Hub\Editor\\Editor\Unity.exe" -projectPath "" On Windows, type the following into the Command Prompt to launch Unity: Applications/Unity/Hub/Editor//Unity.app/Contents/Linux/Unity -projectPath On Linux, type the following into the Terminal to launch Unity: Applications/Unity/Hub/Editor//Unity.app/Contents/MacOS/Unity -projectPath By removing the need for preparing multiple different builds for different parties like testers or clients, this very handy feature saves us time and makes it easier to manage build configurations.įrom resolution changes and developer-mode options to more robust server configurations – accessing the parameters is very simple and can be easily integrated into an existing app.On macOS, type the following into the Terminal to launch Unity: Will cause the app to change the resolution to 640×480 and display in a window.Īs we can see, command line parameters can be used to customize any aspect of the app upon launch. String argumentString for (int i = 0 i \Desktop\CommandLine\CommandLineExample.exe width=640 height=480 isWindowedMode=true Private const string resolutionHeightArg = "height=" Private const string resolutionWidthArg = "width=" Private const string windowModeArg = "isWindowedMode=" Public class CommandLineController : MonoBehaviour For this example to work, we prepared a CommandLineController script that we attach to any object on the scene. Let’s imagine a simple app that will allow the user to change its resolution and window mode through the command line. This is a more advanced usage of the command line because in this case, we’re not able to set it otherwise.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |