uChema
4 年前
当前提交
a16fe655
共有 86 个文件被更改,包括 1248 次插入 和 298 次删除
-
25UOP1_Project/Assets/Prefabs/Characters/BardHare.prefab
-
9UOP1_Project/Assets/Prefabs/Managers/DialogueManager.prefab
-
2UOP1_Project/Assets/Prefabs/Managers/InventoryManager.prefab
-
16UOP1_Project/Assets/Prefabs/Managers/UIManager.prefab
-
91UOP1_Project/Assets/Scenes/Examples/InteractionExample.unity
-
212UOP1_Project/Assets/Scenes/Gameplay.unity
-
2UOP1_Project/Assets/ScriptableObjects/Events/UI/ChangeTabInventoryUIEvent.asset
-
9UOP1_Project/Assets/Scripts/Dialogues/DialogueDataSO.cs
-
88UOP1_Project/Assets/Scripts/Dialogues/DialogueManager.cs
-
6UOP1_Project/Assets/Scripts/Interaction/InteractionManager.cs
-
57UOP1_Project/Assets/Scripts/UI/UIManager.cs
-
55UOP1_Project/Assets/Prefabs/Managers/QuestManager.prefab
-
7UOP1_Project/Assets/Prefabs/Managers/QuestManager.prefab.meta
-
54UOP1_Project/Assets/Prefabs/Managers/TaskManager.prefab
-
7UOP1_Project/Assets/Prefabs/Managers/TaskManager.prefab.meta
-
8UOP1_Project/Assets/ScriptableObjects/Events/Dialogue.meta
-
8UOP1_Project/Assets/ScriptableObjects/Events/Inventory.meta
-
8UOP1_Project/Assets/ScriptableObjects/Events/Quests.meta
-
15UOP1_Project/Assets/ScriptableObjects/Events/UI/CloseDialogueUIEvent.asset
-
15UOP1_Project/Assets/ScriptableObjects/Events/UI/CloseInventoryUIEvent.asset
-
15UOP1_Project/Assets/ScriptableObjects/Events/UI/OpenInventoryUIEvent.asset
-
8UOP1_Project/Assets/ScriptableObjects/Quests.meta
-
15UOP1_Project/Assets/Scripts/Events/ScriptableObjects/UI/TaskChannelSO.cs
-
11UOP1_Project/Assets/Scripts/Events/ScriptableObjects/UI/TaskChannelSO.cs.meta
-
28UOP1_Project/Assets/Scripts/UI/UIDialogueChoiceFiller.cs
-
15UOP1_Project/Assets/ScriptableObjects/Events/Dialogue/EndDialogueEvent.asset
-
8UOP1_Project/Assets/ScriptableObjects/Events/Dialogue/EndDialogueEvent.asset.meta
-
14UOP1_Project/Assets/ScriptableObjects/Events/Dialogue/InteractionWithActorEvent.asset
-
8UOP1_Project/Assets/ScriptableObjects/Events/Dialogue/InteractionWithActorEvent.asset.meta
-
14UOP1_Project/Assets/ScriptableObjects/Events/Dialogue/StartDialogueEvent.asset
-
8UOP1_Project/Assets/ScriptableObjects/Events/Dialogue/StartDialogueEvent.asset.meta
-
15UOP1_Project/Assets/ScriptableObjects/Events/Quests/CheckTaskValidityEvent.asset
-
8UOP1_Project/Assets/ScriptableObjects/Events/Quests/CheckTaskValidityEvent.asset.meta
-
15UOP1_Project/Assets/ScriptableObjects/Events/Quests/EndTaskEvent.asset
-
8UOP1_Project/Assets/ScriptableObjects/Events/Quests/EndTaskEvent.asset.meta
-
14UOP1_Project/Assets/ScriptableObjects/Events/Quests/GiveItemEvent.asset
-
8UOP1_Project/Assets/ScriptableObjects/Events/Quests/GiveItemEvent.asset.meta
-
15UOP1_Project/Assets/ScriptableObjects/Events/Quests/LoseDialogueEvent.asset
-
8UOP1_Project/Assets/ScriptableObjects/Events/Quests/LoseDialogueEvent.asset.meta
-
14UOP1_Project/Assets/ScriptableObjects/Events/Quests/RewardItemEvent.asset
-
8UOP1_Project/Assets/ScriptableObjects/Events/Quests/RewardItemEvent.asset.meta
-
14UOP1_Project/Assets/ScriptableObjects/Events/Quests/StartTaskEvent.asset
-
8UOP1_Project/Assets/ScriptableObjects/Events/Quests/StartTaskEvent.asset.meta
-
15UOP1_Project/Assets/ScriptableObjects/Events/Quests/WinDialogueEvent.asset
-
8UOP1_Project/Assets/ScriptableObjects/Events/Quests/WinDialogueEvent.asset.meta
-
186UOP1_Project/Assets/Scripts/Quests/QuestManager.cs
-
8UOP1_Project/Assets/Scripts/Quests/ScriptableObjects.meta
-
19UOP1_Project/Assets/Scripts/Quests/ScriptableObjects/QuestSO.cs
-
50UOP1_Project/Assets/Scripts/Quests/ScriptableObjects/TaskSO.cs
-
172UOP1_Project/Assets/Scripts/Quests/TaskManager.cs
-
14UOP1_Project/Assets/ScriptableObjects/Events/UI/CloseDialogueEvent.asset
-
14UOP1_Project/Assets/ScriptableObjects/Events/UI/CloseInventoryEvent.asset
-
14UOP1_Project/Assets/ScriptableObjects/Events/UI/OpenInventoryEvent.asset
-
47UOP1_Project/Assets/Scripts/Inventory/ScriptableObjects/TaskSO.cs
-
26UOP1_Project/Assets/UIDialogueChoiceFiller.cs
-
0/UOP1_Project/Assets/ScriptableObjects/Events/UI/ChangeTabInventoryUIEvent.asset.meta
-
0/UOP1_Project/Assets/ScriptableObjects/Events/UI/CloseDialogueUIEvent.asset.meta
-
0/UOP1_Project/Assets/ScriptableObjects/Events/UI/CloseInventoryUIEvent.asset.meta
-
0/UOP1_Project/Assets/ScriptableObjects/Events/UI/OpenInventoryUIEvent.asset.meta
-
0/UOP1_Project/Assets/ScriptableObjects/Events/UI/ChangeTabInventoryUIEvent.asset
-
0/UOP1_Project/Assets/ScriptableObjects/Events/Inventory/AddInventoryItemEvent.asset
-
0/UOP1_Project/Assets/ScriptableObjects/Events/Inventory/AddInventoryItemEvent.asset.meta
-
0/UOP1_Project/Assets/ScriptableObjects/Events/Inventory/CookRecipe.asset
-
0/UOP1_Project/Assets/ScriptableObjects/Events/Inventory/CookRecipe.asset.meta
-
0/UOP1_Project/Assets/ScriptableObjects/Events/Inventory/EquipInventoryItem.asset
-
0/UOP1_Project/Assets/ScriptableObjects/Events/Inventory/EquipInventoryItem.asset.meta
-
0/UOP1_Project/Assets/ScriptableObjects/Events/Inventory/RemoveInventoryItemEvent.asset
-
0/UOP1_Project/Assets/ScriptableObjects/Events/Inventory/RemoveInventoryItemEvent.asset.meta
-
0/UOP1_Project/Assets/ScriptableObjects/Events/Inventory/UseInventoryItem.asset
-
0/UOP1_Project/Assets/ScriptableObjects/Events/Inventory/UseInventoryItem.asset.meta
-
0/UOP1_Project/Assets/ScriptableObjects/Events/Dialogue/MakeDialogueChoiceEvent.asset
-
0/UOP1_Project/Assets/ScriptableObjects/Events/Dialogue/MakeDialogueChoiceEvent.asset.meta
-
0/UOP1_Project/Assets/Scripts/Quests/ScriptableObjects/TaskSO.cs.meta
-
0/UOP1_Project/Assets/Scripts/Quests.meta
-
0/UOP1_Project/Assets/Scripts/UI/UIDialogueChoiceFiller.cs.meta
-
0/UOP1_Project/Assets/Scripts/UI/UIDialogueChoicesManager.cs
-
0/UOP1_Project/Assets/Scripts/UI/UIDialogueChoicesManager.cs.meta
-
0/UOP1_Project/Assets/Scripts/Quests/QuestManager.cs.meta
-
0/UOP1_Project/Assets/Scripts/Quests/ScriptableObjects/QuestSO.cs.meta
-
0/UOP1_Project/Assets/Scripts/Quests/TaskManager.cs.meta
|
|||
%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} |
|
|||
fileFormatVersion: 2 |
|||
guid: 021ad8df909ac4147aa545c01f5ad8db |
|||
PrefabImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
%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} |
|
|||
fileFormatVersion: 2 |
|||
guid: 8a320dae5a9ab684a98f0990bdeda501 |
|||
PrefabImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: 1960d4276e4a9f24483d17b55071d98f |
|||
folderAsset: yes |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: b04789909dc564444b178475c7c47b7a |
|||
folderAsset: yes |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: 7e4dede7ecdaf2c44afbfb1862ba9bba |
|||
folderAsset: yes |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
%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: |
|
|||
%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: |
|
|||
%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: |
|
|||
fileFormatVersion: 2 |
|||
guid: 11c350a4a3a2eb546bcd86cd0c8706dc |
|||
folderAsset: yes |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
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); |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 4d2ce8a9511333c42a9e907bbdb3b32f |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
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); |
|||
} |
|||
} |
|
|||
%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: |
|
|||
fileFormatVersion: 2 |
|||
guid: 4f783502cf29fc442948914c150c1e05 |
|||
NativeFormatImporter: |
|||
externalObjects: {} |
|||
mainObjectFileID: 0 |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
%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: |
|
|||
fileFormatVersion: 2 |
|||
guid: 5f20ccd3e97527a44a6bf34644f85011 |
|||
NativeFormatImporter: |
|||
externalObjects: {} |
|||
mainObjectFileID: 0 |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
%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: |
|
|||
fileFormatVersion: 2 |
|||
guid: 5cfe626f5482b914a9e46ebbe35ea1a8 |
|||
NativeFormatImporter: |
|||
externalObjects: {} |
|||
mainObjectFileID: 0 |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
%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: |
|
|||
fileFormatVersion: 2 |
|||
guid: 71375bc63dd705044a6b0fc6ee5f2acd |
|||
NativeFormatImporter: |
|||
externalObjects: {} |
|||
mainObjectFileID: 0 |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
%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: |
|
|||
fileFormatVersion: 2 |
|||
guid: 0803969a2e523324b86ca9a0c4ac12f2 |
|||
NativeFormatImporter: |
|||
externalObjects: {} |
|||
mainObjectFileID: 0 |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
%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: |
|
|||
fileFormatVersion: 2 |
|||
guid: c54b320c4205f1c49b296b878daf2097 |
|||
NativeFormatImporter: |
|||
externalObjects: {} |
|||
mainObjectFileID: 0 |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
%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: |
|
|||
fileFormatVersion: 2 |
|||
guid: fcc99784052e5cc469b8c22c0674b051 |
|||
NativeFormatImporter: |
|||
externalObjects: {} |
|||
mainObjectFileID: 0 |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
%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: |
|
|||
fileFormatVersion: 2 |
|||
guid: ceeec59dc461abd4f91dac5b07084d24 |
|||
NativeFormatImporter: |
|||
externalObjects: {} |
|||
mainObjectFileID: 0 |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
%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: |
|
|||
fileFormatVersion: 2 |
|||
guid: ab5fce85191f90d449e132c92e099476 |
|||
NativeFormatImporter: |
|||
externalObjects: {} |
|||
mainObjectFileID: 0 |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
%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: |
|
|||
fileFormatVersion: 2 |
|||
guid: dc2da1754c28ab9499cb6c7d72465e69 |
|||
NativeFormatImporter: |
|||
externalObjects: {} |
|||
mainObjectFileID: 0 |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
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(); |
|||
|
|||
} |
|||
|
|||
} |
|||
|
|||
|
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: a1f4e7057c13512428664f22d9f4eb81 |
|||
folderAsset: yes |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
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; |
|||
} |
|||
|
|||
|
|||
} |
|
|||
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; |
|||
|
|||
} |
|||
|
|||
|
|||
} |
|
|||
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; |
|||
|
|||
|
|||
} |
|||
} |
|
|||
%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: |
|
|||
%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: |
|
|||
%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: |
|
|||
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; |
|||
|
|||
} |
|||
|
|||
|
|||
} |
|
|||
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); |
|||
} |
|||
} |
撰写
预览
正在加载...
取消
保存
Reference in new issue