summaryrefslogtreecommitdiff
path: root/Client/Assets/Scripts/XMainClient/AI/AIRunTimeEntryTaskNode.cs
blob: 1dddd659f78981ae58fe660bfaffa5eb7b5b9cea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
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])));
									}
								}
							}
						}
					}
				}
			}
		}
	}
}