Text
首行缩进:<color=#FFFFFF00>缩进、切换中文全角点空格
空格:<color=#aaaaaa00>a(a空一格;aa空两格)
打字机形式:使用DOTween
TiShiText.DOText("0123456789", 2).SetEase(Ease.Linear);
修改Text颜色:
public class TextColorChange : MonoBehaviour
{
public Text text;
void Start()
{
text.color = Color.white;
}
}
输入RGB值
public class TextColorChange : MonoBehaviour
{
public Text text;
void Start()
{
text.color = new Color(129 / 255f, 69 / 255f, 69 / 255f, 255 / 255f);
}
}
16进制转颜色
public class TextColorChange : MonoBehaviour
{
public Text text;
Color newColor
void Start()
{
ColorUtility.TryParseHtmlString("#A68D00", out newColor);
//使用
text.color = newColor;
}
}
color转16进制
input16Color.text = ColorUtility.ToHtmlStringRGB(nowColor);