整合SLSUtilities
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
using Unity.Cinemachine;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Serialization;
|
||||
|
||||
namespace SLSUtilities.Cinemachine
|
||||
{
|
||||
[AddComponentMenu("Cinemachine/Procedural/Extensions/Cinemachine Rotation Offset")]
|
||||
[ExecuteAlways]
|
||||
[SaveDuringPlay]
|
||||
public class CinemachineRotationOffset : CinemachineExtension
|
||||
{
|
||||
public Vector3 rotationOffset; // 你可以在这里控制 X 和 Y 的抖动
|
||||
|
||||
protected override void PostPipelineStageCallback(
|
||||
CinemachineVirtualCameraBase vcam,
|
||||
CinemachineCore.Stage stage, ref CameraState state, float deltaTime)
|
||||
{
|
||||
// 在最终的 Aim 阶段之后应用偏移
|
||||
if (stage == CinemachineCore.Stage.Aim)
|
||||
{
|
||||
state.RawOrientation *= Quaternion.Euler(rotationOffset);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user