This commit is contained in:
parent
938bc95dfd
commit
efa7f0fe20
|
@ -1,6 +1,8 @@
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
using UnityEngine.EventSystems;
|
||||||
|
using UnityEngine.UI;
|
||||||
|
|
||||||
public class GlobalFlag
|
public class GlobalFlag
|
||||||
{
|
{
|
||||||
|
@ -27,4 +29,13 @@ public class GlobalFlag
|
||||||
/// 红方蓝方
|
/// 红方蓝方
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static int blueOrRed = -1;
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -256,6 +256,10 @@ public class TerrestrialRadioInterferenceManger : MonoBehaviour
|
||||||
RaycastHit hit;
|
RaycastHit hit;
|
||||||
if (Physics.Raycast(ray, out hit))
|
if (Physics.Raycast(ray, out hit))
|
||||||
{
|
{
|
||||||
|
//if (CheckGuiRaycastObjects())
|
||||||
|
//{
|
||||||
|
// return;
|
||||||
|
//}
|
||||||
if (EventSystem.current.IsPointerOverGameObject())
|
if (EventSystem.current.IsPointerOverGameObject())
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue