|
|
@@ -97,12 +97,33 @@ public class BowCamera : MonoBehaviour
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- bool needLookAtPoint = false; //需要-镜头看向九轴姿态虚拟节点?
|
|
|
+ //需要-镜头看向九轴姿态虚拟节点?
|
|
|
+ bool needLookAtPoint = false;
|
|
|
+ //镜头旋转转换比值
|
|
|
+ float[] _bowRotateConvertRate = null;
|
|
|
+ float bowRotateConvertRate {
|
|
|
+ get {
|
|
|
+ if (_bowRotateConvertRate == null) {
|
|
|
+ _bowRotateConvertRate = new float[]{ UserSettings.ins.bowRotateConvert.GetRate() };
|
|
|
+ }
|
|
|
+ return _bowRotateConvertRate[0];
|
|
|
+ }
|
|
|
+ }
|
|
|
void LateUpdate() {
|
|
|
if (needLookAtPoint) {
|
|
|
needLookAtPoint = false;
|
|
|
//镜头看向九轴姿态虚拟节点
|
|
|
this.transform.LookAt(CameraToLook.ins.point);
|
|
|
+ //镜头旋转比值转换
|
|
|
+ Vector3 localEulerAngles = this.transform.localEulerAngles;
|
|
|
+ float angleY = localEulerAngles.y;
|
|
|
+ if (angleY < 180) {
|
|
|
+ angleY = Mathf.Clamp(angleY * bowRotateConvertRate, 0, 180);
|
|
|
+ } else {
|
|
|
+ angleY = Mathf.Clamp((angleY - 360) * bowRotateConvertRate, -180, 0);
|
|
|
+ }
|
|
|
+ localEulerAngles.y = angleY;
|
|
|
+ this.transform.localEulerAngles = localEulerAngles;
|
|
|
}
|
|
|
}
|
|
|
|