// Update is called once per frame void Update() { pItem = allRelicsObject.GetComponent <AllSoulItems>().items[currentSoul]; if (onItem) { if (Input.GetKeyDown(KeyCode.LeftArrow)) { currentSoul--; if (0 > currentSoul) { currentSoul = allRelicsObject.GetComponent <AllSoulItems>().items.Length - 1; } } if (Input.GetKeyDown(KeyCode.RightArrow)) { currentSoul++; if (allRelicsObject.GetComponent <AllSoulItems>().items.Length <= currentSoul) { currentSoul = 0; } } if (Input.GetKeyDown(KeyCode.F)) { purchaseItem(); } } }
private void SetupSoulInformation(SoulItem soulItem) { Description.text = soulItem.Description; Name.text = soulItem.Name; Avatar.sprite = soulItem.Avatar; SetupUseButton(soulItem.CanBeUsed); SetupDestroyButton(soulItem.CanBeDestroyed); }
public void SetSoulItem(SoulItem _soulItem, Action OnSoulClick = null) { soulItem = _soulItem; MainImage.sprite = soulItem.Avatar; if (OnSoulClick != null) { SoulButton.onClick.AddListener(() => OnSoulClick()); } }