From 719b1899a2b9644a14b3f0fae80bcbb23f3a8244 Mon Sep 17 00:00:00 2001 From: chenxiangxue <910695411@qq.com> Date: Fri, 23 Aug 2024 18:33:34 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E6=AD=A5=E9=AA=A4=E9=87=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Resources/Prefabs/Objects/步骤状态.prefab | 18 +++ Assets/Scenes/05_LiveScene.unity | 57 ++++++++ .../Devices/计量柜/Device_MeasuringCabinet.cs | 3 - Assets/Scripts/CXX/StepState/1002.meta | 8 ++ .../CXX/StepState/1002/StepState_1002.cs | 134 ++++++++++++++++++ .../CXX/StepState/1002/StepState_1002.cs.meta | 11 ++ Assets/Scripts/CXX/StepState/StepState.cs | 49 +++---- .../Scripts/CXX/StepState/StepStateControl.cs | 20 +-- .../Scripts/Project/Manager/OfficeManager.cs | 8 +- 9 files changed, 265 insertions(+), 43 deletions(-) create mode 100644 Assets/Scripts/CXX/StepState/1002.meta create mode 100644 Assets/Scripts/CXX/StepState/1002/StepState_1002.cs create mode 100644 Assets/Scripts/CXX/StepState/1002/StepState_1002.cs.meta diff --git a/Assets/Resources/Prefabs/Objects/步骤状态.prefab b/Assets/Resources/Prefabs/Objects/步骤状态.prefab index 263267f..f1b9d64 100644 --- a/Assets/Resources/Prefabs/Objects/步骤状态.prefab +++ b/Assets/Resources/Prefabs/Objects/步骤状态.prefab @@ -45,6 +45,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: b60c6991d2888da47850978d1051aa7f, type: 3} m_Name: m_EditorClassIdentifier: + "\u81EA\u5B9A\u4E49": "\u5DE5\u4F5C\u9884\u7EA6" initSceneType: 1 systemId: 0 schemeId: 0 @@ -94,6 +95,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: b60c6991d2888da47850978d1051aa7f, type: 3} m_Name: m_EditorClassIdentifier: + "\u81EA\u5B9A\u4E49": "\u62C6\u9664\u7535\u80FD\u8BA1\u91CF\u88C5\u7F6E" initSceneType: 3 systemId: 0 schemeId: 0 @@ -250,6 +252,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: b60c6991d2888da47850978d1051aa7f, type: 3} m_Name: m_EditorClassIdentifier: + "\u81EA\u5B9A\u4E49": "\u9009\u53D6\u5DE5\u5668\u5177" initSceneType: 2 systemId: 0 schemeId: 0 @@ -344,6 +347,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: b60c6991d2888da47850978d1051aa7f, type: 3} m_Name: m_EditorClassIdentifier: + "\u81EA\u5B9A\u4E49": "\u5B89\u88C5\u7535\u80FD\u8868" initSceneType: 3 systemId: 0 schemeId: 0 @@ -393,6 +397,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: b60c6991d2888da47850978d1051aa7f, type: 3} m_Name: m_EditorClassIdentifier: + "\u81EA\u5B9A\u4E49": "\u73B0\u573A\u901A\u7535\u53CA\u68C0\u67E5" initSceneType: 3 systemId: 0 schemeId: 0 @@ -487,6 +492,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: b60c6991d2888da47850978d1051aa7f, type: 3} m_Name: m_EditorClassIdentifier: + "\u81EA\u5B9A\u4E49": "\u529E\u7406\u5DE5\u4F5C\u7968" initSceneType: 1 systemId: 0 schemeId: 0 @@ -536,6 +542,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: b60c6991d2888da47850978d1051aa7f, type: 3} m_Name: m_EditorClassIdentifier: + "\u81EA\u5B9A\u4E49": "\u5B89\u88C5\u68C0\u67E5" initSceneType: 3 systemId: 0 schemeId: 0 @@ -585,6 +592,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: b60c6991d2888da47850978d1051aa7f, type: 3} m_Name: m_EditorClassIdentifier: + "\u81EA\u5B9A\u4E49": "\u5B9E\u65BD\u5C01\u5370" initSceneType: 3 systemId: 0 schemeId: 0 @@ -634,6 +642,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: b60c6991d2888da47850978d1051aa7f, type: 3} m_Name: m_EditorClassIdentifier: + "\u81EA\u5B9A\u4E49": "\u63A5\u7EBF\u68C0\u67E5" initSceneType: 3 systemId: 0 schemeId: 0 @@ -728,6 +737,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: b60c6991d2888da47850978d1051aa7f, type: 3} m_Name: m_EditorClassIdentifier: + "\u81EA\u5B9A\u4E49": "\u6B63\u786E\u7740\u88C5" initSceneType: 2 systemId: 0 schemeId: 0 @@ -916,6 +926,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: b60c6991d2888da47850978d1051aa7f, type: 3} m_Name: m_EditorClassIdentifier: + "\u81EA\u5B9A\u4E49": "\u73ED\u524D\u4F1A" initSceneType: 3 systemId: 0 schemeId: 0 @@ -965,6 +976,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: b60c6991d2888da47850978d1051aa7f, type: 3} m_Name: m_EditorClassIdentifier: + "\u81EA\u5B9A\u4E49": "\u65AD\u5F00\u7535\u6E90\u5E76\u9A8C\u7535" initSceneType: 3 systemId: 0 schemeId: 0 @@ -1014,6 +1026,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: b60c6991d2888da47850978d1051aa7f, type: 3} m_Name: m_EditorClassIdentifier: + "\u81EA\u5B9A\u4E49": "\u6E05\u7406\u73B0\u573A" initSceneType: 3 systemId: 0 schemeId: 0 @@ -1063,6 +1076,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: b60c6991d2888da47850978d1051aa7f, type: 3} m_Name: m_EditorClassIdentifier: + "\u81EA\u5B9A\u4E49": "\u586B\u5199\u544A\u77E5\u5355" initSceneType: 3 systemId: 0 schemeId: 0 @@ -1112,6 +1126,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: b60c6991d2888da47850978d1051aa7f, type: 3} m_Name: m_EditorClassIdentifier: + "\u81EA\u5B9A\u4E49": "\u586B\u5199\u88C5\u62C6\u5DE5\u5355" initSceneType: 1 systemId: 0 schemeId: 0 @@ -1161,6 +1176,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: b60c6991d2888da47850978d1051aa7f, type: 3} m_Name: m_EditorClassIdentifier: + "\u81EA\u5B9A\u4E49": "\u4E0E\u5BA2\u6237\u6C9F\u901A" initSceneType: 3 systemId: 0 schemeId: 0 @@ -1212,6 +1228,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: b60c6991d2888da47850978d1051aa7f, type: 3} m_Name: m_EditorClassIdentifier: + "\u81EA\u5B9A\u4E49": "\u67E5\u770B\u4EFB\u52A1\u5355" initSceneType: 1 systemId: 0 schemeId: 0 @@ -1273,6 +1290,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: b60c6991d2888da47850978d1051aa7f, type: 3} m_Name: m_EditorClassIdentifier: + "\u81EA\u5B9A\u4E49": "\u6838\u5BF9\u548C\u6284\u5F55\u8BA1\u91CF\u8BBE\u5907\u4FE1\u606F" initSceneType: 3 systemId: 0 schemeId: 0 diff --git a/Assets/Scenes/05_LiveScene.unity b/Assets/Scenes/05_LiveScene.unity index 5fa5728..58449ed 100644 --- a/Assets/Scenes/05_LiveScene.unity +++ b/Assets/Scenes/05_LiveScene.unity @@ -4981,6 +4981,63 @@ Transform: m_Father: {fileID: 0} m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1001 &2135879011 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 1817104531314915914, guid: 049bfb1489c99ca49bfbcdcdca9d9cbf, type: 3} + propertyPath: m_RootOrder + value: 10 + objectReference: {fileID: 0} + - target: {fileID: 1817104531314915914, guid: 049bfb1489c99ca49bfbcdcdca9d9cbf, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1817104531314915914, guid: 049bfb1489c99ca49bfbcdcdca9d9cbf, type: 3} + propertyPath: m_LocalPosition.y + value: 1.5 + objectReference: {fileID: 0} + - target: {fileID: 1817104531314915914, guid: 049bfb1489c99ca49bfbcdcdca9d9cbf, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1817104531314915914, guid: 049bfb1489c99ca49bfbcdcdca9d9cbf, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 1817104531314915914, guid: 049bfb1489c99ca49bfbcdcdca9d9cbf, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1817104531314915914, guid: 049bfb1489c99ca49bfbcdcdca9d9cbf, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1817104531314915914, guid: 049bfb1489c99ca49bfbcdcdca9d9cbf, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1817104531314915914, guid: 049bfb1489c99ca49bfbcdcdca9d9cbf, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1817104531314915914, guid: 049bfb1489c99ca49bfbcdcdca9d9cbf, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1817104531314915914, guid: 049bfb1489c99ca49bfbcdcdca9d9cbf, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1817104531314915916, guid: 049bfb1489c99ca49bfbcdcdca9d9cbf, type: 3} + propertyPath: m_Name + value: "\u6B65\u9AA4\u72B6\u6001" + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 049bfb1489c99ca49bfbcdcdca9d9cbf, type: 3} --- !u!33 &26734964485665869 MeshFilter: m_ObjectHideFlags: 0 diff --git a/Assets/Scripts/CXX/Devices/计量柜/Device_MeasuringCabinet.cs b/Assets/Scripts/CXX/Devices/计量柜/Device_MeasuringCabinet.cs index b1303fa..ec2d5f4 100644 --- a/Assets/Scripts/CXX/Devices/计量柜/Device_MeasuringCabinet.cs +++ b/Assets/Scripts/CXX/Devices/计量柜/Device_MeasuringCabinet.cs @@ -1,9 +1,6 @@ using System.Collections; using System.Collections.Generic; -using Unity.VisualScripting; -using Unity.VisualScripting.Antlr3.Runtime; using UnityEngine; -using static UnityEngine.EventSystems.EventTrigger; /// /// diff --git a/Assets/Scripts/CXX/StepState/1002.meta b/Assets/Scripts/CXX/StepState/1002.meta new file mode 100644 index 0000000..19c6ac3 --- /dev/null +++ b/Assets/Scripts/CXX/StepState/1002.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ef43d36c714b9ad44bf358e51f661beb +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/CXX/StepState/1002/StepState_1002.cs b/Assets/Scripts/CXX/StepState/1002/StepState_1002.cs new file mode 100644 index 0000000..c5b7be7 --- /dev/null +++ b/Assets/Scripts/CXX/StepState/1002/StepState_1002.cs @@ -0,0 +1,134 @@ +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using Unity.VisualScripting.Antlr3.Runtime.Misc; +using UnityEngine; + +/// +/// ֱӽʽܼװ ״̬ +/// +public class StepState_1002 : StepState +{ + private void Awake() + { + steps.Add(1, E_SceneType.Office); + steps.Add(2, E_SceneType.Office); + steps.Add(3, E_SceneType.Office); + steps.Add(4, E_SceneType.Office); + steps.Add(5, E_SceneType.ToolRoom); + steps.Add(6, E_SceneType.ToolRoom); + steps.Add(7, E_SceneType.Site); + steps.Add(8, E_SceneType.Site); + steps.Add(9, E_SceneType.Site); + steps.Add(10, E_SceneType.Site); + steps.Add(11, E_SceneType.Site); + steps.Add(12, E_SceneType.Site); + steps.Add(13, E_SceneType.Site); + steps.Add(14, E_SceneType.Site); + steps.Add(15, E_SceneType.Site); + steps.Add(16, E_SceneType.Site); + steps.Add(17, E_SceneType.Site); + steps.Add(18, E_SceneType.Site); + } + + /// + /// + /// + /// һʼ + public void JumpStep(int num) + { + num--; + //Ƿ + InvokeChangeScene(steps[num], isChangeSence => + { + //ҵ˲賡һ + int first = steps.First(a => a.Value == steps[num]).Key; + + //ӳһʼԭ˲ + while (first>steps.Count-1 && first>num) + { + SetStepState(first); + first++; + } + }); + } + + public void SetStepState(int num) + { + Debug.Log("л"+num); + if (num == 1) + { + //鿴 + OfficeManager.Instance.mobileController.downIndex = 0; + } + else if (num == 2) + { + //ԤԼ + OfficeManager.Instance.mobileController.downIndex = 1; + } + else if (num == 3) + { + //Ʊ + } + else if (num == 4) + { + //дװ𹤵 + } + else if (num == 5) + { + //ȷװ + } + else if (num == 6) + { + //ѡȡ + } + else if (num == 7) + { + //ͻͨ + } + else if (num == 8) + { + //ǰ + } + else if (num == 9) + { + //߼ + } + else if(num == 10) + { + //ϿԴ + } + else if (num == 11) + { + //˶Ժͳ¼豸Ϣ + } + else if(num==12) + { + //ܼװ + } + else if( num == 13) + { + //װܱ + } + else if (num == 14) + { + //װ + } + else if(num==15) + { + //ֳͨ缰 + } + else if(num==16) + { + //ʵʩӡ + } + else if(num==17) + { + //д֪ + } + else if(num==18) + { + //ֳ + } + } +} diff --git a/Assets/Scripts/CXX/StepState/1002/StepState_1002.cs.meta b/Assets/Scripts/CXX/StepState/1002/StepState_1002.cs.meta new file mode 100644 index 0000000..552d052 --- /dev/null +++ b/Assets/Scripts/CXX/StepState/1002/StepState_1002.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6188c45bfdd84a54990578cb8f87397c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/CXX/StepState/StepState.cs b/Assets/Scripts/CXX/StepState/StepState.cs index 2fe0666..47c95e1 100644 --- a/Assets/Scripts/CXX/StepState/StepState.cs +++ b/Assets/Scripts/CXX/StepState/StepState.cs @@ -9,11 +9,6 @@ using UnityEngine; /// public class StepState : MonoBehaviour { - /// - /// - /// - public E_SceneType initSceneType; - [HideInInspector] public int systemId; [HideInInspector] @@ -21,35 +16,25 @@ public class StepState : MonoBehaviour [HideInInspector] public int subProcessId; - public List stepStateBases; - private Action callback; + + public Dictionary steps; public void Init() { - stepStateBases = transform.GetComponentsInChildren(true).ToList(); subProcessId = int.Parse(gameObject.name); schemeId = int.Parse(transform.parent.name); systemId = int.Parse(transform.parent.parent.name); } - ///// - ///// ע᳡תص - ///// - ///// - //public void AddResetChangeScene(Action callback) - //{ - // this.callback = callback; - //} - - public void InvokeChangeScene() + /// + /// ִг״̬ + /// + /// + /// + public void InvokeChangeScene(E_SceneType jumpSence, Action doStepState) { - //if (callback != null) - //{ - // callback(initSceneType); - //}; - string sname = ""; - switch (initSceneType) + switch (jumpSence) { case E_SceneType.None: return; @@ -65,17 +50,25 @@ public class StepState : MonoBehaviour default: return; } - if (GameManager.RunModelMgr.SceneType != initSceneType) + if (GameManager.RunModelMgr.SceneType != jumpSence) { + // GameManager.UIMgr.ShowPanel(E_UI_Layer.System); GameManager.ScenesMgr.LoadSceneAsyn(sname, () => { - Debug.Log("賡" + initSceneType.ToString()); + Debug.Log("賡" + jumpSence.ToString()); GameManager.UIMgr.HidePanel(); - GameManager.RunModelMgr.SceneType = initSceneType; - GameManager.EventMgr.EventTrigger(Enum_EventType.SwitchScene, initSceneType); + GameManager.RunModelMgr.SceneType = jumpSence; + GameManager.EventMgr.EventTrigger(Enum_EventType.SwitchScene, jumpSence); GameManager.EventMgr.EventTrigger(Enum_EventType.SwitchSubProcessStepTriggerID, GameManager.ProcessMgr.d_Scheme.CurrentProcess.CurrentSubProcess.CurrentSubProcessStep.triggersId[0]); + + doStepState.Invoke(true); }); } + else + { + doStepState.Invoke(false); + } } } + diff --git a/Assets/Scripts/CXX/StepState/StepStateControl.cs b/Assets/Scripts/CXX/StepState/StepStateControl.cs index ef267bf..74f8b43 100644 --- a/Assets/Scripts/CXX/StepState/StepStateControl.cs +++ b/Assets/Scripts/CXX/StepState/StepStateControl.cs @@ -54,11 +54,11 @@ public class StepStateControl : MonoBehaviour { ss.ForEach(a=> { - StepStateBase sb = a.stepStateBases.Find(a => a.gameObject.name == objName); - if (sb != null) - { - sb.AddResetFunction(callback); - } + //StepStateBase sb = a.stepStateBases.Find(a => a.gameObject.name == objName); + //if (sb != null) + //{ + // sb.AddResetFunction(callback); + //} }); } } @@ -76,12 +76,12 @@ public class StepStateControl : MonoBehaviour { Debug.Log("ʼ"); // - tmp.InvokeChangeScene(); + //tmp.InvokeChangeScene(); //ʼbase - tmp.stepStateBases.ForEach(a => - { - a.InvokeInitStepStae(); - }); + //tmp.stepStateBases.ForEach(a => + //{ + // a.InvokeInitStepStae(); + //}); } } diff --git a/Assets/Scripts/Project/Manager/OfficeManager.cs b/Assets/Scripts/Project/Manager/OfficeManager.cs index acd9ff6..6b1189f 100644 --- a/Assets/Scripts/Project/Manager/OfficeManager.cs +++ b/Assets/Scripts/Project/Manager/OfficeManager.cs @@ -6,13 +6,17 @@ using UnityEngine; /// /// create by adam /// -public class OfficeManager : MonoBehaviour +public class OfficeManager : SingletonMono { public int currentProcessID; public int currentSubProcessID; public int currentSubProcessStepID; public int currentSubProcessStepTriggerID; - // Start is called before the first frame update + + /// + /// ֻ + /// + public MobileController mobileController; void Start() { GameManager.EventMgr.AddEventListener(Enum_EventType.OfficeTimeLineOver, OfficeTimeLineOver);