예제 #1
0
    public void InitializeTest()
    {
        if (currentStatus == TestStatus.Finished)
        {
            Debug.LogWarning("TestController: Cannot start a new test because another test is already running. Finish it first.");
            return;
        }

        cursor.RegisterNewListener(this);
        TargetPlaneBuilder.Build(baseTarget, targetPlane, currentSequence, configuration.numberOfTargets);
        targets       = targetPlane.GetComponentsInChildren <TargetBehaviour>();
        initialTarget = targets[0];

        Vector3 planeRotation;

        switch (configuration.planeOrientation)
        {
        case PlaneOrientation.PlaneXY:
            planeRotation = new Vector3(-90, 0, 0);
            break;

        case PlaneOrientation.PlaneYZ:
            planeRotation = new Vector3(0, 0, 90);
            break;

        case PlaneOrientation.PlaneZX:
        default:
            planeRotation = new Vector3(0, 0, 0);
            break;
        }
        targetPlane.transform.localRotation = Quaternion.Euler(planeRotation);

        SetCurrentStatus(TestStatus.Waiting);

        initialTarget.SetAsStartingTestTarget();
    }
 public virtual void StartTrial()
 {
     cursor.RegisterNewListener(this);
     trialData.StartTrial(Time.realtimeSinceStartup, cursor.GetCursorPosition());
 }