From 800562f4949e269bf31527799489628349c06c05 Mon Sep 17 00:00:00 2001 From: shenjianxing <”315615051@qq.com“> Date: Mon, 13 Jan 2025 14:17:49 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Scripts/Actions/ActionHelper.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Assets/Scripts/Actions/ActionHelper.cs b/Assets/Scripts/Actions/ActionHelper.cs index 77822f6e..6f4d1e3f 100644 --- a/Assets/Scripts/Actions/ActionHelper.cs +++ b/Assets/Scripts/Actions/ActionHelper.cs @@ -3,6 +3,7 @@ using QFramework.Example; using System; using System.Collections.Generic; using UnityEngine; +using XMLTool; public class ActionHelper @@ -118,7 +119,8 @@ public class ActionHelper case "PointQuestion": return PointQuestionAction.Allocate(act.Value); case "Point3DQuestion": - return Point3DQuestionAction.Allocate(act.Value); + var point3d = (Point3DQuestion)act; + return Point3DQuestionAction.Allocate(point3d.datas); case "TextQuestion": { var strAction = (XMLTool.DictionaryAction)act; From ce0ef2c1589ad1693563a6394d8bab74c12402a0 Mon Sep 17 00:00:00 2001 From: shenjianxing <”315615051@qq.com“> Date: Mon, 13 Jan 2025 15:14:02 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E5=AE=8C=E6=88=903D=E7=82=B9=E4=BD=8D?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Scripts/Actions/Point3DQuestionAction.cs | 3 +++ Assets/Scripts/Item/Point3DItem.cs | 9 ++++++++ Assets/Scripts/Xml/XmlParser.cs | 15 +++++++++--- Doc/Xml配置文档.xml | 23 +++++++++++++++++-- 4 files changed, 45 insertions(+), 5 deletions(-) diff --git a/Assets/Scripts/Actions/Point3DQuestionAction.cs b/Assets/Scripts/Actions/Point3DQuestionAction.cs index 9a8b8e2a..b3ebded9 100644 --- a/Assets/Scripts/Actions/Point3DQuestionAction.cs +++ b/Assets/Scripts/Actions/Point3DQuestionAction.cs @@ -41,6 +41,7 @@ namespace QFramework GameObject obj = GameObject.Instantiate(Resources.Load("PointQuestion/Point3D")) as GameObject; obj.GetOrAddComponent().Init(item); } + this.Finish(); } @@ -64,6 +65,8 @@ namespace QFramework { if (!Deinited) { + datas.Clear(); + datas = null; OnFinished = null; Deinited = true; mPool.Recycle(this); diff --git a/Assets/Scripts/Item/Point3DItem.cs b/Assets/Scripts/Item/Point3DItem.cs index e0ec7698..86ae933b 100644 --- a/Assets/Scripts/Item/Point3DItem.cs +++ b/Assets/Scripts/Item/Point3DItem.cs @@ -15,6 +15,10 @@ public class Point3DItem : MonoBehaviour public void Init(Point3DQuestion.Data data) { this.data = data; + if (string.IsNullOrEmpty(data.name) == false) + { + gameObject.name = data.name; + } if (string.IsNullOrEmpty(data.deviceName)) { gameObject.transform.position = data.pos; @@ -25,6 +29,11 @@ public class Point3DItem : MonoBehaviour { GameObject device = DeviceController.Instance.GetDeviceObj(data.deviceName); gameObject.transform.parent = device.transform; + gameObject.transform.localPosition = Vector3.zero; + gameObject.transform.localEulerAngles = Vector3.zero; + gameObject.transform.localScale = Vector3.one; + + } rotSpeed = data.rotateSpeed; TypeEventSystem.Global.Register(OnObjDestroy).UnRegisterWhenGameObjectDestroyed(gameObject); diff --git a/Assets/Scripts/Xml/XmlParser.cs b/Assets/Scripts/Xml/XmlParser.cs index 7bdf0a90..6350d71e 100644 --- a/Assets/Scripts/Xml/XmlParser.cs +++ b/Assets/Scripts/Xml/XmlParser.cs @@ -1092,9 +1092,18 @@ namespace XMLTool { Point3DQuestion.Data data = new Point3DQuestion.Data(); data.name = item.Attribute("name")?.Value; - data.pos = Utility.GetVector3FromStrArray(item.Attribute("position")?.Value); - data.rotate = Utility.GetVector3FromStrArray(item.Attribute("rotate")?.Value); - data.scale = Utility.GetVector3FromStrArray(item.Attribute("scale")?.Value); + XAttribute atr = item.Attribute("deviceName"); + if (atr!=null) + { + data.deviceName = item.Attribute("deviceName").Value; + } + else + { + data.pos = Utility.GetVector3FromStrArray(item.Attribute("position")?.Value); + data.rotate = Utility.GetVector3FromStrArray(item.Attribute("rotate")?.Value); + data.scale = Utility.GetVector3FromStrArray(item.Attribute("scale")?.Value); + } + float.TryParse(item.Attribute("rotateSpeed")?.Value, out data.rotateSpeed); data.clickEvent = item.Attribute("clickEvent")?.Value; act.datas.Add(data); } diff --git a/Doc/Xml配置文档.xml b/Doc/Xml配置文档.xml index 08b2837f..c2da4429 100644 --- a/Doc/Xml配置文档.xml +++ b/Doc/Xml配置文档.xml @@ -34,6 +34,23 @@ + + + + + + + + + + + + @@ -157,8 +176,8 @@ 模块1 -这里是实训描述内容..... -巴拉巴拉.... + 这里是实训描述内容..... + 巴拉巴拉.... 组织钳 From 8fa25c6fe5db1f0d3e4e6d9056b0999f11c616e6 Mon Sep 17 00:00:00 2001 From: shenjianxing <”315615051@qq.com“> Date: Mon, 13 Jan 2025 17:18:29 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=8A=A5=E9=94=99?= =?UTF-8?q?=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Scripts/Conditions/ObjClickCondition.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Assets/Scripts/Conditions/ObjClickCondition.cs b/Assets/Scripts/Conditions/ObjClickCondition.cs index 68754b2c..91d073b8 100644 --- a/Assets/Scripts/Conditions/ObjClickCondition.cs +++ b/Assets/Scripts/Conditions/ObjClickCondition.cs @@ -43,9 +43,13 @@ namespace QFramework else { obj = DeviceController.Instance.GetDeviceObj(deviceName); + if (obj == null) + { + Debug.LogError($"ûҵ path:{path} deviceName:{deviceName}"); + } } } - if (obj != null && Input.GetMouseButtonUp(0) && EventSystem.current.IsPointerOverGameObject() == false) + if (Input.GetMouseButtonUp(0) && EventSystem.current.IsPointerOverGameObject() == false) { Vector3 mousePos = Input.mousePosition; Ray ray = Camera.main.ScreenPointToRay(mousePos); @@ -62,6 +66,8 @@ namespace QFramework } } } + + return false; } public bool Paused { get; set; } From e6c4b795f52e96b35bdc93f96f4a5dbb489445bf Mon Sep 17 00:00:00 2001 From: shenjianxing <”315615051@qq.com“> Date: Mon, 13 Jan 2025 17:46:57 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=A4=9A=E4=BD=99?= =?UTF-8?q?=E5=BC=95=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Scripts/Item/Point3DItem.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/Assets/Scripts/Item/Point3DItem.cs b/Assets/Scripts/Item/Point3DItem.cs index 86ae933b..49555550 100644 --- a/Assets/Scripts/Item/Point3DItem.cs +++ b/Assets/Scripts/Item/Point3DItem.cs @@ -4,7 +4,6 @@ using System.Collections; using System.Collections.Generic; using UnityEngine; using XMLTool; -using static UnityEditor.Progress; public class Point3DItem : MonoBehaviour {