[Player][Interactions] Pulver moves to item and goes back. Item disappears, but in wrong order
This commit is contained in:
36
Assets/Scripts/GameManager.cs
Normal file
36
Assets/Scripts/GameManager.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class GameManager : MonoBehaviour
|
||||
{
|
||||
private static GameManager _instance;
|
||||
public static GameManager Instance
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_instance == null)
|
||||
{
|
||||
_instance = FindAnyObjectByType<GameManager>();
|
||||
if (_instance == null)
|
||||
{
|
||||
var go = new GameObject("GameManager");
|
||||
_instance = go.AddComponent<GameManager>();
|
||||
DontDestroyOnLoad(go);
|
||||
}
|
||||
}
|
||||
return _instance;
|
||||
}
|
||||
}
|
||||
|
||||
[Header("Game Settings")]
|
||||
public GameSettings gameSettings;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
_instance = this;
|
||||
DontDestroyOnLoad(gameObject);
|
||||
}
|
||||
|
||||
public float PlayerStopDistance => gameSettings != null ? gameSettings.playerStopDistance : 1.0f;
|
||||
public float FollowerPickupDelay => gameSettings != null ? gameSettings.followerPickupDelay : 0.2f;
|
||||
// Add more accessors as needed
|
||||
}
|
||||
Reference in New Issue
Block a user