public void AddBuff(Skill skill, int round = 0) { m_BuffList = m_BuffList ?? new List <Buff>(); Buff buff = new Buff(); buff.AtRound = round; m_BuffList.Add(buff); EventsMgr.GetInstance().TriigerEvent(EventsType.Skill_AddBuff, buff); }
private void Awake() { EventsMgr.GetInstance().AttachEvent(EventsType.FrameItem_Refresh, (data) => { FrameData frameData = (FrameData)data; if (frameData.Type == m_Type) { this.m_Num.text = ((int)frameData.Value).ToString(); } }); }
void Start() { EventsMgr.GetInstance().Init(); attachEvents(); TriggerEvents(); detachrEvents(); }
public void Disperse(List <int> disperseList) { List <Buff> list = new List <Buff>(); foreach (var buff in m_BuffList) { if (disperseList.Contains(buff.Skill.Attribute.Id)) { list.Add(buff); } } EventsMgr.GetInstance().TriigerEvent(EventsType.Skill_Disperse, list); }
public override void Start() { base.Start(); //to-do 这里需要根据技能类型创建不同类型的伤害计算,这里简单的已处理加固定血量来模拟计算 int result = this.m_Skill.Caculate(new FixAddHp()); if (m_Result != null) { m_Result(result); } //注意: 伤害计算结束后需要触发伤害计算结束的事件,来终止任务的执行 EventsMgr.GetInstance().TriigerEvent(EventsType.Skill_EndDmg, null); }
void Start() { EventsMgr.GetInstance().Init(); Debug.Log("RabbitJump JumpHeight:"); attachEvents(); TriggerEvents(); MiniEventDispatcher ee = new MiniEventDispatcher(); ee.Register("ee", ff); ee.Register("ee", ff); ee.Remove("ee", ff); ee.Broadcast("ee", 32, "sfs", 76); //detachrEvents(); }
public void AddBuff(Skill skill, int round = 0) { m_BuffList = m_BuffList ?? new List <Buff>(); skill = new Skill(); Attribute attribute = new Attribute(); attribute.Id = 1; attribute.CostMp = 5; attribute.m_DelayTime = 1; skill.Attribute = attribute; Buff buff = new Buff(); buff.Skill = skill; buff.AtRound = round; m_BuffList.Add(buff); EventsMgr.GetInstance().TriigerEvent(EventsType.Skill_AddBuff, buff); }
public void Reset() { m_IsEventTrigger = false; EventsMgr.GetInstance().AttachEvent(m_EventType, EventHandle); }
/// <summary> /// 事件的处理函数 /// </summary> /// <param name="go"></param> protected virtual void EventHandle(object go) { m_IsEventTrigger = true; EventsMgr.GetInstance().DetachEvent(m_EventType, EventHandle); }
void detachrEvents() { EventsMgr.GetInstance().DetachEvent(eEventsKey.控制系统_兔子跳, RabbitJump); EventsMgr.GetInstance().DetachEvent(eEventsKey.控制系统_兔子向右走, RabbitRight); EventsMgr.GetInstance().DetachEvent(eEventsKey.控制系统_兔子停止向右走, RabbitStopRight); }
void TriggerEvents() { EventsMgr.GetInstance().TriigerEvent(eEventsKey.控制系统_兔子跳, 10.0f); EventsMgr.GetInstance().TriigerEvent(eEventsKey.控制系统_兔子向右走, 5.0f); EventsMgr.GetInstance().TriigerEvent(eEventsKey.控制系统_兔子停止向右走, 5.0f); }
public EventCondition(EventsType type) { m_EventType = type; m_IsEventTrigger = false; EventsMgr.GetInstance().AttachEvent(type, EventHandle); }