Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

unity ihandler click right button

using UnityEngine;
using UnityEngine.UI;
using UnityEngine.EventSystems;
 
public class ClickableObject : MonoBehaviour, IPointerClickHandler {
 
    public void OnPointerClick(PointerEventData eventData)
    {
        if (eventData.button == PointerEventData.InputButton.Left)
            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");
    }
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: array sort c# 
Csharp :: unity sound 
Csharp :: roman 
Csharp :: count number of properties on an object C# 
Csharp :: how to rotate object in unity only on one axis 
Csharp :: c# round double 
Csharp :: c# list 
Csharp :: wpf messagebox result 
Csharp :: how to create a list c# 
Csharp :: c# how does comparing datetime work 
Csharp :: c# if statement 
Csharp :: switch expression c# multiple cases 
Csharp :: c# remove word from string 
Csharp :: delegate in c# 
Csharp :: website link c# 
Csharp :: font dialog c# code 
Csharp :: add a dictionary to another dictionary c# 
Csharp :: override gethashcode 
Csharp :: how to write a list to csv c# 
Csharp :: xamarin picker 
Csharp :: convert decimal to 2 decimal places c# 
Csharp :: how get data from json in c# 
Csharp :: c# switch statements 
Csharp :: c# array display 
Csharp :: c# regex find last match 
Csharp :: c# allowedusernamecharacters 
Csharp :: data annotations in asp.net core 
Csharp :: c# function 
Csharp :: authentication and authorization in asp.net c# with example 
Csharp :: initialize a char array java 
ADD CONTENT
Topic
Content
Source link
Name
4+5 =