A serializable reference to a localized material asset.
A LocalizedMaterial is a LocalizedAsset<T0> specialized for Material, so it
can be serialized and shown in the Inspector.
Additional resources: LocalizedAsset<T0>, ResourceDatabase
<para>Load a localized material.</para>
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); } } }
| Property | Description |
|---|---|
| isDirty | When set to true, the binding instance updates during the next update cycle. When set to false, the binding instance updates only if a change is detected. |
| updateTrigger | When set to BindingUpdateTrigger.EveryUpdate, the binding instance updates in every update, regardless of the data source version. |
| IsEmpty | Whether this reference is unset and resolves to no value. |
| TableEntryReference | The entry within the table collection that this reference resolves. |
| EnableFallback | Whether to walk the locale fallback chain when the resolving locale has no value for this reference. |
| HasLocaleOverride | Whether a locale override is set on this reference. |
| IsEmpty | Whether this reference is unset and resolves to no value. |
| LocaleOverride | The locale used to resolve this reference instead of the locale selected in the project settings. |
| TableReference | The localization table collection that this reference resolves against. |
| Method | Description |
|---|---|
| MarkDirty | Notifies the binding system to process this binding. |
| OnActivated | Called when the binding becomes active for a specific VisualElement. |
| OnDataSourceChanged | Called when the resolved data source of a binding changes. |
| OnDeactivated | Called when the binding is no longer active for a specific VisualElement. |
| Update | Called when the binding system updates the binding. |
| GetLocalizedAsset | Resolves the localized asset synchronously when a synchronous provider and entry can supply it. |
| GetLocalizedAssetAsync | Loads the localized asset asynchronously through the resource database. |
| RefreshAsset | Re-resolves the asset and pushes the result to subscribers. |
| GetEntry | Resolves the entry synchronously from already-loaded tables without triggering a load. |
| GetEntryAsync | Resolves the entry asynchronously, loading the table if it is not already available. |
| SetReference | Sets the table and entry references together so the reference refreshes only once. |
| OnActivated | Starts resolving the reference when it becomes active on an element. |
| OnDeactivated | Stops resolving the reference once it is no longer active on any element. |
| Update | Writes the resolved value to the bound field. |
| Method | Description |
|---|---|
| ForceUpdate | Called when the reference changes so subclasses can refresh any live listeners. |
| ResolveOverrideLocale | Resolves the override locale from the project settings for subclasses to pass to the resource database. |
| Method | Description |
|---|---|
| GetGlobalLogLevel | Gets the global log level for all binding failures. |
| GetPanelLogLevel | Gets the log level for binding failures on a panel. |
| ResetPanelLogLevel | Resets the log level for binding failures on a panel to use the global setting. |
| SetGlobalLogLevel | Sets the log level for all binding failures. |
| SetPanelLogLevel | Sets the log level for binding failures on a panel. |
| Event | Description |
|---|---|
| AssetChanged | Occurs when the resolved asset changes, and once immediately when a handler subscribes. |
| Delegate | Description |
|---|---|
| ChangeHandler | Represents a method that receives a resolved localized asset value. |