Esempio n. 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);
        }
    }
Esempio n. 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);
        }
    }