aaa
This commit is contained in:
parent
33db48e5fd
commit
e66378f5f0
|
@ -1538,7 +1538,7 @@ GameObject:
|
||||||
m_Icon: {fileID: 0}
|
m_Icon: {fileID: 0}
|
||||||
m_NavMeshLayer: 0
|
m_NavMeshLayer: 0
|
||||||
m_StaticEditorFlags: 0
|
m_StaticEditorFlags: 0
|
||||||
m_IsActive: 1
|
m_IsActive: 0
|
||||||
--- !u!4 &478648693
|
--- !u!4 &478648693
|
||||||
Transform:
|
Transform:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
@ -5702,7 +5702,7 @@ MonoBehaviour:
|
||||||
- {fileID: 302277748}
|
- {fileID: 302277748}
|
||||||
- {fileID: 302277752}
|
- {fileID: 302277752}
|
||||||
- {fileID: 1352022184}
|
- {fileID: 1352022184}
|
||||||
dianCollider: {fileID: 478648694}
|
dianTrigger: {fileID: 478648696}
|
||||||
sundries: {fileID: 737359439}
|
sundries: {fileID: 737359439}
|
||||||
inSwitchScrews:
|
inSwitchScrews:
|
||||||
- {fileID: 1775693151}
|
- {fileID: 1775693151}
|
||||||
|
|
|
@ -67,16 +67,6 @@ public class Device_Cover : Device_Base
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
//×ó·âÓ¡¼ô¶Ï»Øµ÷
|
|
||||||
cover_seal_Left.cutAction += () =>
|
|
||||||
{
|
|
||||||
cover_seal_left_Trigger.gameObject.SetActive(true);
|
|
||||||
};
|
|
||||||
//ÓÒ·âÓ¡¼ô¶Ï»Øµ÷
|
|
||||||
cover_seal_Right.cutAction += () =>
|
|
||||||
{
|
|
||||||
cover_seal_right_Trigger.gameObject.SetActive(true);
|
|
||||||
};
|
|
||||||
//左出触发区域回调
|
//左出触发区域回调
|
||||||
cover_seal_left_Trigger.clickAction += () =>
|
cover_seal_left_Trigger.clickAction += () =>
|
||||||
{
|
{
|
||||||
|
@ -108,10 +98,7 @@ public class Device_Cover : Device_Base
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
//注册工具拿出和收回,显示隐藏物体的封印的触发
|
//注册工具拿出和收回,显示隐藏物体的封印的触发
|
||||||
EventCenter.Instance.AddEventListener(Enum_EventType.TakeOutAndRetrievingTheTools, () =>
|
EventCenter.Instance.AddEventListener<GameObject>(Enum_EventType.TakeOutAndRetrievingTheTools, CheckTriggerShow);
|
||||||
{
|
|
||||||
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
protected override void OnMDown()
|
protected override void OnMDown()
|
||||||
{
|
{
|
||||||
|
@ -138,6 +125,32 @@ public class Device_Cover : Device_Base
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 检查显示或隐藏封印触发器
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="obj"></param>
|
||||||
|
private void CheckTriggerShow(GameObject obj)
|
||||||
|
{
|
||||||
|
if (obj == null)
|
||||||
|
{
|
||||||
|
//收回
|
||||||
|
cover_seal_left_Trigger.gameObject.SetActive(false);
|
||||||
|
cover_seal_right_Trigger.gameObject.SetActive(false);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//拿出
|
||||||
|
if (obj.name == "盒装封印")
|
||||||
|
{
|
||||||
|
if (!isOpen && cover_seal_Left.isCut && cover_screw_Left.isInstall)
|
||||||
|
cover_seal_left_Trigger.gameObject.SetActive(true);
|
||||||
|
|
||||||
|
if (!isOpen && cover_seal_Right.isCut && cover_screw_Right.isInstall)
|
||||||
|
cover_seal_right_Trigger.gameObject.SetActive(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 打开盖子
|
/// 打开盖子
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -187,4 +200,13 @@ public class Device_Cover : Device_Base
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void OnDestroy()
|
||||||
|
{
|
||||||
|
EventCenter.Instance.RemoveEventListener<GameObject>(Enum_EventType.TakeOutAndRetrievingTheTools, CheckTriggerShow);
|
||||||
|
}
|
||||||
|
private void OnDisable()
|
||||||
|
{
|
||||||
|
EventCenter.Instance.RemoveEventListener<GameObject>(Enum_EventType.TakeOutAndRetrievingTheTools, CheckTriggerShow);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,13 +51,49 @@ public class Device_Control_1002 : Device_Control
|
||||||
{
|
{
|
||||||
StepStateControl.instance.SetDeviceControl(1002,this);
|
StepStateControl.instance.SetDeviceControl(1002,this);
|
||||||
AddActions();
|
AddActions();
|
||||||
if (GameManager.RunModelMgr.ModeType == E_ModeType.Study)
|
//if (GameManager.RunModelMgr.ModeType == E_ModeType.Study)
|
||||||
GameManager.EventMgr.AddEventListener<string>(Enum_EventType.SwitchSubProcessStepTriggerID, SwitchSubProcessStepTriggerID);
|
// GameManager.EventMgr.AddEventListener<string>(Enum_EventType.SwitchSubProcessStepTriggerID, SwitchSubProcessStepTriggerID);
|
||||||
sundries.gameObject.SetActive(false);
|
sundries.gameObject.SetActive(false);
|
||||||
|
|
||||||
check_JieXian.tool_Lines = jieXian_lines;
|
check_JieXian.tool_Lines = jieXian_lines;
|
||||||
check_JieXian.tool_Screws = meteringDevice.jieXian_screws;
|
check_JieXian.tool_Screws = meteringDevice.jieXian_screws;
|
||||||
|
|
||||||
|
//添加电能表区域点击事件
|
||||||
|
dianTrigger.clickAction += () =>
|
||||||
|
{
|
||||||
|
if ((GameManager.ProcessMgr.IsRightSubProcessStepsTriggerID(dianTrigger.gameObject.name, true)) == 0)
|
||||||
|
{
|
||||||
|
if (meteringDevice == null)
|
||||||
|
{
|
||||||
|
//安装电能表
|
||||||
|
if (LiveSceneManager.Instance.currentTool != null && LiveSceneManager.Instance.currentTool.GetComponent<Device_3Phase4WireMeter>() != null)
|
||||||
|
{
|
||||||
|
meteringDevice = LiveSceneManager.Instance.currentTool.GetComponent<Device_3Phase4WireMeter>();
|
||||||
|
meteringDevice.Add(this);
|
||||||
|
//接线完好关联螺丝重新赋值
|
||||||
|
check_JieXian.tool_Screws = meteringDevice.jieXian_screws;
|
||||||
|
//接线关联螺丝
|
||||||
|
SetLineScrew();
|
||||||
|
//重新注册回调
|
||||||
|
AddActions();
|
||||||
|
//刷新带电状态
|
||||||
|
CheckHasElectricity();
|
||||||
|
//打分
|
||||||
|
dianTrigger.CallScoreAction(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//拆下电能表
|
||||||
|
meteringDevice.Remove(this);
|
||||||
|
//情况接线关联螺丝
|
||||||
|
ClearLineScrew();
|
||||||
|
sundries.gameObject.SetActive(true);
|
||||||
|
//打分
|
||||||
|
dianTrigger.CallScoreAction(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 添加各种操作回调
|
/// 添加各种操作回调
|
||||||
|
@ -95,17 +131,17 @@ public class Device_Control_1002 : Device_Control
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
private void SwitchSubProcessStepTriggerID(string arg0)
|
//private void SwitchSubProcessStepTriggerID(string arg0)
|
||||||
{
|
//{
|
||||||
if (dianTrigger.gameObject.name == arg0)
|
// if (dianTrigger.triggerName == arg0)
|
||||||
{
|
// {
|
||||||
dianTrigger.GetComponent<HighlightEffect>().SetHighlighted(true);
|
// dianTrigger.GetComponent<HighlightEffect>().SetHighlighted(true);
|
||||||
}
|
// }
|
||||||
else
|
// else
|
||||||
{
|
// {
|
||||||
dianTrigger.GetComponent<HighlightEffect>().SetHighlighted(false);
|
// dianTrigger.GetComponent<HighlightEffect>().SetHighlighted(false);
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 还原计量柜状态
|
/// 还原计量柜状态
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -229,79 +265,36 @@ public class Device_Control_1002 : Device_Control
|
||||||
Debug.Log("隐藏接线");
|
Debug.Log("隐藏接线");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private void Update()
|
|
||||||
|
private void FixedUpdate()
|
||||||
{
|
{
|
||||||
//是否可以触发能表的拆卸或安装电
|
//是否可以触发能表的拆卸或安装电
|
||||||
if (meteringDevice == null)
|
if (meteringDevice == null)
|
||||||
{
|
{
|
||||||
dianTrigger.enabled = true;
|
dianTrigger.gameObject.SetActive(true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//电能表固定螺丝拆掉了,线拆掉了
|
//电能表固定螺丝拆掉了,线拆掉了
|
||||||
if (!meteringDevice.fix_screw_left.isInstall && !meteringDevice.fix_screw_right.isInstall && jieXian_lines.TrueForAll(a => !a.isConnected))
|
if (!meteringDevice.fix_screw_left.isInstall && !meteringDevice.fix_screw_right.isInstall && jieXian_lines.TrueForAll(a => !a.isConnected))
|
||||||
{
|
{
|
||||||
dianTrigger.enabled = true;
|
dianTrigger.gameObject.SetActive(true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dianTrigger.enabled = false;
|
dianTrigger.gameObject.SetActive(false);
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//安装或拆除电能表
|
|
||||||
if (dianTrigger.enabled)
|
|
||||||
{
|
|
||||||
if (Input.GetMouseButtonDown(0))
|
|
||||||
{
|
|
||||||
if (Physics.Raycast(Camera.main.ScreenPointToRay(Input.mousePosition), out RaycastHit hit))
|
|
||||||
{
|
|
||||||
if (hit.collider == dianTrigger)
|
|
||||||
{
|
|
||||||
if ((GameManager.ProcessMgr.IsRightSubProcessStepsTriggerID(dianTrigger.gameObject.name, true)) == 0)
|
|
||||||
{
|
|
||||||
if (meteringDevice == null)
|
|
||||||
{
|
|
||||||
//安装电能表
|
|
||||||
if (LiveSceneManager.Instance.currentTool != null && LiveSceneManager.Instance.currentTool.GetComponent<Device_3Phase4WireMeter>() != null)
|
|
||||||
{
|
|
||||||
meteringDevice = LiveSceneManager.Instance.currentTool.GetComponent<Device_3Phase4WireMeter>();
|
|
||||||
meteringDevice.Add(this);
|
|
||||||
//接线关联螺丝
|
|
||||||
SetLineScrew();
|
|
||||||
//重新注册回调
|
|
||||||
AddActions();
|
|
||||||
//刷新带电状态
|
|
||||||
CheckHasElectricity();
|
|
||||||
//打分
|
|
||||||
ScoreManager.instance.Check(dianTrigger.gameObject.name, true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
//拆下电能表
|
|
||||||
meteringDevice.Remove(this);
|
|
||||||
//情况接线关联螺丝
|
|
||||||
ClearLineScrew();
|
|
||||||
sundries.gameObject.SetActive(true);
|
|
||||||
//打分
|
|
||||||
ScoreManager.instance.Check(dianTrigger.gameObject.name, false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnDestroy()
|
//private void OnDestroy()
|
||||||
{
|
//{
|
||||||
if (GameManager.RunModelMgr.ModeType == E_ModeType.Study)
|
// if (GameManager.RunModelMgr.ModeType == E_ModeType.Study)
|
||||||
GameManager.EventMgr.RemoveEventListener<string>(Enum_EventType.SwitchSubProcessStepTriggerID, SwitchSubProcessStepTriggerID);
|
// GameManager.EventMgr.RemoveEventListener<string>(Enum_EventType.SwitchSubProcessStepTriggerID, SwitchSubProcessStepTriggerID);
|
||||||
}
|
//}
|
||||||
private void OnDisable()
|
//private void OnDisable()
|
||||||
{
|
//{
|
||||||
if (GameManager.RunModelMgr.ModeType == E_ModeType.Study)
|
// if (GameManager.RunModelMgr.ModeType == E_ModeType.Study)
|
||||||
GameManager.EventMgr.RemoveEventListener<string>(Enum_EventType.SwitchSubProcessStepTriggerID, SwitchSubProcessStepTriggerID);
|
// GameManager.EventMgr.RemoveEventListener<string>(Enum_EventType.SwitchSubProcessStepTriggerID, SwitchSubProcessStepTriggerID);
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
|
|
|
@ -257,7 +257,7 @@ public class Score_1002 : ScoreBase
|
||||||
else if(triggerName== "电能表区域碰撞")
|
else if(triggerName== "电能表区域碰撞")
|
||||||
{
|
{
|
||||||
//取下电能表时判断验电顺序
|
//取下电能表时判断验电顺序
|
||||||
if(!(bool)para)
|
if(para!=null && !(bool)para)
|
||||||
{
|
{
|
||||||
steps[12].SetScore(IsUninstallJieXianCheckE());
|
steps[12].SetScore(IsUninstallJieXianCheckE());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue