Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

com.utilities.buildpipeline 1.5.7 #45

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
using UnityEditor.Build;
using UnityEditor.Build.Reporting;
using UnityEngine;
using UnityEngine.SceneManagement;
using Utilities.Editor.BuildPipeline.Logging;
using Debug = UnityEngine.Debug;

Expand Down Expand Up @@ -226,7 +227,36 @@ public static BuildReport BuildUnityPlayer()
Debug.Log($"Build Target: {buildInfo.BuildTarget}");
Debug.Log($"Build Options: {buildInfo.BuildOptions}");
Debug.Log($"Target output: \"{buildInfo.FullOutputPath}\"");
Debug.Log($"Scenes in build:\n{string.Join("\n ", buildInfo.Scenes.Select(scene => scene.path))}");
var scenes = buildInfo.Scenes.Select(scene => scene.path).ToArray();

// get the lightmapping settings for each scene in the build and disable auto lightmap generation
foreach (var editorSettingsBuildScene in buildInfo.Scenes)
{
var scene = SceneManager.GetSceneByPath(editorSettingsBuildScene.path);
var op = SceneManager.LoadSceneAsync(scene.path);

while (!op?.isDone ?? false)
{
Task.Yield();
}

var sceneLightmapSettings = Lightmapping.GetLightingSettingsForScene(scene);

if (sceneLightmapSettings != null)
{
sceneLightmapSettings.autoGenerate = false;
EditorUtility.SetDirty(sceneLightmapSettings);
AssetDatabase.SaveAssetIfDirty(sceneLightmapSettings);
}

op = SceneManager.UnloadSceneAsync(scene);

while (!op?.isDone ?? false)
{
Task.Yield();
}
}
Debug.Log($"Scenes in build:\n{string.Join("\n ", scenes)}");
}

try
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"displayName": "Utilities.BuildPipeline",
"description": "The Build Pipeline Utilities aims to give developers more tools and options when making builds with the command line or with continuous integration.",
"keywords": [],
"version": "1.5.6",
"version": "1.5.7",
"unity": "2019.4",
"documentationUrl": "https://github.com/RageAgainstThePixel/com.utilities.buildpipeine#documentation",
"changelogUrl": "https://github.com/RageAgainstThePixel/com.utilities.buildpipeine/releases",
Expand Down
Loading