53 lines
2.2 KiB
C#
53 lines
2.2 KiB
C#
using System;
|
||
using BaseGames.Camera;
|
||
using BaseGames.Dialogue;
|
||
using UnityEngine;
|
||
using UnityEngine.Timeline;
|
||
|
||
namespace BaseGames.Cutscene
|
||
{
|
||
/// <summary>
|
||
/// 过场动画数据资产(架构 14_NarrativeModule §11.5)。
|
||
/// 定义一段完整的过场内容:Timeline 资产、Track 绑定、摄像机混合、可叠加对话层。
|
||
/// 资产路径:Assets/ScriptableObjects/Cutscene/CS_{SceneId}_{ContextId}.asset
|
||
/// </summary>
|
||
[CreateAssetMenu(menuName = "BaseGames/Cutscene/Cutscene")]
|
||
public class CutsceneSO : ScriptableObject
|
||
{
|
||
[Header("Identity")]
|
||
public string cutsceneId; // 全局唯一,用于存档去重和 CutsceneManager.PlayById 查找
|
||
public string displayName;
|
||
public bool playOnlyOnce; // true → 仅首次播放(后续触发跳过)
|
||
public bool isSkippable = true; // 是否允许玩家跳过
|
||
public Sprite thumbnail; // 过场预览图(剧情重放 UI 用)
|
||
|
||
[Header("Timeline")]
|
||
public TimelineAsset Timeline; // Unity Timeline 资产
|
||
|
||
[Header("Timeline Bindings")]
|
||
// Track 与场景 GameObject 的绑定关系(避免 PlayableDirector 硬引用场景对象)
|
||
public CutsceneBinding[] Bindings;
|
||
|
||
[Header("Camera Blend")]
|
||
[Tooltip("进入过场时的摄像机混合配置(可空 = 默认瞬切)")]
|
||
public CameraBlendProfileSO BlendIn;
|
||
[Tooltip("退出过场时的摄像机混合配置(可空 = 默认瞬切)")]
|
||
public CameraBlendProfileSO BlendOut;
|
||
|
||
[Header("Optional Dialogue Overlay")]
|
||
[Tooltip("过场中可叠加播放的对话序列(由 Timeline Marker 或 SignalEmitterClip 触发)")]
|
||
public DialogueSequenceSO[] DialogueLayers;
|
||
}
|
||
|
||
/// <summary>将一条 Timeline Track(通过名称索引)绑定到运行时场景对象。</summary>
|
||
[Serializable]
|
||
public struct CutsceneBinding
|
||
{
|
||
[Tooltip("Timeline Track 的名称(需与 PlayableDirector 内轨道名一致)")]
|
||
public string trackName;
|
||
|
||
[Tooltip("绑定的目标对象;若为 null,CutsceneManager 从场景中按 tag/name 查找")]
|
||
public UnityEngine.Object target;
|
||
}
|
||
}
|