private void Awake() { DontDestroyOnLoad(gameObject); if (m_Instance == null) { m_Instance = this; } else if (m_Instance != null) { Destroy(this.gameObject); } Cursor.lockState = CursorLockMode.Locked; m_PlayerInstances = new List <Player>(); m_LevelManager = GetComponent <LevelManager>(); m_UI = GetComponentInChildren <GameManagerUI>(); Player.onRespawn += Respawn; SceneManager.sceneLoaded += OnSceneLoaded; GameMode.onGameOver += GameEnd; }
public GameManagerUI() { singleton = this; }
// Start is called before the first frame update void Start() { Instance = this; }
void Awake() { instance = this; }