[Puzzles][Input] Update input handling to not mistakingly miss frames. Add debug frame input debugging.
This commit is contained in:
@@ -3,7 +3,25 @@ using System.Collections.Generic;
|
||||
|
||||
public class PuzzleManager : MonoBehaviour
|
||||
{
|
||||
public static PuzzleManager Instance { get; private set; }
|
||||
private static PuzzleManager _instance;
|
||||
public static PuzzleManager Instance
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_instance == null)
|
||||
{
|
||||
_instance = FindAnyObjectByType<PuzzleManager>();
|
||||
if (_instance == null)
|
||||
{
|
||||
var go = new GameObject("PuzzleManager");
|
||||
_instance = go.AddComponent<PuzzleManager>();
|
||||
DontDestroyOnLoad(go);
|
||||
}
|
||||
}
|
||||
return _instance;
|
||||
}
|
||||
}
|
||||
|
||||
private HashSet<PuzzleStepSO> completedSteps = new HashSet<PuzzleStepSO>();
|
||||
private HashSet<PuzzleStepSO> unlockedSteps = new HashSet<PuzzleStepSO>();
|
||||
|
||||
@@ -15,12 +33,12 @@ public class PuzzleManager : MonoBehaviour
|
||||
|
||||
void Awake()
|
||||
{
|
||||
if (Instance != null && Instance != this)
|
||||
if (_instance != null && _instance != this)
|
||||
{
|
||||
Destroy(gameObject);
|
||||
return;
|
||||
}
|
||||
Instance = this;
|
||||
_instance = this;
|
||||
DontDestroyOnLoad(gameObject);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user