コード例 #1
0
        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);
        }
コード例 #2
0
 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();
         }
     });
 }
コード例 #3
0
    void Start()
    {
        EventsMgr.GetInstance().Init();

        attachEvents();

        TriggerEvents();

        detachrEvents();
    }
コード例 #4
0
        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);
        }
コード例 #5
0
        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);
        }
コード例 #6
0
ファイル: testEvent.cs プロジェクト: pixar2016/Assets
    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();
    }
コード例 #7
0
        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);
        }
コード例 #8
0
 public void Reset()
 {
     m_IsEventTrigger = false;
     EventsMgr.GetInstance().AttachEvent(m_EventType, EventHandle);
 }
コード例 #9
0
 /// <summary>
 /// 事件的处理函数
 /// </summary>
 /// <param name="go"></param>
 protected virtual void EventHandle(object go)
 {
     m_IsEventTrigger = true;
     EventsMgr.GetInstance().DetachEvent(m_EventType, EventHandle);
 }
コード例 #10
0
 void detachrEvents()
 {
     EventsMgr.GetInstance().DetachEvent(eEventsKey.控制系统_兔子跳, RabbitJump);
     EventsMgr.GetInstance().DetachEvent(eEventsKey.控制系统_兔子向右走, RabbitRight);
     EventsMgr.GetInstance().DetachEvent(eEventsKey.控制系统_兔子停止向右走, RabbitStopRight);
 }
コード例 #11
0
 void TriggerEvents()
 {
     EventsMgr.GetInstance().TriigerEvent(eEventsKey.控制系统_兔子跳, 10.0f);
     EventsMgr.GetInstance().TriigerEvent(eEventsKey.控制系统_兔子向右走, 5.0f);
     EventsMgr.GetInstance().TriigerEvent(eEventsKey.控制系统_兔子停止向右走, 5.0f);
 }
コード例 #12
0
 public EventCondition(EventsType type)
 {
     m_EventType      = type;
     m_IsEventTrigger = false;
     EventsMgr.GetInstance().AttachEvent(type, EventHandle);
 }