Пример #1
0
 public void CheckPoinColunaGrande(Transform coluna)
 {
     dentroColuna = coluna.gameObject.GetComponent <SpriteRenderer>();
     PlayerLife_Oleo.playerLife_oleo = 3;
     PlayerLife_Oleo.UpdateLives();
     spawnPoint = coluna.position;
 }
    // Update is called once per frame
    void Update()
    {
        if (habilidadeOleo == 0)
        {
            volatilizandoSom.Stop();
            volatilizando.Stop();
        }
        if (volatilizando.isPlaying)
        {
            tempoVolatil -= 1 * Time.deltaTime;
        }
        if (tempoVolatil <= 0)
        {
            habilidadeOleo--;
            tempoVolatil = 2;
            UpdateOleo();
        }

        if (Input.GetButtonDown("Fire1") && !Configuration.isPaused)
        {
            if (onColunaPequena)
            {
                checkPointPequenoSom.Play();
                //checkpointOleo.CheckPoinColunaPequena(colunaTransform);
                dentroColuna.color = new Color(0.5f, 0.4f, 0.1f, 1f);
                habilidadeOleo     = 5;
                if (PlayerLife_Oleo.playerLife_oleo > 0)
                {
                    PlayerLife_Oleo.playerLife_oleo--;
                    PlayerLife_Oleo.UpdateLives();
                }
                UpdateOleo();
            }
            else if (onColunaGrande)
            {
                checkPointGrandeSom.Play();
                checkpointOleo.CheckPoinColunaGrande(colunaTransform);
                colunaCollider.enabled = false;
                dentroColuna.enabled   = false;
            }
            else
            {
                animator.SetBool("Power", true);
                if (habilidadeOleo >= 0)
                {
                    tempoVolatil = 2;
                }
            }
        }
    }
Пример #3
0
 void UpdateDamage()
 {
     if (lifeCounter <= 0 && lifeUpdate == 0)
     {
         playerDefeatOleo.DefeatedByDirty();
     }
     if (lifeCounter < 10 && lifeUpdate == 1)
     {
         PlayerLife_Oleo.playerLife_oleo = 1;
         PlayerLife_Oleo.UpdateLives();
     }
     else if (lifeCounter < 20 && lifeUpdate == 2)
     {
         PlayerLife_Oleo.playerLife_oleo = 2;
         PlayerLife_Oleo.UpdateLives();
     }
 }