using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
///
/// 矩形遮罩镂空
///
public class RectGuidance : MonoBehaviour
{
public static RectGuidance instance;
///
/// 高亮显示目标
///
public Image target;
///
/// 区域范围缓存
///
private Vector3[] corners = new Vector3[4];
///
/// 镂空区域中心
///
private Vector4 center;
///
/// 最终的偏移x
///
private float targetOffsetX = 0;
///
/// 最终的偏移y
///
private float targetOffsetY = 0;
///
/// 遮罩材质
///
private Material material;
///
/// 当前的偏移x
///
private float currentOffsetX = 0f;
///
/// 当前的偏移y
///
private float currentOffsetY = 0f;
///
/// 事件渗透组件
///
private GuidanceEventPenetrate eventPenetrate;
Canvas canvas;
private void Awake()
{
instance = this;
canvas = GameObject.Find("MainUI").GetComponent