using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class CircleGuide : GuideBase
{

    private float r;        // 镂空区域圆形的半径

    public override void Guide(Canvas canvas, RectTransform target)
    {
        base.Guide(canvas, target);
        float width = (targetCorners[3].x - targetCorners[0].x) / 2;
        float height = (targetCorners[1].y - targetCorners[0].y) / 2;
        // 计算半径 
        r  = Mathf.Sqrt( width * width + height * height);
        // 
        this.material.SetFloat("_Slider", r);
    }
    public void Guide(Canvas canvas, RectTransform target,float Redius)
    {
        base.Guide(canvas, target);
        this.material.SetFloat("_Slider", Redius);
    }
}
