private void UpdatePlantPageUI() { SetAllSlotsActive(); JournalPlantEntry cTop = pages[currPage].top; JournalPlantEntry cMid = pages[currPage].mid; JournalPlantEntry cBot = pages[currPage].bottom; if (cTop != null) { imgSlots[0].sprite = cTop.unlocked ? cTop.unlockedImage : cTop.lockedImage; nameSlots[0].text = cTop.unlocked ? cTop.name : undiscovered; descSlots[0].text = cTop.unlocked ? cTop.text : undiscovered; } else { imgSlots[0].gameObject.SetActive(false); descSlots[0].gameObject.SetActive(false); nameSlots[0].gameObject.SetActive(false); backgrounds[0].SetActive(false); } if (cMid != null) { imgSlots[1].sprite = cMid.unlocked ? cMid.unlockedImage : cMid.lockedImage; nameSlots[1].text = cMid.unlocked ? cMid.name : undiscovered; descSlots[1].text = cMid.unlocked ? cMid.text : undiscovered; } else { imgSlots[1].gameObject.SetActive(false); descSlots[1].gameObject.SetActive(false); nameSlots[1].gameObject.SetActive(false); backgrounds[1].SetActive(false); } if (cBot != null) { imgSlots[2].sprite = cBot.unlocked ? cBot.unlockedImage : cBot.lockedImage; nameSlots[2].text = cBot.unlocked ? cBot.name : undiscovered; descSlots[2].text = cBot.unlocked ? cBot.text : undiscovered; } else { imgSlots[2].gameObject.SetActive(false); descSlots[2].gameObject.SetActive(false); nameSlots[2].gameObject.SetActive(false); backgrounds[2].SetActive(false); } pageNum.text = (currPage + 1).ToString(); }
private void SetupPlantObject(JournalEntry toCast) { JournalPlantEntry entry = (JournalPlantEntry)toCast; this.GetComponent <SpriteRenderer>().sprite = entry.unlockedImage; }