Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


SetPlatformIcons

Assign a list of icons for the specified build target and platform icon kind.
Read time 3 minutesLast updated 11 days ago

Definition

  • Type: Method
  • Namespace: UnityEditor
  • Assembly: UnityEditor

SetPlatformIcons(BuildTargetGroup, PlatformIconKind, PlatformIcon[])

Assign a list of icons for the specified build target and platform icon kind.
Warning
Deprecated. Use SetPlatformIcons(NamedBuildTarget , PlatformIconKind) instead
public static void SetPlatformIcons(BuildTargetGroup platform, PlatformIconKind kind, PlatformIcon[] icons)

Parameters


The PlatformIconKind for the platform.

The PlatformIcon array from PlayerSettings.GetPlatformIcons for the same build target and kind. The array length must match the required slot count. Fill each slot with PlatformIcon.SetTexture or PlatformIcon.SetTextures.

Remarks

The icons array must be the one returned by PlayerSettings.GetPlatformIcons for the same build target and kind; texture assets must be in the project. The BuildTargetGroup overload is marked for deprecation in the future; use the NamedBuildTarget overload instead.
Example: Set application icons for an Android application with the Editor script. Place the script in the
Editor
folder.
using UnityEditor.Android;using UnityEditor;using UnityEngine;using UnityEditor.Build;public static class AndroidPlayerSettingsUtility{ // `Adaptive` icons for Android require a background and foreground layer for each icon public static void SetIcons(Texture2D[][] textures) { NamedBuildTarget platform = NamedBuildTarget.Android; PlatformIconKind kind = AndroidPlatformIconKind.Adaptive; PlatformIcon[] icons = PlayerSettings.GetPlatformIcons(platform, kind); //Assign textures to each available icon slot. for (int i = 0; i < icons.Length; i++) { icons[i].SetTextures(textures[i]); } PlayerSettings.SetPlatformIcons(platform, kind, icons); }}
Example: Set application icons for an iOS application with the Editor script. Place the script in the
Editor
folder.
using UnityEditor.iOS;using UnityEditor;using UnityEngine;using UnityEditor.Build;public static class iOSPlayerSettingsUtility{ // Setting all `App` icons for iOS public static void SetAppIcons(Texture2D[] textures) { NamedBuildTarget platform = NamedBuildTarget.iOS; PlatformIconKind kind = iOSPlatformIconKind.Application; PlatformIcon[] icons = PlayerSettings.GetPlatformIcons(platform, kind); //Assign textures to each available icon slot. for (int i = 0; i < icons.Length; i++) { icons[i].SetTextures(textures[i]); } PlayerSettings.SetPlatformIcons(platform, kind, icons); }}

SetPlatformIcons(NamedBuildTarget, PlatformIconKind, PlatformIcon[])

Assign a list of icons for the specified build target and platform icon kind.
public static void SetPlatformIcons(NamedBuildTarget buildTarget, PlatformIconKind kind, PlatformIcon[] icons)

Parameters


The PlatformIconKind for the platform.

The PlatformIcon array from PlayerSettings.GetPlatformIcons for the same build target and kind. The array length must match the required slot count. Fill each slot with PlatformIcon.SetTexture or PlatformIcon.SetTextures.

Remarks

The icons array must be the one returned by PlayerSettings.GetPlatformIcons for the same build target and kind; texture assets must be in the project. The BuildTargetGroup overload is marked for deprecation in the future; use the NamedBuildTarget overload instead.
Example: Set application icons for an Android application with the Editor script. Place the script in the
Editor
folder.
using UnityEditor.Android;using UnityEditor;using UnityEngine;using UnityEditor.Build;public static class AndroidPlayerSettingsUtility{ // `Adaptive` icons for Android require a background and foreground layer for each icon public static void SetIcons(Texture2D[][] textures) { NamedBuildTarget platform = NamedBuildTarget.Android; PlatformIconKind kind = AndroidPlatformIconKind.Adaptive; PlatformIcon[] icons = PlayerSettings.GetPlatformIcons(platform, kind); //Assign textures to each available icon slot. for (int i = 0; i < icons.Length; i++) { icons[i].SetTextures(textures[i]); } PlayerSettings.SetPlatformIcons(platform, kind, icons); }}
Example: Set application icons for an iOS application with the Editor script. Place the script in the
Editor
folder.
using UnityEditor.iOS;using UnityEditor;using UnityEngine;using UnityEditor.Build;public static class iOSPlayerSettingsUtility{ // Setting all `App` icons for iOS public static void SetAppIcons(Texture2D[] textures) { NamedBuildTarget platform = NamedBuildTarget.iOS; PlatformIconKind kind = iOSPlatformIconKind.Application; PlatformIcon[] icons = PlayerSettings.GetPlatformIcons(platform, kind); //Assign textures to each available icon slot. for (int i = 0; i < icons.Length; i++) { icons[i].SetTextures(textures[i]); } PlayerSettings.SetPlatformIcons(platform, kind, icons); }}