diff --git a/SXElectricityInformationAcquisition/Assets/JunctionBox.cs b/SXElectricityInformationAcquisition/Assets/JunctionBox.cs index cdde7ec6..838fc301 100644 --- a/SXElectricityInformationAcquisition/Assets/JunctionBox.cs +++ b/SXElectricityInformationAcquisition/Assets/JunctionBox.cs @@ -4,6 +4,7 @@ using MotionFramework; using System.Collections; using System.Collections.Generic; using UnityEngine; +using HighlightPlus; public class JunctionBox : MonoBehaviour { @@ -15,18 +16,61 @@ public class JunctionBox : MonoBehaviour /// /// 端子排上所有封印和螺丝 /// - public GameObject[] allObjects; + public GameObject[] AllObjects; /// - /// 是否盖上 + /// 接线盒滑块 /// - bool iscover; + public GameObject[] GameObjectSlider; + /// + /// 高亮物体 + /// + //public GameObject[] AllHightObj; + + /// + /// 接线盒是否盖上 + /// + public bool iscover; void Start() { - + Init(); + } + public void Init() + { + for (int i = 0; i < GameObjectSlider.Length; i++) + { + GameObjectSlider[i].GetComponent().enabled = false; + } } + /// + /// 是否高亮 + /// + /// 高亮物体 + /// 高亮 + /// 是否高亮 + //public void HighligtOfObj(string ObjName, HighlightEffect Highlight,bool Ishighlight) + //{ + // for (int i = 0; i < AllObjects.Length; i++) + // { + // if (Ishighlight) + // { + // if (AllObjects[i].name.Equals(ObjName)) + // { + // Highlight.enabled = false; + // } + // } + // else + // { + // if (AllObjects[i].name.Equals(ObjName)) + // { + // Highlight.enabled = true; + // } + // } + // } + //} + void Update() { if (Input.GetMouseButtonDown(0)) @@ -36,14 +80,8 @@ public class JunctionBox : MonoBehaviour bool raycast = Physics.Raycast(ray, out hit); if (raycast) { - //if (hit.collider.gameObject.name == "盖_透明外壳") - //{ - // TransparentlidObj.transform.DOLocalMove(new Vector3(0, -0.0914f, 0),2f); - // ////判断盖子是否打开 - // } - if (!iscover) - { - //iscover = true; + if (iscover) + { //判断盖子是否打开 switch (hit.collider.gameObject.name) { case "接线盒纵向滑块001": @@ -64,17 +102,26 @@ public class JunctionBox : MonoBehaviour break; } } + //else + //{ + // Debug.Log("线盒还在"); + //} } } if (AreAllObjectsHidden()) { + iscover = true; TransparentlidObj.transform.DOLocalMove(new Vector3(0, -0.0914f, 0), 2f); + for (int i = 0; i < GameObjectSlider.Length; i++) + { + GameObjectSlider[i].GetComponent().enabled = true; + } } } public bool AreAllObjectsHidden() { // 检查每个对象的激活状态 - foreach (GameObject obj in allObjects) + foreach (GameObject obj in AllObjects) { if (obj.activeInHierarchy) // 使用 activeInHierarchy 如果你想检查对象是否在其父级结构中被激活 { diff --git a/SXElectricityInformationAcquisition/Assets/Model/宸ュ叿/Mat/閬僵鏉愯川鐞/Electroprobe_mat.mat b/SXElectricityInformationAcquisition/Assets/Model/宸ュ叿/Mat/閬僵鏉愯川鐞/Electroprobe_mat.mat index ec8dac09..2cc69672 100644 --- a/SXElectricityInformationAcquisition/Assets/Model/宸ュ叿/Mat/閬僵鏉愯川鐞/Electroprobe_mat.mat +++ b/SXElectricityInformationAcquisition/Assets/Model/宸ュ叿/Mat/閬僵鏉愯川鐞/Electroprobe_mat.mat @@ -116,7 +116,7 @@ Material: - __dirty: 1 m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} - - _EmiCol: {r: 8, g: 0, b: 0, a: 0} + - _EmiCol: {r: 10.680627, g: 0, b: 0, a: 0} - _EmissionColor: {r: 1, g: 1, b: 1, a: 1} - _Int_E: {r: 0, g: 0, b: 0, a: 0} - _MainCol: {r: 1, g: 1, b: 1, a: 0} diff --git a/SXElectricityInformationAcquisition/Assets/Model/鐢电嚎鏉/Mat/缁濈紭鑳跺甫缁戠嚎p1.mat b/SXElectricityInformationAcquisition/Assets/Model/鐢电嚎鏉/Mat/缁濈紭鑳跺甫缁戠嚎p1.mat index 50c8efb9..2fa1692f 100644 --- a/SXElectricityInformationAcquisition/Assets/Model/鐢电嚎鏉/Mat/缁濈紭鑳跺甫缁戠嚎p1.mat +++ b/SXElectricityInformationAcquisition/Assets/Model/鐢电嚎鏉/Mat/缁濈紭鑳跺甫缁戠嚎p1.mat @@ -114,12 +114,12 @@ Material: - _UVSec: 0 - _ZWrite: 1 - __dirty: 0 - - _step_p1: 0 - - _step_p2: 0 - - _step_p3: 0 - - _step_p4: 0 - - _step_p5: 0 - - _step_p6: 0 + - _step_p1: 1 + - _step_p2: 1 + - _step_p3: 1 + - _step_p4: 1 + - _step_p5: 1 + - _step_p6: 1 m_Colors: - _BaseCol: {r: 0.23429155, g: 0.28497556, b: 0.3679245, a: 0} - _Color: {r: 1, g: 1, b: 1, a: 1} diff --git a/SXElectricityInformationAcquisition/Assets/Scenes/鐜板満 _Test.unity b/SXElectricityInformationAcquisition/Assets/Scenes/鐜板満 _Test.unity index 522dcff5..39e39ea1 100644 --- a/SXElectricityInformationAcquisition/Assets/Scenes/鐜板満 _Test.unity +++ b/SXElectricityInformationAcquisition/Assets/Scenes/鐜板満 _Test.unity @@ -1455,7 +1455,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 7993702416454423269, guid: a6c750f9e3102bc499c6f13f30606383, type: 3} propertyPath: m_LocalPosition.x - value: 0.352 + value: 0.26 objectReference: {fileID: 0} - target: {fileID: 7993702416454423269, guid: a6c750f9e3102bc499c6f13f30606383, type: 3} propertyPath: m_LocalPosition.y @@ -4658,13 +4658,13 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 234854335} serializedVersion: 2 - m_LocalRotation: {x: -0.5000007, y: -0.49999928, z: -0.49999928, w: 0.5000007} + m_LocalRotation: {x: -0.5, y: 0.5, z: 0.5, w: 0.5} m_LocalPosition: {x: 302.9028, y: 2.7021, z: 163.23993} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 1863232719} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_LocalEulerAnglesHint: {x: -90, y: 0, z: 90} --- !u!1 &235597722 GameObject: m_ObjectHideFlags: 0 @@ -5946,13 +5946,13 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 308397487} serializedVersion: 2 - m_LocalRotation: {x: -0.5000007, y: -0.4999993, z: -0.49999923, w: 0.5000008} + m_LocalRotation: {x: -0.5, y: 0.5, z: 0.5, w: 0.5} m_LocalPosition: {x: 302.8748, y: 2.5026, z: 163.3512} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 1863232719} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_LocalEulerAnglesHint: {x: -90, y: 0, z: 90} --- !u!1 &313240505 GameObject: m_ObjectHideFlags: 0 @@ -10544,6 +10544,8 @@ MonoBehaviour: TapeOBJ: {fileID: 588400109} TapeMar: {fileID: 2100000, guid: ddf175dcba94e8d46bc6b6d68d61c395, type: 2} TapeMarCol: {fileID: 1061297897} + TapeTrans: {fileID: 1716821948} + PlayerCamera: {fileID: 6121626523118833240} --- !u!114 &588400117 MonoBehaviour: m_ObjectHideFlags: 0 @@ -10719,10 +10721,82 @@ PrefabInstance: serializedVersion: 3 m_TransformParent: {fileID: 1886732940} m_Modifications: + - target: {fileID: 148332768769380534, guid: 8a244cdd2f00e534aadd2512c3bbfda1, type: 3} + propertyPath: m_Name + value: "JZQ_\u87BA\u4E1D005" + objectReference: {fileID: 0} + - target: {fileID: 456042746316018980, guid: 8a244cdd2f00e534aadd2512c3bbfda1, type: 3} + propertyPath: outlineColor.b + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 456042746316018980, guid: 8a244cdd2f00e534aadd2512c3bbfda1, type: 3} + propertyPath: outlineColor.g + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 456042746316018980, guid: 8a244cdd2f00e534aadd2512c3bbfda1, type: 3} + propertyPath: outlineColor.r + value: 0.044830322 + objectReference: {fileID: 0} + - target: {fileID: 512164593026463554, guid: 8a244cdd2f00e534aadd2512c3bbfda1, type: 3} + propertyPath: m_Name + value: "JZQ_\u87BA\u4E1D005\u65E0\u7528" + objectReference: {fileID: 0} + - target: {fileID: 512164593026463554, guid: 8a244cdd2f00e534aadd2512c3bbfda1, type: 3} + propertyPath: m_IsActive + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 589861374277280589, guid: 8a244cdd2f00e534aadd2512c3bbfda1, type: 3} + propertyPath: m_Name + value: "JZQ_\u87BA\u4E1D006" + objectReference: {fileID: 0} + - target: {fileID: 930848218997392019, guid: 8a244cdd2f00e534aadd2512c3bbfda1, type: 3} + propertyPath: outlineColor.b + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 930848218997392019, guid: 8a244cdd2f00e534aadd2512c3bbfda1, type: 3} + propertyPath: outlineColor.g + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 930848218997392019, guid: 8a244cdd2f00e534aadd2512c3bbfda1, type: 3} + propertyPath: outlineColor.r + value: 0.044830322 + objectReference: {fileID: 0} + - target: {fileID: 1161737969850948934, guid: 8a244cdd2f00e534aadd2512c3bbfda1, type: 3} + propertyPath: m_Enabled + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1929855920836198827, guid: 8a244cdd2f00e534aadd2512c3bbfda1, type: 3} + propertyPath: m_Enabled + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1956453164925617863, guid: 8a244cdd2f00e534aadd2512c3bbfda1, type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} - target: {fileID: 2173138141117422261, guid: 8a244cdd2f00e534aadd2512c3bbfda1, type: 3} propertyPath: m_Enabled value: 0 objectReference: {fileID: 0} + - target: {fileID: 2525010733065056853, guid: 8a244cdd2f00e534aadd2512c3bbfda1, type: 3} + propertyPath: m_Name + value: "JZQ_\u87BA\u4E1D0033" + objectReference: {fileID: 0} + - target: {fileID: 2827228305229768063, guid: 8a244cdd2f00e534aadd2512c3bbfda1, type: 3} + propertyPath: m_Enabled + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 2932504270123713802, guid: 8a244cdd2f00e534aadd2512c3bbfda1, type: 3} + propertyPath: m_Enabled + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 2939563914774196416, guid: 8a244cdd2f00e534aadd2512c3bbfda1, type: 3} + propertyPath: m_Enabled + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3051923061970095289, guid: 8a244cdd2f00e534aadd2512c3bbfda1, type: 3} + propertyPath: m_Enabled + value: 0 + objectReference: {fileID: 0} - target: {fileID: 4019342408188963305, guid: 8a244cdd2f00e534aadd2512c3bbfda1, type: 3} propertyPath: m_Name value: "\u914D\u7535\u533A\u57DF" @@ -10731,10 +10805,142 @@ PrefabInstance: propertyPath: m_IsActive value: 0 objectReference: {fileID: 0} + - target: {fileID: 4176624895521697973, guid: 8a244cdd2f00e534aadd2512c3bbfda1, type: 3} + propertyPath: m_Enabled + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4271818900743762102, guid: 8a244cdd2f00e534aadd2512c3bbfda1, type: 3} + propertyPath: m_Name + value: "JZQ_\u87BA\u4E1D005\u65E0\u7528" + objectReference: {fileID: 0} + - target: {fileID: 4271818900743762102, guid: 8a244cdd2f00e534aadd2512c3bbfda1, type: 3} + propertyPath: m_IsActive + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4551507190943069657, guid: 8a244cdd2f00e534aadd2512c3bbfda1, type: 3} + propertyPath: m_Name + value: "JZQ_\u87BA\u4E1D0044" + objectReference: {fileID: 0} + - target: {fileID: 4600751961582256603, guid: 8a244cdd2f00e534aadd2512c3bbfda1, type: 3} + propertyPath: m_Enabled + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5424038881333046194, guid: 8a244cdd2f00e534aadd2512c3bbfda1, type: 3} + propertyPath: m_Enabled + value: 0 + objectReference: {fileID: 0} - target: {fileID: 5481571468732381626, guid: 8a244cdd2f00e534aadd2512c3bbfda1, type: 3} propertyPath: m_Enabled value: 1 objectReference: {fileID: 0} + - target: {fileID: 6016323581627799535, guid: 8a244cdd2f00e534aadd2512c3bbfda1, type: 3} + propertyPath: m_Enabled + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6190740089570427579, guid: 8a244cdd2f00e534aadd2512c3bbfda1, type: 3} + propertyPath: m_Enabled + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 6384924956409684290, guid: 8a244cdd2f00e534aadd2512c3bbfda1, type: 3} + propertyPath: outlineWidth + value: 0.1 + objectReference: {fileID: 0} + - target: {fileID: 6400377993128675853, guid: 8a244cdd2f00e534aadd2512c3bbfda1, type: 3} + propertyPath: m_Name + value: "JZQ_\u87BA\u4E1D004" + objectReference: {fileID: 0} + - target: {fileID: 6522738736275324934, guid: 8a244cdd2f00e534aadd2512c3bbfda1, type: 3} + propertyPath: m_Name + value: "JZQ_\u87BA\u4E1D003" + objectReference: {fileID: 0} + - target: {fileID: 7531901658563906052, guid: 8a244cdd2f00e534aadd2512c3bbfda1, type: 3} + propertyPath: m_Name + value: "JZQ_\u87BA\u4E1D002" + objectReference: {fileID: 0} + - target: {fileID: 7831804727752754663, guid: 8a244cdd2f00e534aadd2512c3bbfda1, type: 3} + propertyPath: m_Name + value: "JZQ_\u87BA\u4E1D001" + objectReference: {fileID: 0} + - target: {fileID: 7850784194196611404, guid: 8a244cdd2f00e534aadd2512c3bbfda1, type: 3} + propertyPath: m_BlendShapeWeights.Array.data[0] + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7850784194196611404, guid: 8a244cdd2f00e534aadd2512c3bbfda1, type: 3} + propertyPath: m_BlendShapeWeights.Array.data[1] + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7850784194196611404, guid: 8a244cdd2f00e534aadd2512c3bbfda1, type: 3} + propertyPath: m_BlendShapeWeights.Array.data[2] + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7850784194196611404, guid: 8a244cdd2f00e534aadd2512c3bbfda1, type: 3} + propertyPath: m_BlendShapeWeights.Array.data[3] + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7850784194196611404, guid: 8a244cdd2f00e534aadd2512c3bbfda1, type: 3} + propertyPath: m_BlendShapeWeights.Array.data[4] + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7850784194196611404, guid: 8a244cdd2f00e534aadd2512c3bbfda1, type: 3} + propertyPath: m_BlendShapeWeights.Array.data[5] + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8124418084497373114, guid: 8a244cdd2f00e534aadd2512c3bbfda1, type: 3} + propertyPath: AllObjects.Array.size + value: 4 + objectReference: {fileID: 0} + - target: {fileID: 8124418084497373114, guid: 8a244cdd2f00e534aadd2512c3bbfda1, type: 3} + propertyPath: AllObjects.Array.data[0] + value: + objectReference: {fileID: 274585737} + - target: {fileID: 8124418084497373114, guid: 8a244cdd2f00e534aadd2512c3bbfda1, type: 3} + propertyPath: AllObjects.Array.data[1] + value: + objectReference: {fileID: 968825877} + - target: {fileID: 8124418084497373114, guid: 8a244cdd2f00e534aadd2512c3bbfda1, type: 3} + propertyPath: AllObjects.Array.data[2] + value: + objectReference: {fileID: 1870939181} + - target: {fileID: 8124418084497373114, guid: 8a244cdd2f00e534aadd2512c3bbfda1, type: 3} + propertyPath: AllObjects.Array.data[3] + value: + objectReference: {fileID: 1799387239} + - target: {fileID: 8124418084497373114, guid: 8a244cdd2f00e534aadd2512c3bbfda1, type: 3} + propertyPath: AllObjects.Array.data[4] + value: + objectReference: {fileID: 274585737} + - target: {fileID: 8124418084497373114, guid: 8a244cdd2f00e534aadd2512c3bbfda1, type: 3} + propertyPath: AllObjects.Array.data[5] + value: + objectReference: {fileID: 968825877} + - target: {fileID: 8124418084497373114, guid: 8a244cdd2f00e534aadd2512c3bbfda1, type: 3} + propertyPath: AllObjects.Array.data[6] + value: + objectReference: {fileID: 1870939181} + - target: {fileID: 8124418084497373114, guid: 8a244cdd2f00e534aadd2512c3bbfda1, type: 3} + propertyPath: AllObjects.Array.data[7] + value: + objectReference: {fileID: 1799387239} + - target: {fileID: 8124418084497373114, guid: 8a244cdd2f00e534aadd2512c3bbfda1, type: 3} + propertyPath: GameObjectSlider.Array.size + value: 4 + objectReference: {fileID: 0} + - target: {fileID: 8124418084497373114, guid: 8a244cdd2f00e534aadd2512c3bbfda1, type: 3} + propertyPath: GameObjectSlider.Array.data[0] + value: + objectReference: {fileID: 601364448} + - target: {fileID: 8124418084497373114, guid: 8a244cdd2f00e534aadd2512c3bbfda1, type: 3} + propertyPath: GameObjectSlider.Array.data[1] + value: + objectReference: {fileID: 601364447} + - target: {fileID: 8124418084497373114, guid: 8a244cdd2f00e534aadd2512c3bbfda1, type: 3} + propertyPath: GameObjectSlider.Array.data[2] + value: + objectReference: {fileID: 601364446} + - target: {fileID: 8124418084497373114, guid: 8a244cdd2f00e534aadd2512c3bbfda1, type: 3} + propertyPath: GameObjectSlider.Array.data[3] + value: + objectReference: {fileID: 601364443} - target: {fileID: 8219398056856457891, guid: 8a244cdd2f00e534aadd2512c3bbfda1, type: 3} propertyPath: m_Enabled value: 0 @@ -10779,6 +10985,30 @@ PrefabInstance: propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} + - target: {fileID: 8499604590529379764, guid: 8a244cdd2f00e534aadd2512c3bbfda1, type: 3} + propertyPath: m_Enabled + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8534685649925332831, guid: 8a244cdd2f00e534aadd2512c3bbfda1, type: 3} + propertyPath: m_Enabled + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 8670774606254665842, guid: 8a244cdd2f00e534aadd2512c3bbfda1, type: 3} + propertyPath: m_Name + value: "JZQ_\u87BA\u4E1D0022" + objectReference: {fileID: 0} + - target: {fileID: 8849017140435942751, guid: 8a244cdd2f00e534aadd2512c3bbfda1, type: 3} + propertyPath: m_Name + value: "JZQ_\u87BA\u4E1D0011" + objectReference: {fileID: 0} + - target: {fileID: 8869773651089148395, guid: 8a244cdd2f00e534aadd2512c3bbfda1, type: 3} + propertyPath: m_Enabled + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9155057588692886009, guid: 8a244cdd2f00e534aadd2512c3bbfda1, type: 3} + propertyPath: m_IsActive + value: 1 + objectReference: {fileID: 0} - target: {fileID: 9208619634457714727, guid: 8a244cdd2f00e534aadd2512c3bbfda1, type: 3} propertyPath: m_IsActive value: 0 @@ -10801,6 +11031,11 @@ GameObject: m_CorrespondingSourceObject: {fileID: 7617932042775334631, guid: 8a244cdd2f00e534aadd2512c3bbfda1, type: 3} m_PrefabInstance: {fileID: 601364440} m_PrefabAsset: {fileID: 0} +--- !u!1 &601364443 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 6436320337597809072, guid: 8a244cdd2f00e534aadd2512c3bbfda1, type: 3} + m_PrefabInstance: {fileID: 601364440} + m_PrefabAsset: {fileID: 0} --- !u!65 &601364444 stripped BoxCollider: m_CorrespondingSourceObject: {fileID: 7421723187035286862, guid: 8a244cdd2f00e534aadd2512c3bbfda1, type: 3} @@ -10811,6 +11046,21 @@ GameObject: m_CorrespondingSourceObject: {fileID: 892524690026578333, guid: 8a244cdd2f00e534aadd2512c3bbfda1, type: 3} m_PrefabInstance: {fileID: 601364440} m_PrefabAsset: {fileID: 0} +--- !u!1 &601364446 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 8488969482871737929, guid: 8a244cdd2f00e534aadd2512c3bbfda1, type: 3} + m_PrefabInstance: {fileID: 601364440} + m_PrefabAsset: {fileID: 0} +--- !u!1 &601364447 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 3980491336833092151, guid: 8a244cdd2f00e534aadd2512c3bbfda1, type: 3} + m_PrefabInstance: {fileID: 601364440} + m_PrefabAsset: {fileID: 0} +--- !u!1 &601364448 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 2163167586528760616, guid: 8a244cdd2f00e534aadd2512c3bbfda1, type: 3} + m_PrefabInstance: {fileID: 601364440} + m_PrefabAsset: {fileID: 0} --- !u!1 &603379991 GameObject: m_ObjectHideFlags: 0 @@ -13153,11 +13403,6 @@ Transform: m_CorrespondingSourceObject: {fileID: 7745216743049305763, guid: 8a244cdd2f00e534aadd2512c3bbfda1, type: 3} m_PrefabInstance: {fileID: 601364440} m_PrefabAsset: {fileID: 0} ---- !u!1 &724983600 stripped -GameObject: - m_CorrespondingSourceObject: {fileID: 4271818900743762102, guid: 8a244cdd2f00e534aadd2512c3bbfda1, type: 3} - m_PrefabInstance: {fileID: 601364440} - m_PrefabAsset: {fileID: 0} --- !u!1 &730879363 stripped GameObject: m_CorrespondingSourceObject: {fileID: 7831804727752754663, guid: 8a244cdd2f00e534aadd2512c3bbfda1, type: 3} @@ -16989,6 +17234,37 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 935258159} m_CullTransparentMesh: 1 +--- !u!1 &956267094 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 956267095} + m_Layer: 0 + m_Name: "\u65E7\u96C6\u4E2D\u5668\u4E0B\u8FB9\u591A\u4E2A\u87BA\u4E1D\u87BA\u4E1D\u5200\u4F4D\u7F6E" + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &956267095 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 956267094} + serializedVersion: 2 + m_LocalRotation: {x: -0.5000007, y: -0.49999928, z: -0.49999928, w: 0.5000007} + m_LocalPosition: {x: 302.89, y: 2.7364, z: 163.2969} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1863232719} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &958680031 GameObject: m_ObjectHideFlags: 0 @@ -18476,13 +18752,13 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1060361989} serializedVersion: 2 - m_LocalRotation: {x: -0.5000007, y: -0.4999993, z: -0.49999923, w: 0.5000008} + m_LocalRotation: {x: -0.5, y: 0.5, z: 0.5, w: 0.5} m_LocalPosition: {x: 302.9131, y: 2.4919357, z: 163.2115} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 1863232719} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_LocalEulerAnglesHint: {x: -90, y: 0, z: 90} --- !u!1 &1061015454 GameObject: m_ObjectHideFlags: 0 @@ -19441,8 +19717,6 @@ MonoBehaviour: - {fileID: 1953796964} - {fileID: 1830985263} - {fileID: 180043805} - - {fileID: 2055535850} - - {fileID: 724983600} - {fileID: 1131712852} - {fileID: 502117451} ElectricWireSMR: {fileID: 1061297896} @@ -19460,6 +19734,7 @@ MonoBehaviour: - {fileID: 1060361990} - {fileID: 1150006206} - {fileID: 1733212812} + - {fileID: 956267095} interactiveObjects: - {fileID: 1799387243} - {fileID: 274585741} @@ -20139,13 +20414,13 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1176023170} serializedVersion: 2 - m_LocalRotation: {x: -0.5000007, y: -0.4999993, z: -0.49999923, w: 0.5000008} + m_LocalRotation: {x: -0.5, y: 0.5, z: 0.5, w: 0.5} m_LocalPosition: {x: 302.8748, y: 2.5026, z: 163.3512} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 1863232719} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_LocalEulerAnglesHint: {x: -90, y: 0, z: 90} --- !u!1 &1194940543 GameObject: m_ObjectHideFlags: 0 @@ -20857,13 +21132,13 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1230813318} serializedVersion: 2 - m_LocalRotation: {x: -0.5000007, y: -0.49999928, z: -0.49999928, w: 0.5000007} + m_LocalRotation: {x: -0.5, y: 0.5, z: 0.5, w: 0.5} m_LocalPosition: {x: 302.89, y: 2.7153, z: 163.1114} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 1863232719} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_LocalEulerAnglesHint: {x: -90, y: 0, z: 90} --- !u!1 &1230814792 GameObject: m_ObjectHideFlags: 0 @@ -21572,6 +21847,37 @@ MonoBehaviour: m_PersistentCalls: m_Calls: [] m_IsOn: 0 +--- !u!1 &1268051675 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1268051676} + m_Layer: 0 + m_Name: "\u65B0\u96C6\u4E2D\u5668\u4F4D\u7F6E" + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1268051676 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1268051675} + serializedVersion: 2 + m_LocalRotation: {x: -0.5000007, y: -0.49999928, z: -0.49999928, w: 0.5000007} + m_LocalPosition: {x: 302.8246, y: 2.8406801, z: 163.17392} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1863232719} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1278583460 GameObject: m_ObjectHideFlags: 0 @@ -21673,13 +21979,13 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1285315232} serializedVersion: 2 - m_LocalRotation: {x: -0.5000007, y: -0.4999993, z: -0.49999923, w: 0.5000008} + m_LocalRotation: {x: -0.5, y: 0.5, z: 0.5, w: 0.5} m_LocalPosition: {x: 302.9131, y: 2.4919357, z: 163.2115} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 1863232719} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_LocalEulerAnglesHint: {x: -90, y: 0, z: 90} --- !u!1 &1290596208 GameObject: m_ObjectHideFlags: 0 @@ -25718,7 +26024,7 @@ PrefabInstance: m_Modifications: - target: {fileID: 409149086400793276, guid: 87ec8db29445cbe4b81cdbb1df57859f, type: 3} propertyPath: m_Enabled - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 464764829560295397, guid: 87ec8db29445cbe4b81cdbb1df57859f, type: 3} propertyPath: m_Enabled @@ -25796,6 +26102,18 @@ PrefabInstance: propertyPath: m_Enabled value: 0 objectReference: {fileID: 0} + - target: {fileID: 6593761997780618153, guid: 87ec8db29445cbe4b81cdbb1df57859f, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6593761997780618153, guid: 87ec8db29445cbe4b81cdbb1df57859f, type: 3} + propertyPath: m_LocalPosition.y + value: 0.0167 + objectReference: {fileID: 0} + - target: {fileID: 6593761997780618153, guid: 87ec8db29445cbe4b81cdbb1df57859f, type: 3} + propertyPath: m_LocalPosition.z + value: -0.1993 + objectReference: {fileID: 0} - target: {fileID: 7063737413586441568, guid: 87ec8db29445cbe4b81cdbb1df57859f, type: 3} propertyPath: m_LocalPosition.x value: 0.352 @@ -31028,6 +31346,37 @@ MeshFilter: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1710852921} m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &1716821947 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1716821948} + m_Layer: 0 + m_Name: "\u80F6\u5E26\u7F20\u7ED5\u7535\u7EBF\u4F4D\u7F6E" + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1716821948 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1716821947} + serializedVersion: 2 + m_LocalRotation: {x: -0.5000007, y: -0.49999928, z: -0.49999928, w: 0.5000007} + m_LocalPosition: {x: 302.89, y: 2.7364, z: 163.2969} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1863232719} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1717660097 GameObject: m_ObjectHideFlags: 0 @@ -33902,12 +34251,15 @@ Transform: - {fileID: 707065182} - {fileID: 1176023171} - {fileID: 1285315233} - - {fileID: 234854336} - - {fileID: 1230813319} - {fileID: 308397488} - {fileID: 1060361990} + - {fileID: 234854336} + - {fileID: 1230813319} - {fileID: 1150006206} - {fileID: 1733212812} + - {fileID: 956267095} + - {fileID: 1716821948} + - {fileID: 1268051676} m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!4 &1865558430 stripped @@ -34562,6 +34914,7 @@ MonoBehaviour: screw: - {fileID: 402936984} - {fileID: 2058113440} + oncentratorTrans: {fileID: 1268051676} --- !u!1 &1904368290 GameObject: m_ObjectHideFlags: 0 @@ -36868,11 +37221,6 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 2048877966} m_CullTransparentMesh: 1 ---- !u!1 &2055535850 stripped -GameObject: - m_CorrespondingSourceObject: {fileID: 512164593026463554, guid: 8a244cdd2f00e534aadd2512c3bbfda1, type: 3} - m_PrefabInstance: {fileID: 601364440} - m_PrefabAsset: {fileID: 0} --- !u!1 &2058113440 stripped GameObject: m_CorrespondingSourceObject: {fileID: 3850327559864153827, guid: 87ec8db29445cbe4b81cdbb1df57859f, type: 3} @@ -230482,7 +230830,7 @@ Transform: m_GameObject: {fileID: 6121626523908351179} serializedVersion: 2 m_LocalRotation: {x: 2.5564217e-18, y: -0.70707405, z: -0.00000008428979, w: 0.70713955} - m_LocalPosition: {x: 304.82, y: 1.56, z: 158.98} + m_LocalPosition: {x: 304.82, y: 1.56, z: 163.177} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: diff --git a/SXElectricityInformationAcquisition/Assets/Screwdriver.cs b/SXElectricityInformationAcquisition/Assets/Screwdriver.cs index b869b291..ab9b26ec 100644 --- a/SXElectricityInformationAcquisition/Assets/Screwdriver.cs +++ b/SXElectricityInformationAcquisition/Assets/Screwdriver.cs @@ -41,7 +41,7 @@ public class Screwdriver : MonoBehaviour public GameObject[] concentratorScrew; /// - /// 螺丝 + /// 集中器下端螺丝 /// public GameObject[] ScrewObj; @@ -129,7 +129,7 @@ public class Screwdriver : MonoBehaviour originalPosition = ScrewdriverTrans.transform.localPosition; originalRotation = ScrewdriverTrans.transform.localRotation; } - + float weight; // Update is called once per frame void Update() { @@ -168,34 +168,99 @@ public class Screwdriver : MonoBehaviour { if (hit.collider.gameObject.name == ScrewObj[i].name) { + ScrewdriverTrans.gameObject.transform.SetPositionAndRotation(OpenScrewScrewdriverTrans[4].gameObject.transform.position, OpenScrewScrewdriverTrans[4].gameObject.transform.rotation); ScrewdriverTrans.gameObject.transform.SetParent(null); - ScrewdriverTrans.gameObject.transform.localPosition = new Vector3(3.1215f, 2.1383f, -1.3484f); Debug.Log(hit.collider.gameObject.name); ScrewObj[i].gameObject.SetActive(false); + switch (hit.collider.gameObject.name) + { + case "JZQ_螺丝001": + ScrewObj[i].gameObject.SetActive(false); + break; + case "JZQ_螺丝0011": + ScrewObj[i].gameObject.SetActive(false); + break; + case "JZQ_螺丝002": + ScrewObj[i].gameObject.SetActive(false); + break; + case "JZQ_螺丝0022": + ScrewObj[i].gameObject.SetActive(false); + break; + case "JZQ_螺丝003": + ScrewObj[i].gameObject.SetActive(false); + break; + case "JZQ_螺丝0033": + ScrewObj[i].gameObject.SetActive(false); + break; + case "JZQ_螺丝004": + ScrewObj[i].gameObject.SetActive(false); + break; + case "JZQ_螺丝0044": + ScrewObj[i].gameObject.SetActive(false); + break; + case "JZQ_螺丝005": + ScrewObj[i].gameObject.SetActive(false); + break; + case "JZQ_螺丝006": + ScrewObj[i].gameObject.SetActive(false); + break; + } MotionEngine.GetModule().HandleClick(hit.collider.gameObject.name); } } if (hit.collider.gameObject.name == "固定螺丝_Rdown") { + ScrewdriverTrans.gameObject.transform.SetParent(null); Debug.Log(hit.collider.gameObject.name); - StartCoroutine(right()); MotionEngine.GetModule().HandleClick(hit.collider.gameObject.name); + StartCoroutine(right()); + MotionEngine.GetModule().HandleClick(hit.collider.gameObject.name); } if (hit.collider.gameObject.name == "集电器固定螺丝_Ldown") { ScrewdriverTrans.gameObject.transform.SetParent(null); Debug.Log(hit.collider.gameObject.name); - StartCoroutine(left()); MotionEngine.GetModule().HandleClick(hit.collider.gameObject.name); + StartCoroutine(left()); + MotionEngine.GetModule().HandleClick(hit.collider.gameObject.name); } } } + //判断上下两颗螺丝是否全部取下 + if (!ScrewObj[0].activeInHierarchy && !ScrewObj[1].activeInHierarchy) + { + StartCoroutine(Frist()); + } + if (!ScrewObj[2].activeInHierarchy && !ScrewObj[3].activeInHierarchy) + { + StartCoroutine(Second()); + } + if (!ScrewObj[4].activeInHierarchy && !ScrewObj[5].activeInHierarchy) + { + StartCoroutine(Thrid()); + } + if (!ScrewObj[6].activeInHierarchy && !ScrewObj[7].activeInHierarchy) + { + StartCoroutine(Fourth()); + } + if (!ScrewObj[9].activeInHierarchy) + { + StartCoroutine(Sixth()); + } + if (!ScrewObj[8].activeInHierarchy) + { + StartCoroutine(Fivth()); + } + if (ConcentratorScrew()) + { + StartCoroutine(IEConcentratorScrew()); + } //集中器螺丝全隐藏后播放电线动画 if (AreAllObjectsHidden()&& concentrator.isPlayAni) { StartCoroutine(ScrewdriverBack()); ElectricWireBcr.enabled = true; - StartCoroutine(IEElectricWire()); + //StartCoroutine(IEElectricWire()); // Debug.Log("所有螺丝都已隐藏"); } //集中器外壳上的封印和螺丝 @@ -204,10 +269,6 @@ public class Screwdriver : MonoBehaviour HubCoverObj.gameObject.transform.DOLocalMove(new Vector3(0, 0.0167f, -0.2387f),1); // Debug.Log("所有集线器盖子螺丝都已隐藏"); } - if (ConcentratorScrew()) - { - StartCoroutine(IEConcentratorScrew()); - } } /// @@ -268,9 +329,6 @@ public class Screwdriver : MonoBehaviour yield return new WaitForSeconds(0.5f); ScrewdriverTrans.gameObject.transform.localPosition = originalPosition; ScrewdriverTrans.gameObject.transform.localRotation = originalRotation; - // ScrewdriverTrans.transform.DOLocalMove(new Vector3(3.274139f, 1.803738f, -1.191f), 0.5f); - // ScrewdriverTrans.transform.DOLocalRotate(new Vector3(-90f, 0, 0), 0.5f); - //yield return new WaitForSeconds(2f); } /// @@ -319,11 +377,6 @@ public class Screwdriver : MonoBehaviour /// IEnumerator IERconcentratorScrew() { - //ScrewdriverTrans.transform.DOLocalMove(new Vector3(3.2669f, 2.0962f, -1.3294f), 1f); - //yield return new WaitForSeconds(1.5f); - //ScrewdriverTrans.transform.DOLocalRotate(new Vector3(-19.741f, -113.296f, -104.747f), 1f); - //yield return new WaitForSeconds(1.5f); - //ScrewdriverTrans.transform.DOLocalRotate(new Vector3(-19.741f, -113.296f, 90), 1f); ScrewdriverTrans.transform.position = OpenScrewScrewdriverTrans[2].transform.position; yield return new WaitForSeconds(1.5f); RconcentratorScrew.transform.DOLocalMove(new Vector3(0.1143f, 0.0216f, -0.1031f), 0.5f); @@ -355,7 +408,23 @@ public class Screwdriver : MonoBehaviour /// 集线器螺丝拆完后电线动画 /// /// - IEnumerator IEElectricWire() + IEnumerator IEElectricWire(string name ,GameObject[] Screw) + { + for (int a = 0; a < Screw.Length; a++) + { + if (Screw[a].gameObject.activeInHierarchy) + { + for (int i = 0; i <= 100; i++) + { + yield return new WaitForSeconds(0.001f); + ElectricWireSMR.SetBlendShapeWeight(0, i); + } + } + } + + } + #region 电线动画 + IEnumerator Frist() { //yield return new WaitForSeconds(1f); for (int i = 0; i <= 100; i++) @@ -363,32 +432,49 @@ public class Screwdriver : MonoBehaviour yield return new WaitForSeconds(0.001f); ElectricWireSMR.SetBlendShapeWeight(0, i); } + } + IEnumerator Second() + { for (int i = 0; i <= 100; i++) { yield return new WaitForSeconds(0.002f); ElectricWireSMR.SetBlendShapeWeight(1, i); } + } + IEnumerator Thrid() + { for (int i = 0; i <= 100; i++) { yield return new WaitForSeconds(0.002f); ElectricWireSMR.SetBlendShapeWeight(2, i); } + } + IEnumerator Fourth() + { for (int i = 0; i <= 100; i++) { yield return new WaitForSeconds(0.002f); ElectricWireSMR.SetBlendShapeWeight(3, i); } + } + IEnumerator Fivth() + { for (int i = 0; i <= 100; i++) { yield return new WaitForSeconds(0.002f); ElectricWireSMR.SetBlendShapeWeight(4, i); } + } + IEnumerator Sixth() + { for (int i = 0; i <= 100; i++) { yield return new WaitForSeconds(0.002f); ElectricWireSMR.SetBlendShapeWeight(5, i); } } + #endregion + /// /// 集中器背后螺丝全部拆完集中器动画 @@ -406,14 +492,14 @@ public class Screwdriver : MonoBehaviour /// IEnumerator right() { - ScrewdriverTrans.gameObject.transform.localPosition = new Vector3(3.1215f, 2.1383f, -1.3484f); + ScrewdriverTrans.transform.position = OpenScrewScrewdriverTrans[4].transform.position; yield return new WaitForSeconds(0.5f); ConcentratorScrewObj[0].SetActive(false); ConcentratorScrewObj[1].SetActive(false); } IEnumerator left() { - ScrewdriverTrans.gameObject.transform.localPosition = new Vector3(3.1215f, 2.1383f, -1.3484f); + ScrewdriverTrans.transform.position = OpenScrewScrewdriverTrans[4].transform.position; yield return new WaitForSeconds(0.5f); ConcentratorScrewObj[2].SetActive(false); ConcentratorScrewObj[3].SetActive(false); diff --git a/SXElectricityInformationAcquisition/Assets/Seal.cs b/SXElectricityInformationAcquisition/Assets/Seal.cs index 607efbea..8b48664b 100644 --- a/SXElectricityInformationAcquisition/Assets/Seal.cs +++ b/SXElectricityInformationAcquisition/Assets/Seal.cs @@ -49,7 +49,7 @@ public class Seal : MonoBehaviour void Update() { if (Input.GetMouseButtonDown(0)) - {//Camera.transform.forward + { Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); RaycastHit hit; bool raycast = Physics.Raycast(ray, out hit); @@ -60,7 +60,7 @@ public class Seal : MonoBehaviour Sealcol[0].gameObject.SetActive(true); Debug.Log(hit.collider.gameObject.name); MotionEngine.GetModule().HandleClick(hit.collider.gameObject.name); } - if (hit.collider.gameObject.name == "集中器_封印R碰撞 ") + if (hit.collider.gameObject.name == "集中器_封印R碰撞") { Sealcol[1].gameObject.SetActive(true); CabinetDoorLatch.GetComponent().enabled = true; diff --git a/SXElectricityInformationAcquisition/Assets/ToolManager.cs b/SXElectricityInformationAcquisition/Assets/ToolManager.cs index ee9c48ba..73878384 100644 --- a/SXElectricityInformationAcquisition/Assets/ToolManager.cs +++ b/SXElectricityInformationAcquisition/Assets/ToolManager.cs @@ -178,16 +178,16 @@ public class ToolManager : MonoBehaviour Tool[3].gameObject.SetActive(true); RetractBtn[1].gameObject.SetActive(true); } + if (message == "工作证") + { + Tool[1].gameObject.SetActive(true); + } } if (RoleMove.instance.isup) { if (generateAreaScript.IsPlayerInArea()) { - if (message == "工作证") - { - Tool[1].gameObject.SetActive(true); - } if (message == "剥线钳") { Tool[2].gameObject.SetActive(true); diff --git a/SXElectricityInformationAcquisition/Assets/concentrator.cs b/SXElectricityInformationAcquisition/Assets/concentrator.cs index 6e3c6b9c..2e06baa3 100644 --- a/SXElectricityInformationAcquisition/Assets/concentrator.cs +++ b/SXElectricityInformationAcquisition/Assets/concentrator.cs @@ -49,6 +49,12 @@ public class concentrator : MonoBehaviour /// 新盖子上左右两颗螺丝 /// public GameObject[] screw; + + /// + /// 新集中器在电箱中的位置 + /// + public Transform oncentratorTrans; + bool isplaying = true; // Start is called before the first frame update void Start() @@ -60,7 +66,7 @@ public class concentrator : MonoBehaviour void Update() { if (Input.GetMouseButtonDown(0)) - {//Camera.transform.forward + { Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); RaycastHit hit; bool raycast = Physics.Raycast(ray, out hit); @@ -68,8 +74,10 @@ public class concentrator : MonoBehaviour { if (hit.collider.gameObject.name == "新的集中器碰撞") { + concentratorObj.gameObject.transform.SetParent(null); StartCoroutine(Newconcentrator()); - Debug.Log(hit.collider.gameObject.name); MotionEngine.GetModule().HandleClick(hit.collider.gameObject.name); + Debug.Log(hit.collider.gameObject.name); + MotionEngine.GetModule().HandleClick(hit.collider.gameObject.name); } for (int i = 0; i < ScrewObj.Length; i++) { @@ -99,7 +107,7 @@ public class concentrator : MonoBehaviour } /// - /// 新集中器螺丝 + /// 新集中器螺丝全部安装上 /// /// public bool AreAllObjectsHidden() @@ -122,12 +130,12 @@ public class concentrator : MonoBehaviour } } /// - /// 集线器复位动画 + /// 集中器更换动画 /// /// IEnumerator Newconcentrator() { - concentratorObj.gameObject.transform.DOLocalMove(new Vector3(3.0778f, 2.2149f, -1.4581f), 1f); + concentratorObj.gameObject.transform.DOLocalMove(oncentratorTrans.gameObject.transform.position, 1f);//3.0778f, 2.2149f, -1.4581f yield return new WaitForSeconds(1.0f); } @@ -146,9 +154,11 @@ public class concentrator : MonoBehaviour ElectricWireSMR.SetBlendShapeWeight(i, a); } } - yield return new WaitForSeconds(6f); + yield return new WaitForSeconds(1f); Cover.gameObject.SetActive(true); - yield return new WaitForSeconds(1.0f); + yield return new WaitForSeconds(0.5f); + Cover.gameObject.transform.DOLocalMove(new Vector3(0, 0.01672375f, -0.09654188f),1f); + yield return new WaitForSeconds(1.1f); screw[0].gameObject.SetActive(true); yield return new WaitForSeconds(1.0f); screw[1].gameObject.SetActive(true); diff --git a/SXElectricityInformationAcquisition/Assets/taoruiqi/AdhesiveTape.cs b/SXElectricityInformationAcquisition/Assets/taoruiqi/AdhesiveTape.cs index 4c05f823..a242011d 100644 --- a/SXElectricityInformationAcquisition/Assets/taoruiqi/AdhesiveTape.cs +++ b/SXElectricityInformationAcquisition/Assets/taoruiqi/AdhesiveTape.cs @@ -25,6 +25,26 @@ using UnityEngine; /// 电线碰撞 /// public BoxCollider TapeMarCol; + + /// + /// 胶带使用后位置 + /// + public Transform TapeTrans; + + /// + /// 父物体玩家相机坐标 + /// + public Transform PlayerCamera; + + /// + /// 斜口钳的原始位置 + /// + private Vector3 originalPosition; + + /// + /// 斜口钳的原始旋转 + /// + private Quaternion originalRotation; // Start is called before the first frame update void Start() { @@ -33,6 +53,8 @@ using UnityEngine; void Init() { + originalPosition = TapeOBJ.transform.localPosition; + originalRotation = TapeOBJ.transform.localRotation; TapeMar.SetFloat("_step_p1", 0); TapeMar.SetFloat("_step_p2", 0); TapeMar.SetFloat("_step_p3", 0); @@ -54,7 +76,10 @@ using UnityEngine; { if (hit.collider.gameObject.name == "pCylinder170") { - StartCoroutine(Tape()); MotionEngine.GetModule().HandleClick(hit.collider.gameObject.name); + TapeOBJ.gameObject.transform.SetParent(null); + TapeOBJ.gameObject.transform.SetPositionAndRotation(TapeTrans.position, TapeTrans.rotation); + StartCoroutine(Tape()); + MotionEngine.GetModule().HandleClick(hit.collider.gameObject.name); } } } @@ -66,7 +91,6 @@ using UnityEngine; /// IEnumerator Tape() { - TapeOBJ.gameObject.transform.DOLocalMove(new Vector3(3.1215f, 2.1383f, -1.3484f),1f); yield return new WaitForSeconds(1f); TapeMar.SetFloat("_step_p1", 1); yield return new WaitForSeconds(1f); @@ -80,10 +104,9 @@ using UnityEngine; yield return new WaitForSeconds(1f); TapeMar.SetFloat("_step_p6", 1); yield return new WaitForSeconds(1f); - StartCoroutine(TapeBack()); - yield return new WaitForSeconds(1.5f); - TapeOBJ.gameObject.SetActive(false); + //yield return new WaitForSeconds(1.5f); + //TapeOBJ.gameObject.SetActive(false); } /// @@ -92,7 +115,10 @@ using UnityEngine; /// IEnumerator TapeBack() { - TapeOBJ.transform.DOLocalMove(new Vector3(3.179443f, 1.790938f, -1.107346f),1f); + TapeOBJ.gameObject.transform.SetParent(PlayerCamera.transform); + yield return new WaitForSeconds(0.5f); + TapeOBJ.gameObject.transform.localPosition = originalPosition; + TapeOBJ.gameObject.transform.localRotation = originalRotation; TapeMarCol.enabled = false; yield return new WaitForSeconds(1f); } diff --git a/SXElectricityInformationAcquisition/Assets/taoruiqi/Pliers.cs b/SXElectricityInformationAcquisition/Assets/taoruiqi/Pliers.cs index 026ab7e3..90d9d2c5 100644 --- a/SXElectricityInformationAcquisition/Assets/taoruiqi/Pliers.cs +++ b/SXElectricityInformationAcquisition/Assets/taoruiqi/Pliers.cs @@ -155,7 +155,8 @@ public class Pliers : MonoBehaviour /// IEnumerator PliersIE() { - PliersObj.gameObject.transform.position = InteractivePliersTrans[0].gameObject.transform.position; + //PliersObj.gameObject.transform.position = InteractivePliersTrans[0].gameObject.transform.position; + PliersObj.gameObject.transform.SetPositionAndRotation(InteractivePliersTrans[0].gameObject.transform.position, InteractivePliersTrans[3].gameObject.transform.rotation); yield return new WaitForSeconds(1f); //PliersObj.gameObject.transform.DOLocalRotate(new Vector3(-90,90,0),1.5f); //yield return new WaitForSeconds(2f); @@ -225,12 +226,13 @@ public class Pliers : MonoBehaviour /// IEnumerator JunctionBoxRight() { - PliersObj.gameObject.transform.position = InteractivePliersTrans[1].gameObject.transform.position; + //PliersObj.gameObject.transform.position = InteractivePliersTrans[1].gameObject.transform.position; + PliersObj.gameObject.transform.SetPositionAndRotation(InteractivePliersTrans[1].gameObject.transform.position, InteractivePliersTrans[1].gameObject.transform.rotation); //PliersObj.gameObject.transform.DOLocalRotate(new Vector3(-90, 90, 0), 0.5f); //yield return new WaitForSeconds(1f); //PliersObj.gameObject.transform.DOLocalMove(new Vector3(3.1497f, 1.888f, -1.3079f), 0.5f); yield return new WaitForSeconds(1f); - for (int i = 100; i >= 0; i--) + for (int i = 25; i >= 0; i--)//更改斜口钳开口速度改i的值,越小越快 { yield return new WaitForSeconds(0.001f); PliersSki.SetBlendShapeWeight(0, i); @@ -254,12 +256,13 @@ public class Pliers : MonoBehaviour /// IEnumerator JunctionBoxLeft() { - PliersObj.gameObject.transform.position = InteractivePliersTrans[2].gameObject.transform.position; + // PliersObj.gameObject.transform.position = InteractivePliersTrans[2].gameObject.transform.position; + PliersObj.gameObject.transform.SetPositionAndRotation(InteractivePliersTrans[2].gameObject.transform.position, InteractivePliersTrans[2].gameObject.transform.rotation); //PliersObj.gameObject.transform.DOLocalRotate(new Vector3(-90, 90, 0), 0.5f); //yield return new WaitForSeconds(0.8f); //PliersObj.gameObject.transform.DOLocalMove(new Vector3(3.1672f, 1.8637f, -1.4392f), 1f); yield return new WaitForSeconds(1f); - for (int i = 100; i >= 0; i--) + for (int i = 25; i >= 0; i--) { yield return new WaitForSeconds(0.001f); PliersSki.SetBlendShapeWeight(0, i); @@ -283,12 +286,14 @@ public class Pliers : MonoBehaviour /// IEnumerator RightRconcentrator() { - PliersObj.gameObject.transform.position = InteractivePliersTrans[3].gameObject.transform.position; + //PliersObj.gameObject.transform.position = InteractivePliersTrans[3].gameObject.transform.position; + //PliersObj.gameObject.transform.rotation = InteractivePliersTrans[3].gameObject.transform.rotation; + PliersObj.gameObject.transform.SetPositionAndRotation(InteractivePliersTrans[3].gameObject.transform.position, InteractivePliersTrans[3].gameObject.transform.rotation); //PliersObj.gameObject.transform.DOLocalRotate(new Vector3(-90, 90, 0), 0.5f); //yield return new WaitForSeconds(1.2f); //PliersObj.gameObject.transform.DOLocalMove(new Vector3(3.1687f, 2.1218f, -1.4082f), 1f); yield return new WaitForSeconds(1f); - for (int i = 100; i >= 0; i--) + for (int i = 25; i >= 0; i--) { yield return new WaitForSeconds(0.001f); PliersSki.SetBlendShapeWeight(0, i); @@ -311,12 +316,13 @@ public class Pliers : MonoBehaviour /// IEnumerator LeftRconcentrator() { - PliersObj.gameObject.transform.position = InteractivePliersTrans[4].gameObject.transform.position; + //PliersObj.gameObject.transform.position = InteractivePliersTrans[4].gameObject.transform.position; + PliersObj.gameObject.transform.SetPositionAndRotation(InteractivePliersTrans[4].gameObject.transform.position, InteractivePliersTrans[4].gameObject.transform.rotation); //PliersObj.gameObject.transform.DOLocalRotate(new Vector3(-90, 90, 0), 0.5f); //yield return new WaitForSeconds(1.2f); //PliersObj.gameObject.transform.DOLocalMove(new Vector3(3.1683f, 2.1293f, -1.5439f), 1f); yield return new WaitForSeconds(1f); - for (int i = 100; i >= 0; i--) + for (int i = 25; i >= 0; i--) { yield return new WaitForSeconds(0.001f); PliersSki.SetBlendShapeWeight(0, i); diff --git a/SXElectricityInformationAcquisition/Assets/taoruiqi/Script/Field observation.cs b/SXElectricityInformationAcquisition/Assets/taoruiqi/Script/Field observation.cs index 11939b7b..34f3dd82 100644 --- a/SXElectricityInformationAcquisition/Assets/taoruiqi/Script/Field observation.cs +++ b/SXElectricityInformationAcquisition/Assets/taoruiqi/Script/Field observation.cs @@ -27,11 +27,6 @@ public class Fieldobservation : MonoBehaviour /// public Transform UptheladderPos; - /// - /// 打开封印 - /// - bool isOpenLock; - /// /// 透明盖子 /// diff --git a/SXElectricityInformationAcquisition/Assets/taoruiqi/Script/RoleMove.cs b/SXElectricityInformationAcquisition/Assets/taoruiqi/Script/RoleMove.cs index 93eae17b..be705fb1 100644 --- a/SXElectricityInformationAcquisition/Assets/taoruiqi/Script/RoleMove.cs +++ b/SXElectricityInformationAcquisition/Assets/taoruiqi/Script/RoleMove.cs @@ -29,7 +29,7 @@ public class RoleMove : MonoBehaviour //放大视角 往前滑 if (Input.GetAxis("Mouse ScrollWheel") < 0) { - if (Camera.main.fieldOfView <= 90) //小于一个放大范围后就不继续放大了 + if (Camera.main.fieldOfView <= 55) //小于一个放大范围后就不继续放大了 { Camera.main.fieldOfView += 5; }