r2mods/ilspy_dump/ror2_csproj/RoR2.UI/SubmitInputFieldOnEnterKey.cs

24 lines
396 B
C#
Raw Normal View History

2024-10-04 07:26:37 +00:00
using TMPro;
using UnityEngine;
namespace RoR2.UI;
[RequireComponent(typeof(TMP_InputField))]
public class SubmitInputFieldOnEnterKey : MonoBehaviour
{
private TMP_InputField inputField;
private void Awake()
{
inputField = GetComponent<TMP_InputField>();
}
private void Update()
{
if (inputField.isFocused && inputField.text != "")
{
Input.GetKeyDown(KeyCode.Return);
}
}
}