Esempio n. 1
0
 public void getOtherInput()
 {
     if (Input.GetKeyDown(KeyCode.M))
     {
         if (!activeMap)
         {
             mapAnim.SetBool("CloseMap", true);
             Invoke("MapIconToggle", 1.25f);
             map.SetActive(true);
             health.SetActive(false);
             fires.SetActive(false);
         }
         else
         {
             mapAnim.SetBool("CloseMap", false);
             Invoke("MapIconToggle", 0.5f);
             map.SetActive(false);
             health.SetActive(true);
             fires.SetActive(true);
         }
         activeMap = !activeMap;
         FindObjectOfType <AudioManager>().MapToggleSound();
     }
     if (Input.GetKeyDown(KeyCode.J))
     {
         inventory.ChangeActive(inventory.fires[0], 0);
     }
     if (Input.GetKeyDown(KeyCode.K))
     {
         if (inventory.fires[1] != null && inventory.CheckResource(1))
         {
             inventory.ChangeActive(inventory.fires[1], 1);
         }
         else
         {
             inventory.EmptyAnimation(1);
         }
     }
     if (Input.GetKeyDown(KeyCode.L))
     {
         if (inventory.fires[2] != null && inventory.CheckResource(2))
         {
             inventory.ChangeActive(inventory.fires[2], 2);
         }
         else
         {
             inventory.EmptyAnimation(2);
         }
     }
 }
Esempio n. 2
0
 private void Update()
 {
     if (timeBtwUpdate <= 0)
     {
         if (pr.xp >= xpPerSecond)
         {
             pr.LoseXp(xpPerSecond);
         }
         else
         {
             inv.ChangeActive(inv.fires[0], 0);
         }
         timeBtwUpdate = 1;
     }
     else
     {
         timeBtwUpdate -= Time.deltaTime;
     }
 }