// 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>(); } }
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(); }
// 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)); }
public IEnumerator InitStrat(AEPsychClient AEPsychClient, string configPath) { client = AEPsychClient; currentTrial = 0; yield return(StartCoroutine(client.StartServer(configPath))); stratId = client.GetStrat(); }