弧形Text组件
自己写的一个Unity3D制作弧形文字的组件,喜自取,同时希望有大佬可以优化
下面展示一些
内联代码片
。
// A code block
var foo = 'bar';
// An highlighted block
using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class DotModel
{
public UIVertex lb = new UIVertex();
public UIVertex lt = new UIVertex();
public UIVertex rt = new UIVertex();
public UIVertex rb = new UIVertex();
}
[AddComponentMenu("UI/Effects/Extensions/CurvedText")]
public class CurvedText : BaseMeshEffect
{
public float radius = 600;
[Range(0, 360)]
[SerializeField]
public Double singleAngle = 5;
private float lenghOfWord = 0;
public override void ModifyMesh(VertexHelper vh)
{
if (!IsActive())
{
return;
}
DotModel dotModel = new DotModel();
int dotNum = vh.currentVertCount / 4;
float midNum = (dotNum