提交动画相关内容个、
This commit is contained in:
@@ -5,6 +5,7 @@ using UnityEngine;
|
||||
|
||||
namespace NBF
|
||||
{
|
||||
[Serializable]
|
||||
public enum PlayerState
|
||||
{
|
||||
idle = 0,
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NBF
|
||||
{
|
||||
@@ -47,13 +48,12 @@ namespace NBF
|
||||
{
|
||||
_cameraAsset.fppVCam.LookAt = player.FppLook;
|
||||
_cameraAsset.fppVCam.Follow = player.ModelAsset.NeckTransform;
|
||||
// _cameraAsset.fppVCam.follow
|
||||
// _cameraAsset.fppVCam.ResolveFollow()
|
||||
player.ModelAsset.LookIk.solver.target = player.FppLook;
|
||||
}
|
||||
|
||||
_cameraAsset.fppVCam.Priority = 10;
|
||||
_cameraAsset.tppVCam.Priority = 0;
|
||||
StartCoroutine(SnapToTarget());
|
||||
}
|
||||
|
||||
public void SetFppLook(Transform fppCamLook)
|
||||
@@ -65,5 +65,22 @@ namespace NBF
|
||||
{
|
||||
_cameraAsset.fppVCam.Follow = fppCamFollow;
|
||||
}
|
||||
|
||||
IEnumerator SnapToTarget()
|
||||
{
|
||||
// 等 Cinemachine 先激活并跑一帧
|
||||
yield return null;
|
||||
Transform follow = _cameraAsset.fppVCam.Follow;
|
||||
|
||||
_cameraAsset.fppVCam.OnTargetObjectWarped(
|
||||
follow,
|
||||
follow.position - _cameraAsset.fppVCam.transform.position
|
||||
);
|
||||
|
||||
// _cameraAsset.fppVCam.OnTargetObjectWarped(
|
||||
// FPlayer.Instance.ModelAsset.NeckTransform,
|
||||
// FPlayer.Instance.ModelAsset.NeckTransform.position - _cameraAsset.fppVCam.transform.position
|
||||
// );
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user