示例#1
0
    protected virtual void OnTriggerEnter2D(Collider2D collision)
    {
        Player player = collision.GetComponent <Player>();

        if (player != null)
        {
            player.ChangeHp(-dmg);

            if (specialEffect)
            {
                ItemManager.Instance.ApplyItem(player, itemId.Id);
            }

            Destroy(gameObject);
        }

        Nexus nexus = collision.GetComponent <Nexus>();

        if (nexus)
        {
            nexus.DamageNexus(dmg);

            Destroy(gameObject);
        }
    }
示例#2
0
    private void OnTriggerEnter2D(Collider2D collision)
    {
        Player player = collision.GetComponent <Player>();

        if (player != null)
        {
            player.ChangeHp(-dmg);
        }

        Nexus nexus = collision.GetComponent <Nexus>();

        if (nexus)
        {
            nexus.DamageNexus(dmg);
        }
    }