Dedicated Server optimizations
Dedicated Server AssetBundles
Build your application for Dedicated Server
You can create a Dedicated Server build in either of the following ways:
Unity Editor
To create a Dedicated Server build in the Unity Editor, use the following steps:
- Open the Build Profiles window from File > Build Profiles.
- Select Add Build Profile to open the Platform Browser window.
- Select the type of server to build from the list of available platforms. For example, select Linux Server to build a Linux server.
- If the server type isn’t available, select Install with Unity Hub and follow the installation instructions. For information on how to install modules, refer to Add modules.
- Select Switch Profile to set the new build profile as the active profile.
- Click Build.
Tip: You can further configure the Dedicated Server build in the Player settingsSettings that let you set various player-specific options for the final game built by Unity. More info
See in Glossary.
Scripting
To create a Dedicated Server build using a script, set buildPlayerOptions.subtarget
to (int)StandaloneBuildSubtarget.Server
.
buildPlayerOptions.target = BuildTarget.StandaloneWindows;
// SubTarget expects an integer.
buildPlayerOptions.subtarget = (int)StandaloneBuildSubtarget.Server;
Command line
To create a Dedicated Server build through the command line, use the -standaloneBuildSubtarget Server
argument.
-buildTarget Linux64 -standaloneBuildSubtarget Server
Additional resources
Dedicated Server optimizations
Dedicated Server AssetBundles
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。