UIRuleControler.cs 518 B

1234567891011121314151617181920212223
  1. using System;
  2. using UnityEngine;
  3. public class UIRuleControler : MonoBehaviour
  4. {
  5. private void Start()
  6. {
  7. UI2DSprite component = base.GetComponent<UI2DSprite>();
  8. component.onRender = delegate(Material mat)
  9. {
  10. mat.SetFloat("_Cutoff", this.m_fCutoff);
  11. float value = -this.m_fCutoff + (1f + this.m_fCutoff) * this.m_fStep;
  12. mat.SetFloat("_Step", value);
  13. mat.SetTexture("_RuleTex", this.m_texRule);
  14. };
  15. }
  16. public float m_fCutoff = 0.1f;
  17. public float m_fStep = 0.5f;
  18. public Texture2D m_texRule;
  19. }