Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

unity know when mouse on ui

using System.Linq;
using UnityEngine;
using UnityEngine.EventSystems;


public static bool IsPointerOverUIElement()
    {
        var eventData = new PointerEventData(EventSystem.current);
        eventData.position = Input.mousePosition;
        var results = new List<RaycastResult>();
        EventSystem.current.RaycastAll(eventData, results);
        return results.Where(r => r.gameObject.layer == 5).Count() > 0;
    }
Comment

PREVIOUS NEXT
Code Example
Csharp :: linq select count group by c# 
Csharp :: c# get file extension 
Csharp :: website link in unity 
Csharp :: How To Copy a text C# unity 
Csharp :: q# hello world 
Csharp :: how to find how much digits in number c# 
Csharp :: c# 8 null coalescing assignment 
Csharp :: how to insert qoutation marks into string c# 
Csharp :: jitter on collision for 2 rigid bodies 
Csharp :: check if belnd tree plaiying 
Csharp :: c# conver date utc to cst 
Csharp :: c# take only int from string 
Csharp :: C# metodas duomenu paemimui veiksmams ir grazinimui 
Csharp :: c# rename file 
Csharp :: unity how to ommit letters from a string 
Csharp :: unity how to get fps c# 
Csharp :: c # c^b 
Csharp :: unity2d click on gameobject 
Csharp :: gvrviewer.instance.triggered replacement unity 
Csharp :: the .net core sdk cannot be located unity 
Csharp :: c# how to exit program 
Csharp :: how create another new app file in laravel 
Csharp :: assign long value c# 
Csharp :: exit programm c# 
Csharp :: how to check the distance between two dates c# 
Csharp :: beep sound in c# 
Csharp :: Xamarin.Forms - How to navigate to a tabbed page child page 
Csharp :: small modal popup bootstrap 
Csharp :: c# float to string with 2 decimals 
Csharp :: c# date 
ADD CONTENT
Topic
Content
Source link
Name
5+1 =