diff options
author | chai <chaifix@163.com> | 2021-01-25 14:28:30 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2021-01-25 14:28:30 +0800 |
commit | 6eb915c129fc90c6f4c82ae097dd6ffad5239efc (patch) | |
tree | 7dd2be50edf41f36b60fac84696e731c13afe617 /Client/Assets/Scripts/XMainClient/AI/AIRunTimeValueTarget.cs |
+scripts
Diffstat (limited to 'Client/Assets/Scripts/XMainClient/AI/AIRunTimeValueTarget.cs')
-rw-r--r-- | Client/Assets/Scripts/XMainClient/AI/AIRunTimeValueTarget.cs | 39 |
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;
+ }
+ }
+}
|