Improved code usabililty of upgrade unlocks

This commit is contained in:
Pasha Bibko
2026-04-14 15:38:20 +01:00
parent 31844bbeee
commit 41431b9aae
4 changed files with 132 additions and 52 deletions

View File

@@ -88,7 +88,7 @@ namespace Fruitomation.Game
}
}
public class UpgradeManager : MonoBehaviour
public static class UpgradeManager
{
private static string Filepath => Path.Combine(Application.persistentDataPath, "upgrades.json");
private static UnlockedUpgrades CurrentUpgrades;
@@ -119,10 +119,6 @@ namespace Fruitomation.Game
File.WriteAllText(Filepath, json);
}
public void UnlockBasicUpgrade(string id)
{
BasicUpgrade upgrade = Enum.Parse<BasicUpgrade>(id);
CurrentUpgrades.Unlock(upgrade);
}
public static void Unlock(BasicUpgrade upgrade) => CurrentUpgrades.Unlock(upgrade);
}
}