summaryrefslogtreecommitdiff
path: root/Client/Assets/Scripts/XMainClient/AI/AIRunTimeValueTarget.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Client/Assets/Scripts/XMainClient/AI/AIRunTimeValueTarget.cs')
-rw-r--r--Client/Assets/Scripts/XMainClient/AI/AIRunTimeValueTarget.cs39
1 files changed, 39 insertions, 0 deletions
diff --git a/Client/Assets/Scripts/XMainClient/AI/AIRunTimeValueTarget.cs b/Client/Assets/Scripts/XMainClient/AI/AIRunTimeValueTarget.cs
new file mode 100644
index 00000000..857d8635
--- /dev/null
+++ b/Client/Assets/Scripts/XMainClient/AI/AIRunTimeValueTarget.cs
@@ -0,0 +1,39 @@
+using System;
+using System.Xml;
+using XUtliPoolLib;
+
+namespace XMainClient
+{
+ internal class AIRunTimeValueTarget : AIRunTimeNodeCondition
+ {
+ private string _shared_target_name;
+
+ public AIRunTimeValueTarget(XmlElement node) : base(node)
+ {
+ this._shared_target_name = node.GetAttribute("Shared_TargetName");
+ }
+
+ public override bool Update(XEntity entity)
+ {
+ XGameObject xgameObjectByName = entity.AI.AIData.GetXGameObjectByName(this._shared_target_name);
+ XEntity xentity = null;
+ bool flag = xgameObjectByName != null;
+ if (flag)
+ {
+ xentity = XSingleton<XEntityMgr>.singleton.GetEntity(xgameObjectByName.UID);
+ }
+ bool flag2 = xgameObjectByName != null && xentity != null && XEntity.ValideEntity(xentity);
+ bool result;
+ if (flag2)
+ {
+ result = true;
+ }
+ else
+ {
+ entity.AI.SetTarget(null);
+ result = false;
+ }
+ return result;
+ }
+ }
+}