예제 #1
0
    /// <summary>
    /// Use this for initialization.
    /// </summary>
    void Start()
    {
        parentRig = this.transform.parent;
        if (parentRig == null)
        {
            Debug.LogError("Parent camera to empty game object for cameraRig", 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,
            followXform
        );
    }
		/// <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;
				if (follow == null || followXform == null) {
						Debug.LogError ("awaiting follow and followXform.", this);
						return;
				}
				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 (
					"FPCam",
					follow.transform
				);	
		}
예제 #3
0
        private void Start()
        {
            camara = this.transform;
            if (camara == null)
            {
                Debug.LogError("No existe camara en el objeto.", this);
            }

            motor     = GetComponentInParent <Motor>();
            personaje = motor.transform;

            dirFija       = personaje.forward;
            actualDirFija = personaje.forward;

            barEffect = GetComponent <BarsEffect>();
            if (barEffect == null)
            {
                Debug.LogError("Agrega el efecto BarsEffect al objeto.", this);
            }

            camPos = new PosicionCamara();
            camPos.Init("Camara" + netId, new Vector3(0.0f, 1.6f, 0.2f), new GameObject().transform, motor.transform);

            // Inicializa valores
            offSetPersonaje = personaje.position + new Vector3(0f, distanciaArriba, 0f);
            distArribaLibre = distanciaArriba;
            distLejanaLibre = distanciaLejana;
            dirRigData      = DirRig;
        }
예제 #4
0
    // Use this for initialization
    void Start()
    {
        followXForm = GameObject.FindWithTag("Player").transform;
        //changes in respect of the player's transform using the tag
        lookDir = followXForm.forward;

        barEffect = GetComponent <BarsEffect>();
        if (barEffect == null)
        {
            Debug.LogError("Attach a widescreen BarsEffect script to the camera.", this);
            //attaches a message if error
        }
    }
예제 #5
0
    /// <summary>
    /// Use this for initialization.
    /// </summary>
    public void Activate(GameObject player)
    {
        cameraXform = this.transform;        //.parent;
        if (cameraXform == null)
        {
            Debug.LogError("Parent camera to empty GameObject.", this);
        }

        follow      = player.GetComponent <CharacterControllerLogic>();
        followXform = 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;

        if (!Active)
        {
            Active = true;
        }
    }
예제 #6
0
    /// <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) - characterOffset2;
        distanceUpFree   = distanceUp;
        distanceAwayFree = distanceAway;
        savedRigToGoal   = RigToGoalDirection;
    }
예제 #7
0
        void Start()
        {
            cameraXform = this.transform;
            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);
            }

            firstPersonCamPos = new CameraPosition();
            firstPersonCamPos.Init
            (
                "First Person Camera",
                new Vector3(0.0f, 1.6f, 0.2f),
                new GameObject().transform,
                follow.transform
            );

            camState = startingState;

            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("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;
	}
예제 #9
0
    /// <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
			);	
	}
예제 #11
0
 public void OnEnable()
 {
     effect = (BarsEffect)target;
 }
예제 #12
0
 void Awake()
 {
     parentRig = this.transform.parent;
     if(!parentRig.networkView.isMine)
     {
         transform.GetComponent<Camera>().enabled = false;
         transform.GetComponent<AudioListener>().enabled = false;
         enabled = false;
     }else{
         cameraOrigin = GameObject.FindGameObjectWithTag("PlayerCam").transform;
         lookDir = cameraOrigin.forward;
         letterBox = GetComponent<BarsEffect>();
     }
 }
	public void OnEnable()
	{
		effect = (BarsEffect) target;
	}
예제 #14
0
    // Use this for initialization
    void Start()
    {
        followXForm = GameObject.FindWithTag ("Player").transform;
        //changes in respect of the player's transform using the tag
        lookDir = followXForm.forward;

        barEffect = GetComponent<BarsEffect>();
        if(barEffect == null)
        {
            Debug.LogError("Attach a widescreen BarsEffect script to the camera.", this);
            //attaches a message if error
        }
    }
    // 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);
    }