直接上图
直接上代码:
using UnityEngine;
using UnityEngine.UI;
using System.Collections.Generic;
[ExecuteInEditMode]
public class VirticalText : BaseMeshEffect
{
[Tooltip("字和字之间的距离")]
public float spacing = 1;
private float lineSpacing = 1;
private float textSpacing = 1;
private float xOffset = 0;
private float yOffset = 0;
public override void ModifyMesh(VertexHelper helper)
{
if (!IsActive())
return;
List<UIVertex> verts = new List<UIVertex>();
helper.GetUIVertexStream(verts);
Text text = GetComponent<Text>();
TextGenerator tg = text.ca