some updates
This commit is contained in:
@@ -154,6 +154,7 @@ public class effectEventController : MonoBehaviour
|
||||
// local 位姿被清零(见 EnsureCameraDriftPivot/EnsureCameraSkillPivot),故基准 z≈0、X≈0。
|
||||
// 首次调用 SetResolutionCameraSelf 时惰性捕获,供插值 t=0 回到该基准。
|
||||
private bool _cameraSelfBaseCaptured;
|
||||
private float _cameraSelfBaseLocalY;
|
||||
private float _cameraSelfBaseLocalZ;
|
||||
private float _cameraSelfBaseLocalRotX;
|
||||
|
||||
@@ -168,7 +169,7 @@ public class effectEventController : MonoBehaviour
|
||||
/// 故结束后回到本方法设定的值。为兼容"抖动进行中改分辨率"的罕见情形,
|
||||
/// 若相机上已有 SmoothShake 且正在抖动,同步其 startPosition/startRotation 基准。
|
||||
/// </summary>
|
||||
public bool SetResolutionCameraSelf(float t, float targetLocalRotX, float targetLocalZ)
|
||||
public bool SetResolutionCameraSelf(float t, float targetLocalRotX, float targetLocalZ, float targetLocalY = 0f)
|
||||
{
|
||||
if (cachedShakeTarget == null)
|
||||
{
|
||||
@@ -179,15 +180,18 @@ public class effectEventController : MonoBehaviour
|
||||
|
||||
if (!_cameraSelfBaseCaptured)
|
||||
{
|
||||
_cameraSelfBaseLocalY = cachedShakeTarget.localPosition.y;
|
||||
_cameraSelfBaseLocalZ = cachedShakeTarget.localPosition.z;
|
||||
_cameraSelfBaseLocalRotX = NormalizeSignedAngle(cachedShakeTarget.localEulerAngles.x);
|
||||
_cameraSelfBaseCaptured = true;
|
||||
}
|
||||
|
||||
float y = Mathf.Lerp(_cameraSelfBaseLocalY, targetLocalY, t);
|
||||
float z = Mathf.Lerp(_cameraSelfBaseLocalZ, targetLocalZ, t);
|
||||
float rotX = Mathf.Lerp(_cameraSelfBaseLocalRotX, targetLocalRotX, t);
|
||||
|
||||
Vector3 lp = cachedShakeTarget.localPosition;
|
||||
lp.y = y;
|
||||
lp.z = z;
|
||||
cachedShakeTarget.localPosition = lp;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user