// PODER

    public void ActivarPoder()
    {
        if (estadoPlayer != EstadoPlayer.paralizado && estadoPlayer != EstadoPlayer.inmune && gm.ObtenerPoder() > 0 && !animator.GetBool("recibiendoDano"))
        {
            Sequence s = DOTween.Sequence();
            s.Append(GetComponent <SpriteRenderer>().DOColor(new Color(1, 0.8f, 0), 0.5f));
            s.Append(GetComponent <SpriteRenderer>().DOColor(new Color(1, 1, 1), 0.5f));
            s.SetLoops(-1);
            efectoPoder.SetActive(true);
            fogonazo.SetActive(true);
            fogonazo.GetComponent <SpriteRenderer>().DOColor(new Color(1, 1, 1, 0), 0.2f);
            Invoke("QuitarFogonazo", 0.2f);
            estadoPlayer  = EstadoPlayer.inmune;
            poderActivado = true;
            audios[AUDIO_PODER].Play();
            gm.ActivarPoder();
        }
    }
Beispiel #2
0
    // PODER

    public void ActivarPoder()
    {
        if (estadoPlayer != EstadoPlayer.paralizado && estadoPlayer != EstadoPlayer.inmune && gm.ObtenerPoder() > 0 && !animator.GetBool("recibiendoDano"))
        {
            Sequence s = DOTween.Sequence();
            s.Append(GetComponent <SpriteRenderer>().DOColor(new Color(1, 0.8f, 0), 0.5f));
            s.Append(GetComponent <SpriteRenderer>().DOColor(new Color(1, 1, 1), 0.5f));
            s.SetLoops(-1);
            efectoPoder.SetActive(true);
            fogonazo.SetActive(true);
            fogonazo.transform.localScale = new Vector3(2, 2, 1);
            fogonazo.transform.DOScale(0, 0.6f);
            fogonazo.transform.DORotate(new Vector3(0, 0, 720), 0.6f, RotateMode.LocalAxisAdd);
            Sequence s2 = DOTween.Sequence();
            s2.Append(fogonazo.GetComponent <SpriteRenderer>().DOColor(new Color(1, 1, 1, 0.8f), 0.2f));
            s2.Append(fogonazo.GetComponent <SpriteRenderer>().DOColor(new Color(1, 1, 1, 0), 0.4f));
            Invoke("QuitarFogonazo", 0.6f);
            estadoPlayer  = EstadoPlayer.inmune;
            poderActivado = true;
            audios[AUDIO_PODER].Play();
            gm.ActivarPoder();
        }
    }