Exemplo n.º 1
0
    private void OpenCurrentPartyPanel(ShopType shopType)
    {
        if (shopType == ShopType.Mercenaries)
        {
            if (partyBehaviour.heroParty.Count < 5)
            {
                partyBehaviour.AddCharacterToParty(currentlySelectedMercenary.name);

                ReturnToPromptScreen();

                return;
            }
        }

        itemPanel.SetActive(false);
        mercenaryPanel.SetActive(false);

        currentPartyPanel.SetActive(true);

        for (int i = 0; i < 5; i++)
        {
            if (i < partyBehaviour.heroParty.Count)
            {
                int index = i;

                currentPartyPanel.transform.GetChild(i).name = partyBehaviour.heroParty[i].name;
                currentPartyPanel.transform.GetChild(i).transform.GetChild(0).GetComponent <TextMeshProUGUI>().text = partyBehaviour.heroParty[i].name;
                currentPartyPanel.transform.GetChild(i).transform.GetChild(1).GetComponent <Image>().sprite         = partyBehaviour.heroParty[i].sprite;

                currentPartyPanel.transform.GetChild(i).transform.GetChild(2).GetComponent <Button>().interactable = true;
                currentPartyPanel.transform.GetChild(i).transform.GetChild(2).GetComponent <Button>().onClick.AddListener(delegate { EquipCurrentThing(shopType, partyBehaviour.heroParty[index], index); });
            }
            else if (i >= partyBehaviour.heroParty.Count)
            {
                currentPartyPanel.transform.GetChild(i).name = "Empty";
                currentPartyPanel.transform.GetChild(i).transform.GetChild(0).GetComponent <TextMeshProUGUI>().text = "Empty";
                currentPartyPanel.transform.GetChild(i).transform.GetChild(1).GetComponent <Image>().sprite         = null;
                currentPartyPanel.transform.GetChild(i).transform.GetChild(2).GetComponent <Button>().interactable  = false;
            }
        }
    }
Exemplo n.º 2
0
    public void BeginGame(HeroClass startingHero)
    {
        if (currentRound == 1 && currentTurn == 1)
        {
            gameBoardManager.StartRound();
            deckManager.StartRound();
            canvasManager.StartCoroutine("Transition", false);
            isRoundProgressing = true;
        }

        partyBehaviour.AddCharacterToParty(startingHero.name, 0);
    }