浏览代码

Update Cutscenes to use Event Channels

/main
uChema 4 年前
当前提交
c852ab5b
共有 30 个文件被更改,包括 602 次插入206 次删除
  1. 74
      UOP1_Project/Assets/Cutscenes/ExampleCutscene.playable
  2. 157
      UOP1_Project/Assets/Scenes/Examples/CutsceneExample.unity
  3. 169
      UOP1_Project/Assets/Scenes/Gameplay.unity
  4. 36
      UOP1_Project/Assets/Scripts/Cutscenes/CutsceneManager.cs
  5. 9
      UOP1_Project/Assets/Scripts/Cutscenes/CutsceneTrigger.cs
  6. 17
      UOP1_Project/Assets/Scripts/Cutscenes/DialogueControlTrack/DialogueBehaviour.cs
  7. 2
      UOP1_Project/Assets/Scripts/Cutscenes/DialogueControlTrack/DialogueClip.cs
  8. 5
      UOP1_Project/Assets/Scripts/Cutscenes/DialogueControlTrack/DialogueTrack.cs
  9. 31
      UOP1_Project/Assets/Scripts/Dialogues/DialogueManager.cs
  10. 1
      UOP1_Project/Assets/Scripts/UI/UIManager.cs
  11. 50
      UOP1_Project/Assets/Prefabs/Managers/CutsceneManager.prefab
  12. 7
      UOP1_Project/Assets/Prefabs/Managers/CutsceneManager.prefab.meta
  13. 53
      UOP1_Project/Assets/Prefabs/Managers/DialogueManager.prefab
  14. 7
      UOP1_Project/Assets/Prefabs/Managers/DialogueManager.prefab.meta
  15. 14
      UOP1_Project/Assets/ScriptableObjects/Events/UI/MakeDialogueChoiceEvent.asset
  16. 8
      UOP1_Project/Assets/ScriptableObjects/Events/UI/MakeDialogueChoiceEvent.asset.meta
  17. 15
      UOP1_Project/Assets/ScriptableObjects/Events/UI/PauseTimelineEvent.asset
  18. 8
      UOP1_Project/Assets/ScriptableObjects/Events/UI/PauseTimelineEvent.asset.meta
  19. 14
      UOP1_Project/Assets/ScriptableObjects/Events/UI/PlayCutsceneEvent.asset
  20. 8
      UOP1_Project/Assets/ScriptableObjects/Events/UI/PlayCutsceneEvent.asset.meta
  21. 14
      UOP1_Project/Assets/ScriptableObjects/Events/UI/PlayDialogueEvent.asset
  22. 8
      UOP1_Project/Assets/ScriptableObjects/Events/UI/PlayDialogueEvent.asset.meta
  23. 14
      UOP1_Project/Assets/ScriptableObjects/Events/UI/ShowChoicesUIEvent.asset
  24. 8
      UOP1_Project/Assets/ScriptableObjects/Events/UI/ShowChoicesUIEvent.asset.meta
  25. 15
      UOP1_Project/Assets/Scripts/Events/ScriptableObjects/UI/DialogueChoiceChannelSO.cs
  26. 11
      UOP1_Project/Assets/Scripts/Events/ScriptableObjects/UI/DialogueChoiceChannelSO.cs.meta
  27. 15
      UOP1_Project/Assets/Scripts/Events/ScriptableObjects/UI/DialogueChoicesChannelSO.cs
  28. 11
      UOP1_Project/Assets/Scripts/Events/ScriptableObjects/UI/DialogueChoicesChannelSO.cs.meta
  29. 16
      UOP1_Project/Assets/Scripts/Events/ScriptableObjects/UI/PlayableDirectorChannelSO.cs
  30. 11
      UOP1_Project/Assets/Scripts/Events/ScriptableObjects/UI/PlayableDirectorChannelSO.cs.meta

74
UOP1_Project/Assets/Cutscenes/ExampleCutscene.playable


m_EditorClassIdentifier:
_template:
_dialogueLine: {fileID: 11400000, guid: fda69b0faa3f28b4a87ba294f83eedea, type: 2}
_actor: {fileID: 11400000, guid: 027d026cf519df04eb8b7bf251472e13, type: 2}
cutsceneManager: {fileID: 0}
cutsceneManager: {fileID: 0}
PlayDialogueEvent: {fileID: 11400000, guid: f235c0e2f24681044aa448291b13aaac,
type: 2}
PauseTimelineEvent: {fileID: 11400000, guid: 9b0fb5f181adc6b4ca020743fed6c020,
type: 2}
--- !u!114 &-8992890383746913626
MonoBehaviour:
m_ObjectHideFlags: 1

m_BlendOutDuration: 0.5333333333333332
m_MixInCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
- serializedVersion: 3
time: 1
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
m_Curve: []
m_Curve:
- serializedVersion: 3
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
- serializedVersion: 3
time: 1
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
m_Curve: []
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4

m_BlendOutDuration: -1
m_MixInCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
- serializedVersion: 3
time: 1
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
m_Curve: []
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4

m_EditorClassIdentifier:
_template:
_dialogueLine: {fileID: 11400000, guid: 9542270160df90441b23f4575fecee78, type: 2}
_actor: {fileID: 11400000, guid: 027d026cf519df04eb8b7bf251472e13, type: 2}
cutsceneManager: {fileID: 0}
cutsceneManager: {fileID: 0}
PlayDialogueEvent: {fileID: 11400000, guid: f235c0e2f24681044aa448291b13aaac,
type: 2}
PauseTimelineEvent: {fileID: 11400000, guid: 9b0fb5f181adc6b4ca020743fed6c020,
type: 2}
--- !u!114 &5472072730035891554
MonoBehaviour:
m_ObjectHideFlags: 1

157
UOP1_Project/Assets/Scenes/Examples/CutsceneExample.unity


m_LocalScale: {x: 5, y: 5, z: 5}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 14
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &159251022
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 159251025}
- component: {fileID: 159251023}
m_Layer: 0
m_Name: CutsceneManager
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &159251023
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 159251022}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 51755885c3e549b6b9c0a42acba7a0e8, type: 3}
m_Name:
m_EditorClassIdentifier:
_inputReader: {fileID: 11400000, guid: 945ec0365077176418488737deed54be, type: 2}
_dialogueManager: {fileID: 670213351}
--- !u!4 &159251025
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 159251022}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 553.7176, y: 111.36853, z: 61.93091}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 8
m_RootOrder: 12
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &217050266
PrefabInstance:

m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 12
m_RootOrder: 10
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &263925610
GameObject:

m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 13
m_RootOrder: 11
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &400160192
GameObject:

m_InitialTime: 0
m_SceneBindings:
- key: {fileID: 1900134804166205457, guid: eaecfe91517330c48a870c5eb292a50b, type: 2}
value: {fileID: 159251023}
value: {fileID: 0}
- key: {fileID: -7243414920591819180, guid: eaecfe91517330c48a870c5eb292a50b, type: 2}
value: {fileID: 2009359109}
m_ExposedReferences:

objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 54d1f8b93400ea64d97c276fab375df3, type: 3}
--- !u!1 &670213349
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 670213350}
- component: {fileID: 670213351}
m_Layer: 0
m_Name: DialogueManager
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &670213350
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 670213349}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 9
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &670213351
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 670213349}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: e1faa963712171c468c0ea8746754bf6, type: 3}
m_Name:
m_EditorClassIdentifier:
_inputReader: {fileID: 11400000, guid: 945ec0365077176418488737deed54be, type: 2}
dialogueLineEvent: {fileID: 11400000, guid: d987db4881d794f2da0013a89588d890, type: 2}
--- !u!1 &695792052
GameObject:
m_ObjectHideFlags: 0

m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 11
m_RootOrder: 9
m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}
--- !u!1 &826602623
GameObject:

m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 10
m_RootOrder: 8
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &976924101
GameObject:

m_Script: {fileID: 11500000, guid: a1b57f138bf282148942d40c320dc9ba, type: 3}
m_Name:
m_EditorClassIdentifier:
_cutsceneManager: {fileID: 159251023}
PlayCutsceneEvent: {fileID: 11400000, guid: 9397b637ea93a3a4fb144834511eb199, type: 2}
--- !u!1 &1094338735
GameObject:
m_ObjectHideFlags: 0

- {fileID: 2083851273}
- {fileID: 302373843}
m_Father: {fileID: 0}
m_RootOrder: 15
m_RootOrder: 13
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1348188976
GameObject:

m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 16
m_RootOrder: 14
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1536930179
GameObject:

m_Script: {fileID: 11500000, guid: a1b57f138bf282148942d40c320dc9ba, type: 3}
m_Name:
m_EditorClassIdentifier:
_cutsceneManager: {fileID: 159251023}
PlayCutsceneEvent: {fileID: 11400000, guid: 9397b637ea93a3a4fb144834511eb199, type: 2}
--- !u!33 &1705770414
MeshFilter:
m_ObjectHideFlags: 0

- target: {fileID: 1657732992883833910, guid: 45632f0a227c860489bcba0eb1f4ec3e,
type: 3}
propertyPath: m_LocalRotation.y
value: 0.03563515
value: 0.03581318
value: -0.009175836
value: -0.008454343
value: 0.24919106
value: 0.22959732
objectReference: {fileID: 0}
- target: {fileID: 1657732992883833910, guid: 45632f0a227c860489bcba0eb1f4ec3e,
type: 3}
propertyPath: m_LocalRotation.w
value: 0.97258985
value: 0.035795752
value: 0.03581318
value: -0.0085278535
value: -0.008454343
value: 0.23159355
value: 0.22959732
objectReference: {fileID: 0}
- target: {fileID: 2808035858438402709, guid: 45632f0a227c860489bcba0eb1f4ec3e,
type: 3}
propertyPath: m_LocalRotation.w
value: 0.97258985
objectReference: {fileID: 0}
- target: {fileID: 2955398947125553842, guid: 45632f0a227c860489bcba0eb1f4ec3e,
type: 3}

- target: {fileID: 2955398947125553842, guid: 45632f0a227c860489bcba0eb1f4ec3e,
type: 3}
propertyPath: m_LocalRotation.y
value: 0.035813205
value: 0.03581318
value: -0.008454349
value: -0.008454343
objectReference: {fileID: 0}
- target: {fileID: 2955398947125553842, guid: 45632f0a227c860489bcba0eb1f4ec3e,
type: 3}

- target: {fileID: 2955398947125553842, guid: 45632f0a227c860489bcba0eb1f4ec3e,
type: 3}
propertyPath: m_LocalRotation.w
value: 0.97258985
objectReference: {fileID: 0}
- target: {fileID: 8745341640208226293, guid: 45632f0a227c860489bcba0eb1f4ec3e,
type: 3}
propertyPath: m_Name

- target: {fileID: 8745341641394998850, guid: 45632f0a227c860489bcba0eb1f4ec3e,
type: 3}
propertyPath: m_LocalPosition.x
value: -0.73545265
value: -0.88254315
value: -9.9729185
value: -11.967503
value: 0.24919108
value: 0.22959733
value: 0.03563516
value: 0.03581318
value: -0.009175838
value: -0.008454344
value: -0.73545265
value: -0.88254315
value: -9.9729185
value: -11.967503
value: 0.9286216
value: 0.97258985
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 45632f0a227c860489bcba0eb1f4ec3e, type: 3}

169
UOP1_Project/Assets/Scenes/Gameplay.unity


m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 3
m_RootOrder: 5
--- !u!114 &670213351 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 8980297398607076176, guid: ccad748453924ff4092fe3e5b978d8e5,
type: 3}
m_PrefabInstance: {fileID: 8980297399098703799}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: e1faa963712171c468c0ea8746754bf6, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!224 &1172743537 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 9125883718042355530, guid: 42ed5ae1f90714c4488cfabda2298591,

- {fileID: 1598614622}
- {fileID: 1172743537}
m_Father: {fileID: 0}
m_RootOrder: 2
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}

--- !u!1001 &1395789391981611399
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 1395789391861871560, guid: acaae42dd59e9664faee318857afc823,
type: 3}
propertyPath: _dialogueManager
value:
objectReference: {fileID: 670213351}
- target: {fileID: 1395789391861871561, guid: acaae42dd59e9664faee318857afc823,
type: 3}
propertyPath: m_Name
value: CutsceneManager
objectReference: {fileID: 0}
- target: {fileID: 1395789391861871574, guid: acaae42dd59e9664faee318857afc823,
type: 3}
propertyPath: m_LocalPosition.x
value: 553.7176
objectReference: {fileID: 0}
- target: {fileID: 1395789391861871574, guid: acaae42dd59e9664faee318857afc823,
type: 3}
propertyPath: m_LocalPosition.y
value: 111.36853
objectReference: {fileID: 0}
- target: {fileID: 1395789391861871574, guid: acaae42dd59e9664faee318857afc823,
type: 3}
propertyPath: m_LocalPosition.z
value: 61.93091
objectReference: {fileID: 0}
- target: {fileID: 1395789391861871574, guid: acaae42dd59e9664faee318857afc823,
type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1395789391861871574, guid: acaae42dd59e9664faee318857afc823,
type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1395789391861871574, guid: acaae42dd59e9664faee318857afc823,
type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1395789391861871574, guid: acaae42dd59e9664faee318857afc823,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1395789391861871574, guid: acaae42dd59e9664faee318857afc823,
type: 3}
propertyPath: m_RootOrder
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1395789391861871574, guid: acaae42dd59e9664faee318857afc823,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1395789391861871574, guid: acaae42dd59e9664faee318857afc823,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1395789391861871574, guid: acaae42dd59e9664faee318857afc823,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: acaae42dd59e9664faee318857afc823, type: 3}
--- !u!1001 &1970466630767436857
PrefabInstance:
m_ObjectHideFlags: 0

- target: {fileID: 1970466629595806505, guid: 9e5d964358f2bcc4db1c7e33aace9d8d,
type: 3}
propertyPath: m_RootOrder
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1970466629595806505, guid: 9e5d964358f2bcc4db1c7e33aace9d8d,
type: 3}

- target: {fileID: 8313085416397863404, guid: 2af68f4e6b94140cfbcdee05fcc28ce3,
type: 3}
propertyPath: m_RootOrder
value: 1
value: 3
objectReference: {fileID: 0}
- target: {fileID: 8313085416397863404, guid: 2af68f4e6b94140cfbcdee05fcc28ce3,
type: 3}

propertyPath: interactionPanel
value:
objectReference: {fileID: 6822594372875662427}
- target: {fileID: 8313085416397863411, guid: 2af68f4e6b94140cfbcdee05fcc28ce3,
type: 3}
propertyPath: ShowChoicesUIEvent
value:
objectReference: {fileID: 11400000, guid: a4e5e48a0f3430c4197b317e650727c6,
type: 2}
--- !u!1001 &8980297399098703799
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 8980297398607076177, guid: ccad748453924ff4092fe3e5b978d8e5,
type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8980297398607076177, guid: ccad748453924ff4092fe3e5b978d8e5,
type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8980297398607076177, guid: ccad748453924ff4092fe3e5b978d8e5,
type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8980297398607076177, guid: ccad748453924ff4092fe3e5b978d8e5,
type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8980297398607076177, guid: ccad748453924ff4092fe3e5b978d8e5,
type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8980297398607076177, guid: ccad748453924ff4092fe3e5b978d8e5,
type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8980297398607076177, guid: ccad748453924ff4092fe3e5b978d8e5,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8980297398607076177, guid: ccad748453924ff4092fe3e5b978d8e5,
type: 3}
propertyPath: m_RootOrder
value: 2
objectReference: {fileID: 0}
- target: {fileID: 8980297398607076177, guid: ccad748453924ff4092fe3e5b978d8e5,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8980297398607076177, guid: ccad748453924ff4092fe3e5b978d8e5,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8980297398607076177, guid: ccad748453924ff4092fe3e5b978d8e5,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8980297398607076178, guid: ccad748453924ff4092fe3e5b978d8e5,
type: 3}
propertyPath: m_Name
value: DialogueManager
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: ccad748453924ff4092fe3e5b978d8e5, type: 3}
--- !u!1001 &9125883717020623419
PrefabInstance:
m_ObjectHideFlags: 0

36
UOP1_Project/Assets/Scripts/Cutscenes/CutsceneManager.cs


[SerializeField] private InputReader _inputReader = default;
[SerializeField] private DialogueManager _dialogueManager = default;
[SerializeField] private PlayableDirectorChannelSO PlayCutsceneEvent;
[SerializeField] public DialogueLineChannelSO PlayDialogueEvent;
[SerializeField] public VoidEventChannelSO PauseTimelineEvent;
public bool IsCutscenePlaying => _activePlayableDirector.playableGraph.GetRootPlayable(0).GetSpeed() != 0d;
bool IsCutscenePlaying => _activePlayableDirector.playableGraph.GetRootPlayable(0).GetSpeed() != 0d;
private void OnEnable()
{

{
_inputReader.advanceDialogueEvent -= OnAdvance;
}
private void Start()
{
if( PlayCutsceneEvent!=null)
{
public void PlayCutscene(PlayableDirector activePlayableDirector)
PlayCutsceneEvent.OnEventRaised += PlayCutscene;
}
if (PlayDialogueEvent != null)
{
PlayDialogueEvent.OnEventRaised += PlayDialogueFromClip;
}
if (PauseTimelineEvent != null)
{
PauseTimelineEvent.OnEventRaised += PauseTimeline;
}
}
void PlayCutscene(PlayableDirector activePlayableDirector)
{
_inputReader.EnableDialogueInput();

_activePlayableDirector.stopped += HandleDirectorStopped;
}
public void CutsceneEnded()
void CutsceneEnded()
{
if (_activePlayableDirector != null)
_activePlayableDirector.stopped -= HandleDirectorStopped;

private void HandleDirectorStopped(PlayableDirector director) => CutsceneEnded();
public void PlayDialogueFromClip(DialogueLineSO dialogueLine, ActorSO actor)
void PlayDialogueFromClip(DialogueLineSO dialogueLine, ActorSO actor)
{
_dialogueManager.DisplayDialogueLine(dialogueLine, actor);
}

/// <summary>
/// Called by <c>DialogueControlClip</c> on the Timeline.
/// </summary>
public void PauseTimeline()
void PauseTimeline()
public void ResumeTimeline()
void ResumeTimeline()
{
_isPaused = false;
_activePlayableDirector.playableGraph.GetRootPlayable(0).SetSpeed(1);

9
UOP1_Project/Assets/Scripts/Cutscenes/CutsceneTrigger.cs


public class CutsceneTrigger : MonoBehaviour
{
[SerializeField] private CutsceneManager _cutsceneManager = default;
[SerializeField] private PlayableDirectorChannelSO PlayCutsceneEvent;
_cutsceneManager.PlayCutscene(_playableDirector);
if(PlayCutsceneEvent!=null)
PlayCutsceneEvent.RaiseEvent(_playableDirector);
_cutsceneManager.PlayCutscene(_playableDirector);
if (PlayCutsceneEvent != null)
PlayCutsceneEvent.RaiseEvent(_playableDirector);
if (_playOnce)
Destroy(this);

17
UOP1_Project/Assets/Scripts/Cutscenes/DialogueControlTrack/DialogueBehaviour.cs


[SerializeField] private bool _pauseWhenClipEnds = default; //This won't work if the clip ends on the very last frame of the Timeline
[HideInInspector] public CutsceneManager cutsceneManager;
[SerializeField] public DialogueLineChannelSO PlayDialogueEvent;
[SerializeField] public VoidEventChannelSO PauseTimelineEvent;
private bool _dialoguePlayed;

if (Application.isPlaying) //TODO: Find a way to "play" dialogue lines even when scrubbing the Timeline not in Play Mode
{
// Need to ask the CutsceneManager if the cutscene is playing, since the graph is not actually stopped/paused: it's just going at speed 0.
if (playable.GetGraph().IsPlaying()
&& cutsceneManager.IsCutscenePlaying)
if (playable.GetGraph().IsPlaying())
//&& cutsceneManager.IsCutscenePlaying) Need to find an alternative to this
if (_dialogueLine != null&& _actor != null)
if (_dialogueLine != null && _actor != null)
cutsceneManager.PlayDialogueFromClip(_dialogueLine, _actor );
if(PlayDialogueEvent != null)
PlayDialogueEvent.RaiseEvent(_dialogueLine, _actor );
_dialoguePlayed = true;
}
else

&& _dialoguePlayed)
{
if (_pauseWhenClipEnds)
cutsceneManager.PauseTimeline();
if(PauseTimelineEvent!=null)
{
PauseTimelineEvent.OnEventRaised();
}
}
}
}

2
UOP1_Project/Assets/Scripts/Cutscenes/DialogueControlTrack/DialogueClip.cs


public class DialogueClip : PlayableAsset, ITimelineClipAsset
{
[SerializeField] private DialogueBehaviour _template = default;
[HideInInspector] public CutsceneManager cutsceneManager;
// Having ClipCaps set to None makes sure that the clips can't be blended, extrapolated, looped, etc.
public ClipCaps clipCaps

public override Playable CreatePlayable(PlayableGraph graph, GameObject owner)
{
_template.cutsceneManager = cutsceneManager;
ScriptPlayable<DialogueBehaviour> playable = ScriptPlayable<DialogueBehaviour>.Create(graph, _template);
return playable;

5
UOP1_Project/Assets/Scripts/Cutscenes/DialogueControlTrack/DialogueTrack.cs


using UnityEngine.Playables;
using UnityEngine.Timeline;
[TrackBindingType(typeof(CutsceneManager))]
CutsceneManager cutsceneManagerRef = go.GetComponent<PlayableDirector>().GetGenericBinding(this) as CutsceneManager;
dialogueControlClip.cutsceneManager = cutsceneManagerRef;
}
return base.CreateTrackMixer(graph, go, inputCount);

31
UOP1_Project/Assets/Scripts/Dialogues/DialogueManager.cs


[SerializeField] private InputReader _inputReader = default;
public DialogueLineChannelSO OpenUIDialogueEvent;
public DialogueChoicesChannelSO ShowChoicesUIEvent;
public DialogueChoiceChannelSO MakeDialogueChoiceEvent;
private void Start()
{
}
/// <summary>
/// Displays DialogueData in the UI, one by one.

/// <param name="dialogueLine"></param>
public void DisplayDialogueLine(DialogueLineSO dialogueLine, ActorSO actor)
{
if(OpenUIDialogueEvent!=null)
if(OpenUIDialogueEvent!=null)
OpenUIDialogueEvent.RaiseEvent(dialogueLine, actor);
}
}

{
_inputReader.advanceDialogueEvent -= OnAdvance;
// TODO: Demonstration purpose only. Remove or adjust later.
//_choiceBox.Show(_currentDialogueDataSO.Choices, this);
if (MakeDialogueChoiceEvent != null)
{
MakeDialogueChoiceEvent.OnEventRaised += MakeDialogueChoice;
}
if (ShowChoicesUIEvent != null)
{
ShowChoicesUIEvent.RaiseEvent(choices);
}
}
private void MakeDialogueChoice(Choice choice)
{
if (MakeDialogueChoiceEvent != null)
{
MakeDialogueChoiceEvent.OnEventRaised -= MakeDialogueChoice;
}
DisplayDialogueData(choice.NextDialogue);
}
public void DialogueEnded()

1
UOP1_Project/Assets/Scripts/UI/UIManager.cs


public DialogueLineChannelSO OpenUIDialogueEvent;
public VoidEventChannelSO CloseUIDialogueEvent;
public DialogueChoicesChannelSO ShowChoicesUIEvent;
public VoidEventChannelSO OpenInventoryScreenEvent;
public VoidEventChannelSO OpenInventoryScreenForCookingEvent;

50
UOP1_Project/Assets/Prefabs/Managers/CutsceneManager.prefab


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &1395789391861871561
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1395789391861871574}
- component: {fileID: 1395789391861871560}
m_Layer: 0
m_Name: CutsceneManager
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1395789391861871574
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1395789391861871561}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 553.7176, y: 111.36853, z: 61.93091}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &1395789391861871560
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1395789391861871561}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 51755885c3e549b6b9c0a42acba7a0e8, type: 3}
m_Name:
m_EditorClassIdentifier:
_inputReader: {fileID: 11400000, guid: 945ec0365077176418488737deed54be, type: 2}
_dialogueManager: {fileID: 0}
PlayCutsceneEvent: {fileID: 11400000, guid: 9397b637ea93a3a4fb144834511eb199, type: 2}
PlayDialogueEvent: {fileID: 11400000, guid: f235c0e2f24681044aa448291b13aaac, type: 2}
PauseTimelineEvent: {fileID: 11400000, guid: 9b0fb5f181adc6b4ca020743fed6c020, type: 2}

7
UOP1_Project/Assets/Prefabs/Managers/CutsceneManager.prefab.meta


fileFormatVersion: 2
guid: acaae42dd59e9664faee318857afc823
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

53
UOP1_Project/Assets/Prefabs/Managers/DialogueManager.prefab


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &8980297398607076178
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 8980297398607076177}
- component: {fileID: 8980297398607076176}
m_Layer: 0
m_Name: DialogueManager
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &8980297398607076177
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8980297398607076178}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &8980297398607076176
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8980297398607076178}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: e1faa963712171c468c0ea8746754bf6, type: 3}
m_Name:
m_EditorClassIdentifier:
_inputReader: {fileID: 11400000, guid: 945ec0365077176418488737deed54be, type: 2}
OpenUIDialogueEvent: {fileID: 11400000, guid: d987db4881d794f2da0013a89588d890,
type: 2}
ShowChoicesUIEvent: {fileID: 11400000, guid: a4e5e48a0f3430c4197b317e650727c6, type: 2}
MakeDialogueChoiceEvent: {fileID: 11400000, guid: f7b40077957f3834a8d5354c3e4ce759,
type: 2}
CloseUIDialogueEvent: {fileID: 11400000, guid: 53a7f1f01ef364704b1d45d01f2421ae,
type: 2}

7
UOP1_Project/Assets/Prefabs/Managers/DialogueManager.prefab.meta


fileFormatVersion: 2
guid: ccad748453924ff4092fe3e5b978d8e5
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

14
UOP1_Project/Assets/ScriptableObjects/Events/UI/MakeDialogueChoiceEvent.asset


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 92d6e2e5616f2854793bb622c02584fc, type: 3}
m_Name: MakeDialogueChoiceEvent
m_EditorClassIdentifier:

8
UOP1_Project/Assets/ScriptableObjects/Events/UI/MakeDialogueChoiceEvent.asset.meta


fileFormatVersion: 2
guid: f7b40077957f3834a8d5354c3e4ce759
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:

15
UOP1_Project/Assets/ScriptableObjects/Events/UI/PauseTimelineEvent.asset


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 7fafac715ff920c4383fed91a38a351e, type: 3}
m_Name: PauseTimelineEvent
m_EditorClassIdentifier:
description:

8
UOP1_Project/Assets/ScriptableObjects/Events/UI/PauseTimelineEvent.asset.meta


fileFormatVersion: 2
guid: 9b0fb5f181adc6b4ca020743fed6c020
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:

14
UOP1_Project/Assets/ScriptableObjects/Events/UI/PlayCutsceneEvent.asset


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 270378258ff1105459c8a4e2ed30d00a, type: 3}
m_Name: PlayCutsceneEvent
m_EditorClassIdentifier:

8
UOP1_Project/Assets/ScriptableObjects/Events/UI/PlayCutsceneEvent.asset.meta


fileFormatVersion: 2
guid: 9397b637ea93a3a4fb144834511eb199
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:

14
UOP1_Project/Assets/ScriptableObjects/Events/UI/PlayDialogueEvent.asset


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 490ff092768904d48a87607706dc6570, type: 3}
m_Name: PlayDialogueEvent
m_EditorClassIdentifier:

8
UOP1_Project/Assets/ScriptableObjects/Events/UI/PlayDialogueEvent.asset.meta


fileFormatVersion: 2
guid: f235c0e2f24681044aa448291b13aaac
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:

14
UOP1_Project/Assets/ScriptableObjects/Events/UI/ShowChoicesUIEvent.asset


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fb8abfb853214a640b1ef16073934c92, type: 3}
m_Name: ShowChoicesUIEvent
m_EditorClassIdentifier:

8
UOP1_Project/Assets/ScriptableObjects/Events/UI/ShowChoicesUIEvent.asset.meta


fileFormatVersion: 2
guid: a4e5e48a0f3430c4197b317e650727c6
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:

15
UOP1_Project/Assets/Scripts/Events/ScriptableObjects/UI/DialogueChoiceChannelSO.cs


using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
[CreateAssetMenu(menuName = "Events/UI/Dialogue Choice Channel")]
public class DialogueChoiceChannelSO : ScriptableObject
{
public UnityAction<Choice> OnEventRaised;
public void RaiseEvent(Choice choice)
{
if (OnEventRaised != null)
OnEventRaised.Invoke(choice);
}
}

11
UOP1_Project/Assets/Scripts/Events/ScriptableObjects/UI/DialogueChoiceChannelSO.cs.meta


fileFormatVersion: 2
guid: 92d6e2e5616f2854793bb622c02584fc
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

15
UOP1_Project/Assets/Scripts/Events/ScriptableObjects/UI/DialogueChoicesChannelSO.cs


using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
[CreateAssetMenu(menuName = "Events/UI/Dialogue Choices Channel")]
public class DialogueChoicesChannelSO : ScriptableObject
{
public UnityAction<List<Choice>> OnEventRaised;
public void RaiseEvent(List<Choice> choices)
{
if (OnEventRaised != null)
OnEventRaised.Invoke(choices);
}
}

11
UOP1_Project/Assets/Scripts/Events/ScriptableObjects/UI/DialogueChoicesChannelSO.cs.meta


fileFormatVersion: 2
guid: fb8abfb853214a640b1ef16073934c92
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

16
UOP1_Project/Assets/Scripts/Events/ScriptableObjects/UI/PlayableDirectorChannelSO.cs


using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.Playables;
[CreateAssetMenu(menuName = "Events/Playable Director Channel")]
public class PlayableDirectorChannelSO : ScriptableObject
{
public UnityAction<PlayableDirector> OnEventRaised;
public void RaiseEvent(PlayableDirector playable)
{
if (OnEventRaised != null)
OnEventRaised.Invoke(playable);
}
}

11
UOP1_Project/Assets/Scripts/Events/ScriptableObjects/UI/PlayableDirectorChannelSO.cs.meta


fileFormatVersion: 2
guid: 270378258ff1105459c8a4e2ed30d00a
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
正在加载...
取消
保存