Files
RealVRFishingFix/Assets/Photon/PhotonChat/Demos/Demo Chat/Code/Utilities/IgnoreUiRaycastWhenInactive.cs
2026-04-28 10:38:08 +08:00

14 lines
381 B
C#

using UnityEngine;
namespace Photon.Chat.DemoChat.Utilities
{
// small script to avoid clicks picking inactive UI elements
public class IgnoreUiRaycastWhenInactive : MonoBehaviour, ICanvasRaycastFilter
{
public bool IsRaycastLocationValid(Vector2 screenPoint, Camera eventCamera)
{
return gameObject.activeInHierarchy;
}
}
}