【ID1000495】修改PVP关卡战斗上阵时相机位置,写死

main
chenyuqi 2024-10-29 13:50:38 +08:00
parent 3ec6c15c11
commit 190b2e932e
1 changed files with 18 additions and 1 deletions

View File

@ -40,7 +40,13 @@ namespace Gameplay.Level
CameraManager.Instance.MainCamera.GetComponent<CameraController>().leftMargin = cameraInfo.leftMarginInPre;
CameraManager.Instance.MainCamera.GetComponent<CameraController>().topMargin = cameraInfo.topMarginInInPre;
CameraManager.Instance.MainCamera.GetComponent<CameraController>().bottomMargin = cameraInfo.bottomMarginInPre;
//PVP关卡战斗上阵时相机位置写死
if (_level.IsPvPLevel)
{
SetCameraPosInPvP();
return;
}
CameraManager.Instance.MainCamera.GetComponent<CameraController>().AdjustSelf();
}
@ -442,6 +448,17 @@ namespace Gameplay.Level
EventManager.Instance.Send(EventManager.EventName.ToFightModelDragSuc, true);
}
private void SetCameraPosInPvP()
{
var cell = new Vector2Int(3, 13);
var mainCamera = CameraManager.Instance.MainCamera;
var cameraCtrl = mainCamera.GetComponent<CameraController>();
if (cameraCtrl)
{
cameraCtrl.InitializeCameraPosition(_level.Map.BlockPosition2WorldPosition(cell));
}
}
public PrepareState(Level level) : base(level)
{
}