【镜头】增加选中单位镜头自动居中

main
刘涛 2024-10-08 15:54:16 +08:00
parent 1e5f5e157b
commit 04756b7bf6
2 changed files with 8 additions and 1 deletions

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,6 @@
using Gameplay.Level.Select;
using Gameplay.Unit;
using PhxhSDK;
namespace Gameplay.Level
{
@ -22,6 +23,12 @@ namespace Gameplay.Level
UnSelectUnit();
newUnit.OnSelect();
selectView.SetOwner(newUnit);
// 居中镜头
if (LevelManager.Instance.CurrentLevel.isInBattle)
{
CameraManager.Instance.MainCamera.GetComponent<CameraController>().KeepCenter(newUnit.transform.position);
}
}
public void SelectUnit(uint id)