Re-think singleton player idea, add raycasting to stop from falling off ledges
This commit is contained in:
@@ -6,17 +6,24 @@ namespace Scampz.GameJam
|
||||
{
|
||||
public class GameManager : MonoBehaviour
|
||||
{
|
||||
public static GameManager Instance;
|
||||
public Animator animator;
|
||||
|
||||
void Awake()
|
||||
private static GameManager _instance;
|
||||
|
||||
public static GameManager Instance
|
||||
{
|
||||
if (Instance == null)
|
||||
get
|
||||
{
|
||||
Instance = this;
|
||||
if (!_instance)
|
||||
{
|
||||
_instance = new GameObject().AddComponent<GameManager>();
|
||||
_instance.name = _instance.GetType().ToString();
|
||||
DontDestroyOnLoad(_instance.gameObject);
|
||||
}
|
||||
|
||||
return _instance;
|
||||
}
|
||||
}
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
//SceneManager.sceneLoaded += OnSceneLoaded;
|
||||
|
||||
Reference in New Issue
Block a user