Esempio n. 1
0
    // Update is called once per frame
    private void OnTriggerEnter2D(Collider2D collision)
    {
        PlayerBlackSoul player = collision.GetComponent <PlayerBlackSoul>();

        if (player != null)
        {
            player.TakeDamage(damage);
        }
        Destroy(gameObject);
    }
Esempio n. 2
0
    void OnTriggerEnter2D(Collider2D hitInfo)
    {
        PlayerBlackSoul enemy = hitInfo.GetComponent <PlayerBlackSoul>();

        if (enemy != null)
        {
            enemy.TakeDamage(Damage);
        }
        Instantiate(explosion, transform.position, transform.rotation);
        Destroy(gameObject);
    }