summaryrefslogtreecommitdiff
path: root/Client/Assets/Scripts/XMainClient/AI/AIRuntimeSendAIEvent.cs
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2021-01-25 14:28:30 +0800
committerchai <chaifix@163.com>2021-01-25 14:28:30 +0800
commit6eb915c129fc90c6f4c82ae097dd6ffad5239efc (patch)
tree7dd2be50edf41f36b60fac84696e731c13afe617 /Client/Assets/Scripts/XMainClient/AI/AIRuntimeSendAIEvent.cs
+scripts
Diffstat (limited to 'Client/Assets/Scripts/XMainClient/AI/AIRuntimeSendAIEvent.cs')
-rw-r--r--Client/Assets/Scripts/XMainClient/AI/AIRuntimeSendAIEvent.cs45
1 files changed, 45 insertions, 0 deletions
diff --git a/Client/Assets/Scripts/XMainClient/AI/AIRuntimeSendAIEvent.cs b/Client/Assets/Scripts/XMainClient/AI/AIRuntimeSendAIEvent.cs
new file mode 100644
index 00000000..1fe4d8c4
--- /dev/null
+++ b/Client/Assets/Scripts/XMainClient/AI/AIRuntimeSendAIEvent.cs
@@ -0,0 +1,45 @@
+using System;
+using System.Xml;
+using UnityEngine;
+using XUtliPoolLib;
+
+namespace XMainClient
+{
+ internal class AIRuntimeSendAIEvent : AIRunTimeNodeAction
+ {
+ private int _msg_to;
+
+ private int _msg_type;
+
+ private int _entity_type_id;
+
+ private string _msg_str;
+
+ private string _pos_name;
+
+ private Vector3 _pos;
+
+ private float _delay_time;
+
+ public AIRuntimeSendAIEvent(XmlElement node) : base(node)
+ {
+ this._msg_to = int.Parse(node.GetAttribute("MsgTo"));
+ this._msg_type = int.Parse(node.GetAttribute("MsgType"));
+ this._entity_type_id = int.Parse(node.GetAttribute("EntityTypeId"));
+ this._msg_str = node.GetAttribute("MsgStr");
+ this._pos_name = node.GetAttribute("Shared_PosName");
+ this._delay_time = float.Parse(node.GetAttribute("DelayTime"));
+ string[] array = node.GetAttribute("Shared_PosmValue").Split(new char[]
+ {
+ ':'
+ });
+ this._pos = new Vector3(float.Parse(array[0]), float.Parse(array[1]), float.Parse(array[2]));
+ }
+
+ public override bool Update(XEntity entity)
+ {
+ Vector3 vector3ByName = entity.AI.AIData.GetVector3ByName(this._pos_name, this._pos);
+ return XSingleton<XAIOtherActions>.singleton.SendAIEvent(entity, this._msg_to, this._msg_type, this._entity_type_id, this._msg_str, vector3ByName, this._delay_time);
+ }
+ }
+}