LocalizedTexture
A serializable reference to a localized texture asset.
Read time 2 minutesLast updated 7 days ago
Definition
- Type: Class
- Namespace: Unity.Localization
- Assembly: UnityEngine.LocalizationRuntimeModule
- Inherits from: LocalizedAsset<Texture>
public class LocalizedTexture : LocalizedAsset<Texture>
Remarks
A LocalizedTexture is a LocalizedAsset<TObject> specialized for Texture, so it can be serialized and shown in the Inspector.
Additional Resources: LocalizedAsset<TObject>, ResourceDatabase
Load a localized texture.
Examples
using Unity.Localization;using UnityEngine;namespace Unity.Localization.Samples{ public class LocalizedTextureExample { public async Awaitable Load() { var localizedTexture = new LocalizedTexture(); localizedTexture.SetReference("My Assets", "ICON"); Texture texture = await localizedTexture.GetLocalizedAssetAsync(); if (texture != null) Debug.Log(texture.name); } }}
Constructors
Constructor | Description |
|---|---|
| LocalizedTexture() | Creates a localized texture reference. |