diff --git a/Assets/Resources/UI/UI_Tip/ProcessTipPanel.prefab b/Assets/Resources/UI/UI_Tip/ProcessTipPanel.prefab index ec01fcb..cc37cb1 100644 --- a/Assets/Resources/UI/UI_Tip/ProcessTipPanel.prefab +++ b/Assets/Resources/UI/UI_Tip/ProcessTipPanel.prefab @@ -108,6 +108,7 @@ RectTransform: m_ConstrainProportionsScale: 0 m_Children: - {fileID: 267684787124082563} + - {fileID: 38172639612528770} m_Father: {fileID: 0} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -167,3 +168,139 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: image: {fileID: 267684787124082560} + textMeshProUGUI: {fileID: 2523285510643614807} +--- !u!1 &3452568093716872615 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 38172639612528770} + - component: {fileID: 2329643047023932906} + - component: {fileID: 2523285510643614807} + m_Layer: 5 + m_Name: Text (TMP) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &38172639612528770 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3452568093716872615} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 267684787304413251} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &2329643047023932906 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3452568093716872615} + m_CullTransparentMesh: 1 +--- !u!114 &2523285510643614807 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3452568093716872615} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_text: "\u68C0\u67E5\u4E2D" + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: 9ea913af302bbdf42a9f003451c70e02, type: 2} + m_sharedMaterial: {fileID: 4239875615288461448, guid: 9ea913af302bbdf42a9f003451c70e02, type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4294967295 + m_fontColor: {r: 1, g: 1, b: 1, a: 1} + m_enableVertexGradient: 0 + m_colorMode: 3 + m_fontColorGradient: + topLeft: {r: 1, g: 1, b: 1, a: 1} + topRight: {r: 1, g: 1, b: 1, a: 1} + bottomLeft: {r: 1, g: 1, b: 1, a: 1} + bottomRight: {r: 1, g: 1, b: 1, a: 1} + m_fontColorGradientPreset: {fileID: 0} + m_spriteAsset: {fileID: 0} + m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 + m_overrideHtmlColors: 0 + m_faceColor: + serializedVersion: 2 + rgba: 4294967295 + m_fontSize: 36 + m_fontSizeBase: 36 + m_fontWeight: 400 + m_enableAutoSizing: 0 + m_fontSizeMin: 18 + m_fontSizeMax: 72 + m_fontStyle: 0 + m_HorizontalAlignment: 2 + m_VerticalAlignment: 512 + m_textAlignment: 65535 + m_characterSpacing: 0 + m_wordSpacing: 0 + m_lineSpacing: 0 + m_lineSpacingMax: 0 + m_paragraphSpacing: 0 + m_charWidthMaxAdj: 0 + m_enableWordWrapping: 1 + m_wordWrappingRatios: 0.4 + m_overflowMode: 0 + m_linkedTextComponent: {fileID: 0} + parentLinkedComponent: {fileID: 0} + m_enableKerning: 1 + m_enableExtraPadding: 0 + checkPaddingRequired: 0 + m_isRichText: 1 + m_parseCtrlCharacters: 1 + m_isOrthographic: 1 + m_isCullingEnabled: 0 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 + m_VertexBufferAutoSizeReduction: 0 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 0, y: 0, z: 0, w: 0} + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + m_hasFontAssetChanged: 0 + m_baseMaterial: {fileID: 0} + m_maskOffset: {x: 0, y: 0, z: 0, w: 0} diff --git a/Assets/Scripts/CXX/Devices/Device_Base.cs b/Assets/Scripts/CXX/Devices/Device_Base.cs index 9d1fce4..31e18f8 100644 --- a/Assets/Scripts/CXX/Devices/Device_Base.cs +++ b/Assets/Scripts/CXX/Devices/Device_Base.cs @@ -14,6 +14,9 @@ public class Device_Base : PermanentTriggerBase /// public Func triggerAction; + private Vector3 head_LocalPos; + private Vector3 head_LocalEulerAnglesl; + protected override void OnStart() { if ( GameManager.RunModelMgr.SceneType == E_SceneType.Site) @@ -44,4 +47,15 @@ public class Device_Base : PermanentTriggerBase { this.triggerAction = action; } + + /// + /// 设置工具回到手中的位置 + /// + /// + /// + public void SetHeadPosAndEulerang(Vector3 head_LocalPos, Vector3 head_LocalEulerAnglesl) + { + this.head_LocalPos = head_LocalPos; + this.head_LocalEulerAnglesl = head_LocalEulerAnglesl; + } } diff --git a/Assets/Scripts/CXX/Devices/鐩存帴鎺ュ叆寮忕數鑳借閲忚缃/Device_3Phase4WireMeter.cs b/Assets/Scripts/CXX/Devices/鐩存帴鎺ュ叆寮忕數鑳借閲忚缃/Device_3Phase4WireMeter.cs index 7706600..3f29cd6 100644 --- a/Assets/Scripts/CXX/Devices/鐩存帴鎺ュ叆寮忕數鑳借閲忚缃/Device_3Phase4WireMeter.cs +++ b/Assets/Scripts/CXX/Devices/鐩存帴鎺ュ叆寮忕數鑳借閲忚缃/Device_3Phase4WireMeter.cs @@ -81,10 +81,10 @@ public class Device_3Phase4WireMeter : Device_Base cover.transform.localPosition = new Vector3(0.0001220703f, -0.1388763f, -0.2485413f); //左螺丝拧下 cover.cover_screw_Left.isInstall = false; - cover.cover_screw_Left.transform.localPosition = new Vector3(cover.cover_screw_Left.transform.localPosition.x, cover.cover_screw_Left.initPostionY - 0.03f, cover.cover_screw_Left.transform.localPosition.z); + cover.cover_screw_Left.transform.localPosition = new Vector3(cover.cover_screw_Left.transform.localPosition.x, -0.1840515f, -0.2512321f); //右螺丝拧下 cover.cover_screw_Right.isInstall = false; - cover.cover_screw_Right.transform.localPosition = new Vector3(cover.cover_screw_Right.transform.localPosition.x, cover.cover_screw_Right.initPostionY - 0.03f, cover.cover_screw_Right.transform.localPosition.z); + cover.cover_screw_Right.transform.localPosition = new Vector3(cover.cover_screw_Right.transform.localPosition.x, -0.1840515f, -0.2512321f); } /// /// 盖子装上的状态 @@ -96,10 +96,10 @@ public class Device_3Phase4WireMeter : Device_Base cover.transform.localPosition = new Vector3(0.0001220703f, 0.01112366f, -0.09854126f); //左螺丝拧上 cover.cover_screw_Left.isInstall = true; - cover.cover_screw_Left.transform.localPosition = new Vector3(cover.cover_screw_Left.transform.localPosition.x, cover.cover_screw_Left.initPostionY, cover.cover_screw_Left.transform.localPosition.z); + cover.cover_screw_Left.transform.localPosition = new Vector3(cover.cover_screw_Left.transform.localPosition.x, -0.01405334f, -0.1012321f); //右螺丝拧上 cover.cover_screw_Right.isInstall = true; - cover.cover_screw_Right.transform.localPosition = new Vector3(cover.cover_screw_Right.transform.localPosition.x, cover.cover_screw_Right.initPostionY, cover.cover_screw_Right.transform.localPosition.z); + cover.cover_screw_Right.transform.localPosition = new Vector3(cover.cover_screw_Right.transform.localPosition.x, -0.01405334f, -0.1012321f); } /// diff --git a/Assets/Scripts/CXX/Devices/鐩存帴鎺ュ叆寮忕數鑳借閲忚缃/Device_Cover.cs b/Assets/Scripts/CXX/Devices/鐩存帴鎺ュ叆寮忕數鑳借閲忚缃/Device_Cover.cs index 2b831b3..0e02db6 100644 --- a/Assets/Scripts/CXX/Devices/鐩存帴鎺ュ叆寮忕數鑳借閲忚缃/Device_Cover.cs +++ b/Assets/Scripts/CXX/Devices/鐩存帴鎺ュ叆寮忕數鑳借閲忚缃/Device_Cover.cs @@ -55,9 +55,14 @@ public class Device_Cover : Device_Base { Debug.Log("打开盖子"); isOpen = true; - transform.DOLocalMoveY(-0.1388763f, 2); - transform.DOLocalMoveZ(-0.2485413f, 2).OnComplete(() => + + Transform parent = cover_screw_Left.transform.parent; + cover_screw_Left.transform.parent = transform; + cover_screw_Right.transform.parent = transform; + transform.DOLocalMove(new Vector3(transform.localPosition.x,-0.1388763f, -0.2485413f), 2).OnComplete(() => { + cover_screw_Left.transform.parent = parent; + cover_screw_Right.transform.parent = parent; int result = (triggerAction == null ? 0 : triggerAction.Invoke(triggerName, true)); }); } @@ -69,9 +74,14 @@ public class Device_Cover : Device_Base { Debug.Log("盖上盖子"); isOpen = false; - transform.DOLocalMoveY(0.01112366f, 2); - transform.DOLocalMoveZ(-0.09854126f, 2).OnComplete(() => + + Transform parent = cover_screw_Left.transform.parent; + cover_screw_Left.transform.parent = transform; + cover_screw_Right.transform.parent = transform; + transform.DOLocalMove(new Vector3(transform.localPosition.x,0.01112366f, -0.09854126f), 2).OnComplete(() => { + cover_screw_Left.transform.parent = parent; + cover_screw_Right.transform.parent = parent; int result = (triggerAction == null ? 0 : triggerAction.Invoke(triggerName, true)); }); } diff --git a/Assets/Scripts/CXX/Score/ScoreBase.cs b/Assets/Scripts/CXX/Score/ScoreBase.cs new file mode 100644 index 0000000..5dbafe6 --- /dev/null +++ b/Assets/Scripts/CXX/Score/ScoreBase.cs @@ -0,0 +1,21 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class ScoreBase : MonoBehaviour +{ + /// + /// 科目满分 + /// + protected float maxScore = 100; + /// + /// 科目得分s + /// + protected float currentScore; + /// + /// 步骤 + /// + protected Dictionary steps; + + //protected abstract void Init(ScoreSubjectStep step); +} diff --git a/Assets/Scripts/CXX/Score/ScoreSubject.cs.meta b/Assets/Scripts/CXX/Score/ScoreBase.cs.meta similarity index 83% rename from Assets/Scripts/CXX/Score/ScoreSubject.cs.meta rename to Assets/Scripts/CXX/Score/ScoreBase.cs.meta index 9a8eadc..cf308b7 100644 --- a/Assets/Scripts/CXX/Score/ScoreSubject.cs.meta +++ b/Assets/Scripts/CXX/Score/ScoreBase.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 00415bfa520d2dd43b89c50a93350199 +guid: 8dfb1c2b6f6420d47a6094d456c9ad88 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/Scripts/CXX/Score/ScoreManager.cs b/Assets/Scripts/CXX/Score/ScoreManager.cs index 97f9712..4ac655d 100644 --- a/Assets/Scripts/CXX/Score/ScoreManager.cs +++ b/Assets/Scripts/CXX/Score/ScoreManager.cs @@ -4,6 +4,10 @@ using UnityEngine; public class ScoreManager : MonoBehaviour { - List scoreSubjectList; - + public static ScoreManager instance; + List scoreSubjectList; + private void Awake() + { + instance = this; + } } diff --git a/Assets/Scripts/CXX/Score/ScoreSubject.cs b/Assets/Scripts/CXX/Score/ScoreSubject.cs deleted file mode 100644 index ac4bbb6..0000000 --- a/Assets/Scripts/CXX/Score/ScoreSubject.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - -public class ScoreSubject : MonoBehaviour -{ - /// - /// 科目满分 - /// - float maxScore; - /// - /// 科目得分 - /// - float currentScore; - List steps; -} diff --git a/Assets/Scripts/CXX/Score/ScoreSubjectStep.cs b/Assets/Scripts/CXX/Score/ScoreSubjectStep.cs index a423891..1a70440 100644 --- a/Assets/Scripts/CXX/Score/ScoreSubjectStep.cs +++ b/Assets/Scripts/CXX/Score/ScoreSubjectStep.cs @@ -2,7 +2,7 @@ using System.Collections; using System.Collections.Generic; using UnityEngine; -public class ScoreSubjectStep : MonoBehaviour +public class ScoreSubjectStep { /// /// 步骤满分 @@ -17,6 +17,10 @@ public class ScoreSubjectStep : MonoBehaviour /// bool isDone; + public ScoreSubjectStep(float maxScore) + { + this.maxScore = maxScore; + } public void SetScore(float score) { isDone = true; diff --git a/Assets/Scripts/CXX/Score/Score_1002.cs b/Assets/Scripts/CXX/Score/Score_1002.cs new file mode 100644 index 0000000..31e0fba --- /dev/null +++ b/Assets/Scripts/CXX/Score/Score_1002.cs @@ -0,0 +1,38 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class Score_1002 : ScoreBase +{ + + private void Init() + { + steps = new Dictionary(); + steps.Add(3001,new ScoreSubjectStep(0)); + steps.Add(3002, new ScoreSubjectStep(0)); + steps.Add(3003, new ScoreSubjectStep(5)); + steps.Add(3004, new ScoreSubjectStep(5)); + steps.Add(3005, new ScoreSubjectStep(5)); + steps.Add(3006, new ScoreSubjectStep(10)); + steps.Add(3007, new ScoreSubjectStep(5)); + steps.Add(3008, new ScoreSubjectStep(0)); + steps.Add(3009, new ScoreSubjectStep(3)); + steps.Add(3010, new ScoreSubjectStep(4)); + steps.Add(3011, new ScoreSubjectStep(3)); + steps.Add(3012, new ScoreSubjectStep(20)); + steps.Add(3013, new ScoreSubjectStep(20)); + steps.Add(3014, new ScoreSubjectStep(5)); + steps.Add(3015, new ScoreSubjectStep(5)); + steps.Add(3016, new ScoreSubjectStep(3)); + steps.Add(3017, new ScoreSubjectStep(4)); + steps.Add(3018, new ScoreSubjectStep(3)); + } + + /// + /// 判分 + /// + public void CheckScore() + { + + } +} diff --git a/Assets/Scripts/CXX/Score/Score_1002.cs.meta b/Assets/Scripts/CXX/Score/Score_1002.cs.meta new file mode 100644 index 0000000..24be6e2 --- /dev/null +++ b/Assets/Scripts/CXX/Score/Score_1002.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8897a2609da37744e94a004f97f53e6a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/CXX/Tools/Tool_Base.cs b/Assets/Scripts/CXX/Tools/Tool_Base.cs index ca92e8e..ca01352 100644 --- a/Assets/Scripts/CXX/Tools/Tool_Base.cs +++ b/Assets/Scripts/CXX/Tools/Tool_Base.cs @@ -2,6 +2,7 @@ using System.Collections; using System.Collections.Generic; using UnityEngine; using System; +using DG.Tweening; /// /// 工具材料基类 @@ -18,6 +19,9 @@ public class Tool_Base : PermanentTriggerBase /// public Func triggerAction; + private Vector3 head_LocalPos; + private Vector3 head_LocalEulerAnglesl; + protected override void OnStart() { if ( GameManager.RunModelMgr.SceneType == E_SceneType.Site) @@ -48,4 +52,24 @@ public class Tool_Base : PermanentTriggerBase { this.triggerAction = action; } + /// + /// 设置工具回到手中的位置 + /// + /// + /// + public void SetHeadPosAndEulerang(Vector3 head_LocalPos,Vector3 head_LocalEulerAnglesl) + { + this.head_LocalPos = head_LocalPos; + this.head_LocalEulerAnglesl= head_LocalEulerAnglesl; + } + + /// + /// 工具回到手中 + /// + public void ReBackHead() + { + transform.parent=Camera.main.transform; + transform.DOLocalMove(head_LocalPos, 1); + transform.DOLocalRotate(head_LocalEulerAnglesl, 1); + } } diff --git a/Assets/Scripts/CXX/Tools/Tool_Screw.cs b/Assets/Scripts/CXX/Tools/Tool_Screw.cs index 0119022..9a90e7a 100644 --- a/Assets/Scripts/CXX/Tools/Tool_Screw.cs +++ b/Assets/Scripts/CXX/Tools/Tool_Screw.cs @@ -67,23 +67,26 @@ public class Tool_Screw : Tool_Base Debug.Log("开始拧紧螺丝"); //设置螺丝刀初始位置 screwdriver.transform.parent = null; - screwdriver.transform.position = installPos.position; - screwdriver.transform.localEulerAngles = installPos.localEulerAngles; - //动画 - transform.DOLocalMoveY(initPostionY, 1) - .OnUpdate(() => - { - transform.RotateAroundLocal(Vector3.up, 1); - screwdriver.transform.position = installPos.position; - screwdriver.transform.RotateAroundLocal(Vector3.right, 10); - }) - .OnComplete(() => - { - Debug.Log("螺丝已拧紧"); - isInstall = true; - isMoving = false; - installAction?.Invoke(true); - }); + screwdriver.transform.DOLocalRotate(installPos.localEulerAngles, 0.5f); + screwdriver.transform.DOMove(installPos.position, 1).OnComplete(() => + { + //动画 + transform.DOLocalMoveY(initPostionY, 1) + .OnUpdate(() => + { + transform.RotateAroundLocal(Vector3.up, 1); + screwdriver.transform.position = installPos.position; + screwdriver.transform.RotateAroundLocal(Vector3.right, 10); + }) + .OnComplete(() => + { + Debug.Log("螺丝已拧紧"); + isInstall = true; + isMoving = false; + installAction?.Invoke(true); + ReBackHead(); + }); + }); } } @@ -99,23 +102,26 @@ public class Tool_Screw : Tool_Base Debug.Log("开始卸螺丝"); //设置螺丝刀初始位置 screwdriver.transform.parent = null; - screwdriver.transform.position = installPos.position; - screwdriver.transform.localEulerAngles = installPos.localEulerAngles; - //动画 - transform.DOLocalMoveY(initPostionY - 0.02f, 1) - .OnUpdate(() => - { - transform.RotateAroundLocal(Vector3.up, 1); - screwdriver.transform.position = installPos.position; - screwdriver.transform.RotateAroundLocal(Vector3.right, 10); - }) - .OnComplete(() => - { - Debug.Log("螺丝已拧松"); - isInstall = false; - isMoving = false; - installAction?.Invoke(false); - }); + screwdriver.transform.DOLocalRotate(installPos.localEulerAngles, 0.5f); + screwdriver.transform.DOMove(installPos.position, 1).OnComplete(() => + { + //动画 + transform.DOLocalMoveY(initPostionY - 0.02f, 1) + .OnUpdate(() => + { + transform.RotateAroundLocal(Vector3.up, 1); + screwdriver.transform.position = installPos.position; + screwdriver.transform.RotateAroundLocal(Vector3.right, 10); + }) + .OnComplete(() => + { + Debug.Log("螺丝已拧松"); + isInstall = false; + isMoving = false; + installAction?.Invoke(false); + ReBackHead(); + }); + }); } } } diff --git a/Assets/Scripts/CXX/Tools/Tool_Screwdriver.cs b/Assets/Scripts/CXX/Tools/Tool_Screwdriver.cs index 209ea49..6fbce37 100644 --- a/Assets/Scripts/CXX/Tools/Tool_Screwdriver.cs +++ b/Assets/Scripts/CXX/Tools/Tool_Screwdriver.cs @@ -44,16 +44,34 @@ public class Tool_Screwdriver : Tool_Base Tool_Screw ts = hit.transform.GetComponent(); if (ts != null) { - if (ts.id == "电能表盖子固定螺丝1" && !SiteManager.instance.measuringCabinet.meteringDevice.cover.cover_seal_Left.isCut) + //固定螺丝操作限制 + if (ts.id == "电能表盖子固定螺丝1") { - Debug.Log("封印未剪断"); - return; - } + if (!SiteManager.instance.measuringCabinet.meteringDevice.cover.cover_seal_Left.isCut) + { + Debug.Log("封印未剪断"); + return; + } - if (ts.id == "电能表盖子固定螺丝2" && !SiteManager.instance.measuringCabinet.meteringDevice.cover.cover_seal_Right.isCut) + if(SiteManager.instance.measuringCabinet.meteringDevice.cover.isOpen) + { + Debug.Log("盖子打开的"); + return; + } + } + + if (ts.id == "电能表盖子固定螺丝2") { - Debug.Log("封印未剪断"); - return; + if (!SiteManager.instance.measuringCabinet.meteringDevice.cover.cover_seal_Right.isCut) + { + Debug.Log("封印未剪断"); + return; + } + if (SiteManager.instance.measuringCabinet.meteringDevice.cover.isOpen) + { + Debug.Log("盖子打开的"); + return; + } } //接线螺丝要先点击检查接线 diff --git a/Assets/Scripts/CXX/Tools/Tool_TestPen.cs b/Assets/Scripts/CXX/Tools/Tool_TestPen.cs index 07fcf53..7cdde69 100644 --- a/Assets/Scripts/CXX/Tools/Tool_TestPen.cs +++ b/Assets/Scripts/CXX/Tools/Tool_TestPen.cs @@ -1,3 +1,4 @@ +using DG.Tweening; using System.Collections; using System.Collections.Generic; using Unity.VisualScripting; @@ -76,10 +77,13 @@ public class Tool_TestPen : Tool_Base var tmp = ((Device_Socket)device_base); //位置移动 transform.parent = null; - transform.position = tmp.testPosAndRot.position; - transform.eulerAngles = tmp.testPosAndRot.eulerAngles; - Debug.Log("计量柜_插座 已验电"); - isFlicker = tmp.hasElectricity; + transform.DORotate(tmp.testPosAndRot.eulerAngles, 0.5f); + transform.DOMove(tmp.testPosAndRot.position, 1).OnComplete(() => + { + Debug.Log("计量柜_插座 已验电"); + isFlicker = tmp.hasElectricity; + screem.materials[0].color = isFlicker ? Color.red : Color.white; + }); } else if (device_base.deviceType == DeviceType.计量柜_柜门) { @@ -87,13 +91,14 @@ public class Tool_TestPen : Tool_Base //位置移动 transform.parent = null; - transform.position = tmp.testPosAndRot.position; - transform.localEulerAngles = tmp.testPosAndRot.localEulerAngles; - Debug.Log("计量柜_柜门 已验电"); - isFlicker = tmp.hasElectricity; + transform.DOLocalRotate(tmp.testPosAndRot.localEulerAngles, 0.5f); + transform.DOMove(tmp.testPosAndRot.position, 1).OnComplete(() => + { + Debug.Log("计量柜_柜门 已验电"); + isFlicker = tmp.hasElectricity; + screem.materials[0].color = isFlicker ? Color.red : Color.white; + }); } - - screem.materials[0].color = isFlicker ? Color.red : Color.white; } } @@ -110,13 +115,14 @@ public class Tool_TestPen : Tool_Base var tmp = ((Tool_Screw)tool_base); //位置移动 transform.parent = null; - transform.position = tmp.installPos.position; - transform.localEulerAngles = tmp.installPos.localEulerAngles; - Debug.Log("螺丝 已验电"); - isFlicker = tmp.hasElectricity; + transform.DOLocalRotate(tmp.installPos.localEulerAngles, 0.5f); + transform.DOMove(tmp.installPos.position, 1).OnComplete(() => + { + Debug.Log("螺丝 已验电"); + isFlicker = tmp.hasElectricity; + screem.materials[0].color = isFlicker ? Color.red : Color.white; + }); } - - screem.materials[0].color = isFlicker ? Color.red : Color.white; } } diff --git a/Assets/Scripts/CXX/Tools/Tool_WireStripper.cs b/Assets/Scripts/CXX/Tools/Tool_WireStripper.cs index 83e557d..57cec6a 100644 --- a/Assets/Scripts/CXX/Tools/Tool_WireStripper.cs +++ b/Assets/Scripts/CXX/Tools/Tool_WireStripper.cs @@ -1,3 +1,4 @@ +using DG.Tweening; using System.Collections; using System.Collections.Generic; using UnityEngine; @@ -17,11 +18,13 @@ public class Tool_WireStripper : Tool_Base { isCuning = true; transform.parent = null; - transform.position = device_Seal.testPosAndRot.position; - transform.eulerAngles = device_Seal.testPosAndRot.eulerAngles; - //播放动画 - StopAllCoroutines(); - StartCoroutine(PlayAnimi(device_Seal)); + transform.DORotate(device_Seal.testPosAndRot.eulerAngles, 0.5f); + transform.DOMove(device_Seal.testPosAndRot.position, 1).OnComplete(() => + { + //播放动画 + StopAllCoroutines(); + StartCoroutine(PlayAnimi(device_Seal)); + }); } /// @@ -49,6 +52,7 @@ public class Tool_WireStripper : Tool_Base //剪断 device_Seal.Cut(); isCuning = false; + ReBackHead(); } private void Update() diff --git a/Assets/Scripts/CXX/UI/ProcessTipPanel.cs b/Assets/Scripts/CXX/UI/ProcessTipPanel.cs index 764f8d1..6ea5b1e 100644 --- a/Assets/Scripts/CXX/UI/ProcessTipPanel.cs +++ b/Assets/Scripts/CXX/UI/ProcessTipPanel.cs @@ -1,6 +1,7 @@ using System; using System.Collections; using System.Collections.Generic; +using TMPro; using UnityEngine; using UnityEngine.UI; using static UnityEngine.Rendering.DebugUI; @@ -8,6 +9,7 @@ using static UnityEngine.Rendering.DebugUI; public class ProcessTipPanel : MonoBehaviour { public Image image; + public TextMeshProUGUI textMeshProUGUI; /// /// 是否启用进度 /// @@ -35,6 +37,7 @@ public class ProcessTipPanel : MonoBehaviour this.isCheck=true; tmpback = back; Debug.Log("开始核对和抄录"); + textMeshProUGUI.text = "核对中"; } /// @@ -79,6 +82,7 @@ public class ProcessTipPanel : MonoBehaviour private void ThisDestroy() { Debug.Log("核对和抄录完成!"); + textMeshProUGUI.text = "核对完成"; tmpback(true); Destroy(gameObject); }