RoundModifier.cs 381 B

12345678910111213
  1. using UnityEngine;
  2. using System.Collections;
  3. using UnityEngine.UI;
  4. [ModifierID("Round")]
  5. public class RoundModifier : ProceduralImageModifier {
  6. #region implemented abstract members of ProceduralImageModifier
  7. public override Vector4 CalculateRadius (Rect imageRect){
  8. float r = Mathf.Min (imageRect.width,imageRect.height)*0.5f;
  9. return new Vector4 (r,r,r,r);
  10. }
  11. #endregion
  12. }