[TASK] Content fixes

This commit is contained in:
2019-08-26 00:51:03 +02:00
parent b4543142de
commit dc140068d6
24 changed files with 433 additions and 15 deletions

View File

@@ -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
{