diff --git a/Assets/ArtRes/Excel/Config.xlsx b/Assets/ArtRes/Excel/Config.xlsx index f08a806..2a6ebc2 100644 Binary files a/Assets/ArtRes/Excel/Config.xlsx and b/Assets/ArtRes/Excel/Config.xlsx differ diff --git a/Assets/Resources/Prefabs/Objects/Tools/三相四线电能表.prefab b/Assets/Resources/Prefabs/Objects/Tools/三相四线电能表.prefab index 01c927e..d6fd3de 100644 --- a/Assets/Resources/Prefabs/Objects/Tools/三相四线电能表.prefab +++ b/Assets/Resources/Prefabs/Objects/Tools/三相四线电能表.prefab @@ -285,7 +285,7 @@ MonoBehaviour: id: isInstall: 1 installPos: {fileID: 2576541080142119082} - hasElectricity: 1 + hasElectricity: 0 initPostionY: 0.0256958 --- !u!114 &2576541079962278358 MonoBehaviour: @@ -5765,7 +5765,7 @@ MonoBehaviour: id: isInstall: 1 installPos: {fileID: 2576541079818901621} - hasElectricity: 1 + hasElectricity: 0 initPostionY: 0.0256958 --- !u!1 &4627208948562638019 GameObject: @@ -9551,7 +9551,7 @@ MonoBehaviour: id: isInstall: 1 installPos: {fileID: 2576541081300379520} - hasElectricity: 1 + hasElectricity: 0 initPostionY: 0.02220154 --- !u!1 &7847778419808227353 GameObject: @@ -9838,7 +9838,7 @@ MonoBehaviour: id: isInstall: 1 installPos: {fileID: 2576541081225681401} - hasElectricity: 1 + hasElectricity: 0 initPostionY: 0.02220154 --- !u!114 &2576541080563400542 MonoBehaviour: diff --git a/Assets/Scripts/CXX/Devices/直接接入式电能计量装置/Device_3Phase4WireMeter.cs b/Assets/Scripts/CXX/Devices/直接接入式电能计量装置/Device_3Phase4WireMeter.cs index 3f29cd6..525d457 100644 --- a/Assets/Scripts/CXX/Devices/直接接入式电能计量装置/Device_3Phase4WireMeter.cs +++ b/Assets/Scripts/CXX/Devices/直接接入式电能计量装置/Device_3Phase4WireMeter.cs @@ -188,6 +188,7 @@ public class Device_3Phase4WireMeter : Device_Base Debug.Log("ܱѲ"); transform.DOLocalMove(transform.localPosition - new Vector3(0, 0.2f, 0.2f), 2).OnComplete(() => { + CallScoreAction(false); gameObject.SetActive(false); }); } @@ -209,6 +210,7 @@ public class Device_3Phase4WireMeter : Device_Base { LiveSceneManager.Instance.currentTool = null; Debug.Log("ܱѰװ"); + CallScoreAction(true); }); } } diff --git a/Assets/Scripts/CXX/Devices/直接接入式电能计量装置/Device_NamePlate.cs b/Assets/Scripts/CXX/Devices/直接接入式电能计量装置/Device_NamePlate.cs index 418c77a..ecb116a 100644 --- a/Assets/Scripts/CXX/Devices/直接接入式电能计量装置/Device_NamePlate.cs +++ b/Assets/Scripts/CXX/Devices/直接接入式电能计量装置/Device_NamePlate.cs @@ -48,6 +48,7 @@ public class Device_NamePlate : Device_Base tip2.Init("˶Ժͳ¼ɣ"); } int state = (triggerAction == null ? 0 : triggerAction.Invoke(triggerName, true)); + CallScoreAction(); } }); } diff --git a/Assets/Scripts/CXX/Devices/计量柜/Device_MeasuringCabinet.cs b/Assets/Scripts/CXX/Devices/计量柜/Device_MeasuringCabinet.cs index 8c48ded..89bdbb4 100644 --- a/Assets/Scripts/CXX/Devices/计量柜/Device_MeasuringCabinet.cs +++ b/Assets/Scripts/CXX/Devices/计量柜/Device_MeasuringCabinet.cs @@ -182,8 +182,17 @@ public class Device_MeasuringCabinet : MonoBehaviour { a.screws.ForEach(b => { - //װ - b.hasElectricity = b.isInstall; + //װ + //޵еѹ + if(b.triggerName.Contains("")) + { + b.hasElectricity = false; + } + else + { + //ĿǷϵ + b.hasElectricity = b.isInstall; + } }); } } diff --git a/Assets/Scripts/CXX/Devices/计量柜/Device_Sundries.cs b/Assets/Scripts/CXX/Devices/计量柜/Device_Sundries.cs index 59e9de4..5ce6a05 100644 --- a/Assets/Scripts/CXX/Devices/计量柜/Device_Sundries.cs +++ b/Assets/Scripts/CXX/Devices/计量柜/Device_Sundries.cs @@ -8,6 +8,9 @@ public class Device_Sundries : Device_Base { base.OnMDown(); Debug.Log(""); - gameObject.SetActive(false); + gameObject.SetActive(false); + triggerAction.Invoke(triggerName, false); + base.CallScoreAction(); + } } diff --git a/Assets/Scripts/CXX/Score/ScoreSubjectStep.cs b/Assets/Scripts/CXX/Score/ScoreSubjectStep.cs index 0c5637a..ed67efb 100644 --- a/Assets/Scripts/CXX/Score/ScoreSubjectStep.cs +++ b/Assets/Scripts/CXX/Score/ScoreSubjectStep.cs @@ -19,7 +19,7 @@ public class ScoreSubjectStep /// /// Ƿ /// - bool isDone; + public bool isDone; public ScoreSubjectStep(int subProcessId,float maxScore) { @@ -35,9 +35,10 @@ public class ScoreSubjectStep /// ȫ۹ /// /// - public void SetScore(bool AllScore) + /// Ƿظ + public void SetScore(bool AllScore,bool canRepeat=false) { - if (!isDone) + if (!isDone || canRepeat) { isDone = true; currentScore = (AllScore ? maxScore : 0); @@ -48,9 +49,9 @@ public class ScoreSubjectStep /// ٷֱȷ /// /// - public void SetScore(float scaleScore) + public void SetScore(float scaleScore, bool canRepeat=false) { - if (!isDone) + if (!isDone || canRepeat) { isDone = true; currentScore = scaleScore*maxScore; diff --git a/Assets/Scripts/CXX/Score/Score_1002.cs b/Assets/Scripts/CXX/Score/Score_1002.cs index bc3bc94..1de97be 100644 --- a/Assets/Scripts/CXX/Score/Score_1002.cs +++ b/Assets/Scripts/CXX/Score/Score_1002.cs @@ -1,6 +1,7 @@ using System.Collections; using System.Collections.Generic; using System.Linq; +using Unity.VisualScripting; using UnityEngine; public class Score_1002 : ScoreBase @@ -45,9 +46,62 @@ public class Score_1002 : ScoreBase /// List TestPen3list = new List(); /// - /// + /// ضϵ /// - List TestInSwitchList=new List(); + List InSwitchCloseYDList=new List(); + /// + /// ͨ + /// + List InSwitchOpenYDList = new List(); + /// + /// ˳ + /// + List unInstallJieXian=new List() + { + "A_in_˿up", "A_in_˿down", "A_in_", + "B_in_˿up","B_in_˿down","B_in_", + "C_in_˿up","C_in_˿down","C_in_", + "A_out_˿up","A_out_˿down","A_out_", + "B_out_˿up","B_out_˿down","B_out_", + "C_out_˿up","C_out_˿down","C_out_", + "__˿up","__˿down","__", + "_out_˿up","_out_˿down","_out_" + }; + /// + /// ˿ + /// + List currentunInstallJieXian = new List(); + /// + /// װ˿˳ + /// + List installJieXian = new List() + { + "_out_","_out_˿up","_out_˿down", + "__","__˿up","__˿down", + "C_out_","C_out_˿up","C_out_˿down", + "B_out_","B_out_˿up","B_out_˿down", + "A_out_","A_out_˿up","A_out_˿down", + "C_in_","C_in_˿up","C_in_˿down", + "B_in_","B_in_˿up","B_in_˿down", + "A_in_","A_in_˿up", "A_in_˿down" + }; + /// + /// װ˿ + /// + List currentInstallJieXian = new List(); + + /// + /// װ̰װ + /// + List installCover = new List(); + /// + /// װ̶Խ˿ + /// + List installTestJieXian=new List() { "+A_in_˿", "+B_in_˿", "+C_in_˿" }; + /// + /// װ̶Խ + /// + List currentInstallTestJieXian = new List(); public override void CheckScore(string triggerName, object para) { base.CheckScore(triggerName, para); @@ -95,15 +149,16 @@ public class Score_1002 : ScoreBase { if ((bool)para) { - //߼ - //жǷȷ - if (isCheckE()) + //3012֮ǰʱ̣֮ʱװ + if (!steps[3012].isDone) { - steps[3009].SetScore(true); + //߼֣жǷȷ + steps[3009].SetScore(isCheckE()); } else { - + //װ + steps[3014].SetScore(true); } } } @@ -113,11 +168,116 @@ public class Score_1002 : ScoreBase TestPen3list.Add(triggerName); } else if (triggerName == "+in_˿1" || triggerName == "+in_˿2" || triggerName == "+in_˿3") - { - if(SiteManager.instance.measuringCabinet.inSwitch.isOpen==false) + { + //3012֮ǰDz֮ǰװ + if (!steps[3012].isDone) { - TestInSwitchList.Add(triggerName); - isInSwitchCheckE(); + //ϵ + if (SiteManager.instance.measuringCabinet.inSwitch.isOpen == false) + { + InSwitchCloseYDList.Add(triggerName); + steps[3010].SetScore(isInSwitchCheckE(),true); + } + } + else + { + //ͨ + if (SiteManager.instance.measuringCabinet.inSwitch.isOpen==true) + { + InSwitchOpenYDList.Add(triggerName); + } + } + } + else if(triggerName == "ܱ") + { + steps[3011].SetScore(true); + } + else if(unInstallJieXian.Contains(triggerName)) + { + //3012֮ǰDz֮ǰװ + //˿ + if (!steps[3012].isDone) + { + //жϲ + if ((bool)para) + currentunInstallJieXian.Remove(triggerName); + else + currentunInstallJieXian.Add(triggerName); + } + else + { + //жϰװ + if ((bool)para) + currentInstallJieXian.Add(triggerName); + else + currentInstallJieXian.Remove(triggerName); + + //з + if (triggerName.Contains("A_in_˿")) + { + steps[3013].SetScore(IsInstallJieXianCheckE(), true); + } + } + } + else if(triggerName== "ܱײ") + { + //ȡµܱʱж˳ + if(!(bool)para) + { + steps[3012].SetScore(IsUninstallJieXianCheckE()); + } + } + else if(triggerName.Contains("ܱװ˿")) + { + //װ + if (steps[3012].isDone) + { + //װ˿ + if ((bool)para) + currentInstallJieXian.Add(triggerName); + else + currentInstallJieXian.Remove(triggerName); + } + } + else if(triggerName.Contains("ܱӹ̶˿")) + { + //װ + if (steps[3012].isDone) + { + if ((bool)para) + installCover.Add(triggerName); + else + installCover.Remove(triggerName); + + steps[3015].SetScore(Check3015(),true); + } + } + else if(installTestJieXian.Any(a=>triggerName.StartsWith(a))) + { + // + if (steps[3012].isDone) + { + currentInstallTestJieXian.Add(triggerName); + } + } + else if(triggerName.Contains("ܱӡ")) + { + if (steps[3012].isDone) + { + if((bool)para) + { + if(!SiteManager.instance.measuringCabinet.meteringDevice.cover.cover_seal_Left.isCut && !SiteManager.instance.measuringCabinet.meteringDevice.cover.cover_seal_Right.isCut) + { + steps[3016].SetScore(true,true); + } + } + } + } + else if(triggerName== "") + { + if (steps[3012].isDone) + { + steps[3018].SetScore(true); } } } @@ -165,7 +325,7 @@ public class Score_1002 : ScoreBase /// private bool isInSwitchCheckE() { - if (TestInSwitchList.Contains("+in_˿1") && TestInSwitchList.Contains("+in_˿2") && TestInSwitchList.Contains("+in_˿2")) + if (InSwitchCloseYDList.Contains("+in_˿1") && InSwitchCloseYDList.Contains("+in_˿2") && InSwitchCloseYDList.Contains("+in_˿2")) { return true; } @@ -174,4 +334,76 @@ public class Score_1002 : ScoreBase return false; } } + + /// + /// жϲ˳ + /// + /// + private bool IsUninstallJieXianCheckE() + { + if(currentunInstallJieXian.Count!= unInstallJieXian.Count) + { + return false; + } + + //һһȶ + for (int i = 0; i < currentunInstallJieXian.Count; i++) + { + if (currentunInstallJieXian[i] != unInstallJieXian[i]) + { + //˿ + if (currentunInstallJieXian[i].Replace("up","").Replace("down","") != unInstallJieXian[i].Replace("up", "").Replace("down", "")) + return false; + } + } + + return true; + } + + /// + /// жϰװ˳ + /// + /// + public bool IsInstallJieXianCheckE() + { + if(!currentInstallJieXian.Contains("ܱװ˿1") || !currentInstallJieXian.Contains("ܱװ˿2")) + return false; + + if (currentInstallJieXian.Count < currentInstallJieXian.Count+2) + { + return false; + } + + //һһȶ + string[] tmps=new string[currentInstallJieXian.Count]; + currentInstallJieXian.CopyTo(tmps); + var tmplist=tmps.ToList(); + tmplist.Remove("ܱװ˿1"); + tmplist.Remove("ܱװ˿2"); + + + for (int i = 0; i < tmplist.Count; i++) + { + //˿ + if (tmplist[i].Replace("up", "").Replace("down", "") != installJieXian[i].Replace("up", "").Replace("down", "")) + return false; + } + + return true; + } + + public bool Check3015() + { + //عˣš + if (SiteManager.instance.measuringCabinet.inSwitch.isOpen && installCover.Contains("ܱӹ̶˿1") && installCover.Contains("ܱӹ̶˿2")) + { + //˳ + if(installTestJieXian.TrueForAll(a => currentInstallTestJieXian.Contains(a.Replace("up","").Replace("down","")))) + { + return true; + } + } + + return false; + } } diff --git a/Assets/Scripts/CXX/Tools/Tool_BoxSeal.cs b/Assets/Scripts/CXX/Tools/Tool_BoxSeal.cs index 4e5a303..c9a5cfc 100644 --- a/Assets/Scripts/CXX/Tools/Tool_BoxSeal.cs +++ b/Assets/Scripts/CXX/Tools/Tool_BoxSeal.cs @@ -25,11 +25,15 @@ public class Tool_BoxSeal : Tool_Base { //ӡ SiteManager.instance.measuringCabinet.meteringDevice.cover.cover_seal_Left.Install(); + // + SiteManager.instance.measuringCabinet.meteringDevice.cover.cover_seal_Left.CallScoreAction(true); } else if (screw == SiteManager.instance.measuringCabinet.meteringDevice.cover.cover_screw_Right && SiteManager.instance.measuringCabinet.meteringDevice.cover.cover_screw_Right.isInstall) { //ҷӡ SiteManager.instance.measuringCabinet.meteringDevice.cover.cover_seal_Right.Install(); + // + SiteManager.instance.measuringCabinet.meteringDevice.cover.cover_seal_Right.CallScoreAction(true); } } } diff --git a/Assets/Scripts/CXX/Tools/Tool_Line.cs b/Assets/Scripts/CXX/Tools/Tool_Line.cs index 57a28dd..5f2c398 100644 --- a/Assets/Scripts/CXX/Tools/Tool_Line.cs +++ b/Assets/Scripts/CXX/Tools/Tool_Line.cs @@ -57,6 +57,7 @@ public class Tool_Line: Tool_Base isConnected = false; actionBack?.Invoke(isConnected); int state = (triggerAction == null ? 0 : triggerAction.Invoke(triggerName, true)); + CallScoreAction(false); }); } } @@ -70,6 +71,7 @@ public class Tool_Line: Tool_Base isConnected = true; actionBack?.Invoke(isConnected); int state = (triggerAction == null ? 0 : triggerAction.Invoke(triggerName, true)); + CallScoreAction(true); }); } } diff --git a/Assets/Scripts/CXX/Tools/Tool_Screw.cs b/Assets/Scripts/CXX/Tools/Tool_Screw.cs index 32d0ea6..9ff07a2 100644 --- a/Assets/Scripts/CXX/Tools/Tool_Screw.cs +++ b/Assets/Scripts/CXX/Tools/Tool_Screw.cs @@ -85,6 +85,8 @@ public class Tool_Screw : Tool_Base isMoving = false; installAction?.Invoke(true); screwdriver.ReBackHead(); + screwdriver.isUseing = false; + CallScoreAction(true); }); }); } @@ -120,6 +122,8 @@ public class Tool_Screw : Tool_Base isMoving = false; installAction?.Invoke(false); screwdriver.ReBackHead(); + screwdriver.isUseing = false; + CallScoreAction(false); }); }); } diff --git a/Assets/Scripts/CXX/Tools/Tool_Screwdriver.cs b/Assets/Scripts/CXX/Tools/Tool_Screwdriver.cs index 6fbce37..5390f87 100644 --- a/Assets/Scripts/CXX/Tools/Tool_Screwdriver.cs +++ b/Assets/Scripts/CXX/Tools/Tool_Screwdriver.cs @@ -8,6 +8,12 @@ using UnityEngine; /// public class Tool_Screwdriver : Tool_Base { + /// + /// ʹ + /// + [HideInInspector] + public bool isUseing; + /// /// ʼװ˿ /// @@ -16,6 +22,7 @@ public class Tool_Screwdriver : Tool_Base { if (!screw.isInstall) { + isUseing = true; screw.BeInstalled(this); } } @@ -28,13 +35,14 @@ public class Tool_Screwdriver : Tool_Base { if (screw.isInstall) { + isUseing = true; screw.BeUnInstalled(this); } } private void Update() { - if (Input.GetMouseButtonDown(0)) + if (Input.GetMouseButtonDown(0) && !isUseing) { //˿ Ray tmpray = Camera.main.ScreenPointToRay(Input.mousePosition); diff --git a/Assets/StreamingAssets/BinaryData/TB_SubProcessStep.binary b/Assets/StreamingAssets/BinaryData/TB_SubProcessStep.binary index d5614a4..4f23be1 100644 Binary files a/Assets/StreamingAssets/BinaryData/TB_SubProcessStep.binary and b/Assets/StreamingAssets/BinaryData/TB_SubProcessStep.binary differ