Пример #1
0
    public void ShowInventoryForSelling()
    {
        if (InventoryParent.transform.childCount == 1)
        {
            Start();
        }
        for (int i = 1; i < InventoryParent.transform.childCount; i++)
        {
            var displayer = InventoryParent.transform.GetChild(i).GetComponent <ItemDisplayer>();
            displayer.ActionButton.onClick.RemoveAllListeners();
            displayer.ActionButton.onClick.AddListener(() => { InventorySystem.SellItem(displayer.Name.text); UpdateInventory(); });
            displayer.ActionButton.transform.GetChild(0).GetComponent <Text>().text = "Sell";
            displayer.ActionButton.gameObject.SetActive(true);
        }

        CloseInventoryButton.onClick.RemoveAllListeners();
        CloseInventoryButton.onClick.AddListener(() => InventorySystem.EndFullfillment());
        CloseInventoryButton.transform.GetChild(0).GetComponent <Text>().text = "Stop Selling";

        StopAllCoroutines();
        StartCoroutine(MoveIn());
    }