/// <summary> /// Has a specific upgrade for this TowerModel been unlocked already? /// </summary> /// <param name="path">Upgrade path</param> /// <param name="tier">Tier of upgrade</param> public static bool?IsUpgradeUnlocked(this TowerModel towerModel, int path, int tier) { UpgradeModel upgradeModel = towerModel.GetUpgrade(path, tier); return(Game.instance?.GetBtd6Player()?.HasUpgrade(upgradeModel?.name)); }
/// <summary> /// Check if an upgrade has been applied /// </summary> /// <param name="path"></param> /// <param name="tier"></param> public static bool HasUpgrade(this TowerModel towerModel, int path, int tier) { return(HasUpgrade(towerModel, towerModel.GetUpgrade(path, tier))); }