Ejemplo n.º 1
0
        private IEnumerator InitCO()
        {
            AppSettingsManager = new AppSettingsManager();
            AssetManager       = new AssetManager();

            yield return(ReloadEdition());

            // TODO refactor: standardize initialisation of managers
            VocabularyHelper        = new VocabularyHelper(DB);
            JourneyHelper           = new JourneyHelper(DB);
            ScoreHelper             = new ScoreHelper(DB);
            Teacher                 = new TeacherAI(DB, VocabularyHelper, ScoreHelper);
            LogManager              = new LogManager();
            GameLauncher            = new MiniGameLauncher(Teacher);
            FirstContactManager     = new FirstContactManager();
            Services                = new ServicesManager();
            FacebookManager         = gameObject.AddComponent <FacebookManager>();
            FacebookManager.verbose = true;

            // MonoBehaviors
            NavigationManager = gameObject.AddComponent <NavigationManager>();
            NavigationManager.Init();
            gameObject.AddComponent <KeeperManager>();
            gameObject.AddComponent <BookManager>();

            RewardSystemManager = new RewardSystemManager();
            RewardSystemManager.Init();

            PlayerProfileManager = new PlayerProfileManager();
            PlayerProfileManager.LoadPlayerSettings();

            Services = new ServicesManager();

            Debug.Log("AppManager Init(): UIDirector.Init()");
            UIDirector.Init(); // Must be called after NavigationManager has been initialized

            // Debugger setup
            if (!ApplicationConfig.I.DebugLogEnabled)
            {
                Debug.LogWarning("LOGS ARE DISABLED - check the App Config");
            }
            Debug.unityLogger.logEnabled = ApplicationConfig.I.DebugLogEnabled;
            gameObject.AddComponent <Debugging.DebugManager>();

            Debug.Log("AppManager Init(): UpdateAppVersion");
            // Update settings
            AppSettingsManager.UpdateAppVersion();

            Time.timeScale = 1;
            Loaded         = true;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// first Init, from Awake()
        /// </summary>
        protected override void Init()
        {
            if (alreadySetup)
            {
                return;
            }
            alreadySetup = true;

            AppSettingsManager = new AppSettingsManager();

            DB = new DatabaseManager();
            // TODO refactor: standardize initialisation of managers
            LogManager              = new LogManager();
            VocabularyHelper        = new VocabularyHelper(DB);
            JourneyHelper           = new JourneyHelper(DB);
            ScoreHelper             = new ScoreHelper(DB);
            Teacher                 = new TeacherAI(DB, VocabularyHelper, ScoreHelper);
            GameLauncher            = new MiniGameLauncher(Teacher);
            FirstContactManager     = new FirstContactManager();
            Services                = new ServicesManager();
            FacebookManager         = gameObject.AddComponent <FacebookManager>();
            FacebookManager.verbose = true;

            // MonoBehaviors
            NavigationManager = gameObject.AddComponent <NavigationManager>();
            NavigationManager.Init();
            gameObject.AddComponent <KeeperManager>();
            gameObject.AddComponent <BookManager>();

            RewardSystemManager = new RewardSystemManager();
            RewardSystemManager.Init();

            PlayerProfileManager = new PlayerProfileManager();
            PlayerProfileManager.LoadPlayerSettings();

            Services = new ServicesManager();

            Debug.Log("AppManager Init(): UIDirector.Init()");
            UIDirector.Init(); // Must be called after NavigationManager has been initialized

            // Debugger setup
            Debug.unityLogger.logEnabled = AppConfig.DebugLogEnabled;
            gameObject.AddComponent <Debugging.DebugManager>();

            Debug.Log("AppManager Init(): UpdateAppVersion");
            // Update settings
            AppSettingsManager.UpdateAppVersion();
        }