From 6eb915c129fc90c6f4c82ae097dd6ffad5239efc Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 25 Jan 2021 14:28:30 +0800 Subject: +scripts --- .../Scripts/XMainClient/AI/AIRuntimeSendAIEvent.cs | 45 ++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 Client/Assets/Scripts/XMainClient/AI/AIRuntimeSendAIEvent.cs (limited to 'Client/Assets/Scripts/XMainClient/AI/AIRuntimeSendAIEvent.cs') 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.singleton.SendAIEvent(entity, this._msg_to, this._msg_type, this._entity_type_id, this._msg_str, vector3ByName, this._delay_time); + } + } +} -- cgit v1.1-26-g67d0