diff --git a/Assets/Scripts/Actions/CameraSwitchAction.cs b/Assets/Scripts/Actions/CameraSwitchAction.cs index 48f0e77d..beaa5066 100644 --- a/Assets/Scripts/Actions/CameraSwitchAction.cs +++ b/Assets/Scripts/Actions/CameraSwitchAction.cs @@ -47,9 +47,14 @@ namespace QFramework } else { - data.nearPos = Utility.GetVector3FromStrArray(datas["nearPos"]); - data.nearRot = Utility.GetVector3FromStrArray(datas["nearRot"]); - + if (datas.ContainsKey("nearPos")) + { + data.nearPos = Utility.GetVector3FromStrArray(datas["nearPos"]); + } + if (datas.ContainsKey("nearRot")) + { + data.nearRot = Utility.GetVector3FromStrArray(datas["nearRot"]); + } } if (datas.ContainsKey("normalDevice")) @@ -60,8 +65,14 @@ namespace QFramework } else { - data.normalPos = Utility.GetVector3FromStrArray(datas["normalPos"]); - data.normalRot = Utility.GetVector3FromStrArray(datas["normalRot"]); + if (datas.ContainsKey("normalPos")) + { + data.normalPos = Utility.GetVector3FromStrArray(datas["normalPos"]); + } + if (datas.ContainsKey("normalRot")) + { + data.normalRot = Utility.GetVector3FromStrArray(datas["normalRot"]); + } } if (datas.ContainsKey("isOn")) { diff --git a/Assets/Scripts/Actions/ShowAction.cs b/Assets/Scripts/Actions/ShowAction.cs index 096d196a..a34ce52b 100644 --- a/Assets/Scripts/Actions/ShowAction.cs +++ b/Assets/Scripts/Actions/ShowAction.cs @@ -75,7 +75,7 @@ public class ShowAction : IAction if (obj == null) { - Debug.LogError("没有找到物体 :" + path); + Debug.LogError($"没有找到物体 path:{path} deviceName:{deviceName}"); } else { diff --git a/Assets/Scripts/Item/DeviceItem.cs b/Assets/Scripts/Item/DeviceItem.cs index 5cd14286..13dff345 100644 --- a/Assets/Scripts/Item/DeviceItem.cs +++ b/Assets/Scripts/Item/DeviceItem.cs @@ -5,6 +5,7 @@ using System; using System.Collections; using System.Collections.Generic; using UnityEngine; +using static OperationController; public class DeviceItem : MonoBehaviour { @@ -19,6 +20,7 @@ public class DeviceItem : MonoBehaviour gameObject.GetOrAddComponent(); effect.outlineColor = Color.green; StringEventSystem.Global.Register(Global.HighLightTrigger, OnHighLightTriggerEvent); + TypeEventSystem.Global.Register(OnStepChanged); } if (device.MeshCollider) { @@ -40,11 +42,21 @@ public class DeviceItem : MonoBehaviour } } + private void OnStepChanged(StepStatusOnChange change) + { + var effect = gameObject.GetComponent(); + if (effect != null) + { + effect.highlighted = false; + } + } + public void Close() { device = null; tipItem = null; StringEventSystem.Global.UnRegister(Global.HighLightTrigger, OnHighLightTriggerEvent); + TypeEventSystem.Global.UnRegister(OnStepChanged); } private void OnHighLightTriggerEvent(string[] obj) diff --git a/Assets/Scripts/UI/UICameraSwitch.cs b/Assets/Scripts/UI/UICameraSwitch.cs index e144115e..1f3d5451 100644 --- a/Assets/Scripts/UI/UICameraSwitch.cs +++ b/Assets/Scripts/UI/UICameraSwitch.cs @@ -59,6 +59,11 @@ namespace QFramework.Example protected override void OnOpen(IUIData uiData = null) { mData = uiData as UICameraSwitchData ?? new UICameraSwitchData(); + + Near.gameObject.SetActive(mData.nearPos != default); + Far.gameObject.SetActive(mData.normalPos != default); + + if (string.IsNullOrEmpty(mData.isOn)) { if (Near.isOn) @@ -96,6 +101,8 @@ namespace QFramework.Example break; } } + + } private void Update() diff --git a/Data/Audio/Q045.mp3 b/Data/Audio/Q045.mp3 new file mode 100644 index 00000000..27b3e6fb Binary files /dev/null and b/Data/Audio/Q045.mp3 differ diff --git a/Data/Xml/Exam.xml b/Data/Xml/Exam.xml index 71f97c83..a78d36c9 100644 --- a/Data/Xml/Exam.xml +++ b/Data/Xml/Exam.xml @@ -801,7 +801,7 @@ - + - + - + @@ -905,6 +905,7 @@ + @@ -974,6 +975,7 @@ + @@ -1063,6 +1065,7 @@ + @@ -1147,6 +1150,7 @@ + @@ -1203,8 +1207,8 @@ - + @@ -1242,6 +1246,7 @@ + @@ -1270,6 +1275,7 @@ + @@ -1293,6 +1299,7 @@ + @@ -1305,6 +1312,8 @@ + + @@ -1322,8 +1331,8 @@ - + @@ -1346,6 +1355,7 @@ + @@ -1363,8 +1373,8 @@ - + @@ -1378,6 +1388,7 @@ + @@ -1401,8 +1412,8 @@ - + @@ -1415,6 +1426,9 @@ + + + @@ -1441,9 +1455,10 @@ - + + @@ -1457,12 +1472,14 @@ + + @@ -1496,9 +1513,10 @@ - + + @@ -1511,6 +1529,7 @@ + @@ -1571,8 +1590,8 @@ - + @@ -1585,6 +1604,7 @@ + @@ -1622,6 +1642,7 @@ + @@ -1658,6 +1679,7 @@ + @@ -1685,6 +1707,7 @@ + @@ -1714,6 +1737,7 @@ + @@ -1743,6 +1767,7 @@ + @@ -1759,6 +1784,7 @@ + @@ -1795,7 +1821,9 @@ - + + + @@ -1809,6 +1837,7 @@ + @@ -1821,7 +1850,6 @@ - @@ -1840,8 +1868,7 @@ - - + @@ -1855,6 +1882,7 @@ + @@ -1879,6 +1907,7 @@ + @@ -1901,6 +1930,7 @@ + @@ -1942,6 +1972,7 @@ + @@ -1955,6 +1986,7 @@ + @@ -1996,7 +2028,7 @@ - + @@ -2009,6 +2041,7 @@ + @@ -2033,6 +2066,7 @@ + @@ -2054,6 +2088,7 @@ + @@ -2082,6 +2117,7 @@ + @@ -2123,6 +2159,7 @@ + @@ -2136,6 +2173,7 @@ + @@ -2160,8 +2198,8 @@ + - @@ -2235,7 +2273,8 @@ - + + @@ -2247,6 +2286,7 @@ + @@ -2264,6 +2304,7 @@ + @@ -2304,8 +2345,9 @@ + - + @@ -2318,6 +2360,7 @@ + @@ -2335,6 +2378,7 @@ + @@ -2370,6 +2414,11 @@ + + + + + @@ -2441,8 +2490,8 @@ - + @@ -2547,9 +2596,6 @@ - - - @@ -2570,6 +2616,7 @@ + @@ -2602,6 +2649,7 @@ + @@ -2621,6 +2669,7 @@ + @@ -2648,8 +2697,8 @@ + - @@ -2662,6 +2711,7 @@ + @@ -2706,6 +2756,7 @@ + @@ -2735,6 +2786,7 @@ + @@ -2762,6 +2814,7 @@ + @@ -2779,6 +2832,7 @@ + @@ -2803,6 +2857,7 @@ + @@ -2817,6 +2872,7 @@ + @@ -2848,6 +2904,7 @@ + @@ -2876,6 +2933,7 @@ + @@ -2905,6 +2963,7 @@ + @@ -2917,6 +2976,7 @@ + diff --git a/Doc/Xml閰嶇疆鏂囨。.xml b/Doc/Xml閰嶇疆鏂囨。.xml index 381962ab..c658c7f1 100644 --- a/Doc/Xml閰嶇疆鏂囨。.xml +++ b/Doc/Xml閰嶇疆鏂囨。.xml @@ -74,6 +74,7 @@