Exemplo n.º 1
0
    void GetPlayerCar()
    {
        // Return if we don't have player car.
        if (!playerCar)
        {
            return;
        }

        // If player car has RCC_CameraConfig, distance and height will be changed.
        if (playerCar.GetComponent <RCC_CameraConfig> ())
        {
            TPSDistance = playerCar.GetComponent <RCC_CameraConfig> ().distance;
            TPSHeight   = playerCar.GetComponent <RCC_CameraConfig> ().height;
        }

        ChangeCamera(CameraMode.TPS);

        playerRigid = playerCar.GetComponent <Rigidbody>();

        // Getting camera modes from player car.
        hoodCam      = playerCar.GetComponentInChildren <RCC_HoodCamera>();
        wheelCam     = playerCar.GetComponentInChildren <RCC_WheelCamera>();
        fixedCam     = GameObject.FindObjectOfType <RCC_FixedCamera>();
        cinematicCam = GameObject.FindObjectOfType <RCC_CinematicCamera>();

        // Setting transform and position to players car when switched camera target.
        transform.position = playerCar.transform.position;
        transform.rotation = playerCar.transform.rotation * Quaternion.Euler(10f, 0f, 0f);
    }
    private void GetTarget()
    {
        // Return if we don't have the player vehicle.
        if (!playerCar)
        {
            return;
        }

        if (TPSAutoFocus)
        {
            StartCoroutine(AutoFocus());
        }

        // Getting rigid of the player vehicle.
        playerRigid = playerCar.GetComponent <Rigidbody>();

        // Getting camera modes from the player vehicle.
        hoodCam      = playerCar.GetComponentInChildren <RCC_HoodCamera>();
        wheelCam     = playerCar.GetComponentInChildren <RCC_WheelCamera>();
        fixedCam     = GameObject.FindObjectOfType <RCC_FixedCamera>();
        cinematicCam = GameObject.FindObjectOfType <RCC_CinematicCamera>();

        ResetCamera();

        // Setting transform and position to player vehicle when switched camera target.
//		transform.position = playerCar.transform.position;
//		transform.rotation = playerCar.transform.rotation * Quaternion.AngleAxis(10f, Vector3.right);
    }
Exemplo n.º 3
0
    void GetTarget()
    {
        // Return if we don't have the player vehicle.
        if (!playerCar)
        {
            return;
        }

        // If player vehicle has RCC_CameraConfig, distance and height will be adjusted.
        if (playerCar.GetComponent <RCC_CameraConfig> ())
        {
            TPSDistance = playerCar.GetComponent <RCC_CameraConfig> ().distance;
            TPSHeight   = playerCar.GetComponent <RCC_CameraConfig> ().height;
        }

        // Getting rigid of the player vehicle.
        playerRigid = playerCar.GetComponent <Rigidbody>();

        // Getting camera modes from the player vehicle.
        hoodCam      = playerCar.GetComponentInChildren <RCC_HoodCamera>();
        wheelCam     = playerCar.GetComponentInChildren <RCC_WheelCamera>();
        fixedCam     = GameObject.FindObjectOfType <RCC_FixedCamera>();
        cinematicCam = GameObject.FindObjectOfType <RCC_CinematicCamera>();

        ResetCamera();

        // Setting transform and position to player vehicle when switched camera target.
//		transform.position = playerCar.transform.position;
//		transform.rotation = playerCar.transform.rotation * Quaternion.AngleAxis(10f, Vector3.right);
    }
Exemplo n.º 4
0
    void OnPlayerSpawned(HR_PlayerHandler player)
    {
        playerCar   = player.transform;
        playerRigid = player.GetComponent <Rigidbody>();
        hoodCam     = player.GetComponentInChildren <RCC_HoodCamera>();
        tpsCam      = player.GetComponentInChildren <RCC_TPSCamera>();

        if (GameObject.Find("Mirrors"))
        {
            mirrors = GameObject.Find("Mirrors").gameObject;
        }
    }
Exemplo n.º 5
0
    void GetPlayerCar()
    {
        if (!playerCar)
        {
            return;
        }

        cameraMode  = CameraMode.TPS;
        playerRigid = playerCar.GetComponent <Rigidbody>();
        hoodCam     = playerCar.GetComponentInChildren <RCC_HoodCamera>();
        wheelCam    = playerCar.GetComponentInChildren <RCC_WheelCamera>();
        fixedCam    = GameObject.FindObjectOfType <RCC_FixedCamera>();

        transform.position = playerCar.transform.position;
        transform.rotation = playerCar.transform.rotation * Quaternion.Euler(10f, 0f, 0f);

        if (playerCar.GetComponent <RCC_CameraConfig>())
        {
            playerCar.GetComponent <RCC_CameraConfig>().SetCameraSettings();
        }
    }