trriger回调,换空开模型
This commit is contained in:
parent
07c2e0321e
commit
7cdd3856b8
Binary file not shown.
File diff suppressed because it is too large
Load Diff
|
@ -19,6 +19,7 @@ public class Device_Base : PermanentTriggerBase
|
|||
if ( GameManager.RunModelMgr.SceneType == E_SceneType.Site)
|
||||
{
|
||||
base.OnStart();
|
||||
AddTriggerAction(GameManager.ProcessMgr.IsRightSubProcessStepsTriggerID);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ public class Device_Cover : Device_Base
|
|||
|
||||
private void OnMouseDown()
|
||||
{
|
||||
if (GameManager.ProcessMgr.IsRightSubProcessStepsTriggerID(triggerName, true) == 0)
|
||||
if ((triggerAction == null ? 0 : triggerAction.Invoke(triggerName, true)) == 0)
|
||||
{
|
||||
Debug.Log("½ÓÏßÍêºÃ");
|
||||
isCheckOK = true;
|
||||
|
@ -59,7 +59,7 @@ public class Device_Cover : Device_Base
|
|||
transform.DOLocalMoveY(-0.1388763f, 2);
|
||||
transform.DOLocalMoveZ(-0.2485413f, 2).OnComplete(() =>
|
||||
{
|
||||
GameManager.ProcessMgr.IsRightSubProcessStepsTriggerID(triggerName, true);
|
||||
int result=(triggerAction == null ? 0 : triggerAction.Invoke(triggerName, true));
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -51,7 +51,7 @@ public class Device_CabinetDoor : Device_Base
|
|||
if (LiveSceneManager.Instance.currentTool != null && LiveSceneManager.Instance.currentTool.name == "Ñéµç±Ê")
|
||||
return;
|
||||
|
||||
if (GameManager.ProcessMgr.IsRightSubProcessStepsTriggerID(triggerName, true) == 0)
|
||||
if ((triggerAction==null?0: triggerAction.Invoke(triggerName, true)) == 0)
|
||||
{
|
||||
base.OnMDown();
|
||||
if (isOpen)
|
||||
|
|
|
@ -23,6 +23,7 @@ public class Tool_Base : PermanentTriggerBase
|
|||
if ( GameManager.RunModelMgr.SceneType == E_SceneType.Site)
|
||||
{
|
||||
base.OnStart();
|
||||
AddTriggerAction(GameManager.ProcessMgr.IsRightSubProcessStepsTriggerID);
|
||||
}
|
||||
}
|
||||
protected override void OnMEnter()
|
||||
|
|
|
@ -55,7 +55,8 @@ public class Tool_Screwdriver : Tool_Base
|
|||
Debug.Log("·âӡδ¼ô¶Ï");
|
||||
return;
|
||||
}
|
||||
if (GameManager.ProcessMgr.IsRightSubProcessStepsTriggerID(ts.triggerName, true) == 0)
|
||||
|
||||
if ((triggerAction == null ? 0 : triggerAction.Invoke(ts.triggerName, true)) == 0)
|
||||
{
|
||||
if (ts.isInstall)
|
||||
{
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Unity.VisualScripting;
|
||||
using UnityEngine;
|
||||
|
||||
/// <summary>
|
||||
|
@ -16,34 +17,35 @@ public class Tool_TestPen : Tool_Base
|
|||
|
||||
private void Update()
|
||||
{
|
||||
if (GameManager.RunModelMgr.SceneType != E_SceneType.Site) return;
|
||||
if (LiveSceneManager.Instance.currentTool != null && LiveSceneManager.Instance.currentTool.name == "验电笔")
|
||||
{
|
||||
if (Input.GetMouseButtonDown(0))
|
||||
{
|
||||
//点击螺丝验电
|
||||
Ray tmpray = Camera.main.ScreenPointToRay(Input.mousePosition);
|
||||
if (Physics.Raycast(tmpray, out RaycastHit hit))
|
||||
{
|
||||
//插座/柜门
|
||||
Device_Base db = hit.transform.GetComponent<Device_Base>();
|
||||
if (db != null)
|
||||
{
|
||||
Test(db);
|
||||
return;
|
||||
}
|
||||
if (GameManager.RunModelMgr!=null && GameManager.RunModelMgr.SceneType != E_SceneType.Site)
|
||||
return;
|
||||
|
||||
//螺丝
|
||||
Tool_Base tb = hit.transform.GetComponent<Tool_Base>();
|
||||
if (tb != null)
|
||||
{
|
||||
Test(tb);
|
||||
return;
|
||||
}
|
||||
|
||||
if (Input.GetMouseButtonDown(0))
|
||||
{
|
||||
//点击螺丝验电
|
||||
Ray tmpray = Camera.main.ScreenPointToRay(Input.mousePosition);
|
||||
if (Physics.Raycast(tmpray, out RaycastHit hit))
|
||||
{
|
||||
//插座/柜门
|
||||
Device_Base db = hit.transform.GetComponent<Device_Base>();
|
||||
if (db != null)
|
||||
{
|
||||
Test(db);
|
||||
return;
|
||||
}
|
||||
|
||||
//螺丝
|
||||
Tool_Base tb = hit.transform.GetComponent<Tool_Base>();
|
||||
if (tb != null)
|
||||
{
|
||||
Test(tb);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (isFlicker)
|
||||
{
|
||||
time += Time.deltaTime * 3;
|
||||
|
@ -67,7 +69,7 @@ public class Tool_TestPen : Tool_Base
|
|||
/// <param name="device_base">被验电设备</param>
|
||||
public void Test(Device_Base device_base)
|
||||
{
|
||||
if (GameManager.ProcessMgr.IsRightSubProcessStepsTriggerID(device_base.triggerName, true) == 0)
|
||||
if ((triggerAction == null ? 0 : triggerAction.Invoke(triggerName + device_base.triggerName, true)) == 0)
|
||||
{
|
||||
if (device_base.deviceType == DeviceType.计量柜_插座)
|
||||
{
|
||||
|
|
|
@ -60,7 +60,7 @@ public class Tool_WireStripper : Tool_Base
|
|||
Device_Seal ds = hit.transform.GetComponent<Device_Seal>();
|
||||
if (ds != null)
|
||||
{
|
||||
if (GameManager.ProcessMgr.IsRightSubProcessStepsTriggerID(ds.triggerName, true) == 0)
|
||||
if ((triggerAction == null ? 0 : triggerAction.Invoke(ds.triggerName, true)) == 0)
|
||||
{
|
||||
CutOpen(ds);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue