Пример #1
0
    private void OnTriggerEnter(Collider other)
    {
        MonsterHealth health = other.GetComponentInChildren <MonsterHealth>();

        if (health)
        {
            health.decrease();
            Destroy(gameObject);
        }
    }