Exemple #1
0
    void OnTriggerEnter2D(Collider2D hit)
    {
        ennemi ennemi = hit.GetComponent <ennemi>();

        if (ennemi != null)
        {
            ennemi.TakeDamage(damage);
        }
    }
Exemple #2
0
    void OnTriggerEnter2D(Collider2D hit)
    {
        ennemi ennemi = hit.GetComponent <ennemi>();

        if (ennemi != null)
        {
            ennemi.TakeDamage(damage);
        }
        rb.velocity    = Vector2.zero;
        rendu.enabled  = false;
        cercle.enabled = false;
        boom.Play();
    }