public void EntityOnClick(LivingThing thing) { EntityScrollList.Definition.SetActive(true); EntityScrollList.Header.SetActive(true); EntityScrollList.NothingSelected.SetActive(false); GameObject.Find("EntityName").GetComponent <Text>().text = thing.getName(); GameObject.Find("EntityDef").GetComponent <Text>().text = thing.getDefinition(); }
private void OnMouseDown() { string name = livingThing.getName(); string description = livingThing.getDefinition(); GameObject.Find("PopupName").GetComponent <Text>().text = name; GameObject.Find("PopupDescription").GetComponent <Text>().text = description; if (!World.getExplored().Contains(livingThing)) { World.getExplored().Add(livingThing); } }
private void AddEntities() { pair.Clear(); for (int i = 0; i < itemList.Count; ++i) { LivingThing currentItem = itemList[i]; GameObject newItem = entityObject.GetObject(); newItem.transform.SetParent(contentPanel); EntityInfo element = newItem.GetComponent <EntityInfo>(); element.Setup(currentItem); pair.Add(new KeyValuePair <string, GameObject>(currentItem.getName(), newItem)); } }
public void Setup(LivingThing currentItem) { thing = currentItem; theNameOfThing.text = thing.getName(); livingThingButton.onClick.AddListener(delegate { EntityOnClick(thing); }); }