using System; using UnityEngine; public class UIRuleControler : MonoBehaviour { private void Start() { UI2DSprite component = base.GetComponent(); component.onRender = delegate(Material mat) { mat.SetFloat("_Cutoff", this.m_fCutoff); float value = -this.m_fCutoff + (1f + this.m_fCutoff) * this.m_fStep; mat.SetFloat("_Step", value); mat.SetTexture("_RuleTex", this.m_texRule); }; } public float m_fCutoff = 0.1f; public float m_fStep = 0.5f; public Texture2D m_texRule; }