示例#1
0
    protected override void Awake()
    {
        base.Awake();
        //MessageBox("GameMgr_Awake");

        DontDestroyOnLoad(gameObject);
        gameObject.AddComponent <MainLoop>();

        audioMgr = gameObject.AddComponent <AudioMgr>();

        GlobalVar.InitGlovalVar();

        RegisterUI();
    }
示例#2
0
    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();
        }
    }