feat: engine improvements, new scenes, videos, subtitles, hotspot component and docs update

This commit is contained in:
2026-06-08 14:01:58 +08:00
parent e68ed9c962
commit 6b67989007
20 changed files with 354 additions and 35 deletions

View File

@@ -1,8 +1,11 @@
export interface SceneNode {
id: string
type?: 'video' | 'image'
videoUrl: string
imageUrl?: string
subtitleUrl?: string
choices?: Choice[]
hotspots?: Hotspot[]
qte?: QTEDefinition
nextScene?: string
onEnter?: Effect[]
@@ -13,7 +16,22 @@ export interface Choice {
targetScene: string
conditions?: Condition[]
effects?: Effect[]
timeLimit?: number // 单位:秒,超时后自动选择第一项
timeLimit?: number
}
export interface Hotspot {
id: string
label: string
targetScene: string
x: number
y: number
width: number
height: number
showAt?: number
hideAt?: number
conditions?: Condition[]
effects?: Effect[]
timeLimit?: number
}
export interface Condition {
@@ -73,3 +91,5 @@ export type EngineEvent =
| 'qteResult'
| 'videoEnd'
| 'choiceTimeout'
| 'hotspotRequest'
| 'hotspotUpdate'