using System.Collections; using System.Collections.Generic; using UnityEngine; public class MouseDown : MonoBehaviour { // Start is called before the first frame update public GameObject UI; public bool open; public bool answer; public bool actived; public Vector3 mouseDownPosition; void Start() { } // Update is called once per frame void Update() { } public void OnMouseDown() { mouseDownPosition = Input.mousePosition; } public void OnMouseUp() {for (int i = 0; i < UIManager.instance.tanchuang.Length; i++) { if (UIManager.instance.tanchuang[i].activeSelf) { return; } } if ((Input.mousePosition - mouseDownPosition).magnitude < 10) { UI.SetActive(true); actived = true; // UIManager.instance.test(); Debug.Log(gameObject.name); } } }