void Start()
    {
        count=0;
        objectEncounter=0;
        sample=0;
        SetNumber=1;
        objnum=1;
        objDirCount=0;
        totalTime=0.0f;
        FrameInput="";
        //replay=false;
        ZeroAngle=transform.forward;
        displayCrosshairs=false;
        displayGUI=false;
        finalGUI=false;

        GameObject TextObject=GameObject.Find("TextObject");
        subjectInfo=(scr_StartingText)TextObject.GetComponent(typeof(scr_StartingText));
        if (!Directory.Exists(Application.dataPath+"/Data")) {
            Directory.CreateDirectory (Application.dataPath+"/Data");
        }

        //pointPath=filePath+"Pointing.txt";
        if(subjectInfo.Trial)
        {
            filePath=Application.dataPath+"/Data/Subject"+subjectInfo.Number;
            drawingPointPath=Application.dataPath+"/Data/TracingPoints"+subjectInfo.Number;
            while(System.IO.File.Exists (filePath+".txt"))
            {
                filePath=filePath+"+";
            }
            filePath=filePath+".txt";

            while(System.IO.File.Exists (drawingPointPath+".txt"))
            {
                drawingPointPath=drawingPointPath+"+";
            }
            drawingPointPath=drawingPointPath+".txt";
        }
        if(subjectInfo.Record)
        {
            SetNumber=999;
            filePath=Application.dataPath+"/Data/SubjectPracticeData.txt";
        }
        rockLocationPath=Application.dataPath+"/Data/RockLocations.txt";
        print ("Practice");
        print (Application.dataPath);
        if(subjectInfo.Record)
            System.IO.File.WriteAllText(rockLocationPath,"");
        System.IO.File.WriteAllText (filePath,"SubjectNumber:"+subjectInfo.Number+"\r\n"+"Gender:"+subjectInfo.Gender+"\r\n"+"Age:"+subjectInfo.Age+"\r\n");
        System.IO.File.AppendAllText(filePath,"    Pos(x,y,z)      "+"              Rot(x,y,z)    "+"                     Camera(x,y,z)   "+"  SetNumber"+"\r\n");
    }
    void Awake()
    {
        GameObject TextObject=GameObject.Find("TextObject");
        subjectInfo=(scr_StartingText)TextObject.GetComponent(typeof(scr_StartingText));
        //Initialize some variables based on whether this is a Practice session or a Trial session
        if(subjectInfo.Record)
        {
            Instructions.SetActive(false);
            recordingScript=(scr_RecordPosition)gameObject.GetComponent(typeof(scr_RecordPosition));
            recordingScript.enabled=true;
            loadingScript=(scr_LoadExperiment)gameObject.GetComponent(typeof(scr_LoadExperiment));
            loadingScript.enabled=false;
        }

        else
        {
            scr_InstructionScreenClickCallback InstructionsScript=(scr_InstructionScreenClickCallback)Instructions.GetComponent(typeof(scr_InstructionScreenClickCallback));
            InstructionsScript.StartInstructions=true;

            recordingScript=(scr_RecordPosition)gameObject.GetComponent(typeof(scr_RecordPosition));
            recordingScript.enabled=false;
            loadingScript=(scr_LoadExperiment)gameObject.GetComponent(typeof(scr_LoadExperiment));
            loadingScript.InverseSampleRate=int.Parse (subjectInfo.PlayBackSpeed);
            //loadingScript.enabled=true;

            MouseLook lookScript=(MouseLook)GetComponent (typeof(MouseLook));
            lookScript.enabled=false;
            CharacterMotor Motor=(CharacterMotor)GetComponent (typeof(CharacterMotor));
            Motor.enabled=false;
            FPSInputController FPSscript=(FPSInputController)GetComponent (typeof(FPSInputController));
            FPSscript.enabled=false;
            MouseLook cameraScript=(MouseLook)PlayerCam.GetComponent(typeof(MouseLook));
            cameraScript.enabled=false;
            loadingScript.SpawnRocks=subjectInfo.EnableRocks;
        }

        if( subjectInfo.TopView)
        {
            PlayerCam.transform.position=new Vector3(PlayerCam.transform.position.x,PlayerCam.transform.position.y+10.0f,PlayerCam.transform.position.z-5.0f);
            PlayerCam.transform.eulerAngles=new Vector3(45.0f,0.0f,0.0f);
        }
    }