20 lines
419 B
C#
20 lines
419 B
C#
using UnityEngine;
|
|
using ZXKFramework;
|
|
public class MouseDownUpObj : MonoBehaviour
|
|
{
|
|
private void OnMouseDown()
|
|
{
|
|
if (TryGetComponent(out PC_DownUpEvent downEvent))
|
|
{
|
|
downEvent.down?.Invoke(gameObject);
|
|
}
|
|
}
|
|
private void OnMouseUp()
|
|
{
|
|
if (TryGetComponent(out PC_DownUpEvent upEvent))
|
|
{
|
|
upEvent.up?.Invoke(gameObject);
|
|
}
|
|
}
|
|
}
|