Пример #1
0
    void Update()
    {
        if (Player == Dados.PlayerIndice.Vazio)
        {
            return;
        }

        delayTempo += Time.deltaTime;

        if (Input.GetButtonDown(Player.ToString() + "RB") && delayTempo > delayBotao)//Próximo
        {
            delayTempo = 0;
            SFX.PlayOneShot(SomClick);
            ArmaSeguinte();
        }

        if (Input.GetButtonDown(Player.ToString() + "LB") && delayTempo > delayBotao)//Anterior
        {
            delayTempo = 0;
            SFX.PlayOneShot(SomClick);
            ArmaAnterior();
        }

        if (Input.GetButtonDown(Selecionados.VezLoja.ToString() + "Y"))
        {
            print("Upgrade da arma");
            if (ArmaNivel != Dados.ArmaNivel.Nivel5)
            {
                if (AutoSave.Sangue >= Dados.CustoNivel[(int)ArmaNivel + 1])
                {
                    AutoSave.AtualizarSangue(Dados.CustoNivel[(int)ArmaNivel + 1], false);
                    AutoSave.AtualizarArma(Personagem, Itens[indice].Arma);
                    AutoSave.AtualizarNivelArma(Itens[indice].Arma);
                    TrocaArma();
                    txtSangue.text = AutoSave.Sangue.ToString();
                }
            }
        }

        if (Input.GetButtonDown(Player.ToString() + "A") && delayTempo > delayBotao)//Selecionar Arma
        {
            delayTempo = 0;
            SFX.PlayOneShot(SomClick);
            alvoLoja.GetComponent <ControleDeArmas>().AtivarArma(Itens[indice].Arma, AutoSave.QualNivel(Itens[indice].Arma));
            TrocaArma();
        }

        if (Input.GetButtonDown(Selecionados.VezLoja.ToString() + "B"))
        {
            FecharLoja();
        }
    }