Skip to content

Commit

Permalink
com.utilities.buildpipeline 1.5.1 (#38)
Browse files Browse the repository at this point in the history
- set a unity logo app icon if no default app icon is set
  • Loading branch information
StephenHodgson authored Oct 14, 2024
1 parent dc57502 commit 596b498
Show file tree
Hide file tree
Showing 6 changed files with 184 additions and 1 deletion.
21 changes: 21 additions & 0 deletions Editor/BuildInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,27 @@ public string Configuration
/// <inheritdoc />
public virtual void OnPreProcessBuild(BuildReport report)
{
#if UNITY_6000_0_OR_NEWER
var defaultIcons = PlayerSettings.GetIcons(UnityEditor.Build.NamedBuildTarget.FromBuildTargetGroup(BuildTargetGroup.Unknown), IconKind.Any);
#else
var defaultIcons = PlayerSettings.GetIconsForTargetGroup(BuildTargetGroup.Unknown, IconKind.Any);
#endif
if (defaultIcons.Length == 0 || defaultIcons[0] == null)
{
Debug.LogWarning("No app icon set, setting a default...");
var icon = AssetDatabase.LoadAssetAtPath<Texture2D>("Packages/com.utilities.buildpipeline/Editor/Icons/UnityLogo.png");

if (icon == null)
{
throw new MissingReferenceException(nameof(icon));
}
#if UNITY_6000_0_OR_NEWER
PlayerSettings.SetIcons(UnityEditor.Build.NamedBuildTarget.FromBuildTargetGroup(BuildTargetGroup.Unknown), new[] { icon }, IconKind.Any);
#else
PlayerSettings.SetIconsForTargetGroup(BuildTargetGroup.Unknown, new[] { icon });
#endif
AssetDatabase.SaveAssets();
}
}

/// <inheritdoc />
Expand Down
8 changes: 8 additions & 0 deletions Editor/Icons.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added Editor/Icons/UnityLogo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
152 changes: 152 additions & 0 deletions Editor/Icons/UnityLogo.png.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Editor/Platforms/AndroidBuildInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ public override void ParseCommandLineArgs()
/// <inheritdoc />
public override void OnPreProcessBuild(BuildReport report)
{
base.OnPreProcessBuild(report);

if (EditorUserBuildSettings.activeBuildTarget != BuildTarget)
{
return;
Expand Down
2 changes: 1 addition & 1 deletion package.json
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.0",
"version": "1.5.1",
"unity": "2019.4",
"documentationUrl": "https://github.com/RageAgainstThePixel/com.utilities.buildpipeine#documentation",
"changelogUrl": "https://github.com/RageAgainstThePixel/com.utilities.buildpipeine/releases",
Expand Down

0 comments on commit 596b498

Please sign in to comment.