Created
April 15, 2016 13:51
-
-
Save tsubaki/7ad6ce5f20849e6f0c432e63fc44cea1 to your computer and use it in GitHub Desktop.
テキストを動かす奴の基本
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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