This commit is contained in:
huangjiayu 2023-09-18 15:46:36 +08:00
commit ffc1d0e123
4 changed files with 8 additions and 20 deletions

View File

@ -1,6 +1,7 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
public class ShowNameplate : MonoBehaviour
{
@ -15,9 +16,12 @@ public class ShowNameplate : MonoBehaviour
private void OnMouseDown()
{
if (EventSystem.current.IsPointerOverGameObject())
{
return;
}
NameplateController.Instance.RefreshShown();
if (!NameplateController.Instance.DictextMeshPro.ContainsKey(myName))
if (!NameplateController.Instance.DictextMeshPro.ContainsKey(myName))
{
return;
}
@ -26,7 +30,7 @@ public class ShowNameplate : MonoBehaviour
NameplateController.Instance.NameplateImage.overrideSprite = sprite;
NameplateController.Instance.NameplateImage.SetNativeSize();
switch (myName)
switch (myName)
{
case "低压互感器铭牌":
multiple = 1.0f;

View File

@ -10137,7 +10137,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: -491602864608504868, guid: 6fbd9caa46e05824fb3eba389c7d1b27, type: 3}
propertyPath: m_IsActive
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: -491602864608504868, guid: 6fbd9caa46e05824fb3eba389c7d1b27, type: 3}
propertyPath: m_TagString

View File

@ -26,13 +26,10 @@ public class MultimeterManager : MonoBehaviour
{
// 从相机位置发射一条射线经过屏幕上的鼠标点击位置
Ray ray = Camera.ScreenPointToRay(Input.mousePosition);
// 声明一个射线碰撞信息类
RaycastHit hit;
// 进行碰撞检测
bool res = Physics.Raycast(ray, out hit, 1 << 7) && !EventSystem.current.IsPointerOverGameObject();
if (res)
{
// 如果产生了碰撞

View File

@ -41,7 +41,6 @@ public class ClampAmmetersManager : MonoBehaviour
if (clampAmmetersInteractives[i].name.Equals("用电_AA2")|| clampAmmetersInteractives[i].name.Equals("用电_AA3"))
{
clampAmmetersInteractives[i].Fuan = Three.ttpData.data.qxA;
Debug.Log(Three.ttpData.data.qxA + "====Three.ttpData.data.qxA");
}
if (clampAmmetersInteractives[i].name.Equals("用电_BA2")|| clampAmmetersInteractives[i].name.Equals("用电_BA3"))
{
@ -66,18 +65,6 @@ public class ClampAmmetersManager : MonoBehaviour
{
Multimeter[i].activation = Three.ttpData.data.dyC;
}
//if (Multimeter[i].name.Equals("Óõç_N"))
//{
// Multimeter[i].activation = Three.ttpData.data.dyC;
//}
}
}
private void Update()
{
if (Input.GetKeyDown("q"))
{
Debug.Log(Three.ttpData.data.qxA + "====Three.ttpData.data.qxA");
}
}
}