Exemple #1
0
    private void InitGameRoot()
    {
        //1. Init all services
        //a. Resource service
        resourceService = GetComponent <ResourceService>();
        resourceService.InitService();

        //b. Audio service
        audioService = GetComponent <AudioService>();
        audioService.InitService();

        //2. Init all systems
        //a. Menu System
        menuSystem = GetComponent <MenuSystem>();
        menuSystem.InitSystem();

        //b. Puzzle System
        puzzleSystem = GetComponent <PuzzleSystem>();
        puzzleSystem.InitSystem();

        //3.Enter Menu Scene
        if (SceneManager.GetActiveScene().name == Constants.gameRootSceneName)
        {
            menuSystem.EnterMenu();
        }
    }