IEnumerator CronometroImunidade()
    {
        this.gameObject.layer = LayerMask.NameToLayer("Imunidade");
        camRippleEffect.RippleEfecct();
        imunidade = true;
        float temp = tempoDeImunidade / 10;

        playerMaterial.color = new Color(1f, 1f, 1f, 0.5f);
        for (int i = 0; i < 5; i++)
        {
            meshRenderer.enabled = false;
            yield return(new WaitForSeconds(temp));

            meshRenderer.enabled = true;
            yield return(new WaitForSeconds(temp));
        }
        playerMaterial.color  = new Color(1f, 1f, 1f, 1f);
        imunidade             = false;
        this.gameObject.layer = LayerMask.NameToLayer("Player");
    }
    IEnumerator CronometroImunidade()
    {
        float temp = tempoDeImunidade / 10;

        particulasEfeitos.Play(true);
        camRippleEffect.RippleEfecct();
        imunidade             = true;
        this.gameObject.layer = LayerMask.NameToLayer("Imunidade");
        spriteRenderer.color  = new Color(1f, 0f, 0f, 0.5f);
        for (int i = 0; i < 5; i++)
        {
            spriteRenderer.enabled = false;

            yield return(new WaitForSeconds(temp));

            spriteRenderer.enabled = true;
            yield return(new WaitForSeconds(temp));
        }
        imunidade             = false;
        this.gameObject.layer = LayerMask.NameToLayer("Enemy");
        spriteRenderer.color  = mobColor;
    }
    void OnTriggerEnter2D(Collider2D other)
    {
        if (other.gameObject.tag == "Player")
        {
            switch (potion)
            {
            case TiposPotion.HEAL:
                if (other.gameObject.GetComponent <PlayerBasicoVida>().hp < other.gameObject.GetComponent <PlayerBasicoVida>().maxHP)
                {
                    particulasEfeitos.Play(true);
                    other.gameObject.GetComponent <PlayerBasicoVida>().StartCoroutine("AddHP", valorEfeito);
                    Remove();
                    _myGameController.PlaySfx(_myGameController.SxfHeal, .7f);
                }
                break;

            case TiposPotion.MAXHEAL:
                if (other.gameObject.GetComponent <PlayerBasicoVida>().hp < other.gameObject.GetComponent <PlayerBasicoVida>().maxHP)
                {
                    particulasEfeitos.Play(true);
                    other.gameObject.GetComponent <PlayerBasicoVida>().StartCoroutine("MAXHeal");
                    Remove();
                    _myGameController.PlaySfx(_myGameController.SxfHeal, 1);
                }
                break;

            case TiposPotion.IMUNITY:
                if (!other.gameObject.GetComponent <PlayerBasicoVida>().imunidade)
                {
                    particulasEfeitos.Play(true);
                    other.gameObject.GetComponent <PlayerBasicoVida>().StartCoroutine("CronometroImunidadePotion", valorEfeito);
                    Remove();
                    _myGameController.PlaySfx(_myGameController.SfxImunite, 1);
                }
                break;

            case TiposPotion.POWERUP:

                particulasEfeitos.Play(true);
                other.gameObject.GetComponent <JogadorControle>().StartCoroutine("AumentarPlayer");
                Remove();
                _myGameController.PlaySfx(_myGameController.SfxSize, 1);

                break;

            case TiposPotion.DANOAREA:

                particulasEfeitos.Play(true);
                danoArea.gameObject.gameObject.SetActive(true);
                _myGameController.PlaySfx(_myGameController.SfxExplosion, 1);
                camRippleEffect.RippleEfecct();

                Remove();

                break;

            default:
                Debug.Log("tem algo errado.. na potion.cs");

                break;
            }
        }
    }
 // Update is called once per frame
 public void SfxHit()
 {
     camRippleEffect.RippleEfecct();
     _myGameController.PlaySfx(_myGameController.SfxQuebrou, 0.6f);
 }