Пример #1
0
    private void OnGUI()
    {
        if (arrayKeys == null)
        {
            return;
        }

        if (arrayKeys.Length == 0)
        {
            return;
        }

        for (int i = 0; i < arrayKeys.Length; i++)
        {
            int              index   = i;
            string           key     = arrayKeys[index];
            InventoryElement element = _inventoryControl.GetByKey(key);

            GUI.Box(GetRect(index, 50, 75), GetContent(element));
            GUI.Box(GetRect(index, 150, 220), element.elementScript.elementSprite.texture);

            if (GUI.Button(GetRect(index, 400, 30), "Inc " + key))
            {
                _inventoryControl.IncCountByKey(key);
            }
        }
    }