Esempio n. 1
0
    private void DrawGiveItemDropdown()
    {
        List <Item>   itemPrefabs  = ItemManager.Instance.ToList();
        List <string> itemNames    = itemPrefabs.Select(item => item.name).ToList();
        int           selectedItem = -1;

        _giveItemDropdownExpanded = GUICustom.Dropdown(NextControlRect(), "Give Item", _giveItemDropdownExpanded, itemNames, ref selectedItem);
        if (selectedItem != -1)
        {
            Item   item   = Instantiate(itemPrefabs[selectedItem]);
            Player player = Main.Instance.player;
            if (item && player)
            {
                item.Apply(player.gameObject);
            }
            _giveItemDropdownExpanded = true;
        }
    }
Esempio n. 2
0
    private void DrawGUI()
    {
        GUI.Box(new Rect(10, 30, _controlWidth + 20, _lastLine), "");

        DrawTeleportToStairsButton();
        DrawGiveItemDropdown();
        DrawGodModeCheckbox();
        DrawHealButton();

        GUICustom.Separator(NextControlRect(10));

        DrawLevelGeneratorSetSeed();

        GUICustom.Separator(NextControlRect(10));

        DrawToggleDoors();
        DrawShowFogOfWarCheckbox();
    }