テキストを動かす奴の基本
This file contains 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