Script Change Icon(코드로 Icon 변경)
PlayerSetting 의 Icon을 교체해주는 방식으로
사용하는 Unity Version에 따라 다르니 공식문서를 참고하는걸 추천드린다.
<Android Icon 변경 코드>
using UnityEditor.Android;
using UnityEditor;
using UnityEngine;
public static class AndroidPlayerSettingsUtility
{
// `Adaptive` icons for Android require a background and foreground layer for each icon
public static void SetIcons(Texture2D[][] textures)
{
BuildTargetGroup platform = BuildTargetGroup.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);
}
}
반응형
< iOS icon변경 코드 >
using UnityEditor.iOS;
using UnityEditor;
using UnityEngine;
public static class iOSPlayerSettingsUtility
{
// Setting all `App` icons for iOS
public static void SetAppIcons(Texture2D[] textures)
{
BuildTargetGroup platform = BuildTargetGroup.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);
}
}
반응형
< 지원하는 Icon 버전 >
참고로 Android의 Adaptive Icon은 지원하는 버전이 존재한다.
설명 | |
Adaptive | Introduced in Android 8.0 (API level 26). |
Legacy | Single layer icons primarily used by devices running Android 7.0 (API level 24) or below. |
Round | Introduced in Android 7.1 (API level 25). |
Unity PlayerSettingAndroid : [링크]
Unity -(2020.3)PlayerSettings.SetPlatformIcons : [링크]
AndroidPlatformIconKind : [링크]
★☆☆☆☆
반응형
댓글