void OnTriggerEnter2D(Collider2D collision)
    {
        if (collision.CompareTag("Player"))
        {
            Scr_LifeSystem_Player lifesyst = collision.gameObject.GetComponent <Scr_LifeSystem_Player>();

            if (!lifesyst._haveTakeDamage)
            {
                lifesyst.TakingDamange(_bulletDamage);
            }

            Destroy(gameObject);
        }
    }
Example #2
0
    void OnTriggerEnter2D(Collider2D collision)
    {
        if (collision.CompareTag("Player"))
        {
            Scr_LifeSystem_Player lifesyst = collision.gameObject.GetComponent <Scr_LifeSystem_Player>();

            if (!lifesyst._haveTakeDamage)
            {
                lifesyst.TakingDamange(10);
            }

            _data._score += _scoreForKill;

            Destroy(gameObject);
        }
    }