Skip to content

Instantly share code, notes, and snippets.

@tsubaki
Created April 15, 2016 13:51
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tsubaki/7ad6ce5f20849e6f0c432e63fc44cea1 to your computer and use it in GitHub Desktop.
Save tsubaki/7ad6ce5f20849e6f0c432e63fc44cea1 to your computer and use it in GitHub Desktop.
テキストを動かす奴の基本
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
using UnityEngine.EventSystems;
using System.Collections.Generic;
public class TextEffect : UIBehaviour, IMeshModifier {
public new void OnValidate()
{
base.OnValidate ();
var graphics = base.GetComponent<Graphic> ();
if (graphics != null) {
graphics.SetVerticesDirty ();
}
}
public void ModifyMesh (Mesh mesh){}
public void ModifyMesh (VertexHelper verts)
{
var stream = ListPool<UIVertex>.Get ();
verts.GetUIVertexStream (stream);
modify (ref stream);
verts.Clear();
verts.AddUIVertexTriangleStream(stream);
ListPool<UIVertex>.Release (stream);
}
void modify( ref List<UIVertex> stream ){
// 頂点を云々する。1テキスト6頂点
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment