Example #1
0
 public void Rotation()
 {
     cHorizontal           += playerControls.GetAxis("CamHorizontal") * ((invertHorizontal)?RotationSpeed:-RotationSpeed);
     cVertical             += playerControls.GetAxis("CamVertical") * ((invertVertical) ? -RotationSpeed : RotationSpeed);
     cVertical              = Mathf.Clamp(cVertical, minXAngle, maxXAngle);
     cameraRotator.position = Target.position;
     TriToolHub.CreateVector3(cVertical, cHorizontal, 1, TriToolHub.AxisPlane.XY, Target.gameObject, out rotationVector);
     //rotationVector.x = Mathf.Clamp(rotationVector.x, minXAngle, maxXAngle);
     //TriToolHub.Rotate(cameraRotator.gameObject, rotationVector, true, Space.World);
     rotationVector.z = 0;
     TriToolHub.SetRotation(cameraRotator.gameObject, rotationVector, Space.Self);
 }
Example #2
0
    void CameraRotation()
    {
        float hAxis = player.GetAxis("Horizontal Alt");
        float vAxis = player.GetAxis("Vertical Alt");

        //TriToolHub.Rotate(gameObject, new Vector3(vAxis * rotationSpeed, hAxis*rotationSpeed, 0), true, Space.World);


        transform.RotateAround(playerGameObject.transform.position, transform.up, hAxis * rotationSpeed * Time.deltaTime);
        transform.RotateAround(playerGameObject.transform.position, transform.right, vAxis * rotationSpeed * Time.deltaTime);
        TriToolHub.SetRotation(gameObject, TriToolHub.XYZ.Z, 0, Space.World);
    }