#DESCRIPTION OF CLASS#
Inheritance: MonoBehaviour
	/// <summary>
	/// Use this for initialization.
	/// </summary>
	void Start ()
	{
		cameraXform = this.transform;//.parent;
		if (cameraXform == null)
		{
			Debug.LogError("Parent camera to empty GameObject.", this);
		}
		
		follow = GameObject.FindWithTag("Player").GetComponent<CharacterControllerLogic>();
		followXform = GameObject.FindWithTag("Player").transform;
		
		lookDir = followXform.forward;
		curLookDir = followXform.forward;
		
		barEffect = GetComponent<BarsEffect>();
		if (barEffect == null)
		{
			Debug.LogError("Attach a widescreen BarsEffect script to the camera.", this);
		}
		
		// Position and parent a GameObject where first person view should be
		firstPersonCamPos = new CameraPosition();
		firstPersonCamPos.Init
			(
				"First Person Camera",
				new Vector3(0.0f, 1.6f, 0.2f),
				new GameObject().transform,
				follow.transform
			);	

		camState = startingState;

		// Intialize values to avoid having 0s
		characterOffset = followXform.position + new Vector3(0f, distanceUp, 0f);
		distanceUpFree = distanceUp;
		distanceAwayFree = distanceAway;
		savedRigToGoal = RigToGoalDirection;
	}
    /// <summary>
    /// Use this for initialization.
    /// </summary>
    void Start()
    {
        cameraXform = this.transform;//.parent;
        if (cameraXform == null)
        {
            Debug.LogError("Parent camera to empty GameObject.", this);
        }

        follow = GameObject.FindWithTag("Player").GetComponent<CharacterControllerLogic>();
        followXform = GameObject.FindWithTag("CameraFollowXForm").transform;
        centeredTarget = GameObject.FindWithTag("CenteredTarget").transform;
        overTheShoulderTarget = GameObject.FindWithTag("OverTheShoulderTarget").transform;

        lookDir = followXform.forward;
        curLookDir = followXform.forward;

        barEffect = GetComponent<BarsEffect>();
        if (barEffect == null)
        {
            Debug.LogError("Attach a widescreen BarsEffect script to the camera.", this);
        }

        camState = startingState;
        eyeControlState = startingEyeState;
        freeCameraViewMode = startingFreeCameraViewMode;

        if (freeCameraViewMode == FreeCameraViewModes.Centered)
        {
            //set position to centered target
            this.transform.position = centeredTarget.transform.position;
        }
        else
        {
            this.transform.position = overTheShoulderTarget.transform.position;
        }

        // Intialize values to avoid having 0s
        characterOffset = followXform.position + new Vector3(0f, distanceUp, 0f);
        distanceUpFree = distanceUp;
        distanceAwayFree = distanceAway;
        savedRigToGoal = RigToGoalDirection;

        //Eye tracking code
        fixationData = GetComponent<FixationDataComponent>();
        gazeData = GetComponent<GazePointDataComponent>();
        if (!fixationData)
        {
            fixationData = new FixationDataComponent();
        }
        if (!gazeData)
        {
            gazeData = new GazePointDataComponent();
        }
    }
	/// <summary>
	/// Use this for initialization.
	/// </summary>
	void Start ()
	{
		parentRig = this.transform.parent;
		if (parentRig == null)
		{
			Debug.LogError("Parent camera to empty GameObject.", this);
		}
		
		follow = GameObject.FindWithTag("Player").GetComponent<CharacterControllerLogic>();
		followXform = GameObject.FindWithTag("Player").transform;
		
		lookDir = followXform.forward;
		curLookDir = followXform.forward;
		
		barEffect = GetComponent<BarsEffect>();
		if (barEffect == null)
		{
			Debug.LogError("Attach a widescreen BarsEffect script to the camera.", this);
		}
		
		// Position and parent a GameObject where first person view should be
		firstPersonCamPos = new CameraPosition();
		firstPersonCamPos.Init
			(
				"First Person Camera",
				new Vector3(0.0f, 1.6f, 0.2f),
				new GameObject().transform,
				follow.transform
			);	
	}
		public void triggerFocusMain (CharacterControllerLogic logic, Transform t)
		{
				follow = logic;
				followXform = t;
				camState = CamStates.Behind;
				Start ();
		}
		public void startNextTurnPlayer (Transform t)
		{
				follow = t.GetComponent<CharacterControllerLogic> ();
				followXform = t;
				//follow = GameObject.FindWithTag ("Player").GetComponent<CharacterControllerLogic> ();
				//followXform = GameObject.FindWithTag ("Player").transform;
				camState = CamStates.Behind;
				Start ();
		}
    // Use this for initialization
    void Start()
    {
        follow = GameObject.FindGameObjectWithTag("Player").GetComponent<CharacterControllerLogic>();
        followXForm = GameObject.FindGameObjectWithTag("Player").transform;
        lookDir = followXForm.forward;

        barEffect = GetComponent<BarsEffect>();

        // position and parent a GameObject where first person view should be
        firstPersonCamPos = new CameraPosition();
        firstPersonCamPos.Init("First Person Camera", new Vector3(0f, 0.1f, 0.2f), new GameObject().transform, followXForm);
    }