ドキュメント

Unity Engine

Unity Engine

専用サーバー用アプリケーションのビルド

Describes how to create a build for Dedicated Server platform.
読み終わるまでの所要時間 3 分最終更新 1ヶ月前

Dedicated Server ビルドの作成は、以下のいずれかの方法で行えます。

Unity エディター

Unity エディターで Dedicated Server ビルドを作成するには、以下の手順を行います。
  1. File > Build Profiles から Build Profiles ウィンドウを開きます。
  2. Add Build Profile を選択すると、Platform Browser ウィンドウが開きます。
  3. 使用可能なプラットフォームのリストからビルドするサーバーの種類を選択します。例えば、Linux Server を選択して Linux サーバーをビルドします。
  4. サーバータイプを使用できない場合は、Install with Unity Hub を選択し、インストール手順に従います。モジュールのインストール方法については、モジュールの追加を参照してください。
  5. Switch Profile を選択して、新しいビルドプロファイルをアクティブなプロファイルとして設定します。
  6. Build をクリックします。
ヒント: Player 設定で Dedicated Server ビルドを詳細に設定できます。

スクリプティング

スクリプトを使用して Dedicated Server ビルドを作成するには、
buildPlayerOptions.subtarget
を
(int)StandaloneBuildSubtarget.Server
に設定します。
buildPlayerOptions.target = BuildTarget.StandaloneWindows;// SubTarget expects an integer.buildPlayerOptions.subtarget = (int)StandaloneBuildSubtarget.Server;

コマンドライン

コマンドラインで Dedicated Server ビルドを作成するには、
-standaloneBuildSubtarget Server
引数を使用します。
-buildTarget Linux64 -standaloneBuildSubtarget Server

追加リソース