Exemplo n.º 1
0
    //Método para coletar a arma,
    private void OnTriggerEnter(Collider other)
    {
        Fight player = other.GetComponent <Fight>();

        if (other.transform.tag == "Player")
        {
            player.AddWeapon(weapon);
            FindObjectOfType <UIManager>().SetMessage(weapon.messageTela);
            FindObjectOfType <UIManager>().UpdateUI();
            GameManager.inventory.AddWeapon(weapon);
            ObjectDestroy.SetActive(false);
        }
        Debug.Log(other);
    }
Exemplo n.º 2
0
 public void UseItem()
 {
     if (itens[cursorIndex].weapon != null)
     {
         player.AddWeapon(itens[cursorIndex].weapon);
     }
     else if (itens[cursorIndex].consumableItem != null)
     {
         player.UseItem(itens[cursorIndex].consumableItem);
         inventory.RemoveItem(itens[cursorIndex].consumableItem);
         cursorIndex = 0;
         RefreshItensList();
         UpdateItensList(2);
         scrollVertical.value = 1;
     }
     else if (itens[cursorIndex].armor != null)
     {
         player.AddArmor(itens[cursorIndex].armor);
     }
     UpdateAtributes();
     UpdateDescrition();
 }