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/AIRunTimeFindTargetByDist.cs |
+scripts
Diffstat (limited to 'Client/Assets/Scripts/XMainClient/AI/AIRunTimeFindTargetByDist.cs')
-rw-r--r-- | Client/Assets/Scripts/XMainClient/AI/AIRunTimeFindTargetByDist.cs | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/Client/Assets/Scripts/XMainClient/AI/AIRunTimeFindTargetByDist.cs b/Client/Assets/Scripts/XMainClient/AI/AIRunTimeFindTargetByDist.cs new file mode 100644 index 00000000..ad5a6af4 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/AI/AIRunTimeFindTargetByDist.cs @@ -0,0 +1,53 @@ +using System;
+using System.Xml;
+using XUtliPoolLib;
+
+namespace XMainClient
+{
+ internal class AIRunTimeFindTargetByDist : AIRunTimeNodeAction
+ {
+ private string _distance_name;
+
+ private float _distance;
+
+ private bool _filter_immortal;
+
+ private float _angle;
+
+ private float _delta;
+
+ private int _targettype;
+
+ public AIRunTimeFindTargetByDist(XmlElement node) : base(node)
+ {
+ this._distance_name = node.GetAttribute("Shared_DistanceName");
+ this._distance = float.Parse(node.GetAttribute("Shared_DistancemValue"));
+ string attribute = node.GetAttribute("FilterImmortal");
+ string attribute2 = node.GetAttribute("TargetType");
+ string attribute3 = node.GetAttribute("Angle");
+ bool flag = !float.TryParse(attribute3, out this._angle);
+ if (flag)
+ {
+ this._angle = 180f;
+ }
+ string attribute4 = node.GetAttribute("Delta");
+ bool flag2 = !float.TryParse(attribute4, out this._delta);
+ if (flag2)
+ {
+ this._delta = 0f;
+ }
+ bool.TryParse(attribute, out this._filter_immortal);
+ bool flag3 = !int.TryParse(attribute2, out this._targettype);
+ if (flag3)
+ {
+ this._targettype = 0;
+ }
+ }
+
+ public override bool Update(XEntity entity)
+ {
+ float floatByName = entity.AI.AIData.GetFloatByName(this._distance_name, this._distance);
+ return XSingleton<XAITarget>.singleton.FindTargetByDistance(entity, floatByName, this._filter_immortal, this._angle, this._delta, this._targettype);
+ }
+ }
+}
|