From 6eb915c129fc90c6f4c82ae097dd6ffad5239efc Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 25 Jan 2021 14:28:30 +0800 Subject: +scripts --- .../XMainClient/AI/AIRunTimeEntryTaskNode.cs | 62 ++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 Client/Assets/Scripts/XMainClient/AI/AIRunTimeEntryTaskNode.cs (limited to 'Client/Assets/Scripts/XMainClient/AI/AIRunTimeEntryTaskNode.cs') diff --git a/Client/Assets/Scripts/XMainClient/AI/AIRunTimeEntryTaskNode.cs b/Client/Assets/Scripts/XMainClient/AI/AIRunTimeEntryTaskNode.cs new file mode 100644 index 00000000..1dddd659 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/AI/AIRunTimeEntryTaskNode.cs @@ -0,0 +1,62 @@ +using System; +using System.Xml; +using UnityEngine; + +namespace XMainClient +{ + internal class AIRunTimeEntryTaskNode : AIRunTimeRootNode + { + public AIRunTimeEntryTaskNode(XmlElement node) : base(node) + { + for (int i = 0; i < node.Attributes.Count; i++) + { + bool flag = node.Attributes[i].Name.Length >= 3; + if (flag) + { + string name = node.Attributes[i].Name.Substring(2); + bool flag2 = node.Attributes[i].Name.StartsWith("F_"); + if (flag2) + { + base.Data.SetFloatByName(name, float.Parse(node.Attributes[i].Value)); + } + else + { + bool flag3 = node.Attributes[i].Name.StartsWith("S_"); + if (flag3) + { + base.Data.SetStringByName(name, node.Attributes[i].Value); + } + else + { + bool flag4 = node.Attributes[i].Name.StartsWith("I_"); + if (flag4) + { + base.Data.SetIntByName(name, int.Parse(node.Attributes[i].Value)); + } + else + { + bool flag5 = node.Attributes[i].Name.StartsWith("B_"); + if (flag5) + { + base.Data.SetBoolByName(name, node.Attributes[i].Value != "0"); + } + else + { + bool flag6 = node.Attributes[i].Name.StartsWith("V_"); + if (flag6) + { + string[] array = node.Attributes[i].Value.Split(new char[] + { + ':' + }); + base.Data.SetVector3ByName(name, new Vector3(float.Parse(array[0]), float.Parse(array[1]), float.Parse(array[2]))); + } + } + } + } + } + } + } + } + } +} -- cgit v1.1-26-g67d0