58 lines
1.6 KiB
C#
58 lines
1.6 KiB
C#
using System;
|
|
using System.Collections;
|
|
using TMPro;
|
|
using UnityEngine;
|
|
using UnityEngine.EventSystems;
|
|
using UnityEngine.UI;
|
|
|
|
// Token: 0x020000DC RID: 220
|
|
public class TextFieldBehavior : MonoBehaviour, ISelectHandler, IEventSystemHandler
|
|
{
|
|
// Token: 0x0600149C RID: 5276 RVA: 0x0018FD48 File Offset: 0x0018DF48
|
|
private void Start()
|
|
{
|
|
this.inputField = base.gameObject.GetComponent<TMP_InputField>();
|
|
this.inputField2 = base.gameObject.GetComponent<InputField>();
|
|
}
|
|
|
|
// Token: 0x0600149D RID: 5277 RVA: 0x0018FD6C File Offset: 0x0018DF6C
|
|
public void OnSelect(BaseEventData eventData)
|
|
{
|
|
base.StartCoroutine(this.disableHighlight());
|
|
}
|
|
|
|
// Token: 0x0600149E RID: 5278 RVA: 0x0018FD7B File Offset: 0x0018DF7B
|
|
private IEnumerator disableHighlight()
|
|
{
|
|
if (this.inputField)
|
|
{
|
|
Color originalTextColor = this.inputField.selectionColor;
|
|
originalTextColor.a = 0f;
|
|
this.inputField.selectionColor = originalTextColor;
|
|
yield return null;
|
|
this.inputField.caretPosition = this.inputField.text.Length;
|
|
originalTextColor.a = 1f;
|
|
this.inputField.selectionColor = originalTextColor;
|
|
originalTextColor = default(Color);
|
|
}
|
|
else
|
|
{
|
|
Color originalTextColor = this.inputField2.selectionColor;
|
|
originalTextColor.a = 0f;
|
|
this.inputField2.selectionColor = originalTextColor;
|
|
yield return null;
|
|
this.inputField2.caretPosition = this.inputField2.text.Length;
|
|
originalTextColor.a = 1f;
|
|
this.inputField2.selectionColor = originalTextColor;
|
|
originalTextColor = default(Color);
|
|
}
|
|
yield break;
|
|
}
|
|
|
|
// Token: 0x040023B3 RID: 9139
|
|
private TMP_InputField inputField;
|
|
|
|
// Token: 0x040023B4 RID: 9140
|
|
private InputField inputField2;
|
|
}
|