using System; using UnityEngine; public class PrivateModeEventObject : MonoBehaviour { private void Update() { if (!NInput.GetMouseButtonDown(0)) { return; } if (UICamera.Raycast(Input.mousePosition)) { return; } Ray ray = GameMain.Instance.MainCamera.camera.ScreenPointToRay(Input.mousePosition); RaycastHit raycastHit = default(RaycastHit); if (!Physics.Raycast(ray, out raycastHit, float.PositiveInfinity, LayerMask.GetMask(new string[] { LayerMask.LayerToName(base.gameObject.layer) })) || raycastHit.transform != base.transform) { return; } Debug.Log("■■■■■■■■■■■■■■■■■■■■■■■Hit"); } }