PrivateModeEventObject.cs 684 B

123456789101112131415161718192021222324252627
  1. using System;
  2. using UnityEngine;
  3. public class PrivateModeEventObject : MonoBehaviour
  4. {
  5. private void Update()
  6. {
  7. if (!NInput.GetMouseButtonDown(0))
  8. {
  9. return;
  10. }
  11. if (UICamera.Raycast(Input.mousePosition))
  12. {
  13. return;
  14. }
  15. Ray ray = GameMain.Instance.MainCamera.camera.ScreenPointToRay(Input.mousePosition);
  16. RaycastHit raycastHit = default(RaycastHit);
  17. if (!Physics.Raycast(ray, out raycastHit, float.PositiveInfinity, LayerMask.GetMask(new string[]
  18. {
  19. LayerMask.LayerToName(base.gameObject.layer)
  20. })) || raycastHit.transform != base.transform)
  21. {
  22. return;
  23. }
  24. Debug.Log("■■■■■■■■■■■■■■■■■■■■■■■Hit");
  25. }
  26. }