123456789101112131415161718192021222324252627282930313233 |
- using UnityEngine;
- using UnityEngine.UI;
- using System.Collections;
- using System.Collections.Generic;
- public class ImagePlus : Image
- {
- #region 变量
- public int StartIndex;
- public string SpriteName;
- public List<UIVertex> TextVertexList;
- #endregion
- protected override void OnPopulateMesh(VertexHelper toFill)
- {
- toFill.Clear();
- UIVertex[] vertices = new UIVertex[4];
- vertices[0].position = TextVertexList[StartIndex*6 + 3].position;
- vertices[1].position = TextVertexList[StartIndex*6 + 3].position;
- vertices[2].position = TextVertexList[StartIndex*6 + 3].position;
- vertices[3].position = TextVertexList[StartIndex*6 + 3].position;
- vertices[0].uv0 = SpriteAsset.SpriteInfoDic[SpriteName].UvList[0];
- vertices[1].uv0 = SpriteAsset.SpriteInfoDic[SpriteName].UvList[1];
- vertices[2].uv0 = SpriteAsset.SpriteInfoDic[SpriteName].UvList[2];
- vertices[3].uv0 = SpriteAsset.SpriteInfoDic[SpriteName].UvList[3];
- }
- }
|