Exemple #1
0
    bool PerkRequirementsMet()
    {
        if (!_perkDatabase.Contains(newPerkID))
        {
            Debug.LogError("Perk with ID " + newPerkID + " does not exist in the database.");
            return(false);
        }

        if (itemReqPerkIDs.Contains(newPerkID))
        {
            Debug.LogError("This perk has already been added.");
            return(false);
        }

        return(true);
    }
Exemple #2
0
    public void UpdateInfo(Race race, PerkDatabase perks)
    {
        icon.sprite      = Resources.Load(race.RaceIconPath) as Sprite;
        header.text      = race.RaceName;
        description.text = File.ReadAllText(Application.dataPath + "/StreamingAssets" + race.RaceDescPath);

        // Show the race traits:
        traits.text = "Bonus Trait(s): \n";
        if (race.RacePerks == null || race.RacePerks.Count == 0)
        {
            return;
        }

        for (int i = 0; i < race.RacePerks.Count; i++)
        {
            if (perks.Contains(race.RacePerks[i]))
            {
                traits.text += perks.perk(race.RacePerks[i]).PerkName + "\n";
            }
        }
    }