Version: 1.5
LanguageEnglish
  • C#

BuildOptions.PackClustersIntoPlayer

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Description

Pack Virtual Geometry cluster when building the player.

See Also: BuildPipeline.BuildPlayer. The following script example illustrates how to use PackClustersIntoPlayer when building a player. Create a project and add the script under Assets/Editor.

using UnityEditor;
using UnityEngine;

public class PackClustersIntoPlayerExample : MonoBehaviour { [MenuItem("Build/PackClustersIntoPlayer example")] public static void MyBuild() { BuildPlayerOptions buildPlayerOptions = new BuildPlayerOptions(); buildPlayerOptions.scenes = new[] { "Assets/scene.unity" }; buildPlayerOptions.locationPathName = "DetailedReportBuild/MyGame.exe"; buildPlayerOptions.target = BuildTarget.StandaloneWindows64;

buildPlayerOptions.options = BuildOptions.PackClustersIntoPlayer;

var buildReport = BuildPipeline.BuildPlayer(buildPlayerOptions); } }