You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: com.unity.netcode.gameobjects/Documentation~/command-line-arguments.md
+9-13Lines changed: 9 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,24 +7,22 @@ Use [command-line arguments](https://docs.unity3d.com/Documentation/Manual/Comma
7
7
When launching a standalone build (such as a headless dedicated server), you can supply custom arguments to modify runtime behavior.
8
8
9
9
Reserved arguments:
10
-
- -port
11
-
- -ip
12
10
13
-
Unity provides built-in parsing for standard arguments, and you can extend this behavior by adding your own.
11
+
-`-port`
12
+
-`-ip`
14
13
15
-
---
14
+
Unity provides built-in parsing for standard arguments, and you can extend this behavior by adding your own.
16
15
17
-
## Custom Arguments
16
+
## Custom arguments
18
17
19
-
You can define additional custom command line arguments and retrieve them through the `CommandLineOptions` class.
20
-
Use `GetArgs()` in your project code to collect and process these values.
18
+
You can define additional custom command-line arguments and retrieve them through the `CommandLineOptions` class. Use `GetArgs()` in your project code to collect and process these values.
21
19
22
-
[!NOTE]
23
-
Adding a custom commandline argument requires you to explicitly retrieve and handle it in your implementation.
20
+
> [!NOTE]
21
+
> Adding a custom command-line argument requires you to explicitly retrieve and handle it in your implementation.
24
22
25
-
---
23
+
## Example
26
24
27
-
## Example: Reading Command Line Arguments
25
+
The following code shows you an example of defining and then reading a custom command-line argument.
28
26
```
29
27
private const string k_OverrideArg = "-argName";
30
28
@@ -49,8 +47,6 @@ if (ParseCommandLineOptions(out var command))
49
47
}
50
48
```
51
49
52
-
---
53
-
54
50
## Override connection data
55
51
56
52
If you want to ignore the connection port provided through command-line arguments, you can override it by using the optional `forceOverride` parameter in:
0 commit comments