Added a way from the upgrades to game scene

This commit is contained in:
Pasha Bibko
2026-04-14 15:57:10 +01:00
parent 41431b9aae
commit 6868788af7
5 changed files with 347 additions and 52 deletions

View File

@@ -4,6 +4,10 @@ using System.IO;
using System.Linq;
using System;
#if UNITY_EDITOR
using UnityEditor;
#endif // UNITY_EDITOR
namespace Fruitomation.Game
{
[Serializable] public enum BasicUpgrade
@@ -86,6 +90,11 @@ namespace Fruitomation.Game
{
Unlocks.Add(upgrade);
}
public bool IsUnlocked(BasicUpgrade upgrade)
{
return Unlocks.Contains(upgrade);
}
}
public static class UpgradeManager
@@ -120,5 +129,12 @@ namespace Fruitomation.Game
}
public static void Unlock(BasicUpgrade upgrade) => CurrentUpgrades.Unlock(upgrade);
public static bool Unlocked(BasicUpgrade upgrade) => CurrentUpgrades.IsUnlocked(upgrade);
#if UNITY_EDITOR
[MenuItem("Fruitomation/Reset Upgrades")]
#endif // UNITY_EDITOR
public static void ResetUpgrades() => CurrentUpgrades = new UnlockedUpgrades();
}
}