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