This commit is contained in:
parent
f4beaae9c5
commit
724d542812
|
@ -240,7 +240,7 @@ GameObject:
|
||||||
- component: {fileID: 4139865883083994037}
|
- component: {fileID: 4139865883083994037}
|
||||||
- component: {fileID: 4800734424466799504}
|
- component: {fileID: 4800734424466799504}
|
||||||
m_Layer: 0
|
m_Layer: 0
|
||||||
m_Name: "ND_\u4E07\u7528\u8868_02"
|
m_Name: "\u6863\u4F4D"
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
m_Icon: {fileID: 0}
|
m_Icon: {fileID: 0}
|
||||||
m_NavMeshLayer: 0
|
m_NavMeshLayer: 0
|
||||||
|
@ -528,7 +528,7 @@ GameObject:
|
||||||
- component: {fileID: 6774997958504205085}
|
- component: {fileID: 6774997958504205085}
|
||||||
- component: {fileID: 4316715026652588437}
|
- component: {fileID: 4316715026652588437}
|
||||||
m_Layer: 0
|
m_Layer: 0
|
||||||
m_Name: "ND_\u4E07\u7528\u8868_04"
|
m_Name: "\u9ED1\u63D2\u5934"
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
m_Icon: {fileID: 0}
|
m_Icon: {fileID: 0}
|
||||||
m_NavMeshLayer: 0
|
m_NavMeshLayer: 0
|
||||||
|
@ -874,7 +874,7 @@ GameObject:
|
||||||
- component: {fileID: 4926728448107073058}
|
- component: {fileID: 4926728448107073058}
|
||||||
- component: {fileID: 2203297996672072483}
|
- component: {fileID: 2203297996672072483}
|
||||||
m_Layer: 0
|
m_Layer: 0
|
||||||
m_Name: "ND_\u4E07\u7528\u8868_03"
|
m_Name: "\u7EA2\u63D2\u5934"
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
m_Icon: {fileID: 0}
|
m_Icon: {fileID: 0}
|
||||||
m_NavMeshLayer: 0
|
m_NavMeshLayer: 0
|
||||||
|
|
|
@ -285,7 +285,7 @@ MonoBehaviour:
|
||||||
id:
|
id:
|
||||||
isInstall: 1
|
isInstall: 1
|
||||||
installPos: {fileID: 2576541080142119082}
|
installPos: {fileID: 2576541080142119082}
|
||||||
hasElectricity: 0
|
hasElectricity: 1
|
||||||
initPostionY: 0.0256958
|
initPostionY: 0.0256958
|
||||||
--- !u!114 &2576541079962278358
|
--- !u!114 &2576541079962278358
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
|
@ -910,7 +910,7 @@ MonoBehaviour:
|
||||||
id:
|
id:
|
||||||
isInstall: 1
|
isInstall: 1
|
||||||
installPos: {fileID: 2576541080266261661}
|
installPos: {fileID: 2576541080266261661}
|
||||||
hasElectricity: 0
|
hasElectricity: 1
|
||||||
initPostionY: 0.0256958
|
initPostionY: 0.0256958
|
||||||
--- !u!114 &2576541080661371199
|
--- !u!114 &2576541080661371199
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
|
@ -1369,7 +1369,7 @@ MonoBehaviour:
|
||||||
id:
|
id:
|
||||||
isInstall: 1
|
isInstall: 1
|
||||||
installPos: {fileID: 2576541079990510656}
|
installPos: {fileID: 2576541079990510656}
|
||||||
hasElectricity: 0
|
hasElectricity: 1
|
||||||
initPostionY: 0.0256958
|
initPostionY: 0.0256958
|
||||||
--- !u!114 &2576541080516725976
|
--- !u!114 &2576541080516725976
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
|
@ -1662,7 +1662,7 @@ MonoBehaviour:
|
||||||
id:
|
id:
|
||||||
isInstall: 1
|
isInstall: 1
|
||||||
installPos: {fileID: 2576541080447090660}
|
installPos: {fileID: 2576541080447090660}
|
||||||
hasElectricity: 0
|
hasElectricity: 1
|
||||||
initPostionY: 0.0256958
|
initPostionY: 0.0256958
|
||||||
--- !u!114 &2576541080325731228
|
--- !u!114 &2576541080325731228
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
|
@ -2376,7 +2376,7 @@ MonoBehaviour:
|
||||||
id:
|
id:
|
||||||
isInstall: 1
|
isInstall: 1
|
||||||
installPos: {fileID: 2576541080224064224}
|
installPos: {fileID: 2576541080224064224}
|
||||||
hasElectricity: 0
|
hasElectricity: 1
|
||||||
initPostionY: 0.0256958
|
initPostionY: 0.0256958
|
||||||
--- !u!1 &2537738450205131575
|
--- !u!1 &2537738450205131575
|
||||||
GameObject:
|
GameObject:
|
||||||
|
@ -3635,7 +3635,7 @@ MonoBehaviour:
|
||||||
id:
|
id:
|
||||||
isInstall: 1
|
isInstall: 1
|
||||||
installPos: {fileID: 2576541081758559536}
|
installPos: {fileID: 2576541081758559536}
|
||||||
hasElectricity: 0
|
hasElectricity: 1
|
||||||
initPostionY: 0.0256958
|
initPostionY: 0.0256958
|
||||||
--- !u!114 &2576541081429723931
|
--- !u!114 &2576541081429723931
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
|
@ -4382,7 +4382,7 @@ MonoBehaviour:
|
||||||
id:
|
id:
|
||||||
isInstall: 1
|
isInstall: 1
|
||||||
installPos: {fileID: 2576541081645226417}
|
installPos: {fileID: 2576541081645226417}
|
||||||
hasElectricity: 0
|
hasElectricity: 1
|
||||||
initPostionY: 0.0256958
|
initPostionY: 0.0256958
|
||||||
--- !u!114 &2576541080545036941
|
--- !u!114 &2576541080545036941
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
|
@ -4847,7 +4847,7 @@ MonoBehaviour:
|
||||||
id:
|
id:
|
||||||
isInstall: 1
|
isInstall: 1
|
||||||
installPos: {fileID: 2576541080183327174}
|
installPos: {fileID: 2576541080183327174}
|
||||||
hasElectricity: 0
|
hasElectricity: 1
|
||||||
initPostionY: 0.0256958
|
initPostionY: 0.0256958
|
||||||
--- !u!1 &3932947889739227106
|
--- !u!1 &3932947889739227106
|
||||||
GameObject:
|
GameObject:
|
||||||
|
@ -5765,7 +5765,7 @@ MonoBehaviour:
|
||||||
id:
|
id:
|
||||||
isInstall: 1
|
isInstall: 1
|
||||||
installPos: {fileID: 2576541079818901621}
|
installPos: {fileID: 2576541079818901621}
|
||||||
hasElectricity: 0
|
hasElectricity: 1
|
||||||
initPostionY: 0.0256958
|
initPostionY: 0.0256958
|
||||||
--- !u!1 &4627208948562638019
|
--- !u!1 &4627208948562638019
|
||||||
GameObject:
|
GameObject:
|
||||||
|
@ -5886,7 +5886,7 @@ MonoBehaviour:
|
||||||
id:
|
id:
|
||||||
isInstall: 1
|
isInstall: 1
|
||||||
installPos: {fileID: 2576541080163564030}
|
installPos: {fileID: 2576541080163564030}
|
||||||
hasElectricity: 0
|
hasElectricity: 1
|
||||||
initPostionY: 0.0256958
|
initPostionY: 0.0256958
|
||||||
--- !u!114 &2576541080794005321
|
--- !u!114 &2576541080794005321
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
|
@ -6789,7 +6789,7 @@ MonoBehaviour:
|
||||||
id:
|
id:
|
||||||
isInstall: 1
|
isInstall: 1
|
||||||
installPos: {fileID: 2576541079818547023}
|
installPos: {fileID: 2576541079818547023}
|
||||||
hasElectricity: 0
|
hasElectricity: 1
|
||||||
initPostionY: 0.0256958
|
initPostionY: 0.0256958
|
||||||
--- !u!114 &2576541080767639298
|
--- !u!114 &2576541080767639298
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
|
@ -7791,7 +7791,7 @@ MonoBehaviour:
|
||||||
id:
|
id:
|
||||||
isInstall: 1
|
isInstall: 1
|
||||||
installPos: {fileID: 2576541081608891598}
|
installPos: {fileID: 2576541081608891598}
|
||||||
hasElectricity: 0
|
hasElectricity: 1
|
||||||
initPostionY: 0.0256958
|
initPostionY: 0.0256958
|
||||||
--- !u!114 &2576541079857287480
|
--- !u!114 &2576541079857287480
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
|
@ -8167,7 +8167,7 @@ MonoBehaviour:
|
||||||
id:
|
id:
|
||||||
isInstall: 1
|
isInstall: 1
|
||||||
installPos: {fileID: 2576541081575823058}
|
installPos: {fileID: 2576541081575823058}
|
||||||
hasElectricity: 0
|
hasElectricity: 1
|
||||||
initPostionY: 0.0256958
|
initPostionY: 0.0256958
|
||||||
--- !u!114 &2576541080334431883
|
--- !u!114 &2576541080334431883
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
|
@ -9551,7 +9551,7 @@ MonoBehaviour:
|
||||||
id:
|
id:
|
||||||
isInstall: 1
|
isInstall: 1
|
||||||
installPos: {fileID: 2576541081300379520}
|
installPos: {fileID: 2576541081300379520}
|
||||||
hasElectricity: 0
|
hasElectricity: 1
|
||||||
initPostionY: 0.02220154
|
initPostionY: 0.02220154
|
||||||
--- !u!1 &7847778419808227353
|
--- !u!1 &7847778419808227353
|
||||||
GameObject:
|
GameObject:
|
||||||
|
@ -9838,7 +9838,7 @@ MonoBehaviour:
|
||||||
id:
|
id:
|
||||||
isInstall: 1
|
isInstall: 1
|
||||||
installPos: {fileID: 2576541081225681401}
|
installPos: {fileID: 2576541081225681401}
|
||||||
hasElectricity: 0
|
hasElectricity: 1
|
||||||
initPostionY: 0.02220154
|
initPostionY: 0.02220154
|
||||||
--- !u!114 &2576541080563400542
|
--- !u!114 &2576541080563400542
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
|
@ -10925,7 +10925,7 @@ MonoBehaviour:
|
||||||
id:
|
id:
|
||||||
isInstall: 1
|
isInstall: 1
|
||||||
installPos: {fileID: 2576541080299287560}
|
installPos: {fileID: 2576541080299287560}
|
||||||
hasElectricity: 0
|
hasElectricity: 1
|
||||||
initPostionY: 0.0256958
|
initPostionY: 0.0256958
|
||||||
--- !u!1 &8963846282716106637
|
--- !u!1 &8963846282716106637
|
||||||
GameObject:
|
GameObject:
|
||||||
|
|
|
@ -20,12 +20,14 @@ public class Multimeter_pen : MonoBehaviour, IPointerClickHandler
|
||||||
{
|
{
|
||||||
if(eventData.button== PointerEventData.InputButton.Left)
|
if(eventData.button== PointerEventData.InputButton.Left)
|
||||||
{
|
{
|
||||||
|
//左键点选中
|
||||||
Debug.Log("选中"+ id+"笔");
|
Debug.Log("选中"+ id+"笔");
|
||||||
//选中
|
//选中
|
||||||
isChose = true;
|
isChose = true;
|
||||||
}
|
}
|
||||||
else if(eventData.button == PointerEventData.InputButton.Right)
|
else if(eventData.button == PointerEventData.InputButton.Right)
|
||||||
{
|
{
|
||||||
|
//右键点放下
|
||||||
Debug.Log("放开" + id + "笔");
|
Debug.Log("放开" + id + "笔");
|
||||||
//取消选中
|
//取消选中
|
||||||
isChose = false;
|
isChose = false;
|
||||||
|
|
|
@ -59,10 +59,10 @@ public class Device_DirectAccessElectricEnergyMeteringDevice : Device_Base
|
||||||
cover.transform.localPosition = new Vector3(0.0001220703f, -0.1388763f, -0.2485413f);
|
cover.transform.localPosition = new Vector3(0.0001220703f, -0.1388763f, -0.2485413f);
|
||||||
//左螺丝拧下
|
//左螺丝拧下
|
||||||
cover.cover_screw_Left.isInstall = false;
|
cover.cover_screw_Left.isInstall = false;
|
||||||
cover.cover_screw_Left.transform.localPosition = new Vector3(0.06128693f, -0.03405334f, -0.1012321f);
|
cover.cover_screw_Left.transform.localPosition = new Vector3(cover.cover_screw_Left.transform.localPosition.x, cover.cover_screw_Left.initPostionY-0.03f, cover.cover_screw_Left.transform.localPosition.z);
|
||||||
//右螺丝拧下
|
//右螺丝拧下
|
||||||
cover.cover_screw_Right.isInstall = false;
|
cover.cover_screw_Right.isInstall = false;
|
||||||
cover.cover_screw_Right.transform.localPosition = new Vector3(-0.06129074f, -0.03405334f, -0.1012321f);
|
cover.cover_screw_Right.transform.localPosition = new Vector3(cover.cover_screw_Right.transform.localPosition.x, cover.cover_screw_Right.initPostionY-0.03f, cover.cover_screw_Right.transform.localPosition.z);
|
||||||
//左封印被剪开
|
//左封印被剪开
|
||||||
cover.cover_seal_Left.isCut = true;
|
cover.cover_seal_Left.isCut = true;
|
||||||
cover.cover_seal_Left.gameObject.SetActive(false);
|
cover.cover_seal_Left.gameObject.SetActive(false);
|
||||||
|
@ -71,15 +71,15 @@ public class Device_DirectAccessElectricEnergyMeteringDevice : Device_Base
|
||||||
cover.cover_seal_Right.gameObject.SetActive(false);
|
cover.cover_seal_Right.gameObject.SetActive(false);
|
||||||
//左固定螺丝拧下
|
//左固定螺丝拧下
|
||||||
fix_screw_left.isInstall = false;
|
fix_screw_left.isInstall = false;
|
||||||
fix_screw_left.transform.localPosition = new Vector3(0.06592941f, 0.03107117f, -0.1094047f);
|
fix_screw_left.transform.localPosition = new Vector3(fix_screw_left.transform.localPosition.x, fix_screw_left.initPostionY-0.03f, fix_screw_left.transform.localPosition.z);
|
||||||
//右固定螺丝拧下
|
//右固定螺丝拧下
|
||||||
fix_screw_right.isInstall = false;
|
fix_screw_right.isInstall = false;
|
||||||
fix_screw_right.transform.localPosition = new Vector3(-0.06737137f, 0.03107117f, -0.1094047f);
|
fix_screw_right.transform.localPosition = new Vector3(fix_screw_right.transform.localPosition.x, fix_screw_right.initPostionY-0.03f, fix_screw_right.transform.localPosition.z);
|
||||||
//接线螺丝全部拧下
|
//接线螺丝全部拧下
|
||||||
jieXian_screws.ForEach(a =>
|
jieXian_screws.ForEach(a =>
|
||||||
{
|
{
|
||||||
a.isInstall = false;
|
a.isInstall = false;
|
||||||
a.transform.localPosition = new Vector3(a.transform.localPosition.x, 0.005695801f, a.transform.localPosition.z);
|
a.transform.localPosition = new Vector3(a.transform.localPosition.x, a.initPostionY-0.03f, a.transform.localPosition.z);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||||
using Unity.VisualScripting;
|
using Unity.VisualScripting;
|
||||||
using Unity.VisualScripting.Antlr3.Runtime;
|
using Unity.VisualScripting.Antlr3.Runtime;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
using static UnityEngine.EventSystems.EventTrigger;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 计量柜
|
/// 计量柜
|
||||||
|
@ -30,6 +31,11 @@ public class Device_MeasuringCabinet : Device_Base
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public List<Tool_Line> jieXian_screws;
|
public List<Tool_Line> jieXian_screws;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 电能表碰撞
|
||||||
|
/// </summary>
|
||||||
|
public BoxCollider dianCollider;
|
||||||
|
|
||||||
private void Awake()
|
private void Awake()
|
||||||
{
|
{
|
||||||
//添加开关切换回调
|
//添加开关切换回调
|
||||||
|
@ -107,4 +113,57 @@ public class Device_MeasuringCabinet : Device_Base
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void Update()
|
||||||
|
{
|
||||||
|
//是否可以触发能表的拆卸或安装电
|
||||||
|
if (meteringDevice == null)
|
||||||
|
{
|
||||||
|
dianCollider.enabled = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//电能表固定螺丝拆掉了,线拆掉了
|
||||||
|
if (!meteringDevice.fix_screw_left.isInstall && !meteringDevice.fix_screw_right.isInstall && jieXian_screws.TrueForAll(a => !a.isConnected))
|
||||||
|
{
|
||||||
|
dianCollider.enabled = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dianCollider.enabled = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//安装或拆除电能表
|
||||||
|
if (Input.GetMouseButtonDown(0))
|
||||||
|
{
|
||||||
|
if (Physics.Raycast(Camera.main.ScreenPointToRay(Input.mousePosition), out RaycastHit hit))
|
||||||
|
{
|
||||||
|
if (hit.collider == dianCollider)
|
||||||
|
{
|
||||||
|
if (meteringDevice == null)
|
||||||
|
{
|
||||||
|
//安装电能表
|
||||||
|
if (LiveSceneManager.Instance.currentTool != null && LiveSceneManager.Instance.currentTool.GetComponent<Device_DirectAccessElectricEnergyMeteringDevice>() != null)
|
||||||
|
{
|
||||||
|
meteringDevice = LiveSceneManager.Instance.currentTool.GetComponent<Device_DirectAccessElectricEnergyMeteringDevice>();
|
||||||
|
meteringDevice.Add();
|
||||||
|
//接线关联螺丝
|
||||||
|
SetLineScrew();
|
||||||
|
|
||||||
|
//刷新带电状态
|
||||||
|
CheckHasElectricity();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//拆下电能表
|
||||||
|
meteringDevice.Remove();
|
||||||
|
//情况接线关联螺丝
|
||||||
|
ClearLineScrew();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,61 +14,8 @@ public class SiteManager : MonoBehaviour
|
||||||
/// 机柜
|
/// 机柜
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Device_MeasuringCabinet measuringCabinet;
|
public Device_MeasuringCabinet measuringCabinet;
|
||||||
/// <summary>
|
|
||||||
/// 电能表碰撞
|
|
||||||
/// </summary>
|
|
||||||
public BoxCollider dianCollider;
|
|
||||||
private void Awake()
|
private void Awake()
|
||||||
{
|
{
|
||||||
instance = this;
|
instance = this;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Update()
|
|
||||||
{
|
|
||||||
//使能电能表碰撞
|
|
||||||
if (measuringCabinet.meteringDevice == null)
|
|
||||||
{
|
|
||||||
dianCollider.enabled = true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
//电能表固定螺丝拆掉了,线拆掉了
|
|
||||||
if (!measuringCabinet.meteringDevice.fix_screw_left.isInstall && !measuringCabinet.meteringDevice.fix_screw_right.isInstall && measuringCabinet.jieXian_screws.TrueForAll(a=>!a.isConnected))
|
|
||||||
{
|
|
||||||
dianCollider.enabled = true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
dianCollider.enabled = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Input.GetMouseButtonDown(0))
|
|
||||||
{
|
|
||||||
if(Physics.Raycast(Camera.main.ScreenPointToRay(Input.mousePosition),out RaycastHit hit))
|
|
||||||
{
|
|
||||||
if(hit.collider== dianCollider)
|
|
||||||
{
|
|
||||||
if (measuringCabinet.meteringDevice==null)
|
|
||||||
{
|
|
||||||
//安装电能表
|
|
||||||
if(LiveSceneManager.Instance.currentTool!=null && LiveSceneManager.Instance.currentTool.GetComponent<Device_DirectAccessElectricEnergyMeteringDevice>()!=null)
|
|
||||||
{
|
|
||||||
measuringCabinet.meteringDevice = LiveSceneManager.Instance.currentTool.GetComponent<Device_DirectAccessElectricEnergyMeteringDevice>();
|
|
||||||
measuringCabinet.meteringDevice.Add();
|
|
||||||
//接线关联螺丝
|
|
||||||
measuringCabinet.SetLineScrew();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
//拆下电能表
|
|
||||||
measuringCabinet.meteringDevice.Remove();
|
|
||||||
//情况接线关联螺丝
|
|
||||||
measuringCabinet.ClearLineScrew();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,8 +17,8 @@ public class Tool_Multimeter : Tool_Base
|
||||||
/// µ²Î»
|
/// µ²Î»
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Multimeter_dangwei dangWei;
|
public Multimeter_dangwei dangWei;
|
||||||
public Transform redPen;
|
public Multimeter_pen redPen;
|
||||||
public Transform blackPen;
|
public Multimeter_pen blackPen;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Çл»µ²Î»
|
/// Çл»µ²Î»
|
||||||
|
|
Loading…
Reference in New Issue