浏览代码

Rename Task to Step

/main
uChema 4 年前
当前提交
edca0f63
共有 75 个文件被更改,包括 437 次插入485 次删除
  1. 7
      UOP1_Project/Assets/Prefabs/Characters/BardHare.prefab
  2. 4
      UOP1_Project/Assets/Prefabs/Managers/DialogueManager.prefab
  3. 9
      UOP1_Project/Assets/Prefabs/Managers/QuestManager.prefab
  4. 10
      UOP1_Project/Assets/Scenes/Examples/InteractionExample.unity
  5. 103
      UOP1_Project/Assets/Scenes/Gameplay.unity
  6. 2
      UOP1_Project/Assets/ScriptableObjects/Events/Quests/CheckStepValidityEvent.asset
  7. 2
      UOP1_Project/Assets/ScriptableObjects/Events/Quests/EndStepEvent.asset
  8. 2
      UOP1_Project/Assets/ScriptableObjects/Events/Quests/StartStepEvent.asset
  9. 2
      UOP1_Project/Assets/Scripts/Dialogues/DialogueManager.cs
  10. 2
      UOP1_Project/Assets/Scripts/Events/ScriptableObjects/DialogueActorChannelSo.cs
  11. 2
      UOP1_Project/Assets/Scripts/Events/ScriptableObjects/DialogueDataChannelSo.cs
  12. 2
      UOP1_Project/Assets/Scripts/Events/ScriptableObjects/ItemEventChannelSo.cs
  13. 2
      UOP1_Project/Assets/Scripts/Events/ScriptableObjects/UI/TabEventChannelSo.cs
  14. 6
      UOP1_Project/Assets/Scripts/Interaction/InteractionManager.cs
  15. 2
      UOP1_Project/Assets/Scripts/Inventory/InventoryItemFiller.cs
  16. 14
      UOP1_Project/Assets/Scripts/Inventory/InventoryManager.cs
  17. 2
      UOP1_Project/Assets/Scripts/Inventory/ItemPicker.cs
  18. 10
      UOP1_Project/Assets/Scripts/Inventory/UIInventoryManager.cs
  19. 92
      UOP1_Project/Assets/Scripts/Quests/QuestManager.cs
  20. 6
      UOP1_Project/Assets/Scripts/Quests/ScriptableObjects/QuestSO.cs
  21. 2
      UOP1_Project/Assets/Scripts/UI/InventoryTypeTabFiller.cs
  22. 2
      UOP1_Project/Assets/Scripts/UI/InventoryTypeTabsFiller.cs
  23. 2
      UOP1_Project/Assets/ScriptableObjects/Quests/Quest1/Step1/Dialogue/Step1_StartDialogue.asset
  24. 2
      UOP1_Project/Assets/ScriptableObjects/Quests/Quest1/Step2/Dialogue/Step2_LoseDialogue.asset
  25. 2
      UOP1_Project/Assets/ScriptableObjects/Quests/Quest1/Step2/Dialogue/Step2_StartDialogue.asset
  26. 2
      UOP1_Project/Assets/ScriptableObjects/Quests/Quest1/Step2/Dialogue/Step2_WinDialogue.asset
  27. 2
      UOP1_Project/Assets/ScriptableObjects/Quests/Quest1/Step3/Dialogue/Step3_StartDialogue.asset
  28. 15
      UOP1_Project/Assets/Scripts/Events/ScriptableObjects/UI/StepChannelSO.cs
  29. 50
      UOP1_Project/Assets/Scripts/Quests/ScriptableObjects/StepSO.cs
  30. 217
      UOP1_Project/Assets/Scripts/Quests/StepController.cs
  31. 21
      UOP1_Project/Assets/ScriptableObjects/Quests/Quest1/Step1/Step1.asset
  32. 21
      UOP1_Project/Assets/ScriptableObjects/Quests/Quest1/Step2/Step2.asset
  33. 21
      UOP1_Project/Assets/ScriptableObjects/Quests/Quest1/Step3/Step3.asset
  34. 15
      UOP1_Project/Assets/Scripts/Events/ScriptableObjects/UI/TaskChannelSO.cs
  35. 50
      UOP1_Project/Assets/Scripts/Quests/ScriptableObjects/TaskSO.cs
  36. 217
      UOP1_Project/Assets/Scripts/Quests/TaskManager.cs
  37. 0
      /UOP1_Project/Assets/Prefabs/Managers/StepController.prefab
  38. 0
      /UOP1_Project/Assets/Prefabs/Managers/StepController.prefab.meta
  39. 0
      /UOP1_Project/Assets/ScriptableObjects/Events/Quests/CheckStepValidityEvent.asset.meta
  40. 0
      /UOP1_Project/Assets/ScriptableObjects/Events/Quests/EndStepEvent.asset.meta
  41. 0
      /UOP1_Project/Assets/ScriptableObjects/Events/Quests/StartStepEvent.asset.meta
  42. 0
      /UOP1_Project/Assets/ScriptableObjects/Events/Quests/CheckStepValidityEvent.asset
  43. 0
      /UOP1_Project/Assets/ScriptableObjects/Events/Quests/EndStepEvent.asset
  44. 0
      /UOP1_Project/Assets/ScriptableObjects/Events/Quests/StartStepEvent.asset
  45. 0
      /UOP1_Project/Assets/ScriptableObjects/Quests/Quest1/Step1.meta
  46. 0
      /UOP1_Project/Assets/ScriptableObjects/Quests/Quest1/Step2.meta
  47. 0
      /UOP1_Project/Assets/ScriptableObjects/Quests/Quest1/Step3.meta
  48. 0
      /UOP1_Project/Assets/Scripts/Events/ScriptableObjects/UI/StepChannelSO.cs.meta
  49. 0
      /UOP1_Project/Assets/Scripts/Quests/ScriptableObjects/StepSO.cs.meta
  50. 0
      /UOP1_Project/Assets/Scripts/Quests/StepController.cs.meta
  51. 0
      /UOP1_Project/Assets/ScriptableObjects/Quests/Quest1/Step1/Dialogue.meta
  52. 0
      /UOP1_Project/Assets/ScriptableObjects/Quests/Quest1/Step1/Dialogue
  53. 0
      /UOP1_Project/Assets/ScriptableObjects/Quests/Quest1/Step1/Dialogue/Step1_StartDialogue.asset.meta
  54. 0
      /UOP1_Project/Assets/ScriptableObjects/Quests/Quest1/Step1/Dialogue/Step1_StartDialogue.asset
  55. 0
      /UOP1_Project/Assets/ScriptableObjects/Quests/Quest1/Step1/Step1.asset.meta
  56. 0
      /UOP1_Project/Assets/ScriptableObjects/Quests/Quest1/Step2/Dialogue.meta
  57. 0
      /UOP1_Project/Assets/ScriptableObjects/Quests/Quest1/Step2/Dialogue
  58. 0
      /UOP1_Project/Assets/ScriptableObjects/Quests/Quest1/Step2/Dialogue/Step2_LoseDialogue.asset.meta
  59. 0
      /UOP1_Project/Assets/ScriptableObjects/Quests/Quest1/Step2/Dialogue/Step2_StartDialogue.asset.meta
  60. 0
      /UOP1_Project/Assets/ScriptableObjects/Quests/Quest1/Step2/Dialogue/Step2_WinDialogue.asset.meta
  61. 0
      /UOP1_Project/Assets/ScriptableObjects/Quests/Quest1/Step2/Dialogue/Step2_LoseDialogue.asset
  62. 0
      /UOP1_Project/Assets/ScriptableObjects/Quests/Quest1/Step2/Dialogue/Step2_StartDialogue.asset
  63. 0
      /UOP1_Project/Assets/ScriptableObjects/Quests/Quest1/Step2/Dialogue/Step2_WinDialogue.asset
  64. 0
      /UOP1_Project/Assets/ScriptableObjects/Quests/Quest1/Step2/Step2.asset.meta
  65. 0
      /UOP1_Project/Assets/ScriptableObjects/Quests/Quest1/Step3/Dialogue.meta
  66. 0
      /UOP1_Project/Assets/ScriptableObjects/Quests/Quest1/Step3/Dialogue
  67. 0
      /UOP1_Project/Assets/ScriptableObjects/Quests/Quest1/Step3/Dialogue/Step3_StartDialogue.asset.meta
  68. 0
      /UOP1_Project/Assets/ScriptableObjects/Quests/Quest1/Step3/Dialogue/Step3_StartDialogue.asset
  69. 0
      /UOP1_Project/Assets/ScriptableObjects/Quests/Quest1/Step3/Step3.asset.meta

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


m_EditorClassIdentifier:
_actor: {fileID: 11400000, guid: 027d026cf519df04eb8b7bf251472e13, type: 2}
_defaultDialogue: {fileID: 11400000, guid: f7ead55387bac6d4a9ba9bf10c5c3ee5, type: 2}
_startTaskEvent: {fileID: 11400000, guid: ab5fce85191f90d449e132c92e099476, type: 2}
_endDialogueEvent: {fileID: 11400000, guid: 4f783502cf29fc442948914c150c1e05, type: 2}
_startStepEvent: {fileID: 11400000, guid: ab5fce85191f90d449e132c92e099476, type: 2}
_endDialogueEvent: {fileID: 11400000, guid: b2a95390cb0fdfd4ebbd4fac6e1ca2bc, type: 2}
_checkTaskValidityEvent: {fileID: 11400000, guid: 71375bc63dd705044a6b0fc6ee5f2acd,
_endStepEvent: {fileID: 11400000, guid: fa6fff5267e6a0340aa7b0222f9c77c7, type: 2}
_checkStepValidityEvent: {fileID: 11400000, guid: 71375bc63dd705044a6b0fc6ee5f2acd,
type: 2}
_startDialogueEvent: {fileID: 11400000, guid: 5cfe626f5482b914a9e46ebbe35ea1a8,
type: 2}

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


type: 2}
_showChoicesUIEvent: {fileID: 11400000, guid: a4e5e48a0f3430c4197b317e650727c6,
type: 2}
_endDialogue: {fileID: 11400000, guid: 4f783502cf29fc442948914c150c1e05, type: 2}
_endDialogue: {fileID: 11400000, guid: b2a95390cb0fdfd4ebbd4fac6e1ca2bc, type: 2}
_closeDialogueUIEvent: {fileID: 11400000, guid: 53a7f1f01ef364704b1d45d01f2421ae,
type: 2}

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


m_Script: {fileID: 11500000, guid: 10b246087f2d8d842b859e2b2f88078f, type: 3}
m_Name:
m_EditorClassIdentifier:
_quests: []
_quests:
- {fileID: 11400000, guid: 4235b642a3ad91341a7cb42c6851293f, type: 2}
_checkTaskValidityEvent: {fileID: 11400000, guid: 71375bc63dd705044a6b0fc6ee5f2acd,
_checkStepValidityEvent: {fileID: 11400000, guid: 71375bc63dd705044a6b0fc6ee5f2acd,
_endTaskEvent: {fileID: 11400000, guid: 0803969a2e523324b86ca9a0c4ac12f2, type: 2}
_startTaskEvent: {fileID: 11400000, guid: ab5fce85191f90d449e132c92e099476, type: 2}
_endStepEvent: {fileID: 11400000, guid: fa6fff5267e6a0340aa7b0222f9c77c7, type: 2}
_startStepEvent: {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}

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


m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 564729674, guid: 7f3c311f1ca46334ab26b1adfc5be02f, type: 3}
propertyPath: _endTaskEvent
value:
objectReference: {fileID: 11400000, guid: fa6fff5267e6a0340aa7b0222f9c77c7,
type: 2}
- target: {fileID: 564729674, guid: 7f3c311f1ca46334ab26b1adfc5be02f, type: 3}
propertyPath: _endDialogueEvent
value:
objectReference: {fileID: 11400000, guid: b2a95390cb0fdfd4ebbd4fac6e1ca2bc,
type: 2}
- target: {fileID: 2723178623857253410, guid: 7f3c311f1ca46334ab26b1adfc5be02f,
type: 3}
propertyPath: m_LocalPosition.x

103
UOP1_Project/Assets/Scenes/Gameplay.unity


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

m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 8957403575277752756, guid: 021ad8df909ac4147aa545c01f5ad8db,
type: 3}
propertyPath: _quests.Array.size
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8957403575277752756, guid: 021ad8df909ac4147aa545c01f5ad8db,
type: 3}
propertyPath: _quests.Array.data[0]
value:
objectReference: {fileID: 11400000, guid: 4235b642a3ad91341a7cb42c6851293f,
type: 2}
- target: {fileID: 8957403575277752756, guid: 021ad8df909ac4147aa545c01f5ad8db,
type: 3}
propertyPath: _endTaskEvent
value:
objectReference: {fileID: 11400000, guid: fa6fff5267e6a0340aa7b0222f9c77c7,
type: 2}
- target: {fileID: 8957403575277752757, guid: 021ad8df909ac4147aa545c01f5ad8db,
type: 3}
propertyPath: m_LocalPosition.x

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

2
UOP1_Project/Assets/ScriptableObjects/Events/Quests/CheckStepValidityEvent.asset


m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 7fafac715ff920c4383fed91a38a351e, type: 3}
m_Name: CheckTaskValidityEvent
m_Name: CheckStepValidityEvent
m_EditorClassIdentifier:
description:

2
UOP1_Project/Assets/ScriptableObjects/Events/Quests/EndStepEvent.asset


m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4d2ce8a9511333c42a9e907bbdb3b32f, type: 3}
m_Name: EndTaskEvent
m_Name: EndStepEvent
m_EditorClassIdentifier:

2
UOP1_Project/Assets/ScriptableObjects/Events/Quests/StartStepEvent.asset


m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4d2ce8a9511333c42a9e907bbdb3b32f, type: 3}
m_Name: StartTaskEvent
m_Name: StartStepEvent
m_EditorClassIdentifier:

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


private bool _reachedEndOfDialogue { get => _counter >= _currentDialogueDataSO.DialogueLines.Count; }
[Header("Listening on channels")]
[SerializeField] private DialogueDataChannelSo _startDialogue = default;
[SerializeField] private DialogueDataChannelSO _startDialogue = default;
[SerializeField] private DialogueChoiceChannelSO _makeDialogueChoiceEvent = default;
[Header("BoradCasting on channels")]

2
UOP1_Project/Assets/Scripts/Events/ScriptableObjects/DialogueActorChannelSo.cs


/// </summary>
[CreateAssetMenu(menuName = "Events/Dialogue Actor Channel")]
public class DialogueActorChannelSo : ScriptableObject
public class DialogueActorChannelSO : ScriptableObject
{
public UnityAction<ActorSO> OnEventRaised;
public void RaiseEvent(ActorSO actor)

2
UOP1_Project/Assets/Scripts/Events/ScriptableObjects/DialogueDataChannelSo.cs


/// </summary>
[CreateAssetMenu(menuName = "Events/Dialogue Data Channel")]
public class DialogueDataChannelSo : ScriptableObject
public class DialogueDataChannelSO : ScriptableObject
{
public UnityAction<DialogueDataSO> OnEventRaised;
public void RaiseEvent(DialogueDataSO dialogue)

2
UOP1_Project/Assets/Scripts/Events/ScriptableObjects/ItemEventChannelSo.cs


/// </summary>
[CreateAssetMenu(menuName = "Events/UI/Item Event Channel")]
public class ItemEventChannelSo : ScriptableObject
public class ItemEventChannelSO : ScriptableObject
{
public UnityAction<Item> OnEventRaised;
public void RaiseEvent(Item item)

2
UOP1_Project/Assets/Scripts/Events/ScriptableObjects/UI/TabEventChannelSo.cs


using UnityEngine.Events;
[CreateAssetMenu(menuName = "Events/UI/Inventory Tab Event Channel")]
public class TabEventChannelSo : ScriptableObject
public class TabEventChannelSO : ScriptableObject
{
public UnityAction<InventoryTabType> OnEventRaised;
public void RaiseEvent(InventoryTabType item)

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


//Events for the different interaction types
[Header("Broadcasting on")]
[SerializeField] private ItemEventChannelSo _onObjectPickUp = default;
[SerializeField] private ItemEventChannelSO _onObjectPickUp = default;
[SerializeField] private DialogueActorChannelSo _startTalking = default;
[SerializeField] private DialogueActorChannelSO _startTalking = default;
//UI event
[SerializeField] private InteractionUIEventChannelSO _toggleInteractionUI = default;
[Header("Listening to")]

if (_startTalking != null)
{
//raise an event with an actor as parameter
_currentInteractableObject.GetComponent<TaskManager>().InteractWithCharacter();
_currentInteractableObject.GetComponent<StepController>().InteractWithCharacter();
//_startTalking.RaiseEvent(currentActor);
//Change the action map
_inputReader.EnableDialogueInput();

2
UOP1_Project/Assets/Scripts/Inventory/InventoryItemFiller.cs


[SerializeField]
private Button itemButton;
public void SetItem(ItemStack itemStack, bool isSelected, ItemEventChannelSo selectItemEvent)
public void SetItem(ItemStack itemStack, bool isSelected, ItemEventChannelSO selectItemEvent)
{
UnhoverItem();

14
UOP1_Project/Assets/Scripts/Inventory/InventoryManager.cs


private Inventory currentInventory;
[SerializeField]
private ItemEventChannelSo CookRecipeEvent;
private ItemEventChannelSO CookRecipeEvent;
private ItemEventChannelSo UseItemEvent;
private ItemEventChannelSO UseItemEvent;
private ItemEventChannelSo EquipItemEvent;
private ItemEventChannelSO EquipItemEvent;
private ItemEventChannelSo RewardItemEvent;
private ItemEventChannelSO RewardItemEvent;
private ItemEventChannelSo GiveItemEvent;
private ItemEventChannelSO GiveItemEvent;
ItemEventChannelSo AddItemEvent;
ItemEventChannelSO AddItemEvent;
ItemEventChannelSo RemoveItemEvent;
ItemEventChannelSO RemoveItemEvent;
private void OnEnable()
{

2
UOP1_Project/Assets/Scripts/Inventory/ItemPicker.cs


{
[SerializeField]
ItemEventChannelSo AddItemEvent;
ItemEventChannelSO AddItemEvent;
public void PickItem(Item item)
{

10
UOP1_Project/Assets/Scripts/Inventory/UIInventoryManager.cs


private List<InventoryItemFiller> instantiatedGameObjects;
public ItemEventChannelSo CookRecipeEvent;
public ItemEventChannelSo UseItemEvent;
public ItemEventChannelSo EquipItemEvent;
public ItemEventChannelSO CookRecipeEvent;
public ItemEventChannelSO UseItemEvent;
public ItemEventChannelSO EquipItemEvent;
public TabEventChannelSo ChangeTabEvent;
public TabEventChannelSO ChangeTabEvent;
public ItemEventChannelSo SelectItemEvent;
public ItemEventChannelSO SelectItemEvent;
public VoidEventChannelSO ActionButtonClicked;

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


[Header("Linstening to channels")]
[SerializeField] private VoidEventChannelSO _checkTaskValidityEvent = default;
[SerializeField] private TaskChannelSO _endTaskEvent = default;
[SerializeField] private VoidEventChannelSO _checkStepValidityEvent = default;
[SerializeField] private StepChannelSO _endStepEvent = default;
[SerializeField] private TaskChannelSO _startTaskEvent = default;
[SerializeField] private StepChannelSO _startStepEvent = default;
[SerializeField] private ItemEventChannelSo _giveItemEvent = default;
[SerializeField] private ItemEventChannelSo _rewardItemEvent = default;
[SerializeField] private ItemEventChannelSO _giveItemEvent = default;
[SerializeField] private ItemEventChannelSO _rewardItemEvent = default;
private TaskSO _currentTask;
private StepSO _currentStep;
private int _currentTaskIndex =0;
private int _currentStepIndex =0;
if ( _checkTaskValidityEvent!=null)
if ( _checkStepValidityEvent!=null)
_checkTaskValidityEvent.OnEventRaised += CheckTaskValidity;
_checkStepValidityEvent.OnEventRaised += CheckStepValidity;
}
StartGame();

if ( _quests.Count > _currentQuestIndex)
{
_currentQuest = _quests[_currentQuestIndex];
_currentTaskIndex = 0;
_currentTaskIndex = _currentQuest.Tasks.FindIndex(o => o.IsDone == false);
if (_currentTaskIndex >= 0)
StartTask();
_currentStepIndex = 0;
_currentStepIndex = _currentQuest.Steps.FindIndex(o => o.IsDone == false);
if (_currentStepIndex >= 0)
StartStep();
void StartTask()
void StartStep()
Debug.Log("Start task");
if (_currentQuest.Tasks!=null)
if (_currentQuest.Tasks.Count > _currentTaskIndex)
Debug.Log("Start step");
if (_currentQuest.Steps!=null)
if (_currentQuest.Steps.Count > _currentStepIndex)
_currentTask = _currentQuest.Tasks[_currentTaskIndex];
_startTaskEvent.RaiseEvent(_currentTask);
_currentStep = _currentQuest.Steps[_currentStepIndex];
_startStepEvent.RaiseEvent(_currentStep);
void CheckTaskValidity()
void CheckStepValidity()
if (_currentQuest.Tasks != null)
if (_currentQuest.Tasks.Count > _currentTaskIndex)
if (_currentQuest.Steps != null)
if (_currentQuest.Steps.Count > _currentStepIndex)
_currentTask = _currentQuest.Tasks[_currentTaskIndex];
switch (_currentTask.Type)
_currentStep = _currentQuest.Steps[_currentStepIndex];
switch (_currentStep.Type)
case taskType.checkItem:
if (_inventory.Contains(_currentTask.Item))
case stepType.checkItem:
if (_inventory.Contains(_currentStep.Item))
_inventory.Contains(_currentTask.Item);
_inventory.Contains(_currentStep.Item);
EndTask();
}
else
{

}
}
break;
case taskType.giveItem:
if (_inventory.Contains(_currentTask.Item))
case stepType.giveItem:
if (_inventory.Contains(_currentStep.Item))
_giveItemEvent.RaiseEvent(_currentTask.Item);
_giveItemEvent.RaiseEvent(_currentStep.Item);
EndTask();
}
else
{

}
}
break;
case taskType.rewardItem:
_rewardItemEvent.RaiseEvent(_currentTask.Item);
case stepType.rewardItem:
_rewardItemEvent.RaiseEvent(_currentStep.Item);
EndTask();
EndStep();
case taskType.dialogue:
case stepType.dialogue:
EndTask();
EndStep();
break;

}
void EndTask()
void EndStep()
_currentTask = null;
_currentStep = null;
if (_quests[_currentQuestIndex].Tasks != null)
if (_quests[_currentQuestIndex].Tasks.Count > _currentTaskIndex)
if (_quests[_currentQuestIndex].Steps != null)
if (_quests[_currentQuestIndex].Steps.Count > _currentStepIndex)
if (_endTaskEvent != null)
_endTaskEvent.RaiseEvent(_quests[_currentQuestIndex].Tasks[_currentTaskIndex]);
_quests[_currentQuestIndex].Tasks[_currentTaskIndex].FinishTask();
if(_quests[_currentQuestIndex].Tasks.Count > _currentTaskIndex +1)
if (_endStepEvent != null)
_endStepEvent.RaiseEvent(_quests[_currentQuestIndex].Steps[_currentStepIndex]);
_quests[_currentQuestIndex].Steps[_currentStepIndex].FinishStep();
if(_quests[_currentQuestIndex].Steps.Count > _currentStepIndex +1)
_currentTaskIndex++;
StartTask();
_currentStepIndex++;
StartStep();
}
else

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


[CreateAssetMenu(fileName = "Quest", menuName = "Quests/Quest", order = 51)]
public class QuestSO : ScriptableObject
{
[Tooltip("The collection of Tasks composing the Quest")]
[Tooltip("The collection of Steps composing the Quest")]
private List<TaskSO> _tasks = new List<TaskSO>();
private List<StepSO> _steps = new List<StepSO>();
public List<TaskSO> Tasks => _tasks;
public List<StepSO> Steps => _steps;
public bool IsDone => _isDone;
public void FinishQuest()
{

2
UOP1_Project/Assets/Scripts/UI/InventoryTypeTabFiller.cs


[SerializeField]
private Button actionButton;
public void fillTab(InventoryTabType tabType, bool isSelected, TabEventChannelSo changeTabEvent)
public void fillTab(InventoryTabType tabType, bool isSelected, TabEventChannelSO changeTabEvent)
{
tabName.StringReference = tabType.TabName;

2
UOP1_Project/Assets/Scripts/UI/InventoryTypeTabsFiller.cs


[SerializeField]
private List<InventoryTypeTabFiller> instantiatedGameObjects;
public void FillTabs(List<InventoryTabType> typesList, InventoryTabType selectedType, TabEventChannelSo changeTabEvent)
public void FillTabs(List<InventoryTabType> typesList, InventoryTabType selectedType, TabEventChannelSO changeTabEvent)
{
if (instantiatedGameObjects == null)

2
UOP1_Project/Assets/ScriptableObjects/Quests/Quest1/Step1/Dialogue/Step1_StartDialogue.asset


m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a0c0171b565b4074a9462307824be26c, type: 3}
m_Name: Task1_StartDialogue
m_Name: Step1_StartDialogue
m_EditorClassIdentifier:
_actor: {fileID: 11400000, guid: 027d026cf519df04eb8b7bf251472e13, type: 2}
_dialogueLines:

2
UOP1_Project/Assets/ScriptableObjects/Quests/Quest1/Step2/Dialogue/Step2_LoseDialogue.asset


m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a0c0171b565b4074a9462307824be26c, type: 3}
m_Name: Task2_LoseDialogue
m_Name: Step2_LoseDialogue
m_EditorClassIdentifier:
_actor: {fileID: 11400000, guid: 027d026cf519df04eb8b7bf251472e13, type: 2}
_dialogueLines:

2
UOP1_Project/Assets/ScriptableObjects/Quests/Quest1/Step2/Dialogue/Step2_StartDialogue.asset


m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a0c0171b565b4074a9462307824be26c, type: 3}
m_Name: Task2_StartDialogue
m_Name: Step2_StartDialogue
m_EditorClassIdentifier:
_actor: {fileID: 11400000, guid: 027d026cf519df04eb8b7bf251472e13, type: 2}
_dialogueLines:

2
UOP1_Project/Assets/ScriptableObjects/Quests/Quest1/Step2/Dialogue/Step2_WinDialogue.asset


m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a0c0171b565b4074a9462307824be26c, type: 3}
m_Name: Task2_WinDialogue
m_Name: Step2_WinDialogue
m_EditorClassIdentifier:
_actor: {fileID: 11400000, guid: 027d026cf519df04eb8b7bf251472e13, type: 2}
_dialogueLines:

2
UOP1_Project/Assets/ScriptableObjects/Quests/Quest1/Step3/Dialogue/Step3_StartDialogue.asset


m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a0c0171b565b4074a9462307824be26c, type: 3}
m_Name: Task3_StartDialogue
m_Name: Step3_StartDialogue
m_EditorClassIdentifier:
_actor: {fileID: 11400000, guid: 027d026cf519df04eb8b7bf251472e13, type: 2}
_dialogueLines:

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


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

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


using System.Collections.Generic;
using UnityEngine;
public enum stepType
{
dialogue,
giveItem,
checkItem,
rewardItem
}
[CreateAssetMenu(fileName = "step", menuName = "Quests/step", order = 51)]
public class StepSO : 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 _dialogueBeforeStep = default;
[Tooltip("The dialogue that will be diplayed when the step is achieved")]
[SerializeField]
private DialogueDataSO _winDialogue = default;
[Tooltip("The dialogue that will be diplayed if the step 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 step")]
[SerializeField]
private stepType _type = default;
[SerializeField]
bool _isDone=false;
public DialogueDataSO DialogueBeforeStep => _dialogueBeforeStep;
public DialogueDataSO WinDialogue => _winDialogue;
public DialogueDataSO LoseDialogue => _loseDialogue;
public Item Item => _item;
public stepType Type => _type;
public bool IsDone => _isDone;
public ActorSO Actor => _actor;
public void FinishStep()
{
_isDone = true;
}
}

217
UOP1_Project/Assets/Scripts/Quests/StepController.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 step to accomplish.
//the step contains a dialogue and maybe an event.
public class StepController : MonoBehaviour
{
[Header("Data")]
[SerializeField] private ActorSO _actor=default;
[SerializeField] private DialogueDataSO _defaultDialogue = default;
[Header("Listening to channels")]
[SerializeField] private StepChannelSO _startStepEvent = default;
[SerializeField] private VoidEventChannelSO _endDialogueEvent = default;
[SerializeField] private DialogueActorChannelSO _interactionEvent = default;
[SerializeField] private VoidEventChannelSO _winDialogueEvent = default;
[SerializeField] private VoidEventChannelSO _loseDialogueEvent = default;
[SerializeField] private StepChannelSO _endStepEvent = default;
[Header("Broadcasting on channels")]
[SerializeField] private VoidEventChannelSO _checkStepValidityEvent = default;
[SerializeField] private DialogueDataChannelSO _startDialogueEvent = default;
//check if character is actif. An actif character is the character concerned by the step.
private bool _hasActifStep;
private StepSO _currentStep;
private DialogueDataSO _currentDialogue;
private void Start()
{
if (_endDialogueEvent != null)
{ _endDialogueEvent.OnEventRaised += EndDialogue; }
if (_startStepEvent != null)
{ _startStepEvent.OnEventRaised += CheckStepInvolvment; }
if (_interactionEvent != null)
{ _interactionEvent.OnEventRaised += InteractWithCharacter; }
if (_winDialogueEvent != null)
{ _winDialogueEvent.OnEventRaised += PlayWinDialogue; }
if (_loseDialogueEvent != null)
{ _loseDialogueEvent.OnEventRaised += PlayLoseDialogue; }
if (_endStepEvent != null)
{ _endStepEvent.OnEventRaised += EndStep; }
}
//play default dialogue if no step
void PlayDefaultDialogue()
{
if (_defaultDialogue != null)
{
_currentDialogue = _defaultDialogue;
StartDialogue();
}
}
void CheckStepInvolvment(StepSO step)
{
Debug.Log("check involvment");
if(_actor == step.Actor)
{
RegisterStep(step);
}
}
//register a step
void RegisterStep(StepSO step)
{
_currentStep = step;
_hasActifStep = true;
}
//start a dialogue when interaction
//some Steps 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 (_hasActifStep)
{
StartStep();
}
else
{
PlayDefaultDialogue();
}
}
}
public void InteractWithCharacter()
{
if (_hasActifStep)
{
StartStep();
}
else
{
PlayDefaultDialogue();
}
}
void StartStep() {
if(_currentStep!=null)
if (_currentStep.DialogueBeforeStep != null)
{
_currentDialogue = _currentStep.DialogueBeforeStep;
StartDialogue();
}
else
{
Debug.LogError("step without dialogue registring not implemented.");
}
}
void StartDialogue()
{
if (_startDialogueEvent != null)
{
Debug.Log("Start Dialogue ");
_startDialogueEvent.RaiseEvent(_currentDialogue);
}
}
void PlayLoseDialogue() {
if (_currentStep != null)
if (_currentStep.LoseDialogue != null)
{
Debug.Log("Play lose Dialogue ");
_currentDialogue = _currentStep.LoseDialogue;
StartDialogue();
}
}
void PlayWinDialogue()
{
Debug.Log("Play Win Dialogue" + _currentStep.WinDialogue);
if (_currentStep != null)
if (_currentStep.WinDialogue != null)
{
_currentDialogue = _currentStep.WinDialogue;
StartDialogue();
}
}
//End dialogue
void EndDialogue()
{
//depending on the dialogue that ended, do something
switch (_currentDialogue.DialogueType)
{
case dialogueType.startDialogue:
//Check the validity of the step
CheckStepValidity();
break;
case dialogueType.winDialogue:
//After playing the win dialogue close Dialogue and end step
break;
case dialogueType.loseDialogue:
//closeDialogue
//replay start Dialogue if the lose Dialogue ended
if (_currentStep.DialogueBeforeStep != null)
{
_currentDialogue = _currentStep.DialogueBeforeStep;
}
break;
case dialogueType.defaultDialogue:
//close Dialogue
//nothing happens if it's the default dialogue
break;
default:
break;
}
}
void CheckStepValidity()
{
if(_checkStepValidityEvent!=null)
{
_checkStepValidityEvent.RaiseEvent();
}
}
void EndStep(StepSO stepToFinish)
{
Debug.Log("End step " + stepToFinish.name);
if(stepToFinish==_currentStep)
UnregisterStep();
else
{
StartStep();
}
}
void EndStep()
{
UnregisterStep();
}
//unregister a step when it ends.
void UnregisterStep()
{
_currentStep = null;
_hasActifStep = false;
_currentDialogue = _defaultDialogue;
}
}

21
UOP1_Project/Assets/ScriptableObjects/Quests/Quest1/Step1/Step1.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: 3c4c03cb18bdd224b898e0687da8d1ac, type: 3}
m_Name: Step1
m_EditorClassIdentifier:
_actor: {fileID: 11400000, guid: 027d026cf519df04eb8b7bf251472e13, type: 2}
_dialogueBeforeStep: {fileID: 0}
_winDialogue: {fileID: 0}
_loseDialogue: {fileID: 0}
_item: {fileID: 0}
_type: 0
_isDone: 1

21
UOP1_Project/Assets/ScriptableObjects/Quests/Quest1/Step2/Step2.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: 3c4c03cb18bdd224b898e0687da8d1ac, type: 3}
m_Name: Step2
m_EditorClassIdentifier:
_actor: {fileID: 11400000, guid: 027d026cf519df04eb8b7bf251472e13, type: 2}
_dialogueBeforeStep: {fileID: 0}
_winDialogue: {fileID: 11400000, guid: 77292c1386386844d808b7e5ad5485f3, type: 2}
_loseDialogue: {fileID: 11400000, guid: bd01348075afad54497623d69415d173, type: 2}
_item: {fileID: 11400000, guid: 8aff2c01ad67b48d0a0627754d613415, type: 2}
_type: 1
_isDone: 0

21
UOP1_Project/Assets/ScriptableObjects/Quests/Quest1/Step3/Step3.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: 3c4c03cb18bdd224b898e0687da8d1ac, type: 3}
m_Name: Step3
m_EditorClassIdentifier:
_actor: {fileID: 11400000, guid: 027d026cf519df04eb8b7bf251472e13, type: 2}
_dialogueBeforeStep: {fileID: 0}
_winDialogue: {fileID: 0}
_loseDialogue: {fileID: 0}
_item: {fileID: 11400000, guid: 981618c3eb6d24746a53ce7dbe6559a6, type: 2}
_type: 3
_isDone: 0

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);
}
}

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;
[SerializeField]
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;
}
}

217
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;
[SerializeField] private VoidEventChannelSO _winDialogueEvent = default;
[SerializeField] private VoidEventChannelSO _loseDialogueEvent = default;
[SerializeField] private TaskChannelSO _endTaskEvent = 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; }
if (_winDialogueEvent != null)
{ _winDialogueEvent.OnEventRaised += PlayWinDialogue; }
if (_loseDialogueEvent != null)
{ _loseDialogueEvent.OnEventRaised += PlayLoseDialogue; }
if (_endTaskEvent != null)
{ _endTaskEvent.OnEventRaised += EndTask; }
}
//play default dialogue if no task
void PlayDefaultDialogue()
{
if (_defaultDialogue != null)
{
_currentDialogue = _defaultDialogue;
StartDialogue();
}
}
void CheckTaskInvolvment(TaskSO task)
{
Debug.Log("check involvment");
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)
{
Debug.Log("Start Dialogue ");
_startDialogueEvent.RaiseEvent(_currentDialogue);
}
}
void PlayLoseDialogue() {
if (_currentTask != null)
if (_currentTask.LoseDialogue != null)
{
Debug.Log("Play lose Dialogue ");
_currentDialogue = _currentTask.LoseDialogue;
StartDialogue();
}
}
void PlayWinDialogue()
{
Debug.Log("Play Win Dialogue" + _currentTask.WinDialogue);
if (_currentTask != null)
if (_currentTask.WinDialogue != null)
{
_currentDialogue = _currentTask.WinDialogue;
StartDialogue();
}
}
//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
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(TaskSO taskToFinish)
{
Debug.Log("End Task " + taskToFinish.name);
if(taskToFinish==_currentTask)
UnregisterTask();
else
{
StartTask();
}
}
void EndTask()
{
UnregisterTask();
}
//unregister a task when it ends.
void UnregisterTask()
{
_currentTask = null;
_hasActifTask = false;
_currentDialogue = _defaultDialogue;
}
}

/UOP1_Project/Assets/Prefabs/Managers/TaskManager.prefab → /UOP1_Project/Assets/Prefabs/Managers/StepController.prefab

/UOP1_Project/Assets/Prefabs/Managers/TaskManager.prefab.meta → /UOP1_Project/Assets/Prefabs/Managers/StepController.prefab.meta

/UOP1_Project/Assets/ScriptableObjects/Events/Quests/CheckTaskValidityEvent.asset.meta → /UOP1_Project/Assets/ScriptableObjects/Events/Quests/CheckStepValidityEvent.asset.meta

/UOP1_Project/Assets/ScriptableObjects/Events/Quests/EndTaskEvent.asset.meta → /UOP1_Project/Assets/ScriptableObjects/Events/Quests/EndStepEvent.asset.meta

/UOP1_Project/Assets/ScriptableObjects/Events/Quests/StartTaskEvent.asset.meta → /UOP1_Project/Assets/ScriptableObjects/Events/Quests/StartStepEvent.asset.meta

/UOP1_Project/Assets/ScriptableObjects/Events/Quests/CheckTaskValidityEvent.asset → /UOP1_Project/Assets/ScriptableObjects/Events/Quests/CheckStepValidityEvent.asset

/UOP1_Project/Assets/ScriptableObjects/Events/Quests/EndTaskEvent.asset → /UOP1_Project/Assets/ScriptableObjects/Events/Quests/EndStepEvent.asset

/UOP1_Project/Assets/ScriptableObjects/Events/Quests/StartTaskEvent.asset → /UOP1_Project/Assets/ScriptableObjects/Events/Quests/StartStepEvent.asset

/UOP1_Project/Assets/ScriptableObjects/Quests/Quest1/Task1.meta → /UOP1_Project/Assets/ScriptableObjects/Quests/Quest1/Step1.meta

/UOP1_Project/Assets/ScriptableObjects/Quests/Quest1/Task2.meta → /UOP1_Project/Assets/ScriptableObjects/Quests/Quest1/Step2.meta

/UOP1_Project/Assets/ScriptableObjects/Quests/Quest1/Task3.meta → /UOP1_Project/Assets/ScriptableObjects/Quests/Quest1/Step3.meta

/UOP1_Project/Assets/Scripts/Events/ScriptableObjects/UI/TaskChannelSO.cs.meta → /UOP1_Project/Assets/Scripts/Events/ScriptableObjects/UI/StepChannelSO.cs.meta

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

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

/UOP1_Project/Assets/ScriptableObjects/Quests/Quest1/Task1/Dialogue.meta → /UOP1_Project/Assets/ScriptableObjects/Quests/Quest1/Step1/Dialogue.meta

/UOP1_Project/Assets/ScriptableObjects/Quests/Quest1/Task1/Dialogue → /UOP1_Project/Assets/ScriptableObjects/Quests/Quest1/Step1/Dialogue

/UOP1_Project/Assets/ScriptableObjects/Quests/Quest1/Step1/Dialogue/Task1_StartDialogue.asset.meta → /UOP1_Project/Assets/ScriptableObjects/Quests/Quest1/Step1/Dialogue/Step1_StartDialogue.asset.meta

/UOP1_Project/Assets/ScriptableObjects/Quests/Quest1/Step1/Dialogue/Task1_StartDialogue.asset → /UOP1_Project/Assets/ScriptableObjects/Quests/Quest1/Step1/Dialogue/Step1_StartDialogue.asset

/UOP1_Project/Assets/ScriptableObjects/Quests/Quest1/Task1/Task1.asset.meta → /UOP1_Project/Assets/ScriptableObjects/Quests/Quest1/Step1/Step1.asset.meta

/UOP1_Project/Assets/ScriptableObjects/Quests/Quest1/Task2/Dialogue.meta → /UOP1_Project/Assets/ScriptableObjects/Quests/Quest1/Step2/Dialogue.meta

/UOP1_Project/Assets/ScriptableObjects/Quests/Quest1/Task2/Dialogue → /UOP1_Project/Assets/ScriptableObjects/Quests/Quest1/Step2/Dialogue

/UOP1_Project/Assets/ScriptableObjects/Quests/Quest1/Step2/Dialogue/Task2_LoseDialogue.asset.meta → /UOP1_Project/Assets/ScriptableObjects/Quests/Quest1/Step2/Dialogue/Step2_LoseDialogue.asset.meta

/UOP1_Project/Assets/ScriptableObjects/Quests/Quest1/Step2/Dialogue/Task2_StartDialogue.asset.meta → /UOP1_Project/Assets/ScriptableObjects/Quests/Quest1/Step2/Dialogue/Step2_StartDialogue.asset.meta

/UOP1_Project/Assets/ScriptableObjects/Quests/Quest1/Step2/Dialogue/Task2_WinDialogue.asset.meta → /UOP1_Project/Assets/ScriptableObjects/Quests/Quest1/Step2/Dialogue/Step2_WinDialogue.asset.meta

/UOP1_Project/Assets/ScriptableObjects/Quests/Quest1/Step2/Dialogue/Task2_LoseDialogue.asset → /UOP1_Project/Assets/ScriptableObjects/Quests/Quest1/Step2/Dialogue/Step2_LoseDialogue.asset

/UOP1_Project/Assets/ScriptableObjects/Quests/Quest1/Step2/Dialogue/Task2_StartDialogue.asset → /UOP1_Project/Assets/ScriptableObjects/Quests/Quest1/Step2/Dialogue/Step2_StartDialogue.asset

/UOP1_Project/Assets/ScriptableObjects/Quests/Quest1/Step2/Dialogue/Task2_WinDialogue.asset → /UOP1_Project/Assets/ScriptableObjects/Quests/Quest1/Step2/Dialogue/Step2_WinDialogue.asset

/UOP1_Project/Assets/ScriptableObjects/Quests/Quest1/Task2/Task2.asset.meta → /UOP1_Project/Assets/ScriptableObjects/Quests/Quest1/Step2/Step2.asset.meta

/UOP1_Project/Assets/ScriptableObjects/Quests/Quest1/Task3/Dialogue.meta → /UOP1_Project/Assets/ScriptableObjects/Quests/Quest1/Step3/Dialogue.meta

/UOP1_Project/Assets/ScriptableObjects/Quests/Quest1/Task3/Dialogue → /UOP1_Project/Assets/ScriptableObjects/Quests/Quest1/Step3/Dialogue

/UOP1_Project/Assets/ScriptableObjects/Quests/Quest1/Step3/Dialogue/Task3_StartDialogue.asset.meta → /UOP1_Project/Assets/ScriptableObjects/Quests/Quest1/Step3/Dialogue/Step3_StartDialogue.asset.meta

/UOP1_Project/Assets/ScriptableObjects/Quests/Quest1/Step3/Dialogue/Task3_StartDialogue.asset → /UOP1_Project/Assets/ScriptableObjects/Quests/Quest1/Step3/Dialogue/Step3_StartDialogue.asset

/UOP1_Project/Assets/ScriptableObjects/Quests/Quest1/Task3/Task3.asset.meta → /UOP1_Project/Assets/ScriptableObjects/Quests/Quest1/Step3/Step3.asset.meta

正在加载...
取消
保存