У меня есть этот сценарий с переменной чувствительности, но я не могу понять, куда мне добавить его в код. Есть ли специалисты, которые могут мне помочь?
Я хочу добавить это:
public float sensitivity = 5.0f;
в этот код для ротации кватернионов:
switch (firstTouch.phase)
{
case TouchPhase.Began:
firstpoint = firstTouch.position;
xAngTemp = xAngle;
yAngTemp = yAngle;
break;
case TouchPhase.Moved:
secondpoint = firstTouch.position;
//Mainly, about rotate camera. For example, for Screen.width rotate on 180 degree
xAngle = xAngTemp + (secondpoint.x - firstpoint.x) * 180.0f / Screen.width;
yAngle = yAngTemp - (secondpoint.y - firstpoint.y) * 90.0f / Screen.height;
//Rotate camera
this.transform.rotation = Quaternion.Euler(yAngle, xAngle, 0.0f);
character.transform.rotation = Quaternion.Euler(yAngle, xAngle, 0.0f);
break;
}