| Parameter | Description |
|---|---|
| density | The density to read. |
LocalizedTexture The icon for that density.
Returns the icon assigned for a density.
The returned object is the stored one, so assigning to its properties changes what this type holds. Every
density has an icon object from the moment this type is created; an unassigned one reports
LocalizedReference.IsEmpty as true.
Additional resources: IconDensity
Assign a localized icon for one density.
using Unity.Localization; using Android = Unity.Localization.Android;
namespace Unity.Localization.Samples { public class AndroidIconsExample { // Every density has to be assigned, or the locale keeps the icons from the Player Settings. static readonly (Android.IconDensity density, string key)[] k_Icons = { (Android.IconDensity.Low, "Launcher Icon ldpi"), (Android.IconDensity.Medium, "Launcher Icon mdpi"), (Android.IconDensity.High, "Launcher Icon hdpi"), (Android.IconDensity.ExtraHigh, "Launcher Icon xhdpi"), (Android.IconDensity.ExtraExtraHigh, "Launcher Icon xxhdpi"), (Android.IconDensity.ExtraExtraExtraHigh, "Launcher Icon xxxhdpi") };
public void Run(Android.AppInfo appInfo) { foreach (var (density, key) in k_Icons) appInfo.LegacyIcons.GetIcon(density).SetReference("App Icons", key); } } }