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 System.Collections.Generic; | |
| using UnityEngine.UI; | |
| namespace MochiLabs.UI.Effects { | |
| [AddComponentMenu("UI/Effects/Tint")] | |
| public class Tint : BaseVertexEffect { | |
| [SerializeField] | |
| private Color32 tintColor = new Color32(225,225,225,255); | |
| public override void ModifyVertices(List<UIVertex> vertexList) { | |
| if (!IsActive()) | |
| return; | |
| int count = vertexList.Count; | |
| for (int i = 0; i < count; i++) { | |
| UIVertex uiVertex = vertexList[i]; | |
| uiVertex.color = (Color)uiVertex.color * (Color)tintColor; | |
| vertexList[i] = uiVertex; | |
| } | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment