/// <summary> /// Determine the action to take for the specified experiment name and action. /// </summary> internal static ExperimentAction GetActionToTake(string experimentName, ExperimentAction experimentAction) { if (experimentName == null || experimentAction == ExperimentAction.None) { // If either the experiment name or action is not defined, then return 'Show' by default. // This could happen to 'ParameterAttribute' when no experimental related field is declared. return(ExperimentAction.Show); } ExperimentAction action = experimentAction; if (!IsEnabled(experimentName)) { action = (action == ExperimentAction.Hide) ? ExperimentAction.Show : ExperimentAction.Hide; } return(action); }
void AddTrialOrderFromNetwork(Session s) { List <int> array = networkTrialOrder; List <string> arrayString = new List <string>(); foreach (int i in array) { arrayString.Add(s.trials[i].sceneName); ExperimentAction scene = new ExperimentAction(ExperimentActionType.scene, s.trials[i].sceneName); ActionQueue.Enqueue(scene); ExperimentAction questionaire = new ExperimentAction(ExperimentActionType.QuestoinairePart, s.trials[i].questionaireRefName); ActionQueue.Enqueue(questionaire); } uimanager.data.sequenceImp = array.ToArray(); uimanager.data.sequenceExp = arrayString.ToArray(); }
IEnumerator ExecuteAction(ExperimentAction a) { if (a.type == ExperimentActionType.QuestoinairePart) { //load Lobby scene yield return(LoadYourAsyncScene(Lobby)); //SceneManager.LoadScene(Lobby); //Build Questionaire UI uimanager.Build(a.ActionName); //add listener to move to next action uimanager.OnQuestionairePartCompleted.AddListener(NextAction); } else if (a.type == ExperimentActionType.scene) { yield return(LoadYourAsyncScene(a.ActionName)); //SceneManager.LoadScene(a.ActionName); //find end of trialobject and link to OnEndOfTrialEvent //GameObject.Find("[REPLACEWITHCORRECTNAME]").GetComponent<PositionSerializerAdam>().OnEndOfTrialEvent.AddListener(NextAction); //GameObject.Find("EndOfTrialManager").GetComponent<EndOfTrialManager>().OnEndOfTrialEvent.AddListener(NextAction); if (!findAndListen("UiContainer")) { if (!findAndListen("EndOfTrialManager")) { Debug.LogError("No Event End of trial Found"); } } } yield return(Executing = false); }
/// <summary> /// Initializes a new instance of the ExperimentalAttribute class. /// </summary> public ExperimentalAttribute(string experimentName, ExperimentAction experimentAction) { ValidateArguments(experimentName, experimentAction); ExperimentName = experimentName; ExperimentAction = experimentAction; }