From dba53a088f38962f5dd340cc83de55d0fe6cc725 Mon Sep 17 00:00:00 2001 From: shenjianxing <”315615051@qq.com“> Date: Thu, 9 Jan 2025 17:08:20 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=AE=9E=E8=AE=AD=E5=86=85?= =?UTF-8?q?=E5=AE=B9=E4=BB=8B=E7=BB=8D=E5=8F=AF=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Art/UIPrefab/UIInstruction.prefab | 18 ++++++++++++++++++ Assets/Scripts/UI/UIInstruction.Designer.cs | 5 ++++- Assets/Scripts/UI/UIInstruction.cs | 10 ++++++++++ Assets/Scripts/Xml/XmlParser.cs | 2 ++ Doc/Xml配置文档.xml | 4 ++++ 5 files changed, 38 insertions(+), 1 deletion(-) diff --git a/Assets/Art/UIPrefab/UIInstruction.prefab b/Assets/Art/UIPrefab/UIInstruction.prefab index 08c7c14a..873108a6 100644 --- a/Assets/Art/UIPrefab/UIInstruction.prefab +++ b/Assets/Art/UIPrefab/UIInstruction.prefab @@ -468,6 +468,7 @@ MonoBehaviour: Training: {fileID: 2329671978117574524} Operation: {fileID: 616562839221942952} TrainContent: {fileID: 5869372504899619242} + ContentText: {fileID: 2630179459340483145} OperationContent: {fileID: 3768800539522999701} ConfirmBtn: {fileID: 783019177237190269} --- !u!1 &2550146359932684284 @@ -1805,6 +1806,7 @@ GameObject: - component: {fileID: 1747114938129779637} - component: {fileID: 6155234247361610581} - component: {fileID: 2630179459340483145} + - component: {fileID: 956712290457367647} m_Layer: 5 m_Name: ContentText m_TagString: Untagged @@ -1928,6 +1930,22 @@ MonoBehaviour: m_hasFontAssetChanged: 0 m_baseMaterial: {fileID: 0} m_maskOffset: {x: 0, y: 0, z: 0, w: 0} +--- !u!114 &956712290457367647 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8301949965222141633} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0d51f3a7c41ab0346b49ae50d456bece, type: 3} + m_Name: + m_EditorClassIdentifier: + MarkType: 0 + CustomComponentName: + CustomComment: + mComponentName: TMPro.TextMeshProUGUI --- !u!1 &8662634946358023954 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Scripts/UI/UIInstruction.Designer.cs b/Assets/Scripts/UI/UIInstruction.Designer.cs index 605a53d9..14859343 100644 --- a/Assets/Scripts/UI/UIInstruction.Designer.cs +++ b/Assets/Scripts/UI/UIInstruction.Designer.cs @@ -5,7 +5,7 @@ using QFramework; namespace QFramework.Example { - // Generate Id:b1c63efb-a7a0-4270-8cd9-08f25e4d69b5 + // Generate Id:031f03df-56cd-4f22-b0e4-b4cc8ddb2f1a public partial class UIInstruction { public const string Name = "UIInstruction"; @@ -17,6 +17,8 @@ namespace QFramework.Example [SerializeField] public RectTransform TrainContent; [SerializeField] + public TMPro.TextMeshProUGUI ContentText; + [SerializeField] public UnityEngine.UI.Image OperationContent; [SerializeField] public UnityEngine.UI.Button ConfirmBtn; @@ -28,6 +30,7 @@ namespace QFramework.Example Training = null; Operation = null; TrainContent = null; + ContentText = null; OperationContent = null; ConfirmBtn = null; diff --git a/Assets/Scripts/UI/UIInstruction.cs b/Assets/Scripts/UI/UIInstruction.cs index aa7d6981..b936f544 100644 --- a/Assets/Scripts/UI/UIInstruction.cs +++ b/Assets/Scripts/UI/UIInstruction.cs @@ -2,6 +2,7 @@ using UnityEngine; using UnityEngine.UI; using QFramework; using TMPro; +using System.Diagnostics.Eventing.Reader; namespace QFramework.Example { @@ -47,6 +48,15 @@ namespace QFramework.Example protected override void OnOpen(IUIData uiData = null) { + if (string.IsNullOrEmpty(Global.Instance.curModule.Descript)) + { + + ContentText.text = "ûDescript"; + } + else + { + ContentText.text = Global.Instance.curModule.Descript; + } } protected override void OnShow() diff --git a/Assets/Scripts/Xml/XmlParser.cs b/Assets/Scripts/Xml/XmlParser.cs index 970508a6..20dcf3f9 100644 --- a/Assets/Scripts/Xml/XmlParser.cs +++ b/Assets/Scripts/Xml/XmlParser.cs @@ -22,6 +22,7 @@ namespace XMLTool public string type { get; set; } public string Scene { get; set; } public string ModuleName { get; set; } + public string Descript { get; set; } public List Operations { get; set; } public List Devices { get; set; } @@ -186,6 +187,7 @@ namespace XMLTool // ģ module.type = moduleElement.Element("Type")?.Value; module.ModuleName = moduleElement.Element("Name")?.Value; + module.Descript = moduleElement.Element("Descript")?.Value; module.Scene = moduleElement.Element("Scene")?.Value; // 豸 diff --git a/Doc/Xml配置文档.xml b/Doc/Xml配置文档.xml index c8c19d72..08b2837f 100644 --- a/Doc/Xml配置文档.xml +++ b/Doc/Xml配置文档.xml @@ -156,6 +156,10 @@ 模块1 + +这里是实训描述内容..... +巴拉巴拉.... + 组织钳