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