Exemplo n.º 1
0
        public void OpenMenu(LocationMenuBuilderDB locationMenuBuilder, TownNodeList townNode)
        {
            // Activate menu
            background.enabled = true;
            menuPanel.gameObject.SetActive(true);

            // Cache current menu info
            menuBuilderDB = locationMenuBuilder;
            node          = townNode;
            currentTab    = 0;

            // Pull shopkeeper data
            GameObject _feedeeGO = feedeeManager.GetFeedeeAtNode(townNode);

            if (_feedeeGO != null)
            {
                npcSlotUI.SlotSetup(_feedeeGO, townNode.ToString());
                npcInfoDescription.SetCharacterInfo(_feedeeGO);
                npcSlotButton.onClick.AddListener(() => npcInfoDescription.SetCharacterInfo(_feedeeGO));
                NPCInfo npcInfo = _feedeeGO.GetComponent <NPCInfo>();
                choiceButtons[0].onClick.AddListener(() => npcInfo.TalkToNPC());
                choiceButtons[1].interactable = false;
                choiceButtons[2].interactable = false;
                choiceButtons[3].interactable = false;
            }

            // Label tabs and populate menu items
            SetupMenuTabs();
            slotCoroutine = StartCoroutine(SetupMenuSlots(currentTab));
        }