public void CheckDiscoveredStatus(PeriodicTableItem a_Element) { for (int i = 0; i < m_Items.Count; i++) { if (m_Items[i].GetComponent <PeriodicTableDisplay>().GetItem().GetSymbol() == a_Element.GetSymbol()) { if (m_Items[i].GetComponent <PeriodicTableDisplay>().GetItem().GetDiscoveredStatus() == false) { m_Items[i].GetComponent <PeriodicTableDisplay>().SetDiscovered(true); } } } }
public void AddElement(PeriodicTableItem a_Element, Transform transform) { GameObject element = Instantiate(m_ElementPrefab, transform); PeriodicTableDisplay display = element.GetComponent <PeriodicTableDisplay>(); if (display != null) { display.Setup(a_Element); } m_Items.Add(element); }
public void Setup(PeriodicTableItem a_Item) { m_Item = a_Item; if (m_Item.GetDiscoveredStatus()) { m_Symbol.text = a_Item.GetSymbol(); m_Number.text = a_Item.GetNumber().ToString(); GetComponent <Image>().color = m_Item.GetColor(); } else { m_Symbol.text = "?"; m_Number.text = a_Item.GetNumber().ToString(); GetComponent <Image>().color = Color.grey; } }