Skip to content

Commit 646d505

Browse files
authored
CU-868gjncm9: Fix compilation error on Unity 2022 and newer (#27)
BuildReport API to get build files has changed from Unity 2022.1 onwards
2 parents 94a3b4c + d2d1417 commit 646d505

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

Assets/MXRUS/Editor/Extensions.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,18 @@ void Append(string text, bool newLine = true) {
3636
Append(string.Empty);
3737

3838
// Show files, if any
39-
if (buildReport.files != null) {
39+
BuildFile[] buildFiles;
40+
41+
#if UNITY_2022_1_OR_NEWER
42+
buildFiles = buildReport.GetFiles();
43+
#else
44+
buildFiles = buildReport.files;
45+
#endif
46+
47+
if (buildFiles != null) {
4048
indentLevel = 1;
4149
Append("files:");
42-
foreach (var file in buildReport.files) {
50+
foreach (var file in buildFiles) {
4351
indentLevel = 2;
4452
Append($"id: {file.id}");
4553
Append($"path: {file.path}");

0 commit comments

Comments
 (0)