修改提交
This commit is contained in:
@@ -17,6 +17,8 @@ namespace NBF
|
||||
[SerializeField] private CameraAsset _cameraAsset;
|
||||
private CameraShowMode _lastMode = CameraShowMode.None;
|
||||
|
||||
private PlayerUnityComponent FollowPlayer;
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (_lastMode == Mode) return;
|
||||
@@ -43,27 +45,26 @@ namespace NBF
|
||||
|
||||
private void SetFPPCam()
|
||||
{
|
||||
var player = FPlayer.Instance;
|
||||
if (player != null)
|
||||
if (FollowPlayer != null)
|
||||
{
|
||||
_cameraAsset.fppVCam.LookAt = player.FppLook;
|
||||
_cameraAsset.fppVCam.Follow = player.ModelAsset.NeckTransform;
|
||||
_cameraAsset.fppVCam.LookAt = FollowPlayer.FppLook;
|
||||
_cameraAsset.fppVCam.Follow = FollowPlayer.ModelAsset.NeckTransform;
|
||||
}
|
||||
|
||||
_cameraAsset.fppVCam.Priority = 10;
|
||||
_cameraAsset.tppVCam.Priority = 0;
|
||||
// StartCoroutine(SnapToTarget());
|
||||
}
|
||||
|
||||
public void SetFppLook(Transform fppCamLook)
|
||||
public void SetFppLook(PlayerUnityComponent playerUnityComponent)
|
||||
{
|
||||
_cameraAsset.fppVCam.LookAt = fppCamLook;
|
||||
FollowPlayer = playerUnityComponent;
|
||||
_cameraAsset.fppVCam.LookAt = FollowPlayer.FppLook;
|
||||
Mode = CameraShowMode.FPP;
|
||||
}
|
||||
|
||||
public void SetFppFollow(Transform fppCamFollow)
|
||||
public void SetFppFollow(PlayerUnityComponent playerUnityComponent)
|
||||
{
|
||||
_cameraAsset.fppVCam.Follow = fppCamFollow;
|
||||
_cameraAsset.fppVCam.Follow = FollowPlayer.ModelAsset.NeckTransform;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user