using System;
using I2.Loc;
using UnityEngine;

public class PositionStoreForLocalize : UIWFPositionStore
{
	public void Awake()
	{
		LocalizationManager.OnLocalizeEvent += this.OnLocalize;
	}

	public void OnEnable()
	{
		this.OnLocalize();
	}

	private void OnDestroy()
	{
		LocalizationManager.OnLocalizeEvent -= this.OnLocalize;
	}

	protected void OnLocalize()
	{
		if (!base.gameObject.activeInHierarchy || this.targetLanguage != Product.systemLanguage)
		{
			return;
		}
		base.Apply();
	}

	[SerializeField]
	protected Product.Language targetLanguage;
}
