using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.EventSystems;
public class shubiao : MonoBehaviour, IPointerDownHandler, IPointerUpHandler
{
private Button Strawbtn;
private bool isDown = false;
// Start is called before the first frame update
void Start()
{
Strawbtn = GameObject.Find(“diguan”).GetComponent();
}
// Update is called once per frame
void Update()
{
if (isDown)
{
Strawbtn.transform.position = Input.mousePosition;
}
}
public void OnPointerDown(PointerEventData eventData)
{
isDown = true;
}
public void OnPointerUp(PointerEventData eventData)
{
isDown = false;
}
}