diff --git a/Assets/Scenes/05_LiveScene.unity b/Assets/Scenes/05_LiveScene.unity index c40073d..bb5984b 100644 --- a/Assets/Scenes/05_LiveScene.unity +++ b/Assets/Scenes/05_LiveScene.unity @@ -7127,7 +7127,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 4675619581299266311, guid: 10f4454f32eb20e4298912d896f6020e, type: 3} propertyPath: m_Name - value: "\u4E09\u76F8\u56DB\u7EBF\u7535\u8868" + value: "\u539F\u4E09\u76F8\u56DB\u7EBF\u7535\u8868" objectReference: {fileID: 0} - target: {fileID: 5209635747906703206, guid: 10f4454f32eb20e4298912d896f6020e, type: 3} propertyPath: m_RootOrder diff --git a/Assets/Scripts/CXX/Devices/现场控制/Device_Control_1002.cs b/Assets/Scripts/CXX/Devices/现场控制/Device_Control_1002.cs index 39b0269..0f5a352 100644 --- a/Assets/Scripts/CXX/Devices/现场控制/Device_Control_1002.cs +++ b/Assets/Scripts/CXX/Devices/现场控制/Device_Control_1002.cs @@ -91,10 +91,14 @@ public class Device_Control_1002 : Device_Control { if (a) { + //²ðϳ¡¾°ÖÐ×Ô´øµÄµçÄܱí²ÅÏÔʾÔÓÎï + if (meteringDevice.name == "Ô­ÈýÏàËÄÏßµç±í") + { + sundries.gameObject.SetActive(true); + } meteringDevice = null; //Çé¿ö½ÓÏß¹ØÁªÂÝË¿ ClearLineScrew(); - sundries.gameObject.SetActive(true); //´ò·Ö dianTrigger.CallScoreAction(false); } @@ -127,10 +131,13 @@ public class Device_Control_1002 : Device_Control }); }); - //½ÓÏßÁ¬½ÓºÍȡϻص÷ + //½ÓÏßÁ¬½ÓºÍȡϻص÷£¬Åжϻص÷ jieXian_lines.ForEach(line => { - line.AddAction(isConnected => + //ÎÞµçÄÜ±í²»¿ÉÒÆ¶¯ + line.AddCanMoveCheck(() => { return meteringDevice != null; }); + + line.AddCompleteAction(isConnected => { //ˢдøµã״̬ CheckHasElectricity(); @@ -138,6 +145,18 @@ public class Device_Control_1002 : Device_Control CheckJieXianOk(check_JieXian); }); }); + + ///¿ª¹ØÂÝË¿²»¿É²ðж + inSwitchScrews.ForEach(a => + { + a.AddCheckAction(() => + { + //Ìáʾ²»¿É²ð + TipPanel tip2 = Instantiate(Resources.Load("UI/UI_Tip/TipPanel"), GameManager.UIMgr.canvas.transform); + tip2.Init("µ±Ç°ÂÝË¿²»¿É²ðж£¡"); + return false; + }); + }); } /// diff --git a/Assets/Scripts/CXX/Tools/Tool_Line.cs b/Assets/Scripts/CXX/Tools/Tool_Line.cs index 5f2c398..a905d2f 100644 --- a/Assets/Scripts/CXX/Tools/Tool_Line.cs +++ b/Assets/Scripts/CXX/Tools/Tool_Line.cs @@ -30,49 +30,74 @@ public class Tool_Line: Tool_Base /// public float InstallPosY; + /// + /// ²Ù×÷ºó»Øµ÷ + /// private Action actionBack; + /// + /// ÊÇ·ñ¿ÉÒÆ¶¯ÅÐ¶Ï + /// + private Func checkCanMove; - //protected override void OnAwake() - //{ - // base.OnAwake(); - // id = gameObject.name; - //} - public void AddAction(Action actionBack) + public void AddCompleteAction(Action actionBack) { this.actionBack = actionBack; } + public void AddCanMoveCheck(Func canMoveCheck) + { + this.checkCanMove = canMoveCheck; + } + + /// + /// ÊÇ·ñ¿ÉÒÔ + /// + /// + public bool CanMove() + { + if (checkCanMove == null) + { + return true; + } + else + { + return checkCanMove.Invoke(); + } + } protected override void OnMDown() { - if ((triggerAction == null ? 0 : triggerAction.Invoke(triggerName, false)) == 0) + if (CanMove()) { - base.OnMDown(); - if (isConnected) + if ((triggerAction == null ? 0 : triggerAction.Invoke(triggerName, false)) == 0) { - //ȡϽÓÏß - if (screws.TrueForAll(a => !a.isInstall)) + base.OnMDown(); + if (isConnected) { - transform.DOLocalMoveY(InstallPosY - 2, 1).OnComplete(() => + //ȡϽÓÏß + if (screws.TrueForAll(a => !a.isInstall)) { - isConnected = false; - actionBack?.Invoke(isConnected); - int state = (triggerAction == null ? 0 : triggerAction.Invoke(triggerName, true)); - CallScoreAction(false); - }); + transform.DOLocalMoveY(InstallPosY - 2, 1).OnComplete(() => + { + isConnected = false; + actionBack?.Invoke(isConnected); + int state = (triggerAction == null ? 0 : triggerAction.Invoke(triggerName, true)); + CallScoreAction(false); + }); + } } - } - else - { - //×°ÉϽÓÏß - if (screws.TrueForAll(a => !a.isInstall)) + else { - transform.DOLocalMoveY(InstallPosY, 1).OnComplete(() => + //×°ÉϽÓÏß + if (screws.TrueForAll(a => !a.isInstall)) { - isConnected = true; - actionBack?.Invoke(isConnected); - int state = (triggerAction == null ? 0 : triggerAction.Invoke(triggerName, true)); - CallScoreAction(true); - }); + transform.DOLocalMoveY(InstallPosY, 1).OnComplete(() => + { + isConnected = true; + actionBack?.Invoke(isConnected); + int state = (triggerAction == null ? 0 : triggerAction.Invoke(triggerName, true)); + CallScoreAction(true); + }); + } } } }