Search Unity

WSA: PlayerSettings.GetIconSizesForTargetGroup & GetIconsForTargetGroup & Co

Discussion in 'Windows' started by mr_zog, May 12, 2017.

  1. mr_zog

    mr_zog

    Joined:
    Jan 21, 2014
    Posts:
    165
    Hi,

    I want to set all the WSA icons and splashscreens via code.
    This always returns length 0, even if I already have set the icons:
    Code (csharp):
    1.  
    2. [MenuItem( "Tools/Windows Store Icon Fix0r" )]
    3.     static void SetIcons()
    4.     {
    5.         var sizes = PlayerSettings.GetIconSizesForTargetGroup(BuildTargetGroup.WSA);
    6.  
    7.         foreach( int size in sizes )
    8.         {
    9.             Debug.Log( "s:" + size );
    10.         }
    11.  
    12.  
    13.         var icons = PlayerSettings.GetIconsForTargetGroup(BuildTargetGroup.WSA);
    14.  
    15.         foreach( var icon in icons )
    16.         {
    17.             Debug.Log( "icon:" + icon.width + "/" + icon.height );
    18.         }
    19.     }
    20.  
    There's a closed source script in the asset store which does this, but it's incomplete/buggy. So it should be possible, but not with this API?
    What would you suggest to use?

    Thanks!
     
  2. mr_zog

    mr_zog

    Joined:
    Jan 21, 2014
    Posts:
    165
    It's a curse ... minutes after posting, I stumbled over this:
    var t = PlayerSettings.WSA.GetVisualAssetsImage(PlayerSettings.WSAImageType.PackageLogo, PlayerSettings.WSAImageScale._100);
    PlayerSettings.WSA.SetVisualAssetsImage("", PlayerSettings.WSAImageType.PackageLogo, PlayerSettings.WSAImageScale._100);

    First test seems to work.