Re-think singleton player idea, add raycasting to stop from falling off ledges

This commit is contained in:
2022-08-15 15:40:04 -07:00
parent 4a4add3668
commit 9a245d94c7
23 changed files with 661 additions and 439 deletions

View File

@@ -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;