Version: 2023.2
Dedicated Server optimizations
Dedicated Server AssetBundles

Build your application for Dedicated Server

You can create a Dedicated Server build through either of the following ways:

Unity Editor

To create a Dedicated Server build through the Unity Editor:

  1. From the Unity Editor, select File > Build Settings.
  2. Select Dedicated Server.
Add Dedicated Server Build Support module
Add Dedicated Server Build Support module

Tip: You can further configure the Dedicated Server build through the Player settings.

脚本

To create a Dedicated Server build through a script:

Set buildPlayerOptions.subtarget to (int)StandaloneBuildSubtarget.Server. For example, refer to the following code snippet.

buildPlayerOptions.target = BuildTarget.StandaloneWindows;
// SubTarget expects an integer.
buildPlayerOptions.subtarget = (int)StandaloneBuildSubtarget.Server;

Refer to Creating and Using Scripts to learn more.

Command line

To create a Dedicated Server build through the command line, use the -standaloneBuildSubtarget Server argument. For example, refer to the following code snippet.

-buildTarget Linux64 -standaloneBuildSubtarget Server
Dedicated Server optimizations
Dedicated Server AssetBundles
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961