chore: initial commit
This commit is contained in:
25
Assets/Scripts/Camera/CameraBlendProfileSO.cs
Normal file
25
Assets/Scripts/Camera/CameraBlendProfileSO.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using UnityEngine;
|
||||
using Unity.Cinemachine;
|
||||
|
||||
namespace BaseGames.Camera
|
||||
{
|
||||
[CreateAssetMenu(menuName = "Camera/BlendProfile")]
|
||||
public class CameraBlendProfileSO : ScriptableObject
|
||||
{
|
||||
public CinemachineBlendDefinition.Styles Style = CinemachineBlendDefinition.Styles.EaseInOut;
|
||||
public float BlendTime = 0.5f;
|
||||
[Tooltip("Style = Custom 时使用")]
|
||||
public AnimationCurve CustomCurve = AnimationCurve.EaseInOut(0f, 0f, 1f, 1f);
|
||||
|
||||
/// <summary>转换为 Cinemachine 混合定义。</summary>
|
||||
public CinemachineBlendDefinition ToBlendDefinition()
|
||||
{
|
||||
return new CinemachineBlendDefinition
|
||||
{
|
||||
Style = this.Style,
|
||||
Time = this.BlendTime,
|
||||
CustomCurve = this.Style == CinemachineBlendDefinition.Styles.Custom ? CustomCurve : null
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user