Version: Unity 6.0 (6000.0)
LanguageEnglish
  • C#

PlayerSettings.SetPlatformIcons

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Switch to Manual

Declaration

public static void SetPlatformIcons(Build.NamedBuildTarget buildTarget, PlatformIconKind kind, PlatformIcon[] icons);
Obsolete Use SetPlatformIcons(NamedBuildTarget , PlatformIconKind) instead.

Declaration

public static void SetPlatformIcons(BuildTargetGroup platform, PlatformIconKind kind, PlatformIcon[] icons);

Parameters

Parameter Description
buildTarget The NamedBuildTarget.
kind The PlatformIconKind for the platform.
icons 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.

Description

Assign a list of icons for the specified build target and platform icon kind.

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.

Additional resources: PlayerSettings.GetPlatformIcons, PlatformIcon.SetTexture, PlatformIcon.SetTextures.

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); } }