Exemplo n.º 1
0
    private void OnCollisionEnter(Collision collision)
    {
        if (collision.collider.tag == "Sword" && IsActive)
        {
            if (_health <= 0)
            {
                RemovalFromTower();
                CanvasManager.Instance.AddProgress();
                _delimiter.Separation(collision.GetContact(0).point);
            }
            else
            {
                _helmet.PushHelmet(collision.GetContact(0).point);
                //_helmet.gameObject.SetActive(false);
                _health -= 1;
            }
        }

        if (collision.gameObject.layer == 9)
        {
            gameObject.layer = 11;

            IsActive = true;
            //if (tag == "Rock")
            //{
            //    RemovalFromTower();
            //    transform.SetParent(null);
            //}
        }
    }