- Home /
[Unity 2021] Setting the Default Icon via script?
Hey there!
In Unity 2020, you could set the default icon in the Project Settings with this code:
PlayerSettings.SetIconsForTargetGroup(BuildTargetGroup.Unknown, new Texture2D[] {defaultIcon});
However, in Unity 2021, PlayerSettings.SetIconsForTargetGroup
is marked as deprecated and it's recommended to use the PlayerSettings.SetIcons
method. But that doesn't seem to be having the desired effect. Trying to set the icon for Build.NamedBuildTarget.Unknown
just results in a console error and setting for any other platform doesn't change the icon shown in Project Settings.
Does anyone know how to do this now in Unity 2021?
Thanks!
Answer by Mr-Zhou · Dec 11, 2021 at 03:24 PM
Hello, I have the same problem now, do you have a solution now? Thanks!
Answer by sofiabrown · Dec 20, 2021 at 08:45 PM
Hi, this was a regression that was introduced in an alpha version of 2021.2.0. The good news is that this has been fixed in 2022.2.0a1, and there is also a backport in progress to 2021.2. You can track its progress here: https://issuetracker.unity3d.com/issues/android-the-default-icon-does-not-get-successfully-changed-to-another-icon
Your answer
Follow this Question
Related Questions
set Application icon from script for build? 0 Answers
GUILayout Icon + Text 3 Answers
Change the icon of a built project? 1 Answer