1234567891011121314151617181920212223242526272829303132333435363738394041 |
- using System;
- using UnityEngine;
- public class PrivateModeEventObject : MonoBehaviour
- {
- public int GetEventNo()
- {
- return this.eventNo;
- }
- 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;
- }
- if (PrivateModeEventObject.onClickObject != null)
- {
- PrivateModeEventObject.onClickObject(this.eventNo);
- }
- }
- [SerializeField]
- [Header("イベント番号")]
- private int eventNo;
- public static Action<int> onClickObject;
- }
|