33 lines
827 B
C#
33 lines
827 B
C#
|
using System;
|
|||
|
using TMPro;
|
|||
|
using UnityEngine;
|
|||
|
using ZGame;
|
|||
|
|
|||
|
namespace HK.Keyboard
|
|||
|
{
|
|||
|
[RequireComponent(typeof(TMP_InputField))]
|
|||
|
public class TMP_InputField_Register : MonoBehaviour
|
|||
|
{
|
|||
|
TMP_InputField inputField;
|
|||
|
public Action OKAction;
|
|||
|
|
|||
|
private void Awake()
|
|||
|
{
|
|||
|
inputField = GetComponent<TMP_InputField>();
|
|||
|
|
|||
|
inputField.shouldHideSoftKeyboard = true;
|
|||
|
inputField.onSelect.AddListener(SelectInputField);
|
|||
|
}
|
|||
|
|
|||
|
private void OnDestroy()
|
|||
|
{
|
|||
|
inputField.onSelect.RemoveListener(SelectInputField);
|
|||
|
}
|
|||
|
|
|||
|
private void SelectInputField(string arg0)
|
|||
|
{
|
|||
|
EventManager.Instance.FireNow(OpenKeyboardEventArgs.EventId,
|
|||
|
new OpenKeyboardEventArgs(inputField, OKAction));
|
|||
|
}
|
|||
|
}
|
|||
|
}
|