Ejemplo n.º 1
0
    /// <summary>
    /// When hovering over an upgrade in the upgrade tree, show its stats
    /// </summary>
    /// <param name="instance"></param>
    public void ShowUpgradeTooltip(UpgradeInstance instance)
    {
        PositionTooltip();
        title.text = instance.upgrade.name;
        string lockedString = instance.isUnlocked ? "Already Unlocked\n\n" : "";

        description.text = lockedString + GetStatsString(instance.upgrade.ModifiersAffected);
    }
Ejemplo n.º 2
0
 /// <summary>
 /// Calculate which upgrades can be unlocked next and update them
 /// </summary>
 /// <param name="instance"></param>
 public bool ApplyUpgrade(UpgradeInstance instance)
 {
     if (PlayerStats.instance.GetUpgradePoints() > 0)
     {
         PlayerStats.instance.AddUpgrade(instance.upgrade);
         rims[instance.id].sprite = instance.upgrade.unlockedRimSprite;
         SetNeighborsUnlockable(instance.id);
         PlayerStats.instance.UseUpgradePoint();
         return(true);
     }
     return(false);
 }