예제 #1
0
        public void StartTask(Simulator owner, StimuliType stimulusType)
        {
            this.owner        = owner;
            this.stimulusType = stimulusType;

            area            = owner.Area.NextInWorld(TaskType);
            gameObject.name = gameObject.name + "_" + area.Side;
        }
예제 #2
0
        private void newTask()
        {
            currentTask = tasks.CreateNext(nextStimulus);
            if (currentTask == null)
            {
                Debug.Log("All tasks finished!");
                IsActive = false;
                return;
            }

            currentTask.StartTask(this, nextStimulus);
            nextStimulus = StimuliTypeExtensions.Next();
        }
예제 #3
0
        public void StartSimulating(StimuliType type, Task.Task owner, float lifetime)
        {
            this.type  = type;
            this.owner = owner;

            this.lifetime = lifetime;
            spentLifetime = 0;
            if (sprite != null)
            {
                SetUpSprite();
            }

            DoFadeIn(lifetime, owner.FadeInOut, owner.RotationFactor);
        }
예제 #4
0
        public void StartTests(string name)
        {
            if (lastEnteredName != name)
            {
                lastEnteredName = name;
                testId          = 1;
            }

            tasks.Reset(settings.TaskCount);
            area.Reset(settings.TaskCount);
            nextStimulus = StimuliTypeExtensions.Next();
            IsActive     = true;

            string runName;

            if (string.IsNullOrWhiteSpace(name))
            {
                runName = $"Run {testId}";
            }
            else if (testId > 1)
            {
                runName = $"{name} - run {testId}";
            }
            else
            {
                runName = name;
            }
            testId++;

            UpdateBackground();

            settings.LastUsedName = name;
            settings.Store();

            FlushToDisk();
            AudioListener.volume = settings.SoundVolume;

            results.StartTest(runName);
            waitingTime = settings.PauseBeforeTasks;
        }
예제 #5
0
        public Task CreateNext(StimuliType type)
        {
            if (!HasNext)
            {
                return(null);
            }

            currentIndex++;
            var next = randomTasks.Next();

            switch (next)
            {
            case TaskType.Overlap:
                var newOverlap = Instantiate(overlapPrefab, Vector3.zero, Quaternion.identity);
                newOverlap.name = $"Overlap_{currentIndex}_{type}";
                return(newOverlap.GetComponent <Overlap>());

            default:
                var newGap = Instantiate(gapPrefab, Vector3.zero, Quaternion.identity);
                newGap.name = $"Gap_{currentIndex}_{type}";
                return(newGap.GetComponent <Gap>());
            }
        }