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 -这里是实训描述内容..... -巴拉巴拉.... + 这里是实训描述内容..... + 巴拉巴拉.... 组织钳