Second draft of the consolidated card system
This commit is contained in:
@@ -15,24 +15,7 @@ namespace Data.CardSystem
|
||||
{
|
||||
private static CardSystemManager _instance;
|
||||
private static bool _isQuitting = false;
|
||||
|
||||
public static CardSystemManager Instance
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_instance == null && Application.isPlaying && !_isQuitting)
|
||||
{
|
||||
_instance = FindAnyObjectByType<CardSystemManager>();
|
||||
if (_instance == null)
|
||||
{
|
||||
var go = new GameObject("CardSystemManager");
|
||||
_instance = go.AddComponent<CardSystemManager>();
|
||||
DontDestroyOnLoad(go);
|
||||
}
|
||||
}
|
||||
return _instance;
|
||||
}
|
||||
}
|
||||
public static CardSystemManager Instance => _instance;
|
||||
|
||||
[Header("Card Collection")]
|
||||
[SerializeField] private List<CardDefinition> availableCards = new List<CardDefinition>();
|
||||
@@ -51,14 +34,7 @@ namespace Data.CardSystem
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
if (_instance != null && _instance != this)
|
||||
{
|
||||
Destroy(gameObject);
|
||||
return;
|
||||
}
|
||||
|
||||
_instance = this;
|
||||
DontDestroyOnLoad(gameObject);
|
||||
|
||||
// Build lookup dictionary
|
||||
BuildDefinitionLookup();
|
||||
|
||||
Reference in New Issue
Block a user