You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
1.0 KiB

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);
}
}
}