28 lines
579 B
C#
28 lines
579 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using System;
|
|
using UnityEngine.EventSystems;
|
|
|
|
namespace ZXKFramework
|
|
{
|
|
public class MouseClickObj : MonoBehaviour
|
|
{
|
|
public Action<GameObject> down;
|
|
public Action<GameObject> up;
|
|
|
|
private void OnMouseDown()
|
|
{
|
|
//if (!EventSystem.current.IsPointerOverGameObject())
|
|
//{
|
|
down?.Invoke(gameObject);
|
|
//}
|
|
}
|
|
|
|
private void OnMouseUp()
|
|
{
|
|
up?.Invoke(gameObject);
|
|
}
|
|
}
|
|
}
|