using UnityEngine.Localization.Events; namespace UnityEngine.Localization.Components { /// /// Component that can be used to Localize a [Prefab](https://docs.unity3d.com/Manual/Prefabs.html). /// When the Locale is changed the prefab will be instantiated as a child of the gameobject this component is attached to, the instance will then be sent through . /// [AddComponentMenu("Localization/Asset/Localize Prefab Event")] public class LocalizedGameObjectEvent : LocalizedAssetEvent { GameObject m_Current; /// protected override void UpdateAsset(GameObject localizedAsset) { if (m_Current != null) { Destroy(m_Current); m_Current = null; } if (localizedAsset != null) { m_Current = Instantiate(localizedAsset, transform); m_Current.hideFlags = HideFlags.DontSave | HideFlags.NotEditable; } OnUpdateAsset.Invoke(m_Current); } } }