Merge branch 'master' of http://git.umayle.com:2023/yulong/NewN_UAVPlane
This commit is contained in:
commit
2da0c9d838
|
@ -1,6 +1,8 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class GlobalFlag
|
||||
{
|
||||
|
@ -27,4 +29,13 @@ public class GlobalFlag
|
|||
/// 红方蓝方
|
||||
/// </summary>
|
||||
public static int blueOrRed = -1;
|
||||
public static bool CheckGuiRaycastObjects(EventSystem eventSystem, GraphicRaycaster graphicRaycaster)
|
||||
{
|
||||
PointerEventData eventData = new PointerEventData(eventSystem);
|
||||
eventData.pressPosition = Input.mousePosition;
|
||||
eventData.position = Input.mousePosition;
|
||||
List<RaycastResult> list = new List<RaycastResult>();
|
||||
graphicRaycaster.Raycast(eventData, list);
|
||||
return list.Count > 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -245,6 +245,8 @@ public class TerrestrialRadioInterferenceManger : MonoBehaviour
|
|||
Detection();
|
||||
|
||||
}
|
||||
public EventSystem eventsystem;
|
||||
public GraphicRaycaster RaycastInCanvas;
|
||||
/// <summary>
|
||||
/// 点击无线电显示UI
|
||||
/// <summary>
|
||||
|
@ -256,6 +258,10 @@ public class TerrestrialRadioInterferenceManger : MonoBehaviour
|
|||
RaycastHit hit;
|
||||
if (Physics.Raycast(ray, out hit))
|
||||
{
|
||||
if (GlobalFlag.CheckGuiRaycastObjects(eventsystem, RaycastInCanvas))
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (EventSystem.current.IsPointerOverGameObject())
|
||||
{
|
||||
return;
|
||||
|
|
Loading…
Reference in New Issue