예제 #1
0
    public void RefreshSelectedScenario()
    {
        if (selectedScenario.EnemyDeck == null)
        {
            throw new Exception("Scenario is not valid for the campaign");
        }

        mapDescriptionText.text      = selectedScenario.Map.Description;
        scenarioDescriptionText.text = selectedScenario.Description;

        //Creates the list of rules for the scenario
        GameManager.DestroyAllChildren(ruleListParent);
        ruleObjectList = new List <GameObject>();
        foreach (var rule in selectedScenario.Rules)
        {
            var ruleObject = Instantiate(ruleDisplayPrefab, ruleListParent.transform);
            ruleObject.GetComponent <RuleDisplayObject>().RefreshRuleDisplay(rule, _campaignManagerUI: this);
            ruleObjectList.Add(ruleObject);
        }

        enemyHeroNameText.text  = $"<b>Hero:</b> {selectedScenario.EnemyDeck.HeroCard.Name}";
        enemyClassNameText.text = $"<b>Class: </b>{selectedScenario.EnemyDeck.DeckClass.GetEnumDescription()}";

        GameManager.DestroyAllChildren(enemyHeroParent);
        GameManager.instance.libraryManager.CreateCardObject(selectedScenario.EnemyDeck.HeroCard, enemyHeroParent.transform, 0.35f);
        enemyDeckList.InitDeckListObject(selectedScenario.EnemyDeck, _campaignManagerUI: this, hideCards: true);
        enemyDeckDetailsArea.SetActive(false);

        GameManager.instance.mapGrid.RefreshGrid(selectedScenario.Map, selectedScenario.Id.Value);

        playButton.interactable = !loadedDeck.CampaignTracker.CompletedCampaign && selectedScenario.Id == loadedDeck.CampaignTracker.GetCurrentScenario().Id;
    }
예제 #2
0
 public void RefreshPlayerDetails()
 {
     playerDeckList.InitDeckListObject(loadedDeck, _campaignManagerUI: this);
     honourPointsText.text = $"<b>Honour Points:</b> {loadedDeck.CampaignTracker.HonourPoints}";
 }