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

Review first: Remove .NET Standard 2.1 Dependency & Fix Scripting Restore #113

Merged
merged 3 commits into from
Jul 10, 2023
Merged
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
2 changes: 2 additions & 0 deletions Editor/Build/BuildProject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,7 @@ private static bool BuildPlayer(string notification, BuildReleaseType releaseTyp
string preBuildCompanyName = PlayerSettings.companyName;
string preBuildProductName = PlayerSettings.productName;
string preBuildBundleIdentifier = PlayerSettings.GetApplicationIdentifier(platform.targetGroup);
ScriptingImplementation preBuildImplementation = PlayerSettings.GetScriptingBackend(platform.targetGroup);

// Configure environment settings to match the build configuration
ConfigureEnvironment(releaseType, platform, architecture, scriptingBackend, distribution, buildTime);
Expand Down Expand Up @@ -426,6 +427,7 @@ private static bool BuildPlayer(string notification, BuildReleaseType releaseTyp
PlayerSettings.companyName = preBuildCompanyName;
PlayerSettings.productName = preBuildProductName;
PlayerSettings.SetApplicationIdentifier(platform.targetGroup, preBuildBundleIdentifier);
PlayerSettings.SetScriptingBackend(platform.targetGroup, preBuildImplementation);

return success;
}
Expand Down
2 changes: 1 addition & 1 deletion Editor/Build/Platform/BuildAndroid.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public override void Init()
variants = new BuildVariant[] {
new BuildVariant(_deviceTypeVariantId, EnumNamesToArray<AndroidArchitecture>()
.Skip(1)
.SkipLast(1)
.SkipLast()
.ToArray(),
0, true),
new BuildVariant(_textureCompressionVariantId, EnumNamesToArray<MobileTextureSubtarget>(), 0),
Expand Down
4 changes: 2 additions & 2 deletions Editor/Build/Platform/BuildVariant.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public string variantKey
{
get
{
return isFlag ? string.Join('+', flags) : values[selectedIndex];
return isFlag ? string.Join("+", flags) : values[selectedIndex];
}
}

Expand Down Expand Up @@ -64,7 +64,7 @@ List<int> ConvertFlagsToSelectedIndexList(int number)

public override string ToString()
{
return isFlag ? string.Join('+', flags) : values[selectedIndex];
return isFlag ? string.Join("+", flags) : values[selectedIndex];
}
}
}
16 changes: 16 additions & 0 deletions Editor/Generic/ExtensionMethods.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System.Collections.Generic;
using System.IO;
using System.Text.RegularExpressions;
using UnityEditor;
Expand Down Expand Up @@ -70,5 +71,20 @@ public static void SafeDeleteArrayElementAtIndex(this SerializedProperty value,
if (value.arraySize == oldLength)
value.DeleteArrayElementAtIndex(i);
}

// Provided by Jon Skeet in https://stackoverflow.com/questions/969091/c-skiplast-implementation
public static IEnumerable<T> SkipLast<T>(this IEnumerable<T> source)
{
T previous = default(T);
bool first = true;
foreach (T element in source)
{
if (!first)
yield return previous;

previous = element;
first = false;
}
}
}
}