示例#1
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.CompareTag("Role"))
     {
         ResourceMgr.PushItem(this);
         BattleHero hero = collision.GetComponent <BattleHero>();
         BattleManager.GetInst().EnqueueSkill(hero.PlayerId, Type);
         CommonCommand.ExecuteLongBattle(Client2ServerList.GetInst().C2S_BATTLE_GET_ITEM, new ArrayList()
         {
             (byte)Type
         });
     }
 }
示例#2
0
        private void OnTriggerEnter2D(Collider2D collision)
        {
            if (collision.CompareTag("Role"))
            {
                collision.GetComponent <BattleHero>().ReduceHp(1);
            }
            else
            {
                BattlePlat plat = collision.GetComponent <BattlePlat>();
                if (plat != null)
                {
                    TriggerCbFunc(plat);
                    return;
                }

                BattleItem item = collision.GetComponent <BattleItem>();
                if (item != null)
                {
                    ResourceMgr.PushItem(item);
                    return;
                }
            }
        }