Ejemplo n.º 1
0
    private void PopulateInventory(PlayerInventoryDetails inventoryList)
    {
        ClearInventory();

        cashingInventoryList = inventoryList;



        foreach (var item in inventoryList.playerInventoryItems)
        {
            CreateInventoryItem(item);
        }
    }
Ejemplo n.º 2
0
    // optimaze this operation with  object pool unity training shop ui
    private void ClearInventory()
    {
        cashingInventoryList = null;

        Debug.Log("<color=red> optimazation: </color> <color=yellow> ClearInventory() , CreateInventoryItem( Item item) optimaze these operation with  object pool unity training shop ui</color>");
        if (_scrollViewContent == null)
        {
            _scrollViewContent = _playerInventoryWindow.transform.Find("scrollview/Viewport/Content");
        }

        foreach (Transform child in _scrollViewContent)
        {
            Destroy(child.gameObject);
        }
    }