示例#1
0
    void Start()
    {
        Aguia  = GameObject.Find("Aguia");
        Mamute = GameObject.Find("Mamute");
        Peixe  = GameObject.Find("Peixe");

        AguiaPrefab  = GameObject.Find("Aguia2");
        MamutePrefab = GameObject.Find("Mamute2");
        PeixePrefab  = GameObject.Find("Peixe2");

        AguiaPrefab.SetActive(true);
        MamutePrefab.SetActive(false);
        PeixePrefab.SetActive(false);

        ultimo_Monstro_Escolhido = "Aguia";
        UltimoMonstroEscolhido();


        banco_active = false;
        //A seta que aponta para o lado Right é desativada
        SetaRight.SetActive(false);
        //A Variavel de controle de animação da camera (Estado) é zerada, ou seja modo Estatico
        currentCam = 0;
        monster    = 1;

        MoveToPosition();

        LayerOFtextBD();

        itensController = GameObject.Find("Itens").GetComponent <ItensController>();
    }
示例#2
0
    public void Click_Voltar()
    {
        AguiaPrefab.SetActive(true);
        PeixePrefab.SetActive(true);
        MamutePrefab.SetActive(true);

        Application.LoadLevel("MAIN_MENU");
    }
	// Update is called once per frame
	void Update () {

        vidaEnemy = Enemie.gameObject.GetComponent<UIEnemy>().enemyLife;

        if (monstroAtivo == "Aguia")
        {

            vidaPlayer = Aguia.GetComponent<AguiaBehaviour>().battleLife;

        }
        else if (monstroAtivo == "Mamute")
        {

            vidaPlayer = Mamute.GetComponent<MamuteBehaviour>().battleLife;

        }
        else
        {

            vidaPlayer = Peixe.GetComponent<PeixeBehaviour>().battleLife;

        }

        //VERIFICAR A DERROTA
        if (vidaEnemy <= 0)
        {
            Aguia.GetComponent<AguiaBehaviour>().AguiaPrefab.SetActive(false);
            Mamute.GetComponent<MamuteBehaviour>().MamutePrefab.SetActive(false);
            Peixe.GetComponent<PeixeBehaviour>().peixePrefab.SetActive(false);

            Peixe.GetComponent<PeixeBehaviour>().UI.SetActive(false);
            Aguia.GetComponent<AguiaBehaviour>().UI.SetActive(false);
            Mamute.GetComponent<MamuteBehaviour>().UI.SetActive(false);

            HabAtk.SetActive(false);
            HabDef.SetActive(false);

            Peixe.GetComponent<PeixeBehaviour>().load = false;
            Aguia.GetComponent<AguiaBehaviour>().load = false;
            Mamute.GetComponent<MamuteBehaviour>().load = false;


            Application.LoadLevel("GAME_OVER");

        }

        else if (vidaPlayer <= 0)
        {
            Aguia.GetComponent<AguiaBehaviour>().AguiaPrefab.SetActive(false);
            Mamute.GetComponent<MamuteBehaviour>().MamutePrefab.SetActive(false);
            Peixe.GetComponent<PeixeBehaviour>().peixePrefab.SetActive(false);

            Peixe.GetComponent<PeixeBehaviour>().UI.SetActive(false);
            Aguia.GetComponent<AguiaBehaviour>().UI.SetActive(false);
            Mamute.GetComponent<MamuteBehaviour>().UI.SetActive(false);

            HabAtk.SetActive(false);
            HabDef.SetActive(false);

            Peixe.GetComponent<PeixeBehaviour>().load = false;
            Aguia.GetComponent<AguiaBehaviour>().load = false;
            Mamute.GetComponent<MamuteBehaviour>().load = false;

           
            Application.LoadLevel("GAME_OVER");
        }

        //====================== VERIFICAR A DERROA FIM

        if (Input.GetKey(KeyCode.Escape))
        {
            Aguia.GetComponent<AguiaBehaviour>().AguiaPrefab.SetActive(true);
            Mamute.GetComponent<MamuteBehaviour>().MamutePrefab.SetActive(true);
            Peixe.GetComponent<PeixeBehaviour>().peixePrefab.SetActive(true);

            Peixe.GetComponent<PeixeBehaviour>().UI.SetActive(true);
            Aguia.GetComponent<AguiaBehaviour>().UI.SetActive(true);
            Mamute.GetComponent<MamuteBehaviour>().UI.SetActive(true);

            HabAtk.SetActive(true);
            HabDef.SetActive(true);

            Peixe.GetComponent<PeixeBehaviour>().load = false;
            Aguia.GetComponent<AguiaBehaviour>().load = false;
            Mamute.GetComponent<MamuteBehaviour>().load = false;

            Application.LoadLevel("LABORATORIO");
        }

        /*TUDO NOVO*/
        if (pressletters == true)
        {
            HabAtk.SetActive(false);
            HabDef.SetActive(false);
            PressLetters();

            //Essa operaçao serve para começar o timer
            if (clicked == false && timerLetters > 0)
            {

                timerLetters -= Time.deltaTime;

            }
            //Essa operaçao sera verdeira se o jogador nao conseguir clicar em todas as letras
            if (clicked == false && timerLetters <= 0)
            {

                if (primeiroJogador == true)
                {
                    penaltyAtk = penaltyAtk + 2;
                }
                if (primeiroJogador == false)
                {
                    penaltyDef = penaltyDef + 2;
                }

                SetLetters();
                timerLetters = 4.0f;
                pressletters = false;
                clickControl = 0;
            }

            //Essa operacao serve para quando o jogador conseguir clicar em todas as letras
            if (clickControl > 6 && clicked == true)
            {
                clickControl = 0;
                timerLetters = 4.0f;
                SetLetters();
                pressletters = false;
            }

        }
        if (pressButton == false && pressletters == false)
        {

            if (atkPress == 1)
            {
                if (monstroAtivo == "Aguia")
                {
                    AguiaPrefab.GetComponent<Animator>().SetInteger("animCondition", 1);
                }
                else if (monstroAtivo == "Peixe")
                {
                    PeixePrefab.GetComponent<Animator>().SetInteger("animCondition", 1);
                }
                else if (monstroAtivo == "Mamute")
                {
                    MamutePrefab.GetComponent<Animator>().SetInteger("animCondition", 1);
                }
                atk1++;
                round++;
                atkPress = 0;

            }
            else if (atkPress == 2)
            {
                if (monstroAtivo == "Aguia")
                {
                    AguiaPrefab.GetComponent<Animator>().SetInteger("animCondition", 2);
                }
                else if (monstroAtivo == "Peixe")
                {
                    PeixePrefab.GetComponent<Animator>().SetInteger("animCondition", 2);
                }
                else if (monstroAtivo == "Mamute")
                {
                    MamutePrefab.GetComponent<Animator>().SetInteger("animCondition", 2);
                }
                atk2++;
                round++;
                atkPress = 0;
            }


            if (defPress == 3)
            {
                if (monstroAtivo == "Aguia")
                {
                    AguiaPrefab.GetComponent<Animator>().SetInteger("animCondition", 3);
                }
                else if (monstroAtivo == "Peixe")
                {
                    PeixePrefab.GetComponent<Animator>().SetInteger("animCondition", 3);
                }
                else if (monstroAtivo == "Mamute")
                {
                    MamutePrefab.GetComponent<Animator>().SetInteger("animCondition", 3);
                }
                def1++;
                round++;
                defPress = 0;

            }
            else if (defPress == 4)
            {
                if (monstroAtivo == "Aguia")
                {
                    AguiaPrefab.GetComponent<Animator>().SetInteger("animCondition", 4);
                }
                else if (monstroAtivo == "Peixe")
                {
                    PeixePrefab.GetComponent<Animator>().SetInteger("animCondition", 4);
                }
                else if (monstroAtivo == "Mamute")
                {
                    MamutePrefab.GetComponent<Animator>().SetInteger("animCondition", 4);
                }
                def2++;
                round++;
                defPress = 0;
            }
        }

    }