/// <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);
        }
 public static StateSystemProvider GetInstance()
 {
     if (_instance == null)
     {
         _instance = new StateSystemProvider();
     }
     return(_instance);
 }
Пример #3
0
        // Setup ///////////////////////////////////////

        void SetupWorld()
        {
            store      = new TestDataStore();
            dispatcher = new TestDispatcher();
            provider   = StateSystemProvider.GetInstance();
            provider.SetDataStore(store);
            provider.SetDispatcher(dispatcher);
        }
Пример #4
0
        protected virtual void Start()
        {
            StateSystemProvider.GetInstance().Provide(this);

            dispatcher.OnEnterState += OnEnterState;
            dispatcher.OnExitState  += OnExitState;
            dataStore.OnDataUpdate  += OnDataUpdate;

            OnEnterState(dispatcher.state);
        }
        protected void BootstrapRuntime()
        {
            modelMiddleware = TutorialManagerModelMiddleware.GetInstance();
            dispatcher      = AdaptiveStateDispatcher.GetInstance();
            provider        = StateSystemProvider.GetInstance();

            fsm            = new TutorialManagerFSM();
            fsm.dispatcher = dispatcher;

            provider.SetDispatcher(dispatcher);
            provider.SetDataStore(modelMiddleware);
        }