jcayro
1
I’m working on a unity project in version 5.6.2f1 with license plus and for iOS platform.
I want to change the icon default by code, I have searched in forums and propose the following code:
Texture2D icon = Resources.Load(iconName) as Texture2D;
Texture2D[ ] icons = new Texture2D[ ]{icon, icon, icon, icon};
PlayerSettings.SetIconsForTargetGroup(BuildTargetGroup.iOS, icons);
I try it but it does not work, anyone know how to do this?
Just curious, but why do you need to change the icon through code instead of in player settings directly?
I’ve never tried to change it through code personally.
Otherwise, the doc says you need to get the icon size Unity - Scripting API: PlayerSettings.SetIconsForTargetGroup
using GetIconSizesForTargetGroup, so if your array size doesn’t provide enough or gives to many icons, it doesn’t get assigned.
jcayro
3
Thanks! it was an array size problem, now it works.