浏览代码

Dialogue And Quest Managers + Refractoring some scripts

/main
uChema 4 年前
当前提交
a16fe655
共有 86 个文件被更改,包括 1248 次插入298 次删除
  1. 25
      UOP1_Project/Assets/Prefabs/Characters/BardHare.prefab
  2. 9
      UOP1_Project/Assets/Prefabs/Managers/DialogueManager.prefab
  3. 2
      UOP1_Project/Assets/Prefabs/Managers/InventoryManager.prefab
  4. 16
      UOP1_Project/Assets/Prefabs/Managers/UIManager.prefab
  5. 91
      UOP1_Project/Assets/Scenes/Examples/InteractionExample.unity
  6. 212
      UOP1_Project/Assets/Scenes/Gameplay.unity
  7. 2
      UOP1_Project/Assets/ScriptableObjects/Events/UI/ChangeTabInventoryUIEvent.asset
  8. 9
      UOP1_Project/Assets/Scripts/Dialogues/DialogueDataSO.cs
  9. 88
      UOP1_Project/Assets/Scripts/Dialogues/DialogueManager.cs
  10. 6
      UOP1_Project/Assets/Scripts/Interaction/InteractionManager.cs
  11. 57
      UOP1_Project/Assets/Scripts/UI/UIManager.cs
  12. 55
      UOP1_Project/Assets/Prefabs/Managers/QuestManager.prefab
  13. 7
      UOP1_Project/Assets/Prefabs/Managers/QuestManager.prefab.meta
  14. 54
      UOP1_Project/Assets/Prefabs/Managers/TaskManager.prefab
  15. 7
      UOP1_Project/Assets/Prefabs/Managers/TaskManager.prefab.meta
  16. 8
      UOP1_Project/Assets/ScriptableObjects/Events/Dialogue.meta
  17. 8
      UOP1_Project/Assets/ScriptableObjects/Events/Inventory.meta
  18. 8
      UOP1_Project/Assets/ScriptableObjects/Events/Quests.meta
  19. 15
      UOP1_Project/Assets/ScriptableObjects/Events/UI/CloseDialogueUIEvent.asset
  20. 15
      UOP1_Project/Assets/ScriptableObjects/Events/UI/CloseInventoryUIEvent.asset
  21. 15
      UOP1_Project/Assets/ScriptableObjects/Events/UI/OpenInventoryUIEvent.asset
  22. 8
      UOP1_Project/Assets/ScriptableObjects/Quests.meta
  23. 15
      UOP1_Project/Assets/Scripts/Events/ScriptableObjects/UI/TaskChannelSO.cs
  24. 11
      UOP1_Project/Assets/Scripts/Events/ScriptableObjects/UI/TaskChannelSO.cs.meta
  25. 28
      UOP1_Project/Assets/Scripts/UI/UIDialogueChoiceFiller.cs
  26. 15
      UOP1_Project/Assets/ScriptableObjects/Events/Dialogue/EndDialogueEvent.asset
  27. 8
      UOP1_Project/Assets/ScriptableObjects/Events/Dialogue/EndDialogueEvent.asset.meta
  28. 14
      UOP1_Project/Assets/ScriptableObjects/Events/Dialogue/InteractionWithActorEvent.asset
  29. 8
      UOP1_Project/Assets/ScriptableObjects/Events/Dialogue/InteractionWithActorEvent.asset.meta
  30. 14
      UOP1_Project/Assets/ScriptableObjects/Events/Dialogue/StartDialogueEvent.asset
  31. 8
      UOP1_Project/Assets/ScriptableObjects/Events/Dialogue/StartDialogueEvent.asset.meta
  32. 15
      UOP1_Project/Assets/ScriptableObjects/Events/Quests/CheckTaskValidityEvent.asset
  33. 8
      UOP1_Project/Assets/ScriptableObjects/Events/Quests/CheckTaskValidityEvent.asset.meta
  34. 15
      UOP1_Project/Assets/ScriptableObjects/Events/Quests/EndTaskEvent.asset
  35. 8
      UOP1_Project/Assets/ScriptableObjects/Events/Quests/EndTaskEvent.asset.meta
  36. 14
      UOP1_Project/Assets/ScriptableObjects/Events/Quests/GiveItemEvent.asset
  37. 8
      UOP1_Project/Assets/ScriptableObjects/Events/Quests/GiveItemEvent.asset.meta
  38. 15
      UOP1_Project/Assets/ScriptableObjects/Events/Quests/LoseDialogueEvent.asset
  39. 8
      UOP1_Project/Assets/ScriptableObjects/Events/Quests/LoseDialogueEvent.asset.meta
  40. 14
      UOP1_Project/Assets/ScriptableObjects/Events/Quests/RewardItemEvent.asset
  41. 8
      UOP1_Project/Assets/ScriptableObjects/Events/Quests/RewardItemEvent.asset.meta
  42. 14
      UOP1_Project/Assets/ScriptableObjects/Events/Quests/StartTaskEvent.asset
  43. 8
      UOP1_Project/Assets/ScriptableObjects/Events/Quests/StartTaskEvent.asset.meta
  44. 15
      UOP1_Project/Assets/ScriptableObjects/Events/Quests/WinDialogueEvent.asset
  45. 8
      UOP1_Project/Assets/ScriptableObjects/Events/Quests/WinDialogueEvent.asset.meta
  46. 186
      UOP1_Project/Assets/Scripts/Quests/QuestManager.cs
  47. 8
      UOP1_Project/Assets/Scripts/Quests/ScriptableObjects.meta
  48. 19
      UOP1_Project/Assets/Scripts/Quests/ScriptableObjects/QuestSO.cs
  49. 50
      UOP1_Project/Assets/Scripts/Quests/ScriptableObjects/TaskSO.cs
  50. 172
      UOP1_Project/Assets/Scripts/Quests/TaskManager.cs
  51. 14
      UOP1_Project/Assets/ScriptableObjects/Events/UI/CloseDialogueEvent.asset
  52. 14
      UOP1_Project/Assets/ScriptableObjects/Events/UI/CloseInventoryEvent.asset
  53. 14
      UOP1_Project/Assets/ScriptableObjects/Events/UI/OpenInventoryEvent.asset
  54. 47
      UOP1_Project/Assets/Scripts/Inventory/ScriptableObjects/TaskSO.cs
  55. 26
      UOP1_Project/Assets/UIDialogueChoiceFiller.cs
  56. 0
      /UOP1_Project/Assets/ScriptableObjects/Events/UI/ChangeTabInventoryUIEvent.asset.meta
  57. 0
      /UOP1_Project/Assets/ScriptableObjects/Events/UI/CloseDialogueUIEvent.asset.meta
  58. 0
      /UOP1_Project/Assets/ScriptableObjects/Events/UI/CloseInventoryUIEvent.asset.meta
  59. 0
      /UOP1_Project/Assets/ScriptableObjects/Events/UI/OpenInventoryUIEvent.asset.meta
  60. 0
      /UOP1_Project/Assets/ScriptableObjects/Events/UI/ChangeTabInventoryUIEvent.asset
  61. 0
      /UOP1_Project/Assets/ScriptableObjects/Events/Inventory/AddInventoryItemEvent.asset
  62. 0
      /UOP1_Project/Assets/ScriptableObjects/Events/Inventory/AddInventoryItemEvent.asset.meta
  63. 0
      /UOP1_Project/Assets/ScriptableObjects/Events/Inventory/CookRecipe.asset
  64. 0
      /UOP1_Project/Assets/ScriptableObjects/Events/Inventory/CookRecipe.asset.meta
  65. 0
      /UOP1_Project/Assets/ScriptableObjects/Events/Inventory/EquipInventoryItem.asset
  66. 0
      /UOP1_Project/Assets/ScriptableObjects/Events/Inventory/EquipInventoryItem.asset.meta
  67. 0
      /UOP1_Project/Assets/ScriptableObjects/Events/Inventory/RemoveInventoryItemEvent.asset
  68. 0
      /UOP1_Project/Assets/ScriptableObjects/Events/Inventory/RemoveInventoryItemEvent.asset.meta
  69. 0
      /UOP1_Project/Assets/ScriptableObjects/Events/Inventory/UseInventoryItem.asset
  70. 0
      /UOP1_Project/Assets/ScriptableObjects/Events/Inventory/UseInventoryItem.asset.meta
  71. 0
      /UOP1_Project/Assets/ScriptableObjects/Events/Dialogue/MakeDialogueChoiceEvent.asset
  72. 0
      /UOP1_Project/Assets/ScriptableObjects/Events/Dialogue/MakeDialogueChoiceEvent.asset.meta
  73. 0
      /UOP1_Project/Assets/Scripts/Quests/ScriptableObjects/TaskSO.cs.meta
  74. 0
      /UOP1_Project/Assets/Scripts/Quests.meta
  75. 0
      /UOP1_Project/Assets/Scripts/UI/UIDialogueChoiceFiller.cs.meta
  76. 0
      /UOP1_Project/Assets/Scripts/UI/UIDialogueChoicesManager.cs
  77. 0
      /UOP1_Project/Assets/Scripts/UI/UIDialogueChoicesManager.cs.meta
  78. 0
      /UOP1_Project/Assets/Scripts/Quests/QuestManager.cs.meta
  79. 0
      /UOP1_Project/Assets/Scripts/Quests/ScriptableObjects/QuestSO.cs.meta
  80. 0
      /UOP1_Project/Assets/Scripts/Quests/TaskManager.cs.meta

25
UOP1_Project/Assets/Prefabs/Characters/BardHare.prefab


serializedVersion: 2
m_Size: {x: 1, y: 1.9781234, z: 0.8272768}
m_Center: {x: 0, y: 0.9399556, z: -0.0409081}
--- !u!114 &564729674
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3351096123413661336}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: b803c85ebca51c4499674adbe5ea4a21, type: 3}
m_Name:
m_EditorClassIdentifier:
_actor: {fileID: 0}
_defaultDialogue: {fileID: 0}
_startTaskEvent: {fileID: 11400000, guid: ab5fce85191f90d449e132c92e099476, type: 2}
_endDialogueEvent: {fileID: 11400000, guid: 4f783502cf29fc442948914c150c1e05, type: 2}
_interactionEvent: {fileID: 11400000, guid: 5f20ccd3e97527a44a6bf34644f85011, type: 2}
_checkTaskValidityEvent: {fileID: 11400000, guid: 71375bc63dd705044a6b0fc6ee5f2acd,
type: 2}
_startDialogueEvent: {fileID: 11400000, guid: 5cfe626f5482b914a9e46ebbe35ea1a8,
type: 2}
--- !u!1001 &2467996762377272265
PrefabInstance:
m_ObjectHideFlags: 0

- target: {fileID: -8679921383154817045, guid: 34ed7fe3652b17a4abd3f65a68583890,
type: 3}
propertyPath: m_LocalPosition.x
value: 3.77
value: -1.83
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 34ed7fe3652b17a4abd3f65a68583890,
type: 3}

- target: {fileID: -8679921383154817045, guid: 34ed7fe3652b17a4abd3f65a68583890,
type: 3}
propertyPath: m_LocalPosition.z
value: -12.14
value: -8.27
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 34ed7fe3652b17a4abd3f65a68583890,
type: 3}

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


m_Name:
m_EditorClassIdentifier:
_inputReader: {fileID: 11400000, guid: 945ec0365077176418488737deed54be, type: 2}
OpenUIDialogueEvent: {fileID: 11400000, guid: d987db4881d794f2da0013a89588d890,
_startDialogue: {fileID: 11400000, guid: 5cfe626f5482b914a9e46ebbe35ea1a8, type: 2}
_makeDialogueChoiceEvent: {fileID: 11400000, guid: f7b40077957f3834a8d5354c3e4ce759,
ShowChoicesUIEvent: {fileID: 11400000, guid: a4e5e48a0f3430c4197b317e650727c6, type: 2}
MakeDialogueChoiceEvent: {fileID: 11400000, guid: f7b40077957f3834a8d5354c3e4ce759,
_openUIDialogueEvent: {fileID: 11400000, guid: d987db4881d794f2da0013a89588d890,
CloseUIDialogueEvent: {fileID: 11400000, guid: 53a7f1f01ef364704b1d45d01f2421ae,
_showChoicesUIEvent: {fileID: 11400000, guid: a4e5e48a0f3430c4197b317e650727c6,
_endDialogue: {fileID: 11400000, guid: 4f783502cf29fc442948914c150c1e05, type: 2}

2
UOP1_Project/Assets/Prefabs/Managers/InventoryManager.prefab


CookRecipeEvent: {fileID: 11400000, guid: 1a56201d2b4714889a387c20fbd8f3e8, type: 2}
UseItemEvent: {fileID: 11400000, guid: cbe9057614db5422a97c4c250c742f06, type: 2}
EquipItemEvent: {fileID: 11400000, guid: 0cef922101fd44b25a2d96f2972d5f50, type: 2}
RewardItemEvent: {fileID: 11400000, guid: ceeec59dc461abd4f91dac5b07084d24, type: 2}
GiveItemEvent: {fileID: 11400000, guid: c54b320c4205f1c49b296b878daf2097, type: 2}
AddItemEvent: {fileID: 11400000, guid: 582b52ca2b84a41528fe274eea1ced6a, type: 2}
RemoveItemEvent: {fileID: 11400000, guid: 4ed6ade94b85c452094b0147619e8b49, type: 2}

16
UOP1_Project/Assets/Prefabs/Managers/UIManager.prefab


m_Script: {fileID: 11500000, guid: e5eb1a5a891704b35b2ad0529d003d43, type: 3}
m_Name:
m_EditorClassIdentifier:
OpenUIDialogueEvent: {fileID: 11400000, guid: d987db4881d794f2da0013a89588d890,
_openUIDialogueEvent: {fileID: 11400000, guid: d987db4881d794f2da0013a89588d890,
CloseUIDialogueEvent: {fileID: 11400000, guid: 53a7f1f01ef364704b1d45d01f2421ae,
_closeUIDialogueEvent: {fileID: 11400000, guid: 53a7f1f01ef364704b1d45d01f2421ae,
OpenInventoryScreenEvent: {fileID: 11400000, guid: 30f6db2122a30480b996908173e1c7d7,
_showChoicesUIEvent: {fileID: 11400000, guid: a4e5e48a0f3430c4197b317e650727c6,
OpenInventoryScreenForCookingEvent: {fileID: 11400000, guid: 146c579dca5c2f248a607ef66a36d765,
_openInventoryScreenEvent: {fileID: 11400000, guid: 30f6db2122a30480b996908173e1c7d7,
CloseInventoryScreenEvent: {fileID: 11400000, guid: f6f7aad2f09f04ebf8d89aa6f52a6102,
_openInventoryScreenForCookingEvent: {fileID: 11400000, guid: 146c579dca5c2f248a607ef66a36d765,
OnInteractionEndedEvent: {fileID: 11400000, guid: c499d87f35465124f8fb2751b150430d,
_closeInventoryScreenEvent: {fileID: 11400000, guid: f6f7aad2f09f04ebf8d89aa6f52a6102,
SetInteractionEvent: {fileID: 11400000, guid: 818cc55cb05226248bdb15ace58eab84,
_onInteractionEndedEvent: {fileID: 11400000, guid: c499d87f35465124f8fb2751b150430d,
type: 2}
_setInteractionEvent: {fileID: 11400000, guid: 818cc55cb05226248bdb15ace58eab84,
type: 2}
dialogueController: {fileID: 0}
inventoryPanel: {fileID: 0}

91
UOP1_Project/Assets/Scenes/Examples/InteractionExample.unity


m_LightProbeSampleCountMultiplier: 4
m_LightingDataAsset: {fileID: 112000000, guid: f3658c79011056a45be1a9f331e27541,
type: 2}
m_UseShadowmask: 1
m_UseShadowmask: 0
--- !u!196 &4
NavMeshSettings:
serializedVersion: 2

- 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
value: 0.2295973
value: 0.22959732
value: 0.03581321
value: 0.03581318
value: -0.00845435
value: -0.008454343
objectReference: {fileID: 0}
- target: {fileID: 2955398947125553842, guid: 45632f0a227c860489bcba0eb1f4ec3e,
type: 3}
propertyPath: m_LocalRotation.w
value: 0.97258985
objectReference: {fileID: 0}
- target: {fileID: 8745341640208226293, guid: 45632f0a227c860489bcba0eb1f4ec3e,
type: 3}

- 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.967755
value: 0.97258985
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 45632f0a227c860489bcba0eb1f4ec3e, type: 3}

m_Name:
m_EditorClassIdentifier:
_inputReader: {fileID: 11400000, guid: 945ec0365077176418488737deed54be, type: 2}
dialogueLineEvent: {fileID: 0}
_startDialogue: {fileID: 0}
_makeDialogueChoiceEvent: {fileID: 0}
_openUIDialogueEvent: {fileID: 0}
_showChoicesUIEvent: {fileID: 0}
_endDialogue: {fileID: 0}
--- !u!4 &419940103
Transform:
m_ObjectHideFlags: 0

m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 564729674, guid: 7f3c311f1ca46334ab26b1adfc5be02f, type: 3}
propertyPath: _actor
value:
objectReference: {fileID: 11400000, guid: 027d026cf519df04eb8b7bf251472e13,
type: 2}
- target: {fileID: 564729674, guid: 7f3c311f1ca46334ab26b1adfc5be02f, type: 3}
propertyPath: _defaultDialogue
value:
objectReference: {fileID: 11400000, guid: f7ead55387bac6d4a9ba9bf10c5c3ee5,
type: 2}
- target: {fileID: 2723178623857253410, guid: 7f3c311f1ca46334ab26b1adfc5be02f,
type: 3}
propertyPath: m_LocalPosition.x

m_Script: {fileID: 11500000, guid: e5eb1a5a891704b35b2ad0529d003d43, type: 3}
m_Name:
m_EditorClassIdentifier:
OpenUIDialogueEvent: {fileID: 0}
CloseUIDialogueEvent: {fileID: 0}
OpenInventoryScreenEvent: {fileID: 0}
OpenInventoryScreenForCookingEvent: {fileID: 0}
CloseInventoryScreenEvent: {fileID: 0}
OnInteractionEndedEvent: {fileID: 0}
SetInteractionEvent: {fileID: 0}
_openUIDialogueEvent: {fileID: 0}
_closeUIDialogueEvent: {fileID: 0}
_showChoicesUIEvent: {fileID: 0}
_openInventoryScreenEvent: {fileID: 0}
_openInventoryScreenForCookingEvent: {fileID: 0}
_closeInventoryScreenEvent: {fileID: 0}
_onInteractionEndedEvent: {fileID: 0}
_setInteractionEvent: {fileID: 0}
dialogueController: {fileID: 1981939915}
inventoryPanel: {fileID: 0}
interactionPanel: {fileID: 0}

m_EditorClassIdentifier:
_inputReader: {fileID: 11400000, guid: 945ec0365077176418488737deed54be, type: 2}
_dialogueManager: {fileID: 419940102}
PlayCutsceneEvent: {fileID: 0}
PlayDialogueEvent: {fileID: 0}
PauseTimelineEvent: {fileID: 0}
--- !u!4 &1647029640
Transform:
m_ObjectHideFlags: 0

m_Script: {fileID: 11500000, guid: 6868cb6f048b549b3b137c5989933a22, type: 3}
m_Name:
m_EditorClassIdentifier:
lineText: {fileID: 1931605197}
actorNameText: {fileID: 902962639}
_lineText: {fileID: 0}
_actorNameText: {fileID: 0}
_choicesManager: {fileID: 0}
ShowChoicesEvent: {fileID: 0}
--- !u!222 &1981939916
CanvasRenderer:
m_ObjectHideFlags: 0

212
UOP1_Project/Assets/Scenes/Gameplay.unity


m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 5
m_RootOrder: 6
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &670213351 stripped
MonoBehaviour:

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

m_Modification:
m_TransformParent: {fileID: 1869732381}
m_Modifications:
- target: {fileID: 1284969401, guid: 0ac9fcac72b964a9181545df5e543b03, type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3687453176493695291, guid: 0ac9fcac72b964a9181545df5e543b03,
type: 3}
propertyPath: m_AnchorMin.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 3687453176493695291, guid: 0ac9fcac72b964a9181545df5e543b03,
type: 3}
propertyPath: m_AnchorMax.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 3687453176493695291, guid: 0ac9fcac72b964a9181545df5e543b03,
type: 3}
propertyPath: m_AnchoredPosition.x
value: 199.80005
objectReference: {fileID: 0}
- target: {fileID: 3687453176493695291, guid: 0ac9fcac72b964a9181545df5e543b03,
type: 3}
propertyPath: m_AnchoredPosition.y
value: -48.699997
objectReference: {fileID: 0}
objectReference: {fileID: 0}
- target: {fileID: 3687453176568796421, guid: 0ac9fcac72b964a9181545df5e543b03,
type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3687453176568796422, guid: 0ac9fcac72b964a9181545df5e543b03,
type: 3}

type: 3}
propertyPath: m_Pivot.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3787434768372665207, guid: 0ac9fcac72b964a9181545df5e543b03,
type: 3}
propertyPath: m_AnchorMin.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 3787434768372665207, guid: 0ac9fcac72b964a9181545df5e543b03,
type: 3}
propertyPath: m_AnchorMax.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 3787434768372665207, guid: 0ac9fcac72b964a9181545df5e543b03,
type: 3}
propertyPath: m_AnchoredPosition.x
value: 199.80005
objectReference: {fileID: 0}
- target: {fileID: 3787434768372665207, guid: 0ac9fcac72b964a9181545df5e543b03,
type: 3}
propertyPath: m_AnchoredPosition.y
value: -156.09999
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 0ac9fcac72b964a9181545df5e543b03, type: 3}

m_Script: {fileID: 11500000, guid: 8f5450ac502f84bd89a993767b4d01e0, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1001 &8077577192889283150
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 8077577191811875362, guid: 8a320dae5a9ab684a98f0990bdeda501,
type: 3}
propertyPath: m_Name
value: TaskManager
objectReference: {fileID: 0}
- target: {fileID: 8077577191811875362, guid: 8a320dae5a9ab684a98f0990bdeda501,
type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8077577191811875363, guid: 8a320dae5a9ab684a98f0990bdeda501,
type: 3}
propertyPath: m_LocalPosition.x
value: 1690.5188
objectReference: {fileID: 0}
- target: {fileID: 8077577191811875363, guid: 8a320dae5a9ab684a98f0990bdeda501,
type: 3}
propertyPath: m_LocalPosition.y
value: 153.30937
objectReference: {fileID: 0}
- target: {fileID: 8077577191811875363, guid: 8a320dae5a9ab684a98f0990bdeda501,
type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8077577191811875363, guid: 8a320dae5a9ab684a98f0990bdeda501,
type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8077577191811875363, guid: 8a320dae5a9ab684a98f0990bdeda501,
type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8077577191811875363, guid: 8a320dae5a9ab684a98f0990bdeda501,
type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8077577191811875363, guid: 8a320dae5a9ab684a98f0990bdeda501,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8077577191811875363, guid: 8a320dae5a9ab684a98f0990bdeda501,
type: 3}
propertyPath: m_RootOrder
value: 7
objectReference: {fileID: 0}
- target: {fileID: 8077577191811875363, guid: 8a320dae5a9ab684a98f0990bdeda501,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8077577191811875363, guid: 8a320dae5a9ab684a98f0990bdeda501,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8077577191811875363, guid: 8a320dae5a9ab684a98f0990bdeda501,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 8a320dae5a9ab684a98f0990bdeda501, type: 3}
--- !u!1001 &8313085415731550940
PrefabInstance:
m_ObjectHideFlags: 0

- target: {fileID: 8313085416397863404, guid: 2af68f4e6b94140cfbcdee05fcc28ce3,
type: 3}
propertyPath: m_RootOrder
value: 3
value: 4
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 &8957403574244887918
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 8957403575277752757, guid: 021ad8df909ac4147aa545c01f5ad8db,
type: 3}
propertyPath: m_LocalPosition.x
value: 1690.5188
objectReference: {fileID: 0}
- target: {fileID: 8957403575277752757, guid: 021ad8df909ac4147aa545c01f5ad8db,
type: 3}
propertyPath: m_LocalPosition.y
value: 153.30937
objectReference: {fileID: 0}
- target: {fileID: 8957403575277752757, guid: 021ad8df909ac4147aa545c01f5ad8db,
type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8957403575277752757, guid: 021ad8df909ac4147aa545c01f5ad8db,
type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8957403575277752757, guid: 021ad8df909ac4147aa545c01f5ad8db,
type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8957403575277752757, guid: 021ad8df909ac4147aa545c01f5ad8db,
type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8957403575277752757, guid: 021ad8df909ac4147aa545c01f5ad8db,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8957403575277752757, guid: 021ad8df909ac4147aa545c01f5ad8db,
type: 3}
propertyPath: m_RootOrder
value: 2
objectReference: {fileID: 0}
- target: {fileID: 8957403575277752757, guid: 021ad8df909ac4147aa545c01f5ad8db,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8957403575277752757, guid: 021ad8df909ac4147aa545c01f5ad8db,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8957403575277752757, guid: 021ad8df909ac4147aa545c01f5ad8db,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8957403575277752759, guid: 021ad8df909ac4147aa545c01f5ad8db,
type: 3}
propertyPath: m_Name
value: QuestManager
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 021ad8df909ac4147aa545c01f5ad8db, type: 3}
--- !u!1001 &8980297399098703799
PrefabInstance:
m_ObjectHideFlags: 0

m_Modifications:
- target: {fileID: 8980297398607076176, guid: ccad748453924ff4092fe3e5b978d8e5,
type: 3}
propertyPath: _closeDialogueUIEvent
value:
objectReference: {fileID: 11400000, guid: 53a7f1f01ef364704b1d45d01f2421ae,
type: 2}
- target: {fileID: 8980297398607076177, guid: ccad748453924ff4092fe3e5b978d8e5,
type: 3}
propertyPath: m_LocalPosition.x

- target: {fileID: 8980297398607076177, guid: ccad748453924ff4092fe3e5b978d8e5,
type: 3}
propertyPath: m_RootOrder
value: 2
value: 3
objectReference: {fileID: 0}
- target: {fileID: 8980297398607076177, guid: ccad748453924ff4092fe3e5b978d8e5,
type: 3}

2
UOP1_Project/Assets/ScriptableObjects/Events/UI/ChangeTabInventoryUIEvent.asset


m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4159c28bee95141458b8004bf633a717, type: 3}
m_Name: ChangeTabEvent
m_Name: ChangeTabInventoryUIEvent
m_EditorClassIdentifier:

9
UOP1_Project/Assets/Scripts/Dialogues/DialogueDataSO.cs


using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Timeline;
public enum dialogueType
{
startDialogue,
winDialogue,
loseDialogue,
defaultDialogue,
}
/// <summary>
/// A Dialogue is a list of consecutive DialogueLines. They play in sequence using the input of the player to skip forward.
/// In future versions it might contain support for branching conversations.

[SerializeField] private ActorSO _actor = default;
[SerializeField] private List<DialogueLineSO> _dialogueLines;
[SerializeField] private List<Choice> _choices;
[SerializeField] private dialogueType _dialogueType;
public dialogueType DialogueType => _dialogueType;
//TODO: Add support for branching conversations
// Maybe add 2 (or more) special line slots which represent a choice in a conversation

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


using System.Collections.Generic;
using TMPro;
using UnityEngine;
using UnityEngine.Serialization;
using UnityEngine.UI;
/// <summary>

// [SerializeField] private ChoiceBox _choiceBox; // TODO: Demonstration purpose only. Remove or adjust later.
[SerializeField] private InputReader _inputReader = default;
public DialogueLineChannelSO OpenUIDialogueEvent;
public DialogueChoicesChannelSO ShowChoicesUIEvent;
public DialogueChoiceChannelSO MakeDialogueChoiceEvent;
public VoidEventChannelSO CloseUIDialogueEvent;
private DialogueDataSO _currentDialogueDataSO;
[Header("Listening on channels")]
[SerializeField] private DialogueDataChannelSo _startDialogue = default;
[SerializeField] private DialogueChoiceChannelSO _makeDialogueChoiceEvent = default;
[Header("BoradCasting on channels")]
[SerializeField] private DialogueLineChannelSO _openUIDialogueEvent = default;
[SerializeField] private DialogueChoicesChannelSO _showChoicesUIEvent = default;
[SerializeField] private VoidEventChannelSO _endDialogue = default;
[SerializeField] private VoidEventChannelSO _closeDialogueUIEvent = default;
private DialogueDataSO _currentDialogueDataSO = default;
if(_startDialogue!=null)
{
_startDialogue.OnEventRaised += DisplayDialogueData;
}
}

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

{
_inputReader.advanceDialogueEvent -= OnAdvance;
if (MakeDialogueChoiceEvent != null)
if (_makeDialogueChoiceEvent != null)
MakeDialogueChoiceEvent.OnEventRaised += MakeDialogueChoice;
_makeDialogueChoiceEvent.OnEventRaised += MakeDialogueChoice;
if (ShowChoicesUIEvent != null)
if (_showChoicesUIEvent != null)
ShowChoicesUIEvent.RaiseEvent(choices);
_showChoicesUIEvent.RaiseEvent(choices);
if (MakeDialogueChoiceEvent != null)
if (_makeDialogueChoiceEvent != null)
MakeDialogueChoiceEvent.OnEventRaised -= MakeDialogueChoice;
_makeDialogueChoiceEvent.OnEventRaised -= MakeDialogueChoice;
}
DisplayDialogueData(choice.NextDialogue);

{
if(CloseUIDialogueEvent!=null)
CloseUIDialogueEvent.RaiseEvent();
if(_endDialogue!=null)
_endDialogue.RaiseEvent();
if (_closeDialogueUIEvent != null)
_closeDialogueUIEvent.RaiseEvent();
// TODO: Demonstration purpose only. Remove or adjust later.
/*
[Serializable]
public class ChoiceBox
{
[SerializeField] private GameObject _gameObject;
[SerializeField] private Transform _contentTrans;
[SerializeField] private GameObject _buttonPrefab;
public void Show(List<Choice> choices, DialogueManager dialogueManager)
{
_gameObject.SetActive(true);
// Refresh choice box
foreach(Transform child in _contentTrans)
{
GameObject.Destroy(child.gameObject);
}
for(int i = 0; i < choices.Count; i++)
{
Button choiceButton = GameObject.Instantiate<Button>(_buttonPrefab.GetComponent<Button>(), _contentTrans);
choiceButton.GetComponentInChildren<TMP_Text>().text = choices[i].OptionName;
int index = i;
choiceButton.onClick.AddListener(() => OnChoiceButtonClick(choices[index], dialogueManager));
}
}
private void OnChoiceButtonClick(Choice choice, DialogueManager dialogueManager)
{
if (choice.Response != null)
dialogueManager.DisplayDialogueData(choice.Response);
else
dialogueManager.DialogueEnded();
_gameObject.SetActive(false);
}
}
*/

6
UOP1_Project/Assets/Scripts/Interaction/InteractionManager.cs


[Header("Broadcasting on")]
[SerializeField] private ItemEventChannelSo _onObjectPickUp = default;
[SerializeField] private VoidEventChannelSO _onCookingStart = default;
[SerializeField] private DialogueDataChannelSo _startTalking = default;
[SerializeField] private DialogueActorChannelSo _startTalking = default;
//UI event
[SerializeField] private InteractionUIEventChannelSO _toggleInteractionUI = default;
[Header("Listening to")]

case InteractionType.Talk:
if (_currentInteractableObject != null)
{
if (_onCookingStart != null)
if (_startTalking != null)
//Actor currentActor = currentInteractableObject.GetComponent<Dialogue>().GetActor();
_currentInteractableObject.GetComponent<TaskManager>().InteractWithCharacter();
//_startTalking.RaiseEvent(currentActor);
Debug.Log("talk event raised");
//Change the action map

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


using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Serialization;
[Header("Listening on channels")]
[Header("Dialogue Events")]
[FormerlySerializedAs("OpenUIDialogueEvent")]
[SerializeField] private DialogueLineChannelSO _openUIDialogueEvent= default;
[FormerlySerializedAs("CloseUIDialogueEvent")]
[SerializeField] private VoidEventChannelSO _closeUIDialogueEvent = default;
[FormerlySerializedAs("ShowChoicesUIEvent")]
[SerializeField] private DialogueChoicesChannelSO _showChoicesUIEvent = default;
[SerializeField] private DialogueLineChannelSO OpenUIDialogueEvent= default;
[SerializeField] private VoidEventChannelSO CloseUIDialogueEvent = default;
[SerializeField] private DialogueChoicesChannelSO ShowChoicesUIEvent = default;
[Header("Inventory Events")]
[FormerlySerializedAs("OpenInventoryScreenEvent")]
[SerializeField] private VoidEventChannelSO _openInventoryScreenEvent = default;
[FormerlySerializedAs("OpenInventoryScreenForCookingEvent")]
[SerializeField] private VoidEventChannelSO _openInventoryScreenForCookingEvent = default;
[FormerlySerializedAs("CloseInventoryScreenEvent")]
[SerializeField] private VoidEventChannelSO _closeInventoryScreenEvent = default;
[SerializeField] private VoidEventChannelSO OpenInventoryScreenEvent = default;
[SerializeField] private VoidEventChannelSO OpenInventoryScreenForCookingEvent = default;
[SerializeField] private VoidEventChannelSO CloseInventoryScreenEvent = default;
[SerializeField] private VoidEventChannelSO OnInteractionEndedEvent = default;
[SerializeField] private InteractionUIEventChannelSO SetInteractionEvent = default;
[Header("Interaction Events")]
[FormerlySerializedAs("OnInteractionEndedEvent")]
[SerializeField] private VoidEventChannelSO _onInteractionEndedEvent = default;
[FormerlySerializedAs("SetInteractionEvent")]
[SerializeField] private InteractionUIEventChannelSO _setInteractionEvent = default;
if (OpenUIDialogueEvent != null)
if (_openUIDialogueEvent != null)
OpenUIDialogueEvent.OnEventRaised += OpenUIDialogue;
_openUIDialogueEvent.OnEventRaised += OpenUIDialogue;
if (CloseUIDialogueEvent != null)
if (_closeUIDialogueEvent != null)
CloseUIDialogueEvent.OnEventRaised += CloseUIDialogue;
_closeUIDialogueEvent.OnEventRaised += CloseUIDialogue;
if (OpenInventoryScreenForCookingEvent != null)
if (_openInventoryScreenForCookingEvent != null)
OpenInventoryScreenForCookingEvent.OnEventRaised += SetInventoryScreenForCooking;
_openInventoryScreenForCookingEvent.OnEventRaised += SetInventoryScreenForCooking;
if (OpenInventoryScreenEvent != null)
if (_openInventoryScreenEvent != null)
OpenInventoryScreenEvent.OnEventRaised += SetInventoryScreen;
_openInventoryScreenEvent.OnEventRaised += SetInventoryScreen;
if (CloseInventoryScreenEvent != null)
if (_closeInventoryScreenEvent != null)
CloseInventoryScreenEvent.OnEventRaised += CloseInventoryScreen;
_closeInventoryScreenEvent.OnEventRaised += CloseInventoryScreen;
if (SetInteractionEvent != null)
if (_setInteractionEvent != null)
SetInteractionEvent.OnEventRaised += SetInteractionPanel;
_setInteractionEvent.OnEventRaised += SetInteractionPanel;
}
}

if (isForCooking)
{
OnInteractionEndedEvent.RaiseEvent();
_onInteractionEndedEvent.RaiseEvent();
}
}

55
UOP1_Project/Assets/Prefabs/Managers/QuestManager.prefab


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &8957403575277752759
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 8957403575277752757}
- component: {fileID: 8957403575277752756}
m_Layer: 0
m_Name: QuestManager
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &8957403575277752757
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8957403575277752759}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 1690.5188, y: 153.30937, 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 &8957403575277752756
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8957403575277752759}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 10b246087f2d8d842b859e2b2f88078f, type: 3}
m_Name:
m_EditorClassIdentifier:
_quests: []
_inventory: {fileID: 11400000, guid: 59c84467f7726dc4587a8373b0936f03, type: 2}
_checkTaskValidityEvent: {fileID: 11400000, guid: 71375bc63dd705044a6b0fc6ee5f2acd,
type: 2}
_endTaskEvent: {fileID: 11400000, guid: 0803969a2e523324b86ca9a0c4ac12f2, type: 2}
_startTaskEvent: {fileID: 11400000, guid: ab5fce85191f90d449e132c92e099476, type: 2}
_winDialogueEvent: {fileID: 11400000, guid: dc2da1754c28ab9499cb6c7d72465e69, type: 2}
_loseDialogueEvent: {fileID: 11400000, guid: fcc99784052e5cc469b8c22c0674b051, type: 2}
_giveItemEvent: {fileID: 11400000, guid: c54b320c4205f1c49b296b878daf2097, type: 2}
_rewardItemEvent: {fileID: 11400000, guid: ceeec59dc461abd4f91dac5b07084d24, type: 2}

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


fileFormatVersion: 2
guid: 021ad8df909ac4147aa545c01f5ad8db
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

54
UOP1_Project/Assets/Prefabs/Managers/TaskManager.prefab


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &8077577191811875362
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 8077577191811875363}
- component: {fileID: 8077577191811875360}
m_Layer: 0
m_Name: TaskManager
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &8077577191811875363
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8077577191811875362}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 1690.5188, y: 153.30937, 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 &8077577191811875360
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8077577191811875362}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: b803c85ebca51c4499674adbe5ea4a21, type: 3}
m_Name:
m_EditorClassIdentifier:
_actor: {fileID: 0}
_defaultDialogue: {fileID: 0}
_startTaskEvent: {fileID: 11400000, guid: ab5fce85191f90d449e132c92e099476, type: 2}
_endDialogueEvent: {fileID: 11400000, guid: 4f783502cf29fc442948914c150c1e05, type: 2}
_interactionEvent: {fileID: 11400000, guid: 5f20ccd3e97527a44a6bf34644f85011, type: 2}
_checkTaskValidityEvent: {fileID: 11400000, guid: 71375bc63dd705044a6b0fc6ee5f2acd,
type: 2}
_startDialogueEvent: {fileID: 11400000, guid: 5cfe626f5482b914a9e46ebbe35ea1a8,
type: 2}

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


fileFormatVersion: 2
guid: 8a320dae5a9ab684a98f0990bdeda501
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

8
UOP1_Project/Assets/ScriptableObjects/Events/Dialogue.meta


fileFormatVersion: 2
guid: 1960d4276e4a9f24483d17b55071d98f
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

8
UOP1_Project/Assets/ScriptableObjects/Events/Inventory.meta


fileFormatVersion: 2
guid: b04789909dc564444b178475c7c47b7a
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

8
UOP1_Project/Assets/ScriptableObjects/Events/Quests.meta


fileFormatVersion: 2
guid: 7e4dede7ecdaf2c44afbfb1862ba9bba
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

15
UOP1_Project/Assets/ScriptableObjects/Events/UI/CloseDialogueUIEvent.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: CloseDialogueUIEvent
m_EditorClassIdentifier:
description:

15
UOP1_Project/Assets/ScriptableObjects/Events/UI/CloseInventoryUIEvent.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: CloseInventoryUIEvent
m_EditorClassIdentifier:
description:

15
UOP1_Project/Assets/ScriptableObjects/Events/UI/OpenInventoryUIEvent.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: OpenInventoryUIEvent
m_EditorClassIdentifier:
description:

8
UOP1_Project/Assets/ScriptableObjects/Quests.meta


fileFormatVersion: 2
guid: 11c350a4a3a2eb546bcd86cd0c8706dc
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

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


using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
[CreateAssetMenu(menuName = "Events/Task Channel")]
public class TaskChannelSO : ScriptableObject
{
public UnityAction<TaskSO> OnEventRaised;
public void RaiseEvent(TaskSO task)
{
if (OnEventRaised != null)
OnEventRaised.Invoke(task);
}
}

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


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

28
UOP1_Project/Assets/Scripts/UI/UIDialogueChoiceFiller.cs


using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using TMPro;
using UnityEngine.Localization.Components;
using UnityEngine.Serialization;
public class UIDialogueChoiceFiller : MonoBehaviour
{
[FormerlySerializedAs("choiceText")]
[SerializeField] private LocalizeStringEvent _choiceText;
[FormerlySerializedAs("MakeAChoiceEvent")]
[SerializeField] private DialogueChoiceChannelSO _makeAChoiceEvent;
Choice currentChoice;
public void FillChoice(Choice choiceToFill)
{
currentChoice = choiceToFill;
_choiceText.StringReference = choiceToFill.Response.Sentence;
}
public void ButtonClicked()
{
if(_makeAChoiceEvent!=null)
_makeAChoiceEvent.RaiseEvent(currentChoice);
}
}

15
UOP1_Project/Assets/ScriptableObjects/Events/Dialogue/EndDialogueEvent.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: EndDialogueEvent
m_EditorClassIdentifier:
description:

8
UOP1_Project/Assets/ScriptableObjects/Events/Dialogue/EndDialogueEvent.asset.meta


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

14
UOP1_Project/Assets/ScriptableObjects/Events/Dialogue/InteractionWithActorEvent.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: 72b8faf3c652eb74786b6fd69e28e7f3, type: 3}
m_Name: InteractionWithActorEvent
m_EditorClassIdentifier:

8
UOP1_Project/Assets/ScriptableObjects/Events/Dialogue/InteractionWithActorEvent.asset.meta


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

14
UOP1_Project/Assets/ScriptableObjects/Events/Dialogue/StartDialogueEvent.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: 458685ec13446b04e887efdeca5ec20f, type: 3}
m_Name: StartDialogueEvent
m_EditorClassIdentifier:

8
UOP1_Project/Assets/ScriptableObjects/Events/Dialogue/StartDialogueEvent.asset.meta


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

15
UOP1_Project/Assets/ScriptableObjects/Events/Quests/CheckTaskValidityEvent.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: CheckTaskValidityEvent
m_EditorClassIdentifier:
description:

8
UOP1_Project/Assets/ScriptableObjects/Events/Quests/CheckTaskValidityEvent.asset.meta


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

15
UOP1_Project/Assets/ScriptableObjects/Events/Quests/EndTaskEvent.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: EndTaskEvent
m_EditorClassIdentifier:
description:

8
UOP1_Project/Assets/ScriptableObjects/Events/Quests/EndTaskEvent.asset.meta


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

14
UOP1_Project/Assets/ScriptableObjects/Events/Quests/GiveItemEvent.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: 27ee1f4193e7cac488aad6442034451d, type: 3}
m_Name: GiveItemEvent
m_EditorClassIdentifier:

8
UOP1_Project/Assets/ScriptableObjects/Events/Quests/GiveItemEvent.asset.meta


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

15
UOP1_Project/Assets/ScriptableObjects/Events/Quests/LoseDialogueEvent.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: LoseDialogueEvent
m_EditorClassIdentifier:
description:

8
UOP1_Project/Assets/ScriptableObjects/Events/Quests/LoseDialogueEvent.asset.meta


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

14
UOP1_Project/Assets/ScriptableObjects/Events/Quests/RewardItemEvent.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: 27ee1f4193e7cac488aad6442034451d, type: 3}
m_Name: RewardItemEvent
m_EditorClassIdentifier:

8
UOP1_Project/Assets/ScriptableObjects/Events/Quests/RewardItemEvent.asset.meta


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

14
UOP1_Project/Assets/ScriptableObjects/Events/Quests/StartTaskEvent.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: 4d2ce8a9511333c42a9e907bbdb3b32f, type: 3}
m_Name: StartTaskEvent
m_EditorClassIdentifier:

8
UOP1_Project/Assets/ScriptableObjects/Events/Quests/StartTaskEvent.asset.meta


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

15
UOP1_Project/Assets/ScriptableObjects/Events/Quests/WinDialogueEvent.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: WinDialogueEvent
m_EditorClassIdentifier:
description:

8
UOP1_Project/Assets/ScriptableObjects/Events/Quests/WinDialogueEvent.asset.meta


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

186
UOP1_Project/Assets/Scripts/Quests/QuestManager.cs


using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class QuestManager : MonoBehaviour
{
[Header("Data")]
[SerializeField] private List<QuestSO> _quests = default;
[SerializeField] private Inventory _inventory = default;
[Header("Linstening to channels")]
[SerializeField] private VoidEventChannelSO _checkTaskValidityEvent = default;
[SerializeField] private VoidEventChannelSO _endTaskEvent = default;
[Header("Broadcasting on channels")]
[SerializeField] private TaskChannelSO _startTaskEvent = default;
[SerializeField] private VoidEventChannelSO _winDialogueEvent = default;
[SerializeField] private VoidEventChannelSO _loseDialogueEvent = default;
[SerializeField] private ItemEventChannelSo _giveItemEvent = default;
[SerializeField] private ItemEventChannelSo _rewardItemEvent = default;
private QuestSO _currentQuest;
private TaskSO _currentTask;
private int _currentQuestIndex =0;
private int _currentTaskIndex =0;
private void Start()
{
if( _checkTaskValidityEvent!=null)
{
_checkTaskValidityEvent.OnEventRaised += CheckTaskValidity;
}
if (_endTaskEvent != null)
{
_endTaskEvent.OnEventRaised += EndTask;
}
StartGame();
}
void StartGame()
{//Add code for saved information
_currentQuestIndex = 0;
if (_quests != null)
{
_currentQuestIndex = _quests.FindIndex(o => o.IsDone == false);
if(_currentQuestIndex >0)
StartQuest();
}
}
void StartQuest()
{
if (_quests != null)
if ( _quests.Count > _currentQuestIndex)
{
_currentQuest = _quests[_currentQuestIndex];
_currentTaskIndex = 0;
_currentTaskIndex = _currentQuest.Tasks.FindIndex(o => o.IsDone == false);
if (_currentTaskIndex > 0)
StartTask();
}
}
void StartTask()
{
if(_currentQuest.Tasks!=null)
if (_currentQuest.Tasks.Count > _currentTaskIndex)
{
_currentTask = _currentQuest.Tasks[_currentTaskIndex];
_startTaskEvent.RaiseEvent(_currentTask);
}
}
void CheckTaskValidity()
{
if(_currentQuest!=null)
if (_currentQuest.Tasks != null)
if (_currentQuest.Tasks.Count > _currentTaskIndex)
{
_currentTask = _currentQuest.Tasks[_currentTaskIndex];
switch (_currentTask.Type)
{
case taskType.checkItem:
if (_inventory.Contains(_currentTask.Item))
{
_inventory.Contains(_currentTask.Item);
//Trigger win dialogue
if(_winDialogueEvent!=null)
{
_winDialogueEvent.OnEventRaised();
}
}
else
{
//trigger lose dialogue
if (_loseDialogueEvent != null)
{
_loseDialogueEvent.OnEventRaised();
}
}
break;
case taskType.giveItem:
if (_inventory.Contains(_currentTask.Item))
{
_giveItemEvent.RaiseEvent(_currentTask.Item);
//trigger win dialogue
if (_winDialogueEvent != null)
{
_winDialogueEvent.OnEventRaised();
}
}
else
{
//trigger lose dialogue
if (_loseDialogueEvent != null)
{
_loseDialogueEvent.OnEventRaised();
}
}
break;
case taskType.rewardItem:
_rewardItemEvent.RaiseEvent(_currentTask.Item);
//no dialogue is needed after Reward Item
break;
case taskType.dialogue:
//dialogue has already been played
break;
}
}
}
void EndTask()
{
_currentTask.FinishTask();
if (_quests != null)
if (_quests.Count > _currentQuestIndex)
if (_quests[_currentQuestIndex].Tasks != null)
if (_quests[_currentQuestIndex].Tasks.Count > _currentTaskIndex)
{
Debug.Log(_quests[_currentQuestIndex].Tasks[_currentTaskIndex].IsDone);
_quests[_currentQuestIndex].Tasks[_currentTaskIndex].FinishTask();
if(_quests[_currentQuestIndex].Tasks.Count < _currentTaskIndex+1)
{
_currentTaskIndex++;
StartTask();
}
else
{
EndQuest();
}
}
}
void EndQuest()
{
if (_quests != null)
if (_quests.Count > _currentQuestIndex)
{
_quests[_currentQuestIndex].FinishQuest();
if (_quests.Count < _currentQuestIndex + 1)
{
_currentQuestIndex++;
StartQuest();
}
}
}
}

8
UOP1_Project/Assets/Scripts/Quests/ScriptableObjects.meta


fileFormatVersion: 2
guid: a1f4e7057c13512428664f22d9f4eb81
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

19
UOP1_Project/Assets/Scripts/Quests/ScriptableObjects/QuestSO.cs


using System.Collections.Generic;
using UnityEngine;
[CreateAssetMenu(fileName = "Quest", menuName = "Quests/Quest", order = 51)]
public class QuestSO : ScriptableObject
{
[Tooltip("The collection of Tasks composing the Quest")]
[SerializeField]
private List<TaskSO> _tasks = new List<TaskSO>();
bool _isDone = false;
public List<TaskSO> Tasks => _tasks;
public bool IsDone => _isDone;
public void FinishQuest()
{
_isDone = true;
}
}

50
UOP1_Project/Assets/Scripts/Quests/ScriptableObjects/TaskSO.cs


using System.Collections.Generic;
using UnityEngine;
public enum taskType
{
dialogue,
giveItem,
checkItem,
rewardItem
}
[CreateAssetMenu(fileName = "Task", menuName = "Quests/Task", order = 51)]
public class TaskSO : ScriptableObject
{
[Tooltip("The Character this mission will need interaction with")]
[SerializeField]
private ActorSO _actor = default;
[Tooltip("The dialogue that will be diplayed befor an action, if any")]
[SerializeField]
private DialogueDataSO _dialogueBeforeTask = default;
[Tooltip("The dialogue that will be diplayed when the task is achieved")]
[SerializeField]
private DialogueDataSO _winDialogue = default;
[Tooltip("The dialogue that will be diplayed if the task is not achieved yet")]
[SerializeField]
private DialogueDataSO _loseDialogue = default;
[Tooltip("The item to check/give/reward")]
[SerializeField]
private Item _item = default;
[Tooltip("The type of the task")]
[SerializeField]
private taskType _type = default;
bool _isDone=false;
public DialogueDataSO DialogueBeforeTask => _dialogueBeforeTask;
public DialogueDataSO WinDialogue => _winDialogue;
public DialogueDataSO LoseDialogue => _loseDialogue;
public Item Item => _item;
public taskType Type => _type;
public bool IsDone => _isDone;
public ActorSO Actor => _actor;
public void FinishTask()
{
_isDone = true;
}
}

172
UOP1_Project/Assets/Scripts/Quests/TaskManager.cs


using System.Collections;
using System.Collections.Generic;
using UnityEngine;
//this script needs to be put on the actor, and takes care of the current task to accomplish.
//the task contains a dialogue and maybe an event.
public class TaskManager : MonoBehaviour
{
[Header("Data")]
[SerializeField] private ActorSO _actor=default;
[SerializeField] private DialogueDataSO _defaultDialogue = default;
[Header("Listening to channels")]
[SerializeField] private TaskChannelSO _startTaskEvent = default;
[SerializeField] private VoidEventChannelSO _endDialogueEvent = default;
[SerializeField] private DialogueActorChannelSo _interactionEvent = default;
[Header("Broadcasting on channels")]
[SerializeField] private VoidEventChannelSO _checkTaskValidityEvent = default;
[SerializeField] private DialogueDataChannelSo _startDialogueEvent = default;
//check if character is actif. An actif character is the character concerned by the task.
private bool _hasActifTask;
private TaskSO _currentTask;
private DialogueDataSO _currentDialogue;
private void Start()
{
if (_endDialogueEvent != null)
{ _endDialogueEvent.OnEventRaised += EndDialogue; }
if (_startTaskEvent != null)
{ _startTaskEvent.OnEventRaised += CheckTaskInvolvment; }
if (_interactionEvent != null)
{ _interactionEvent.OnEventRaised += InteractWithCharacter; }
}
//play default dialogue if no task
void PlayDefaultDialogue()
{
if (_defaultDialogue != null)
{
_currentDialogue = _defaultDialogue;
StartDialogue();
}
}
void CheckTaskInvolvment(TaskSO task)
{
if(_actor == task.Actor)
{
RegisterTask(task);
}
}
//register a task
void RegisterTask(TaskSO task)
{
_currentTask = task;
_hasActifTask = true;
}
//start a dialogue when interaction
//some tasks need to be instantanious. And do not need the interact button.
//when interaction again, restart same dialogue.
void InteractWithCharacter(ActorSO actorToInteractWith)
{
if (actorToInteractWith == _actor)
{
if (_hasActifTask)
{
StartTask();
}
else
{
PlayDefaultDialogue();
}
}
}
public void InteractWithCharacter()
{
if (_hasActifTask)
{
StartTask();
}
else
{
PlayDefaultDialogue();
}
}
void StartTask() {
if(_currentTask!=null)
if (_currentTask.DialogueBeforeTask != null)
{
_currentDialogue = _currentTask.DialogueBeforeTask;
StartDialogue();
}
else
{
Debug.LogError("Task without dialogue registring not implemented.");
}
}
void StartDialogue()
{
if (_startDialogueEvent != null)
{
_startDialogueEvent.RaiseEvent(_currentDialogue);
}
}
//End dialogue
void EndDialogue()
{
//depending on the dialogue that ended, do something
switch (_currentDialogue.DialogueType)
{
case dialogueType.startDialogue:
//Check the validity of the task
CheckTaskValidity();
break;
case dialogueType.winDialogue:
//After playing the win dialogue close Dialogue and end Task
EndTask();
break;
case dialogueType.loseDialogue:
//closeDialogue
//replay start Dialogue if the lose Dialogue ended
if(_currentTask.DialogueBeforeTask!=null)
{
_currentDialogue = _currentTask.DialogueBeforeTask;
}
break;
case dialogueType.defaultDialogue:
//close Dialogue
//nothing happens if it's the default dialogue
break;
default:
break;
}
}
void CheckTaskValidity()
{
if(_checkTaskValidityEvent!=null)
{
_checkTaskValidityEvent.RaiseEvent();
}
}
void EndTask()
{
UnregisterTask();
}
//unregister a task when it ends.
void UnregisterTask()
{
_currentTask = null;
_hasActifTask = false;
_currentDialogue = _defaultDialogue;
}
}

14
UOP1_Project/Assets/ScriptableObjects/Events/UI/CloseDialogueEvent.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: CloseDialogueEvent
m_EditorClassIdentifier:

14
UOP1_Project/Assets/ScriptableObjects/Events/UI/CloseInventoryEvent.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: CloseInventoryEvent
m_EditorClassIdentifier:

14
UOP1_Project/Assets/ScriptableObjects/Events/UI/OpenInventoryEvent.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: OpenInventoryEvent
m_EditorClassIdentifier:

47
UOP1_Project/Assets/Scripts/Inventory/ScriptableObjects/TaskSO.cs


using System.Collections.Generic;
using UnityEngine;
public enum taskType
{
dialogue,
giveItem,
checkItem,
rewardItem
}
[CreateAssetMenu(fileName = "Task", menuName = "Missions/Task", order = 51)]
public class TaskSO : ScriptableObject
{
[SerializeField]
private bool _isInstantanious;
[Tooltip("The Character this mission will need interaction with")]
[SerializeField]
private ActorSO _actor;
[SerializeField]
private List <DialogueLineSO> _dialogue;
[SerializeField]
private Item _item;
[SerializeField]
private taskType _type;
[SerializeField]
VoidEventChannelSO _startDialogue;
[SerializeField]
VoidEventChannelSO _endDialogue;
bool _isDone=false;
public List<DialogueLineSO> Dialogue => _dialogue;
public Item Item => _item;
public taskType Type => _type;
public bool IsDone => _isDone;
public ActorSO Actor => _actor;
public bool IsInstantanious => _isInstantanious;
public VoidEventChannelSO StartDialogue => _startDialogue ;
public VoidEventChannelSO EndDialogue=> _endDialogue;
public void FinishTask()
{
_isDone = true;
}
}

26
UOP1_Project/Assets/UIDialogueChoiceFiller.cs


using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using TMPro;
using UnityEngine.Localization.Components;
public class UIDialogueChoiceFiller : MonoBehaviour
{
[SerializeField]
LocalizeStringEvent choiceText;
[SerializeField]
DialogueChoiceChannelSO MakeAChoiceEvent;
Choice currentChoice;
public void FillChoice(Choice choiceToFill)
{
currentChoice = choiceToFill;
choiceText.StringReference = choiceToFill.Response.Sentence;
}
public void ButtonClicked()
{
if(MakeAChoiceEvent!=null)
MakeAChoiceEvent.RaiseEvent(currentChoice);
}
}

/UOP1_Project/Assets/ScriptableObjects/Events/UI/ChangeTabEvent.asset.meta → /UOP1_Project/Assets/ScriptableObjects/Events/UI/ChangeTabInventoryUIEvent.asset.meta

/UOP1_Project/Assets/ScriptableObjects/Events/UI/CloseDialogueEvent.asset.meta → /UOP1_Project/Assets/ScriptableObjects/Events/UI/CloseDialogueUIEvent.asset.meta

/UOP1_Project/Assets/ScriptableObjects/Events/UI/CloseInventoryEvent.asset.meta → /UOP1_Project/Assets/ScriptableObjects/Events/UI/CloseInventoryUIEvent.asset.meta

/UOP1_Project/Assets/ScriptableObjects/Events/UI/OpenInventoryEvent.asset.meta → /UOP1_Project/Assets/ScriptableObjects/Events/UI/OpenInventoryUIEvent.asset.meta

/UOP1_Project/Assets/ScriptableObjects/Events/UI/ChangeTabEvent.asset → /UOP1_Project/Assets/ScriptableObjects/Events/UI/ChangeTabInventoryUIEvent.asset

/UOP1_Project/Assets/ScriptableObjects/Events/UI/AddInventoryItemEvent.asset → /UOP1_Project/Assets/ScriptableObjects/Events/Inventory/AddInventoryItemEvent.asset

/UOP1_Project/Assets/ScriptableObjects/Events/UI/AddInventoryItemEvent.asset.meta → /UOP1_Project/Assets/ScriptableObjects/Events/Inventory/AddInventoryItemEvent.asset.meta

/UOP1_Project/Assets/ScriptableObjects/Events/UI/CookRecipe.asset → /UOP1_Project/Assets/ScriptableObjects/Events/Inventory/CookRecipe.asset

/UOP1_Project/Assets/ScriptableObjects/Events/UI/CookRecipe.asset.meta → /UOP1_Project/Assets/ScriptableObjects/Events/Inventory/CookRecipe.asset.meta

/UOP1_Project/Assets/ScriptableObjects/Events/UI/EquipInventoryItem.asset → /UOP1_Project/Assets/ScriptableObjects/Events/Inventory/EquipInventoryItem.asset

/UOP1_Project/Assets/ScriptableObjects/Events/UI/EquipInventoryItem.asset.meta → /UOP1_Project/Assets/ScriptableObjects/Events/Inventory/EquipInventoryItem.asset.meta

/UOP1_Project/Assets/ScriptableObjects/Events/UI/RemoveInventoryItemEvent.asset → /UOP1_Project/Assets/ScriptableObjects/Events/Inventory/RemoveInventoryItemEvent.asset

/UOP1_Project/Assets/ScriptableObjects/Events/UI/RemoveInventoryItemEvent.asset.meta → /UOP1_Project/Assets/ScriptableObjects/Events/Inventory/RemoveInventoryItemEvent.asset.meta

/UOP1_Project/Assets/ScriptableObjects/Events/UI/UseInventoryItem.asset → /UOP1_Project/Assets/ScriptableObjects/Events/Inventory/UseInventoryItem.asset

/UOP1_Project/Assets/ScriptableObjects/Events/UI/UseInventoryItem.asset.meta → /UOP1_Project/Assets/ScriptableObjects/Events/Inventory/UseInventoryItem.asset.meta

/UOP1_Project/Assets/ScriptableObjects/Events/UI/MakeDialogueChoiceEvent.asset → /UOP1_Project/Assets/ScriptableObjects/Events/Dialogue/MakeDialogueChoiceEvent.asset

/UOP1_Project/Assets/ScriptableObjects/Events/UI/MakeDialogueChoiceEvent.asset.meta → /UOP1_Project/Assets/ScriptableObjects/Events/Dialogue/MakeDialogueChoiceEvent.asset.meta

/UOP1_Project/Assets/Scripts/Inventory/ScriptableObjects/TaskSO.cs.meta → /UOP1_Project/Assets/Scripts/Quests/ScriptableObjects/TaskSO.cs.meta

/UOP1_Project/Assets/Quests.meta → /UOP1_Project/Assets/Scripts/Quests.meta

/UOP1_Project/Assets/UIDialogueChoiceFiller.cs.meta → /UOP1_Project/Assets/Scripts/UI/UIDialogueChoiceFiller.cs.meta

/UOP1_Project/Assets/UIDialogueChoicesManager.cs → /UOP1_Project/Assets/Scripts/UI/UIDialogueChoicesManager.cs

/UOP1_Project/Assets/UIDialogueChoicesManager.cs.meta → /UOP1_Project/Assets/Scripts/UI/UIDialogueChoicesManager.cs.meta

/UOP1_Project/Assets/Quests/QuestManager.cs.meta → /UOP1_Project/Assets/Scripts/Quests/QuestManager.cs.meta

/UOP1_Project/Assets/Quests/QuestSO.cs.meta → /UOP1_Project/Assets/Scripts/Quests/ScriptableObjects/QuestSO.cs.meta

/UOP1_Project/Assets/Quests/TaskManager.cs.meta → /UOP1_Project/Assets/Scripts/Quests/TaskManager.cs.meta

正在加载...
取消
保存