23 lines
477 B
C#
23 lines
477 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using TMPro;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
[RequireComponent(typeof(Button))]
|
|
public class CustomInputFieldButton : MonoBehaviour
|
|
{
|
|
public TMP_InputField inputField;
|
|
Button button;
|
|
void Start()
|
|
{
|
|
button = GetComponent<Button>();
|
|
button.onClick.AddListener(OnClick);
|
|
}
|
|
|
|
void OnClick()
|
|
{
|
|
inputField.text+= GetComponentInChildren<TMP_Text>().text;
|
|
}
|
|
}
|