/// <summary>
        /// Sets up the various components of the Tutorial Manager system
        /// </summary>
        static void BootstrapAdaptiveContent()
        {
            var modelMiddleware = TutorialManagerModelMiddleware.GetInstance();
            var dispatcher      = AdaptiveStateDispatcher.GetInstance();

            dispatcher.OnEnterState += FSM_EnterState;
            dispatcher.OnExitState  += FSM_ExitState;

            var fsm = new TutorialManagerFSM();

            fsm.dispatcher = dispatcher;
            m_State        = new TutorialManagerState(fsm);

            string cueTutorial = m_State.tutorialId;

            if (string.IsNullOrEmpty(cueTutorial))
            {
                if (modelMiddleware.TMData.tutorials.Count == 0)
                {
                    modelMiddleware.CreateTutorialEntity("EmptyTutorial");
                    modelMiddleware.CreateStepEntity("EmptyStep", "EmptyTutorial");
                }
                cueTutorial = modelMiddleware.TMData.tutorials[0].id;
            }
            fsm.stateList = modelMiddleware.TMData.tutorialTable[cueTutorial].steps;

            var provider = StateSystemProvider.GetInstance();

            provider.SetDispatcher(dispatcher);
            provider.SetDataStore(modelMiddleware);
        }
Ejemplo n.º 2
0
 public TutorialManagerSaveableState(TutorialManagerState state)
 {
     showTutorial                = state.showTutorial;
     decisionReceived            = state.decisionReceived;
     adaptiveOnboardingEventSent = state.adaptiveOnboardingEventSent;
     autoAdvance = state.autoAdvance;
     tutorialId  = state.tutorialId;
     currentStep = state.currentStep;
 }
 /// <summary>
 /// Clears the runtime TutorialManager state.
 /// </summary>
 /// <remarks>
 /// This method is provided for QA and testing purposes only. Calling it will null out all prior decisions and
 /// runtime progress on the current device.
 /// </remarks>
 public static void Reset()
 {
     ClearAnalytics();
     if (m_State == null)
     {
         var fsm = new TutorialManagerFSM();
         m_State = new TutorialManagerState(fsm);
         ReadState();
     }
     m_State.Reset();
     SaveState();
 }