using System; using I2.Loc; using UnityEngine; using UnityEngine.Events; [RequireComponent(typeof(Localize))] [RequireComponent(typeof(UILabel))] public class NGUILabelSpacingHold : MonoBehaviour { private void Awake() { if (this.callAwake) { return; } this.callAwake = true; this.localize = base.GetComponent(); this.label = base.GetComponent(); if (this.localize != null && this.label != null) { this.localize.LocalizeEvent.AddListener(new UnityAction(this.OnLocalize)); if (this.label.useFloatSpacing) { this.HoldSpacingX = this.label.floatSpacingX; this.HoldSpacingY = this.label.floatSpacingY; } else { this.HoldSpacingX = (float)this.label.spacingX; this.HoldSpacingY = (float)this.label.spacingY; } this.updateReq = true; this.OnLocalize(); } } public void OnLocalize() { if (!this.callAwake) { this.Awake(); } if (!this.updateReq) { return; } if (LocalizationManager.CurrentLanguageCode == "ja") { if (this.label.useFloatSpacing) { this.label.floatSpacingX = this.HoldSpacingX; this.label.floatSpacingY = this.HoldSpacingY; } else { this.label.spacingX = (int)this.HoldSpacingX; this.label.spacingY = (int)this.HoldSpacingY; } } else if (this.label.useFloatSpacing) { UILabel uilabel = this.label; float num = 0f; this.label.floatSpacingY = num; uilabel.floatSpacingX = num; } else { UILabel uilabel2 = this.label; int num2 = 0; this.label.spacingY = num2; uilabel2.spacingX = num2; } } private float HoldSpacingX; private float HoldSpacingY; private bool updateReq; private bool callAwake; private Localize localize; private UILabel label; }