Added a way from the upgrades to game scene
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user