Пример #1
0
    // Start is called before the first frame update
    void Start()
    {
        if (client == null)
        {
            client = FindObjectOfType <AEPsychClient>();
        }
        if (experiment == null)
        {
            experiment = FindObjectOfType <Experiment>();
        }

        /*
         * if (client.baseConfig == null)
         * {
         *  client.ConnectServer();
         * }
         */
        if (!experiment.UsesModelExplorer())
        {
            gameObject.SetActive(false);
        }

        if (GetComponent <Canvas>().worldCamera == null)
        {
            GetComponent <Canvas>().worldCamera = FindObjectOfType <Camera>();
        }

        if (experiment.autoDisableOtherCanvases)
        {
            otherCanvases = FindObjectsOfType <Canvas>();
        }
    }
Пример #2
0
    public IEnumerator InitStrat(AEPsychClient AEPsychClient, string configPath, bool isPath = true)
    {
        client = AEPsychClient;
        yield return(StartCoroutine(client.StartServer(configPath: configPath, "0.01", isPath)));

        stratId = client.GetStrat();
    }
Пример #3
0
 // OnStateChange (optional)
 // An optional callback for when the ExperimentState field changes. This enables
 // additional experiment flow control and visibility into the Experiment State Machine.
 public void OnExperimentStateChange(ExperimentState oldState, ExperimentState newState)
 {
     if (newState == ExperimentState.WaitingForAskResponse)
     {
         SetText("Querying for next trial");
     }
     AEPsychClient.Log(string.Format("SetState: {0} -> {1}", oldState, newState));
 }
Пример #4
0
    public IEnumerator InitStrat(AEPsychClient AEPsychClient, string configPath)
    {
        client       = AEPsychClient;
        currentTrial = 0;
        yield return(StartCoroutine(client.StartServer(configPath)));

        stratId = client.GetStrat();
    }