Пример #1
0
    void OnTriggerEnter2D(Collider2D hitinfo)
    {
        Enemy1 enemy = hitinfo.GetComponent <Enemy1>();

        if (enemy != null)
        {
            enemy.TakeDamge(damage);
            enemy.Feedback();
        }
        PlayerMechanics player = hitinfo.GetComponent <PlayerMechanics>();

        if (player != null)
        {
            player.TakeDamge(damage);
        }
        Instantiate(BulletEx, transform.position, quaternion.identity);
        Destroy(gameObject);
    }