예제 #1
0
        public virtual void PreEntry(TrialProgress t, bool first = true)
        {
            Debug.Log("Entering trial: " + TrialID);
            if (head == this && first)
            {
                Debug.Log(string.Format("Entered Block: {0} at time: {1}", BlockID, DateTime.Now));
                t.ResetOngoing();
                t.successes = new List <int>();
                int NumBlocks = DS.GetData().Blocks.Count;
                t.NumCollectedPerBlock = new int[NumBlocks];
            }

            if (head == this && first == false)
            {
                Debug.Log(string.Format("Entered Block: {0} at time: {1}", BlockID, DateTime.Now));
                t.SpecialReset();
                t.successes = new List <int>();
                int NumBlocks = DS.GetData().Blocks.Count;
                t.NumCollectedPerBlock = new int[NumBlocks];
            }

            Debug.Log("Current Trial Increment: " + data.DataSingleton.GetData().TrialInitialValue);

            if (t.TrialNumber < 2)
            {
                t.TimeSinceExperimentStart = 0.0f;
            }

            TrialStartTime = DateTimeOffset.Now.ToUnixTimeMilliseconds();

            _runningTime  = 0;
            TrialProgress = t;
            TrialProgress.GetCurrTrial().NumCollected = 0;
        }
예제 #2
0
        public override void PreEntry(TrialProgress t, bool first = true)
        {
            base.PreEntry(t, first);
            t.TimingVerification = data.DataSingleton.GetData().TimingVerification; // timing diagnostics

            LoadNextSceneWithTimer(Constants.LoadingScreen);
            t.isLoaded = true;
        }
예제 #3
0
        public override void PreEntry(TrialProgress t, bool first = true)
        {
            // Sets the field of the preentry
            base.PreEntry(t, first);
            t.TimingVerification = data.DataSingleton.GetData().TimingVerification; // timing diagnostics

            _runningTime -= trialData.Rotate;

            LoadNextSceneWithTimer(trialData.Scene);
        }
예제 #4
0
        // Here we construct the entire linked list structure.
        public FieldTrial(InputField[] fields) : base(-1, -1)
        {
            _fields = fields;

            // This block of code will use the default configuration file if
            // using webGL or Android (can add others in if statement)
            // Otherwise calls the directory picker to select the configuration file.

            var AutoRunConfigDir = Application.streamingAssetsPath + "/AutoRun_Config/";
            var files            = new string[0];

            if (Directory.Exists(AutoRunConfigDir))
            {
                files = Directory.GetFiles(AutoRunConfigDir);
            }

            if (files.Length > 0)
            {
                var defaultConfig = AutoRunConfigDir + Path.GetFileName(files[0]);
                Loader.ExternalActivation(defaultConfig);
            }

            else
            {
                while (true)
                {
                    // Here we're using: https://github.com/gkngkc/UnityStandaloneFileBrowser because it was easier than rolling our own
                    string[] paths = StandaloneFileBrowser.OpenFilePanel("Choose configuration file", "Configuration_Files", "", false);
                    string   path  = paths[0];
                    if (Loader.ExternalActivation(path))
                    {
                        break;
                    }
                }
            }

            TrialProgress = new TrialProgress();
            _fields       = fields;
        }
예제 #5
0
        public override void PreEntry(TrialProgress t, bool first = true)
        {
            base.PreEntry(t, first);

            LoadNextSceneWithTimer(trialData.Scene);
        }
예제 #6
0
 public override void PreEntry(TrialProgress t, bool first = true)
 {
     base.PreEntry(t, first);
     Debug.Log("In close trial");
 }
예제 #7
0
 public override void PreEntry(TrialProgress t, bool first = true)
 {
     base.PreEntry(t, first);
     GenerateTrials();
     Progress();
 }