예제 #1
0
 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();
 }
예제 #2
0
    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);
        }
    }
예제 #3
0
 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));
     }
 }
예제 #4
0
 public void Setup(LivingThing currentItem)
 {
     thing = currentItem;
     theNameOfThing.text = thing.getName();
     livingThingButton.onClick.AddListener(delegate { EntityOnClick(thing); });
 }