Commit 97beae3b authored by 16이진형's avatar 16이진형

더블클릭 왼쪽 마우스만 인식하게 변경

parent 9d74ef11
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using UnityEngine; using UnityEngine;
using UnityEngine.EventSystems;
public class DoubleClick : MonoBehaviour public class DoubleClick : MonoBehaviour, IPointerClickHandler
{ {
...@@ -18,7 +19,7 @@ public class DoubleClick : MonoBehaviour ...@@ -18,7 +19,7 @@ public class DoubleClick : MonoBehaviour
// Start is called before the first frame update // Start is called before the first frame update
void Start() void Start()
{ {
} }
// Update is called once per frame // Update is called once per frame
...@@ -30,8 +31,30 @@ public class DoubleClick : MonoBehaviour ...@@ -30,8 +31,30 @@ public class DoubleClick : MonoBehaviour
} }
} }
public void OnPointerClick(PointerEventData eventData)
{
if (eventData.button == PointerEventData.InputButton.Left)
{
OnClick();
//Debug.Log("Left click");
}
else if (eventData.button == PointerEventData.InputButton.Middle)
{
//Debug.Log("Middle click");
}
else if (eventData.button == PointerEventData.InputButton.Right)
{
//Debug.Log("Right click");
}
}
public void OnClick() public void OnClick()
{ {
/*
if(eventData.button != PointerEventData.InputButton.Left)
{
return;
}*/
if (click) if (click)
{ {
OnDoubleClick(); OnDoubleClick();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment