From f8bf4bd5a76c59743bca71be4b9e29040bcc314f Mon Sep 17 00:00:00 2001 From: chenxiangxue <910695411@qq.com> Date: Thu, 29 Aug 2024 18:36:04 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=93=E5=88=86=EF=BC=8C=E6=94=B6=E5=9B=9E?= =?UTF-8?q?=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Scripts/CXX/StepState/1002/StepState_1002.cs | 6 ++++++ Assets/Scripts/CXX/Tools/Tool_Base.cs | 11 +++++++++-- Assets/Scripts/CXX/Tools/Tool_Screw.cs | 4 ++-- Assets/Scripts/CXX/Tools/Tool_Screwdriver.cs | 12 +++--------- Assets/Scripts/CXX/Tools/Tool_TestPen.cs | 1 - Assets/Scripts/CXX/Tools/Tool_WireStripper.cs | 7 +++---- 6 files changed, 23 insertions(+), 18 deletions(-) diff --git a/Assets/Scripts/CXX/StepState/1002/StepState_1002.cs b/Assets/Scripts/CXX/StepState/1002/StepState_1002.cs index a878e56..e6bd909 100644 --- a/Assets/Scripts/CXX/StepState/1002/StepState_1002.cs +++ b/Assets/Scripts/CXX/StepState/1002/StepState_1002.cs @@ -137,6 +137,9 @@ public class StepState_1002 : StepState //还原柜子 SiteManager.instance.measuringCabinet.Init(); + + //还原npc对话 + GameObject.FindObjectsOfType().ToList().ForEach(a => { a.speackIndex = 0; }); } else if (num == 3008) { @@ -145,6 +148,9 @@ public class StepState_1002 : StepState else if (num == 3009) { //接线检查 + + //还原npc负责人 + GameObject.FindObjectsOfType().ToList().Find(a => a.triggerName == "NPC负责人").speackIndex = 1; } else if(num == 3010) { diff --git a/Assets/Scripts/CXX/Tools/Tool_Base.cs b/Assets/Scripts/CXX/Tools/Tool_Base.cs index 1c11b08..9418304 100644 --- a/Assets/Scripts/CXX/Tools/Tool_Base.cs +++ b/Assets/Scripts/CXX/Tools/Tool_Base.cs @@ -18,10 +18,15 @@ public class Tool_Base : PermanentTriggerBase /// trigger触发事件 /// public Func triggerAction; + /// + /// 是否再移动 + /// + public bool isMoving; private Vector3 head_LocalPos; private Vector3 head_LocalEulerAnglesl; + protected override void OnAwake() { @@ -77,12 +82,14 @@ public class Tool_Base : PermanentTriggerBase /// public void ReBackHead() { + isMoving = true; transform.parent = Camera.main.transform; - transform.DOLocalRotate(head_LocalEulerAnglesl, 0.5f); - transform.DOLocalMove(head_LocalPos, 1).OnComplete(() => + transform.DOLocalRotate(head_LocalEulerAnglesl, 0.3f); + transform.DOLocalMove(head_LocalPos, 0.8f).OnComplete(() => { transform.localPosition = head_LocalPos; transform.localEulerAngles = head_LocalEulerAnglesl; + isMoving = false; }); } } diff --git a/Assets/Scripts/CXX/Tools/Tool_Screw.cs b/Assets/Scripts/CXX/Tools/Tool_Screw.cs index 9ff07a2..7013aad 100644 --- a/Assets/Scripts/CXX/Tools/Tool_Screw.cs +++ b/Assets/Scripts/CXX/Tools/Tool_Screw.cs @@ -85,7 +85,7 @@ public class Tool_Screw : Tool_Base isMoving = false; installAction?.Invoke(true); screwdriver.ReBackHead(); - screwdriver.isUseing = false; + screwdriver.isMoving = false; CallScoreAction(true); }); }); @@ -122,7 +122,7 @@ public class Tool_Screw : Tool_Base isMoving = false; installAction?.Invoke(false); screwdriver.ReBackHead(); - screwdriver.isUseing = false; + screwdriver.isMoving = false; CallScoreAction(false); }); }); diff --git a/Assets/Scripts/CXX/Tools/Tool_Screwdriver.cs b/Assets/Scripts/CXX/Tools/Tool_Screwdriver.cs index 5390f87..5801aac 100644 --- a/Assets/Scripts/CXX/Tools/Tool_Screwdriver.cs +++ b/Assets/Scripts/CXX/Tools/Tool_Screwdriver.cs @@ -8,12 +8,6 @@ using UnityEngine; /// public class Tool_Screwdriver : Tool_Base { - /// - /// 正在使用 - /// - [HideInInspector] - public bool isUseing; - /// /// 开始安装螺丝 /// @@ -22,7 +16,7 @@ public class Tool_Screwdriver : Tool_Base { if (!screw.isInstall) { - isUseing = true; + isMoving = true; screw.BeInstalled(this); } } @@ -35,14 +29,14 @@ public class Tool_Screwdriver : Tool_Base { if (screw.isInstall) { - isUseing = true; + isMoving = true; screw.BeUnInstalled(this); } } private void Update() { - if (Input.GetMouseButtonDown(0) && !isUseing) + if (Input.GetMouseButtonDown(0) && !base.isMoving) { //点击螺丝验电 Ray tmpray = Camera.main.ScreenPointToRay(Input.mousePosition); diff --git a/Assets/Scripts/CXX/Tools/Tool_TestPen.cs b/Assets/Scripts/CXX/Tools/Tool_TestPen.cs index 20f2269..bc7cdbd 100644 --- a/Assets/Scripts/CXX/Tools/Tool_TestPen.cs +++ b/Assets/Scripts/CXX/Tools/Tool_TestPen.cs @@ -1,7 +1,6 @@ using DG.Tweening; using System.Collections; using System.Collections.Generic; -using Unity.VisualScripting; using UnityEngine; /// diff --git a/Assets/Scripts/CXX/Tools/Tool_WireStripper.cs b/Assets/Scripts/CXX/Tools/Tool_WireStripper.cs index e737bd2..3e601f6 100644 --- a/Assets/Scripts/CXX/Tools/Tool_WireStripper.cs +++ b/Assets/Scripts/CXX/Tools/Tool_WireStripper.cs @@ -9,14 +9,13 @@ using static Unity.Burst.Intrinsics.X86.Avx; /// public class Tool_WireStripper : Tool_Base { - private bool isCuning; /// /// 开始剪封印 /// /// public void CutOpen(Device_Seal device_Seal) { - isCuning = true; + isMoving = true; transform.parent = null; transform.DORotate(device_Seal.testPosAndRot.eulerAngles, 0.5f); transform.DOMove(device_Seal.testPosAndRot.position, 1).OnComplete(() => @@ -51,14 +50,14 @@ public class Tool_WireStripper : Tool_Base } //剪断 device_Seal.Cut(); - isCuning = false; + isMoving = false; ReBackHead(); int result = (triggerAction == null ? 0 : triggerAction.Invoke(device_Seal.triggerName, true)); } private void Update() { - if (Input.GetMouseButtonDown(0) && !isCuning) + if (Input.GetMouseButtonDown(0) && !isMoving) { //点击螺丝验电 Ray tmpray = Camera.main.ScreenPointToRay(Input.mousePosition);