예제 #1
0
파일: DebugUI.cs 프로젝트: jaoel/LD44
    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;
        }
    }
예제 #2
0
파일: DebugUI.cs 프로젝트: jaoel/LD44
    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();
    }