Пример #1
0
    //Display a stimulus, and complete when the stimulus is done
    private IEnumerator PresentStimulus(TrialConfig config)
    {
        GameObject  circle = Instantiate(circlePrefab);
        FlashSprite fs     = circle.GetComponent <FlashSprite>();

        fs.SetGrayscaleColor(config["gsColor"][0], config["alpha"][0]);
        yield return(new WaitForSeconds(fs.flashDuration));
    }
Пример #2
0
    // ShowStimuli (MANDATORY)
    // Display a stimulus, and finish when the stimulus is done.
    // Use the dimension names defined in your config file as string keys to access the float lists
    // contained in the TrialConfig. Experiment will not continue running until EndShowStimuli is called.
    public override void ShowStimuli(TrialConfig config)
    {
        SetText("Now presenting stimulus.");
        GameObject  circle = Instantiate(circlePrefab);
        FlashSprite fs     = circle.GetComponent <FlashSprite>();

        fs.SetGrayscaleColor(config["gsColor"][0], config["alpha"][0]);
        StartCoroutine(EndShowStimuliAfterSeconds(fs.flashDuration));
    }
Пример #3
0
    IEnumerator DisplayOptimal()
    {
        yield return(StartCoroutine(client.Query(QueryType.max)));

        QueryMessage m      = client.GetQueryResponse();
        TrialConfig  maxLoc = m.x;
        GameObject   circle = Instantiate(circlePrefab);
        FlashSprite  fs     = circle.GetComponent <FlashSprite>();

        fs.flashDuration = -1.0f; //never destroy
        fs.SetGrayscaleColor(maxLoc["gsColor"][0]);
    }
Пример #4
0
    IEnumerator DisplayOptimal()
    {
        yield return(StartCoroutine(client.Query(QueryType.inverse, y: 0.75f, probability_space: true)));

        QueryMessage m      = client.GetQueryResponse();
        TrialConfig  maxLoc = m.x;
        GameObject   circle = Instantiate(circlePrefab);
        FlashSprite  fs     = circle.GetComponent <FlashSprite>();

        fs.SetGrayscaleColor(maxLoc["gsColor"][0], maxLoc["alpha"][0]);
        fs.flashDuration = -1.0f; //never destroy
        SetText("Experiment complete! Displaying 75% threshold color: ");
    }