void modoBatalha()
 {
     if (GameController.getCurrentState() == GAME_STATE.IN_BATTLE)
     {
         if (Input.GetKeyDown(KeyCode.Z) && ValidaTeclas.getCurrentStateButton() == BUTTON_STATE.IN_DEFFAULT)
         {
             Debug.Log("atacar");
             pararSons();
             playerAttack.Play();
             fight(highAttack);
         }
         if (Input.GetKeyDown(KeyCode.X) && activeItem == false && ValidaTeclas.getCurrentStateButton() == BUTTON_STATE.IN_DEFFAULT)
         {
             pararSons();
             activeItem = true;
             Debug.Log("usar item");
         }
         if (Input.GetKeyDown(KeyCode.C) && ValidaTeclas.getCurrentStateButton() == BUTTON_STATE.IN_DEFFAULT)
         {
             pararSons();
             Debug.Log("fugir");
             fugir();
         }
     }
 }
 // Update is called once per frame
 void Update()
 {
     if (Input.GetKeyDown(KeyCode.I))
     {
         if (GameController.getCurrentState() == GAME_STATE.IN_EXPLORATION && GameController.getCurrentState() != GAME_STATE.IN_DEAD)
         {
             foreach (AudioSource objeto in Object.FindObjectsOfType(typeof(AudioSource)))
             {
                 if (objeto.tag != "Som")
                 {
                     objeto.Stop();
                 }
             }
             GameController.changeState(GAME_STATE.IN_INVENTORY);
             inventory.gameObject.SetActive(!inventory.gameObject.activeSelf);
             positionTarget = new Vector3(target.transform.position.x, target.transform.position.y, transform.position.z);
             Vector3 tempPosition = Vector3.Lerp(transform.position, positionTarget, 5);
             transform.position = tempPosition;
         }
         else if (GameController.getCurrentState() == GAME_STATE.IN_INVENTORY)
         {
             foreach (AudioSource objeto in Object.FindObjectsOfType(typeof(AudioSource)))
             {
                 if (objeto.tag != "Som")
                 {
                     objeto.Stop();
                 }
             }
             inventory.gameObject.SetActive(!inventory.gameObject.activeSelf);
             GameController.changeState(GAME_STATE.IN_EXPLORATION);
         }
     }
     if (Input.GetKeyDown(KeyCode.X))
     {
         if (GameController.getCurrentState() != GAME_STATE.IN_DEAD && ValidaTeclas.getCurrentStateButton() == BUTTON_STATE.IN_DEFFAULT)
         {
             if (GameController.getCurrentState() == GAME_STATE.IN_BATTLE || GameController.getCurrentState() == GAME_STATE.IN_BOSS)
             {
                 foreach (AudioSource objeto in Object.FindObjectsOfType(typeof(AudioSource)))
                 {
                     if (objeto.tag != "Som")
                     {
                         objeto.Stop();
                     }
                 }
                 inventory.gameObject.SetActive(!inventory.gameObject.activeSelf);
                 positionTarget = new Vector3(target.transform.position.x, target.transform.position.y, transform.position.z);
                 Vector3 tempPosition = Vector3.Lerp(transform.position, positionTarget, 5);
                 transform.position = tempPosition;
             }
         }
     }
 }
Beispiel #3
0
 void modoBattle()
 {
     if (GameController.getCurrentState() == GAME_STATE.IN_BOSS)
     {
         if (Input.GetKeyDown(KeyCode.Z) && ValidaTeclas.getCurrentStateButton() == BUTTON_STATE.IN_DEFFAULT)
         {
             Debug.Log("Atacar");
             pararSons();
             playerAttack.Play();
             fightBoss(highAttack);
         }
         if (Input.GetKeyDown(KeyCode.X) && activeItem == false && ValidaTeclas.getCurrentStateButton() == BUTTON_STATE.IN_DEFFAULT)
         {
             pararSons();
             Debug.Log("Usar item");
         }
     }
 }