图片:
注释
在Text中可以直接附加上,加上unity自带的shadow,描边等可以实现其他效果
代码
using UnityEngine;
using UnityEngine.UI;
using System.Collections.Generic;
using System;
namespace Kola {
[AddComponentMenu("UI/Kola/UIMirrorText")]
[ExecuteInEditMode]
#if !UNITY_5_1
public class UIMirrorText : BaseMeshEffect
{
//距离,限制范围0-30
[Range(0, 30)]
public float distance;
public override void ModifyMesh(VertexHelper vh)
{
if (!IsActive() || vh.currentVertCount == 0)
{
return;
}
List<UIVertex> vertexs = new List<UIVertex>();
vh.GetUIVertexStream(vertexs);
UIVertex vt;
int count = vertexs.