Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


LocalizedSprite

A serializable reference to a localized sprite asset.
Read time 2 minutesLast updated 7 days ago

Definition

public class LocalizedSprite : LocalizedAsset<Sprite>

Remarks

A LocalizedSprite is a LocalizedAsset<TObject> specialized for Sprite, so it can be serialized and shown in the Inspector. Prefer it over LocalizedTexture for UI images, which take a sprite.
Load a localized sprite.

Examples

using Unity.Localization;using UnityEngine;namespace Unity.Localization.Samples{ public class LocalizedSpriteExample { public async Awaitable Load() { var localizedSprite = new LocalizedSprite(); localizedSprite.SetReference("My Assets", "FLAG"); Sprite sprite = await localizedSprite.GetLocalizedAssetAsync(); if (sprite != null) Debug.Log(sprite.name); } }}

Inheritance