using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Test : MonoBehaviour
{
public float pinchDist;
private float zoomVelocity;
private float targetDistance;
private float minDistance = 3;
private float maxDistance = 8;
private float distance;
public Transform car;
private Vector3 TargetPoint;
float x;
float y;
public float speed = 1f;
float xSpeed = 30f;
float ySpeed = 30f;
public float angle;
public float targetangle;
public int yMinLimit = 40;
public int yMaxLimit = 85;
private float m_touchMaxDist = 20f;
public Vector3 currentDirention;
private bool keepMove;
private float waittime = 3f;
private bool m_autoRotation;
private float smoothness = 0.16f;
private readonly Vector2 m_fitScreenRes = new Vector2(2048f, 1536f);
float roatspeedy;
private void Awake()
{
currentDirention = transform.position - TargetPoint;
angle = Vector3.Angle(currentDirention, new Vector3(0, 1, 0));
targetangle = angle;
float xFactor = m_fitScreenRes.x / Screen.width;
Debug.Log(xFactor);
float yFactor = m_fitScreenRes.y / Screen.height;
Debug.Log(yFactor);
xSpeed = xFactor * speed;
ySpeed = yFactor * speed;
m_touchMaxDist /= xFactor;
}
// Use this for initialization
void Start()
{
TargetPoint = car.position;