// Update is called once per frame
    public void Explode()
    {
        Collider[] hitObjects = Physics.OverlapSphere(transform.position, weapon.radius);

        for (int i = 0; i < hitObjects.Length; i++)
        {
            hitHandler.OnAgentHited(new WeaponDataObject(weapon), hitObjects[i].gameObject, transform.position);
        }

        GameObject explosion = Instantiate(weapon.particle);

        explosion.transform.position = transform.position;
        Destroy(gameObject);
    }
    public virtual void shoot(Vector3 target)
    {
        characterAnimator.SetTrigger("Shoot");
        //Altera o Y do alvo para alinhar-se com a altura da arma
        target.y = 1.2f;
        //Força o personagem olhar para o local onde está atirando
        transform.LookAt(target);
        RaycastHit raycastHit;
        Ray        ray = new Ray(transform.position, transform.forward);

        if (weapon.ammo-- > 0)
        {
            if (Physics.Raycast(ray, out raycastHit))
            {
                hitHandler.OnAgentHited(weaponData, raycastHit.collider.gameObject, raycastHit.point);
            }
        }
    }