Пример #1
0
    public void UpdateMenu(ItemMenuType type, Dictionary <String, String> functionList)
    {
        switch (type)
        {
        case ItemMenuType.PickupPanel:
            pickupPanel.Find("Text").GetComponent <Text>().text = functionList["Text"];
            break;

        case ItemMenuType.LockedPanel:
            lockedPanel.Find("Text").GetComponent <Text>().text = functionList["Text"];
            break;

        case ItemMenuType.UsePanel:
            usePanel.Find("Function 1").GetComponent <Text>().text = functionList["Function 1"];
            usePanel.Find("Exit").GetComponent <Text>().text       = functionList["Exit"];

            if (!functionList.ContainsKey("Function 2"))
            {
                usePanel.Find("Function 2").gameObject.SetActive(false);
            }
            else
            {
                usePanel.Find("Function 2").GetComponent <Text>().text = functionList["Function 2"];
                usePanel.Find("Function 2").gameObject.SetActive(true);
            }
            break;
        }
    }
Пример #2
0
        public void ShowPanel(ref FlatPanel panel, ItemMenuType menuType)
        {
            if (panel.Controls.Count > 1)
            {
                panel.Controls.RemoveAt(1);
            }

            LayoutsDictionary layouts = new LayoutsDictionary();

            panel.Controls.Add(layouts.dictionary[(int)menuType]);
            panel.Controls[1].Left = 0;
        }
Пример #3
0
    public void ToggleDisplay(ItemMenuType type, bool turnOn)
    {
        switch (type)
        {
        case ItemMenuType.PickupPanel:
            pickupPanel.gameObject.SetActive(turnOn);
            break;

        case ItemMenuType.LockedPanel:
            lockedPanel.gameObject.SetActive(turnOn);
            break;

        case ItemMenuType.UsePanel:
            usePanel.gameObject.SetActive(turnOn);
            break;
        }
    }