public void OnTriggerEnter(Collider other) { if (other.tag == "Player") { Player = other.gameObject.GetComponent <Adventurer>(); Player.GetComponent <Movement>().enabled = false; UI.ItemUI.enabled = true; if (weapon != null) { UI.ItemNameLabel.text = weapon.name; UI.ItemDescLabel.text = weapon.description; UI.EquipButton.onClick.AddListener(EquipItem); UI.DiscardButton.onClick.AddListener(DiscardItem); } else if (armor != null) { UI.ItemNameLabel.text = armor.name; UI.ItemDescLabel.text = armor.description; UI.EquipButton.onClick.AddListener(EquipItem); UI.DiscardButton.onClick.AddListener(DiscardItem); } } }
public void EquipItem() { if (weapon != null) { Player.weapon = weapon; } else if (armor != null) { Player.armor = armor; } Player.ResetHealth(); Player.GetComponent <Movement>().enabled = true; UI.ItemUI.enabled = false; Destroy(gameObject); }
private void SetDaysToComplete(int daysToComplete) { this.daysToComplete.text = _adventurer.GetComponent <Adventurer>().quest.name + "\n" + "Days To Complete" + "\n" + daysToComplete.ToString(); }