Commit 07371ab7 authored by czy's avatar czy

控制摄像机旋转角度

parent bbe48dd0
...@@ -3217,6 +3217,7 @@ MonoBehaviour: ...@@ -3217,6 +3217,7 @@ MonoBehaviour:
HSpeedAI: 10 HSpeedAI: 10
backDis: 7.02 backDis: 7.02
upDis: 5.61 upDis: 5.61
rotationVector3MainCamera: {x: 20, y: 0, z: 0}
VSpeedEnemy_V: 10 VSpeedEnemy_V: 10
SpeedLevelEnemy_V: 1 SpeedLevelEnemy_V: 1
AddSpeedEnemy_V: 10 AddSpeedEnemy_V: 10
......
...@@ -34,6 +34,8 @@ public class FollowTarget : MonoBehaviour ...@@ -34,6 +34,8 @@ public class FollowTarget : MonoBehaviour
public float backDis=5.51f; public float backDis=5.51f;
public float upDis= 8.77f; public float upDis= 8.77f;
[Tooltip("控制摄像机的旋转角度")]
public Vector3 rotationVector3;
//public float smood=10; //public float smood=10;
public Transform target; public Transform target;
...@@ -47,7 +49,8 @@ public class FollowTarget : MonoBehaviour ...@@ -47,7 +49,8 @@ public class FollowTarget : MonoBehaviour
} }
private void LateUpdate() private void LateUpdate()
{ {
rotationVector3 = ConfigurationFile.instance.rotationVector3MainCamera;
//读取配置文件数据 //读取配置文件数据
backDis = ConfigurationFile.instance.backDis; backDis = ConfigurationFile.instance.backDis;
upDis = ConfigurationFile.instance.upDis; upDis = ConfigurationFile.instance.upDis;
...@@ -59,7 +62,11 @@ public class FollowTarget : MonoBehaviour ...@@ -59,7 +62,11 @@ public class FollowTarget : MonoBehaviour
Vector3 followPoint = new Vector3(0,0, target.position.z) + Vector3.up * upDis - target.forward * backDis;//照相机不左右移动 Vector3 followPoint = new Vector3(0,0, target.position.z) + Vector3.up * upDis - target.forward * backDis;//照相机不左右移动
transform.position = followPoint; transform.position = followPoint;
transform.position = followPoint; //选择
//transform.Rotate(RotateVector3); //在update中将会一直旋转
transform.rotation = Quaternion.Euler(rotationVector3.x, rotationVector3.y, rotationVector3.z);
} }
} }
...@@ -13,7 +13,7 @@ public class ConfigurationFile : MonoBehaviour ...@@ -13,7 +13,7 @@ public class ConfigurationFile : MonoBehaviour
public float AddSpeed = 10.0f; public float AddSpeed = 10.0f;
[Tooltip("控制左右移动的速度。")] [Tooltip("控制左右移动的速度。")]
public float HSpeed = 10.0f; public float HSpeed = 10.0f;
//########################################
[Header("AI")] [Header("AI")]
[Tooltip("控制向前的速度。")] [Tooltip("控制向前的速度。")]
public float VSpeedAI = 20.0f; public float VSpeedAI = 20.0f;
...@@ -22,12 +22,15 @@ public class ConfigurationFile : MonoBehaviour ...@@ -22,12 +22,15 @@ public class ConfigurationFile : MonoBehaviour
public float AddSpeedAI = 10.0f; public float AddSpeedAI = 10.0f;
[Tooltip("控制左右移动的速度。")] [Tooltip("控制左右移动的速度。")]
public float HSpeedAI = 10.0f; public float HSpeedAI = 10.0f;
//########################################
[Header("摄像机")] [Header("摄像机")]
[Tooltip("相对主角 向后的距离")] [Tooltip("相对主角 向后的距离")]
public float backDis = 5.51f; public float backDis = 5.51f;
[Tooltip("相对主角 向上的距离")] [Tooltip("相对主角 向上的距离")]
public float upDis = 8.77f; public float upDis = 8.77f;
[Tooltip("控制摄像机的旋转角度")]
public Vector3 rotationVector3MainCamera;
//########################################
[Header("打手")] [Header("打手")]
[Tooltip("基础速度")] [Tooltip("基础速度")]
public float VSpeedEnemy_V = 20.0f; public float VSpeedEnemy_V = 20.0f;
...@@ -39,7 +42,7 @@ public class ConfigurationFile : MonoBehaviour ...@@ -39,7 +42,7 @@ public class ConfigurationFile : MonoBehaviour
public float VertigoTimeEnemy_V = 3.0f; public float VertigoTimeEnemy_V = 3.0f;
[Tooltip("小人出现的位置在目标的前方的距离")] [Tooltip("小人出现的位置在目标的前方的距离")]
public float disZ = 50; public float disZ = 50;
//########################################
[Header("巨石")] [Header("巨石")]
[Tooltip("眩晕时长")] [Tooltip("眩晕时长")]
public float VertigoTimeGianRock = 3; public float VertigoTimeGianRock = 3;
......
...@@ -276,6 +276,7 @@ public class PlayerMove : MonoBehaviour ...@@ -276,6 +276,7 @@ public class PlayerMove : MonoBehaviour
if (m_bIsCanMove && !BattleCtrl.instance.isEndBattle) if (m_bIsCanMove && !BattleCtrl.instance.isEndBattle)
{ {
xDelta = 0;//避免眩晕期间不会执行UpdateJoystick();造成偏移现象。
if (timerVertigo <= 0) if (timerVertigo <= 0)
{ {
timerVertigo = 0; timerVertigo = 0;
...@@ -286,6 +287,7 @@ public class PlayerMove : MonoBehaviour ...@@ -286,6 +287,7 @@ public class PlayerMove : MonoBehaviour
{ {
//眩晕 //眩晕
timerVertigo -= Time.deltaTime; timerVertigo -= Time.deltaTime;
} }
} }
...@@ -382,11 +384,12 @@ public class PlayerMove : MonoBehaviour ...@@ -382,11 +384,12 @@ public class PlayerMove : MonoBehaviour
} }
else if (currentGesture.type == EasyTouch.EvtType.On_TouchUp) else if (currentGesture.type == EasyTouch.EvtType.On_TouchUp)
{ {
//print("鼠标抬起");//眩晕期间不会进来,也会发生飘移现象
xDelta = 0; xDelta = 0;
} }
} }
//else if (currentGesture != null && (currentGesture.type == EasyTouch.EvtType.On_DragEnd)) //else if (currentGesture != null && (currentGesture.type == EasyTouch.EvtType.On_DragEnd))
//{ //{
// addXTemp = 0; // addXTemp = 0;
......
...@@ -67,7 +67,7 @@ public class Enemy_Vertigo : MonoBehaviour ...@@ -67,7 +67,7 @@ public class Enemy_Vertigo : MonoBehaviour
{ {
hit.gameObject.GetComponent<PlayerMove>().Vertigo(VertigoTime);//眩晕1秒 hit.gameObject.GetComponent<PlayerMove>().Vertigo(VertigoTime);//眩晕1秒
hit.gameObject.GetComponent<PlayerMove>().ChangeSpeedLevel(-1); //等级降低一级 hit.gameObject.GetComponent<PlayerMove>().ChangeSpeedLevel(-1); //等级降低一级
print("------------"+transform.name); //print("------------"+transform.name);
Destroy(gameObject); Destroy(gameObject);
} }
} }
......
...@@ -2104,6 +2104,7 @@ MonoBehaviour: ...@@ -2104,6 +2104,7 @@ MonoBehaviour:
m_EditorClassIdentifier: m_EditorClassIdentifier:
backDis: 6.390015 backDis: 6.390015
upDis: 6.64 upDis: 6.64
RotateVector3: {x: 20, y: 0, z: 0}
target: {fileID: 9066730885846526947} target: {fileID: 9066730885846526947}
--- !u!1 &3837569216639476273 --- !u!1 &3837569216639476273
GameObject: GameObject:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment