[C#] 纯文本查看 复制代码using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.EventSystems;
[RequireComponent(typeof(InputField))]
public class InputFieldScaler:MonoBehaviour,ILayoutElement
{
private Text textComponent
{
get
{
return this.GetComponent().textComponent;
}
}
public TextGenerationSettings GetTextGenerationSettings(Vector2 extents)
{
var settings = textComponent.GetGenerationSettings(extents);
settings.generateOutOfBounds = true;
return settings;
}
private RectTransform m_Rect;
private RectTransform rectTransform
{
get
{
if (m_Rect == null)
m_Rect = GetComponent();
retur