public void LoadESL(ExperimentSession exs) { Type esltype = null; if (!string.IsNullOrEmpty(exs.LogicPath)) { if (File.Exists(exs.LogicPath)) { var assembly = exs.LogicPath.CompileFile(); esltype = assembly.GetExportedTypes()[0]; } else { esltype = Type.GetType(exs.LogicPath); } } if (esl != null) { Destroy(esl); } esl = gameObject.AddComponent(esltype) as ExperimentSessionLogic; esl.exsession = exs; esl.exmanager = uicontroller.exmanager; esl.OnBeginStartExperimentSession = uicontroller.OnBeginStartExperimentSession; esl.OnEndStartExperimentSession = uicontroller.OnEndStartExperimentSession; esl.OnBeginStopExperimentSession = uicontroller.OnBeginStopExperimentSession; esl.OnEndStopExperimentSession = uicontroller.OnEndStopExperimentSession; }
ExperimentSession ValidateExperimentSession(ExperimentSession exs) { if (string.IsNullOrEmpty(exs.Name)) { exs.Name = exs.ID; } return(exs); }