예제 #1
0
 private void Awake()
 {
     craftingList = FindObjectOfType <CraftingList>();
     items        = Resources.LoadAll <Item>("Items");
     // Event listener for clicking on the building icon, sets the selected building to the current instance
     GetComponent <Button>().onClick.AddListener(onViewBuilding);
     Level = 1;
 }
예제 #2
0
    public void Setup(Item currentItem, CraftingList currentCraftingList)
    {
        item          = currentItem;
        nameText.text = item.name;
        icon.sprite   = item.icon;

        craftingList = currentCraftingList;
    }
예제 #3
0
    private void DrawRecipeListDisplay()
    {
        recipeListDisplay = new Rect(5, 5, position.width * 0.30f, position.height);
        GUILayout.BeginArea(recipeListDisplay);

        //Input field for a list of recipes
        selectedCraftingList = (CraftingList)EditorGUILayout.ObjectField(selectedCraftingList, typeof(CraftingList), false);

        if (selectedCraftingList != null)
        {
            //TODO: find a way to live update this list
            if (GUILayout.Button("UpdateList"))
            {
                DrawRecipesList();
            }
            recipeList?.DoLayoutList();
        }
        GUILayout.EndArea();
    }