效果: 点击白色框可拖拽选择区域 代码: using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.EventSystems; public class jietu : MonoBehaviour, IDragHandler, IEndDragHandler,IBeginDragHandler { void Start() { //DrawTriangle(30, 0, 100, 250, 200, 100, mat);//三角形的三个定点坐标 } public void OnBeginDrag(PointerEventData eventData) { dragObj = eventData.rawPointerPress; } public void OnDrag(PointerEventData eventData) { if (dragObj!=null) { dragObj.transform.position = Input.mousePosition; leftBottomPos = leftBottom.transform.position; leftTopPos = leftTop.transform.position;