Beispiel #1
0
        private void AddButtons()
        {
            Debug.Log("Refreshig");
            Debug.Log(_player.BaseCannonFragments.Count + " + " + _player.Barrels.Count);

            GameObject butt = Resources.Load <GameObject>("Prefabs/Menu/Inventory/Item_Button");

            Debug.Log(_player.BaseCannonFragments.Count);
            for (int i = 0; i < _player.BaseCannonFragments.Count; i++)
            {
                GameObject button       = Instantiate(butt, contentPanel, false);
                ItemButton sampleButton = button.GetComponent <ItemButton>();
                sampleButton.SetUp(_player.BaseCannonFragments[i], null, _inventoryName, _inventoryText, _resolver);
                sampleButton.SetPicture();
                _addedButtons.Add(button);
            }

            for (int i = 0; i < _player.Barrels.Count; i++)
            {
                Debug.Log(_player.Barrels[i].DamageMultiplier);
                GameObject button       = Instantiate(butt, contentPanel, false);
                ItemButton sampleButton = button.GetComponent <ItemButton>();
                sampleButton.SetUp(null, _player.Barrels[i], _inventoryName, _inventoryText, _resolver);
                sampleButton.SetPicture();
                _addedButtons.Add(button);
            }
        }