Exemple #1
0
    void createBatches()
    {
        VariableFetcher fetch = VariableFetcher.Get;

        batches = new TaskBatch[STANDARD_BATCH_COUNT + HYBRID_BATCH_COUNT];
        for (int i = START_BATCH; i <= STANDARD_BATCH_COUNT; i++)
        {
            int batchNum   = i;
            int batchIndex = batchNum - 1;
            fetch.GetBool(getImageCheckKey(batchNum), delegate(bool isImages)
            {
                string batchName = string.Format("{0}{1}", BATCH_KEY, batchNum);
                if (isImages)
                {
                    batches[batchIndex] = new ImageTaskBatch(batchName, processBatch);
                }
                else
                {
                    batches[batchIndex] = new TaskBatch(batchName, processBatch);
                }
                // In the Editor the arrays are not full initialized when all batches have been processed
                // So the post processing callback should run here, to ensure the array has been populated
                                        #if UNITY_EDITOR
                postProcessBatch();
                                        #endif
            });
        }
        randomBatch = UnityEngine.Random.Range(0, STANDARD_BATCH_COUNT);
    }
    void loadTutorial()
    {
        tutorial = new TSTutorial();
        VariableFetcher fetcher = VariableFetcher.Get;

        fetcher.GetInt(TUTORIAL_COUNT, delegate(int count)
        {
            tutorial.Init(count);
            for (int i = 0; i < count; i++)
            {
                int currentIndex = i;
                fetcher.GetString(getTutorialKey(currentIndex), delegate(string message)
                {
                    tutorial.SetStep(currentIndex, message);
                    if (verboseMode)
                    {
                        Debug.LogFormat("Setting tutorial step {0} to {1}", currentIndex, message);
                    }
                    if (tutorial.TutorialLoaded())
                    {
                        startTutorial(tutorial.CurrentStep());
                        if (verboseMode)
                        {
                            Debug.Log("Tutorial is beginning");
                        }
                    }
                });
            }
        });
    }
Exemple #3
0
 public TaskBatch(string batchKey, Action onStimuliFetched)
 {
     earlyInit();
     this.batchKey         = batchKey;
     this.onStimuliFetched = onStimuliFetched;
     this.fetcher          = VariableFetcher.Get;
     fetcher.GetValueList(batchKey, getStimuliNames);
 }
Exemple #4
0
 protected override void fetchReferences()
 {
     base.fetchReferences();
     leftButton.SetText(leftKey.ToString());
     rightButton.SetText(rightKey.ToString());
     data = TSDataController.Instance;
     data.SubscribeToGameEnd(handleGameEnd);
     tutorial = TSTutorialController.Instance;
     fetcher  = VariableFetcher.Get;
     fetchTunableVariables();
     StartCoroutine(waitToSpawn());
 }