protected override void Awake() { base.Awake(); //MessageBox("GameMgr_Awake"); DontDestroyOnLoad(gameObject); gameObject.AddComponent <MainLoop>(); audioMgr = gameObject.AddComponent <AudioMgr>(); GlobalVar.InitGlovalVar(); RegisterUI(); }
private void Awake() { if (workAsGameMgr) { DontDestroyOnLoad(gameObject); gameObject.AddComponent <MainLoop>(); gameObject.AddComponent <AudioMgr>(); GlobalVar.InitGlovalVar(); AudioMgr.Instance.PlayAuBg("Music_game"); RegisterUI(); } else { GlobalVar.InitGlovalVar(); } if (initSceneMark) { GlobalVar.InitSceneMark(); } }