[TASK] Content fixes
This commit is contained in:
@@ -7,7 +7,7 @@ public class PlayerCameraController : MonoBehaviour
|
||||
public float xSpeed = 1.0f;
|
||||
public float ySpeed = 20.0f;
|
||||
public float yMinLimit = 5;
|
||||
public float yMaxLimit = 1300f;
|
||||
public float yMaxLimit = 130f;
|
||||
public float zoomSpeedDesktop = 20f;
|
||||
public float zoomSpeedMobile = 20f;
|
||||
public float distanceMin = 10f;
|
||||
@@ -34,11 +34,26 @@ public class PlayerCameraController : MonoBehaviour
|
||||
{
|
||||
if (target)
|
||||
{
|
||||
if (Input.GetMouseButton(0))
|
||||
Vector2 movementInputDelta = Vector2.zero;
|
||||
if (SystemInfo.deviceType == DeviceType.Handheld)
|
||||
{
|
||||
velocityX = xSpeed * Input.GetAxis("Mouse X") * distance * 0.02f;
|
||||
velocityY = ySpeed * Input.GetAxis("Mouse Y") * 0.02f;
|
||||
if (Input.touchCount == 1)
|
||||
{
|
||||
movementInputDelta = Input.touches[0].deltaPosition * 0.02f;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Input.GetMouseButton(0))
|
||||
{
|
||||
movementInputDelta = new Vector2(Input.GetAxis("Mouse X"), Input.GetAxis("Mouse Y"));
|
||||
}
|
||||
}
|
||||
|
||||
movementInputDelta *= 0.2f;
|
||||
velocityX = xSpeed * movementInputDelta.x * distance;
|
||||
velocityY = ySpeed * movementInputDelta.y;
|
||||
|
||||
rotationYAxis += velocityX;
|
||||
rotationXAxis -= velocityY;
|
||||
rotationXAxis = ClampAngle(rotationXAxis, yMinLimit, yMaxLimit);
|
||||
@@ -84,7 +99,7 @@ public class PlayerCameraController : MonoBehaviour
|
||||
float touchDeltaMag = (touchZero.position - touchOne.position).magnitude;
|
||||
|
||||
// Find the difference in the distances between each frame.
|
||||
return (prevTouchDeltaMag - touchDeltaMag) * zoomSpeedMobile;
|
||||
return - (prevTouchDeltaMag - touchDeltaMag) * zoomSpeedMobile;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user