示例#1
0
    private void addCraftedToInventory(IBlueprint bp)
    {
        string loc = bp.getObjectLocation();

        Debug.Log("Loading crafted item from location " + loc);
        GameObject crafted = (GameObject)Instantiate((GameObject)Resources.Load(loc));

        ItemInfo crfItmInf = getItemInfo(crafted);

        Debug.Log("ItemInfo of Crafted: " + crfItmInf.itemName);

        if (!inventory.addItem(crfItmInf))
        {
            Debug.LogError("Crafted item wasnt added to inventory");
        }
        crafted.SetActive(false);
    }