using System; using System.Collections.Generic; using System.Text; using CommonLang.Property; using CommonAI.Zone.ZoneEditor; using CommonAI.Zone.Instance; using CommonAI.Zone.Attributes; using CommonAI.Zone.EventTrigger; namespace CommonAI.Zone.ZoneEditor.EventTrigger { [DescAttribute("场景初始化", "场景")] public class SceneInitialized : AbstractTrigger { public override string ToString() { return string.Format("当场景初始化时"); } public override void Listen(EventTriggerAdapter api, EventArguments args) { api.listen_SceneInit(args, api.ZoneAPI); } } [DescAttribute("时间逝去", "时间")] public class TimeElapsed : AbstractTrigger { [DescAttribute("时间(秒)")] public float TimeSEC = 5.0f; public override string ToString() { return string.Format("当{0}秒之后", TimeSEC); } public override void Listen(EventTriggerAdapter api, EventArguments args) { api.listen_TimeDelaySEC(args, TimeSEC); } } [DescAttribute("时间间隔", "时间")] public class TimePeriodic : AbstractTrigger { [DescAttribute("时间(秒)")] public float EveryTimeSEC = 5.0f; public override string ToString() { return string.Format("每隔{0}秒", EveryTimeSEC); } public override void Listen(EventTriggerAdapter api, EventArguments args) { api.listen_TimePeriodicSEC(args, EveryTimeSEC); } } [DescAttribute("时间间隔按次数", "时间")] public class TimeTask : AbstractTrigger { [DescAttribute("延时时间(秒)")] public float DelayTimeSEC = 0f; [DescAttribute("间隔时间(秒)")] public float EveryTimeSEC = 5.0f; [DescAttribute("重复次数")] public int RepeatCount = 0; public override string ToString() { return string.Format("延时{0}秒,每隔{1}秒,执行{2}次", DelayTimeSEC, EveryTimeSEC, RepeatCount); } public override void Listen(EventTriggerAdapter api, EventArguments args) { api.listen_TimeTaskSEC(args, EveryTimeSEC, DelayTimeSEC, RepeatCount); } } [DescAttribute("(变量)时间逝去", "时间")] public class ValuedTimeElapsed : AbstractTrigger { [DescAttribute("时间(秒)")] public RealValue TimeSEC = new RealValue.VALUE(5); public override string ToString() { return string.Format("当{0}秒之后", TimeSEC); } public override void Listen(EventTriggerAdapter api, EventArguments args) { api.listen_TimeDelaySEC(args, TimeSEC.GetValue(api, args)); } } [DescAttribute("(变量)时间间隔", "时间")] public class ValuedTimePeriodic : AbstractTrigger { [DescAttribute("时间(秒)")] public RealValue EveryTimeSEC = new RealValue.VALUE(5); public override string ToString() { return string.Format("每隔{0}秒", EveryTimeSEC); } public override void Listen(EventTriggerAdapter api, EventArguments args) { api.listen_TimePeriodicSEC(args, EveryTimeSEC.GetValue(api, args)); } } [DescAttribute("(变量)时间间隔按次数", "时间")] public class ValuedTimeTask : AbstractTrigger { [DescAttribute("延时时间(秒)")] public RealValue DelayTimeSEC = new RealValue.VALUE(5); [DescAttribute("间隔时间(秒)")] public RealValue EveryTimeSEC = new RealValue.VALUE(5); [DescAttribute("重复次数")] public IntegerValue RepeatCount = new IntegerValue.VALUE(0); public override string ToString() { return string.Format("延时{0}秒,每隔{1}秒,执行{2}次", DelayTimeSEC, EveryTimeSEC, RepeatCount); } public override void Listen(EventTriggerAdapter api, EventArguments args) { api.listen_TimeTaskSEC(args, EveryTimeSEC.GetValue(api, args), DelayTimeSEC.GetValue(api, args), RepeatCount.GetValue(api, args)); } } [DescAttribute("当从游戏服收到消息", "游戏服")] public class RecvMessageFromGS : AbstractTrigger { [DescAttribute("消息name")] public string Message; public override string ToString() { return string.Format("当从游戏服收到消息“{0}”", Message); } public override void Listen(EventTriggerAdapter api, EventArguments args) { api.listen_RecvMessageFromGS(args, api.ZoneAPI, Message); } } }