示例#1
0
    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;
    }
示例#2
0
 public GameManagerUI()
 {
     singleton = this;
 }
示例#3
0
 // Start is called before the first frame update
 void Start()
 {
     Instance = this;
 }
示例#4
0
 void Awake()
 {
     instance = this;
 }