This commit is contained in:
账号名 2024-01-28 15:31:00 +08:00
commit 373f859ec1
3 changed files with 35 additions and 10 deletions

View File

@ -6,7 +6,7 @@ AnimationClip:
m_CorrespondingSourceObject: {fileID: 0} m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0} m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_Name: Radar m_Name: RadarNew
serializedVersion: 6 serializedVersion: 6
m_Legacy: 0 m_Legacy: 0
m_Compressed: 0 m_Compressed: 0

View File

@ -38,7 +38,7 @@ RenderSettings:
m_ReflectionIntensity: 1 m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0} m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 1113159741} m_Sun: {fileID: 1113159741}
m_IndirectSpecularColor: {r: 0.16207841, g: 0.30599776, b: 0.6701277, a: 1} m_IndirectSpecularColor: {r: 0.16235614, g: 0.30591527, b: 0.66776896, a: 1}
m_UseRadianceAmbientProbe: 0 m_UseRadianceAmbientProbe: 0
--- !u!157 &3 --- !u!157 &3
LightmapSettings: LightmapSettings:
@ -25857,7 +25857,7 @@ PrefabInstance:
- target: {fileID: 1640552070326309401, guid: 4917651f381dd774e933facd31452d35, - target: {fileID: 1640552070326309401, guid: 4917651f381dd774e933facd31452d35,
type: 3} type: 3}
propertyPath: m_RootOrder propertyPath: m_RootOrder
value: 8 value: 7
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 1640552070326309401, guid: 4917651f381dd774e933facd31452d35, - target: {fileID: 1640552070326309401, guid: 4917651f381dd774e933facd31452d35,
type: 3} type: 3}
@ -49760,6 +49760,8 @@ MonoBehaviour:
m_EditorClassIdentifier: m_EditorClassIdentifier:
wrjMenuSetPanel: {fileID: 729007801} wrjMenuSetPanel: {fileID: 729007801}
canvasRect: {fileID: 147647011} canvasRect: {fileID: 147647011}
eventsystem: {fileID: 1768340610}
RaycastInCanvas: {fileID: 147647008}
--- !u!114 &1436809532 --- !u!114 &1436809532
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -64224,7 +64226,7 @@ MonoBehaviour:
m_PreInfinity: 2 m_PreInfinity: 2
m_PostInfinity: 2 m_PostInfinity: 2
m_RotationOrder: 4 m_RotationOrder: 4
randSeed: 273660937 randSeed: 16312687
isDoingTransition: 0 isDoingTransition: 0
minimumHeight: 0 minimumHeight: 0
--- !u!114 &1820978574 --- !u!114 &1820978574
@ -89160,7 +89162,7 @@ PrefabInstance:
- target: {fileID: 3494968556799403173, guid: c20b9fea41a9bce4e8780bab3d0e13f9, - target: {fileID: 3494968556799403173, guid: c20b9fea41a9bce4e8780bab3d0e13f9,
type: 3} type: 3}
propertyPath: m_RootOrder propertyPath: m_RootOrder
value: 7 value: 6
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 3494968556799403173, guid: c20b9fea41a9bce4e8780bab3d0e13f9, - target: {fileID: 3494968556799403173, guid: c20b9fea41a9bce4e8780bab3d0e13f9,
type: 3} type: 3}
@ -90818,7 +90820,7 @@ PrefabInstance:
- target: {fileID: 5856212116958320594, guid: eed0736c9868e994ebeff87ecef8c23e, - target: {fileID: 5856212116958320594, guid: eed0736c9868e994ebeff87ecef8c23e,
type: 3} type: 3}
propertyPath: m_RootOrder propertyPath: m_RootOrder
value: 6 value: 5
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 5856212116958320594, guid: eed0736c9868e994ebeff87ecef8c23e, - target: {fileID: 5856212116958320594, guid: eed0736c9868e994ebeff87ecef8c23e,
type: 3} type: 3}

View File

@ -4,6 +4,8 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using UnityEngine; using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;
namespace Assets.Zion.Scripts.Adam namespace Assets.Zion.Scripts.Adam
{ {
@ -25,6 +27,7 @@ namespace Assets.Zion.Scripts.Adam
RaycastHit hitInfo; RaycastHit hitInfo;
if (Physics.Raycast(ray, out hitInfo, 1000)) if (Physics.Raycast(ray, out hitInfo, 1000))
{ {
if (CheckGuiRaycastObjects()) return;
EquipmentCommon ec = hitInfo.collider.GetComponent<EquipmentCommon>(); EquipmentCommon ec = hitInfo.collider.GetComponent<EquipmentCommon>();
if (ec != null && ec.isPlayer) if (ec != null && ec.isPlayer)
{ {
@ -35,6 +38,14 @@ namespace Assets.Zion.Scripts.Adam
wrjMenuSetPanel.gameObject.SetActive(true); wrjMenuSetPanel.gameObject.SetActive(true);
wrjMenuSetPanel.anchoredPosition = new Vector3(posItem.x + 100f, posItem.y, posItem.z); wrjMenuSetPanel.anchoredPosition = new Vector3(posItem.x + 100f, posItem.y, posItem.z);
} }
else
{
wrjMenuSetPanel.localScale = Vector3.zero;
}
}
else
{
wrjMenuSetPanel.localScale = Vector3.zero;
} }
} }
else else
@ -44,9 +55,21 @@ namespace Assets.Zion.Scripts.Adam
} }
} }
public EventSystem eventsystem;
public GraphicRaycaster RaycastInCanvas;
/// <summary>
/// UI 防穿透
/// </summary>
/// <returns></returns>
public bool CheckGuiRaycastObjects()
{
PointerEventData eventData = new PointerEventData(eventsystem);
eventData.pressPosition = Input.mousePosition;
eventData.position = Input.mousePosition;
List<RaycastResult> list = new List<RaycastResult>();
RaycastInCanvas.Raycast(eventData, list);
return list.Count > 0;
}
public Vector3 GetScreenPosition(GameObject target) public Vector3 GetScreenPosition(GameObject target)
{ {