net.dreditor.dialogues.implementation 0.1.6 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.attestation.p7m +0 -0
- package/DREditor.Dialogues.Implementation.asmdef +15 -15
- package/DREditor.Dialogues.Implementation.asmdef.meta +7 -7
- package/DialogueAssetDataClearer.cs +49 -49
- package/DialogueAssetDataClearer.cs.meta +11 -11
- package/DialogueAssetEndEventHandler.cs +57 -57
- package/DialogueAssetEndEventHandler.cs.meta +11 -11
- package/DialogueAssetEnder.cs +239 -239
- package/DialogueAssetEnder.cs.meta +11 -11
- package/DialogueAssetFinisher.cs +89 -89
- package/DialogueAssetFinisher.cs.meta +11 -11
- package/DialogueAssetFinisherBase.cs +82 -82
- package/DialogueAssetFinisherBase.cs.meta +11 -11
- package/DialogueAssetManager.cs +65 -65
- package/DialogueAssetManager.cs.meta +11 -11
- package/DialogueAssetReader.cs +377 -377
- package/DialogueAssetReader.cs.meta +11 -11
- package/DialogueAssetStarter.cs +254 -254
- package/DialogueAssetStarter.cs.meta +11 -11
- package/DialogueAssetStarterDebugger.cs +40 -40
- package/DialogueAssetStarterDebugger.cs.meta +11 -11
- package/DialogueAssetWaiter.cs +93 -93
- package/DialogueAssetWaiter.cs.meta +11 -11
- package/DialogueLineReader.cs +391 -391
- package/DialogueLineReader.cs.meta +11 -11
- package/DialogueManager.cs +83 -83
- package/DialogueManager.cs.meta +11 -11
- package/DialogueNameSaver.cs +45 -45
- package/DialogueNameSaver.cs.meta +11 -11
- package/FastForwardToLine.cs +102 -102
- package/FastForwardToLine.cs.meta +11 -11
- package/InstantDialogueEnder.cs +91 -91
- package/InstantDialogueEnder.cs.meta +11 -11
- package/InstantDialogueFinisher.cs +132 -132
- package/InstantDialogueFinisher.cs.meta +11 -11
- package/InstantDialogueStarter.cs +82 -82
- package/InstantDialogueStarter.cs.meta +11 -11
- package/NotLeavingOnDialogueFinish.cs +44 -44
- package/NotLeavingOnDialogueFinish.cs.meta +11 -11
- package/PreparableDialogueStarter.cs +88 -88
- package/PreparableDialogueStarter.cs.meta +11 -11
- package/{Samples → Samples~}/Dialogue_Asset_End_Event_Handler.prefab +685 -685
- package/{Samples → Samples~}/Dialogue_Asset_End_Event_Handler.prefab.meta +7 -7
- package/{Samples → Samples~}/Dialogue_Asset_Ender.prefab +858 -858
- package/{Samples → Samples~}/Dialogue_Asset_Ender.prefab.meta +7 -7
- package/{Samples → Samples~}/Dialogue_Asset_Finisher.prefab +301 -301
- package/{Samples → Samples~}/Dialogue_Asset_Finisher.prefab.meta +7 -7
- package/{Samples → Samples~}/Dialogue_Asset_Load_Identifier.prefab +48 -48
- package/{Samples → Samples~}/Dialogue_Asset_Load_Identifier.prefab.meta +7 -7
- package/{Samples → Samples~}/Dialogue_Asset_Loader.prefab +231 -231
- package/{Samples → Samples~}/Dialogue_Asset_Loader.prefab.meta +7 -7
- package/{Samples → Samples~}/Dialogue_Asset_Reader_DRE.prefab +511 -511
- package/{Samples → Samples~}/Dialogue_Asset_Reader_DRE.prefab.meta +7 -7
- package/{Samples → Samples~}/Dialogue_Asset_Reader_Shell.prefab +252 -252
- package/{Samples → Samples~}/Dialogue_Asset_Reader_Shell.prefab.meta +7 -7
- package/{Samples → Samples~}/Dialogue_Asset_Reader_Template.prefab +193 -193
- package/{Samples → Samples~}/Dialogue_Asset_Reader_Template.prefab.meta +7 -7
- package/{Samples → Samples~}/Dialogue_Asset_Starter.prefab +613 -613
- package/{Samples → Samples~}/Dialogue_Asset_Starter.prefab.meta +7 -7
- package/{Samples → Samples~}/Dialogue_Asset_Waiter.prefab +50 -50
- package/{Samples → Samples~}/Dialogue_Asset_Waiter.prefab.meta +7 -7
- package/{Samples → Samples~}/Dialogue_Events_Shell.prefab +458 -458
- package/{Samples → Samples~}/Dialogue_Events_Shell.prefab.meta +7 -7
- package/{Samples → Samples~}/Dialogue_Events_Template.prefab +302 -302
- package/{Samples → Samples~}/Dialogue_Events_Template.prefab.meta +7 -7
- package/{Samples → Samples~}/Dialogue_Line_Loader.prefab +1282 -1282
- package/{Samples → Samples~}/Dialogue_Line_Loader.prefab.meta +7 -7
- package/{Samples → Samples~}/Dialogue_Line_Reader.prefab +3688 -3688
- package/{Samples → Samples~}/Dialogue_Line_Reader.prefab.meta +7 -7
- package/{Samples → Samples~}/Dialogue_Name_Saver.prefab +48 -48
- package/{Samples → Samples~}/Dialogue_Name_Saver.prefab.meta +7 -7
- package/{Samples → Samples~}/Dialogue_System_Shell.prefab +325 -325
- package/{Samples → Samples~}/Dialogue_System_Shell.prefab.meta +7 -7
- package/{Samples → Samples~}/Dialogue_System_Template.prefab +1138 -1138
- package/{Samples → Samples~}/Dialogue_System_Template.prefab.meta +7 -7
- package/{Samples → Samples~}/Fast_Forward_To_Line_Tool.prefab +53 -53
- package/{Samples → Samples~}/Fast_Forward_To_Line_Tool.prefab.meta +7 -7
- package/{Samples → Samples~}/Instant_Dialogue_Ender.prefab +141 -141
- package/{Samples → Samples~}/Instant_Dialogue_Ender.prefab.meta +7 -7
- package/{Samples → Samples~}/Instant_Dialogue_Finisher.prefab +172 -172
- package/{Samples → Samples~}/Instant_Dialogue_Finisher.prefab.meta +7 -7
- package/{Samples → Samples~}/Instant_Dialogue_Starter.prefab +55 -55
- package/{Samples → Samples~}/Instant_Dialogue_Starter.prefab.meta +7 -7
- package/{Samples → Samples~}/On_Loading_Through_Scene_Transition.prefab +48 -48
- package/{Samples → Samples~}/On_Loading_Through_Scene_Transition.prefab.meta +7 -7
- package/{Samples → Samples~}/Scene_Event_On_Text_Display.prefab +47 -47
- package/{Samples → Samples~}/Scene_Event_On_Text_Display.prefab.meta +7 -7
- package/{Samples → Samples~}/Trial_Dialogue_Asset_Reader.prefab +561 -561
- package/{Samples → Samples~}/Trial_Dialogue_Asset_Reader.prefab.meta +7 -7
- package/{Samples → Samples~}/Trial_Dialogue_Asset_Starter.prefab +239 -239
- package/{Samples → Samples~}/Trial_Dialogue_Asset_Starter.prefab.meta +7 -7
- package/{Samples → Samples~}/Trial_Dialogue_Line_Loader.prefab +941 -941
- package/{Samples → Samples~}/Trial_Dialogue_Line_Loader.prefab.meta +7 -7
- package/{Samples → Samples~}/Trial_Dialogue_Loader.prefab +232 -232
- package/{Samples → Samples~}/Trial_Dialogue_Loader.prefab.meta +7 -7
- package/{Samples → Samples~}/Tween_Waiter_Handler.prefab +46 -46
- package/{Samples → Samples~}/Tween_Waiter_Handler.prefab.meta +7 -7
- package/package.json +39 -34
- package/package.json.meta +7 -7
- package/Samples.meta +0 -8
package/InstantDialogueEnder.cs
CHANGED
|
@@ -1,92 +1,92 @@
|
|
|
1
|
-
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
-
using DREditor.Dialogues.Ending;
|
|
3
|
-
using DREditor.Dialogues.Finishing;
|
|
4
|
-
using System.Collections;
|
|
5
|
-
using System.Collections.Generic;
|
|
6
|
-
using UnityEngine;
|
|
7
|
-
using UnityEngine.Serialization;
|
|
8
|
-
|
|
9
|
-
namespace DREditor.Dialogues.Implementation
|
|
10
|
-
{
|
|
11
|
-
/// <summary>
|
|
12
|
-
///
|
|
13
|
-
/// </summary>
|
|
14
|
-
[ClassHeader(nameof(DialogueEnder) + ", " +
|
|
15
|
-
"\n\n")]
|
|
16
|
-
public class InstantDialogueEnder : DialogueEnder
|
|
17
|
-
{
|
|
18
|
-
/// <summary>
|
|
19
|
-
///
|
|
20
|
-
/// </summary>
|
|
21
|
-
[Tooltip("")]
|
|
22
|
-
[SerializeField] DialogueFinisher InstantDialogueFinisher = null;
|
|
23
|
-
|
|
24
|
-
/// <summary>
|
|
25
|
-
///
|
|
26
|
-
/// </summary>
|
|
27
|
-
[Tooltip("")]
|
|
28
|
-
[SerializeField] protected int collectionID = 1;
|
|
29
|
-
|
|
30
|
-
/// <summary>
|
|
31
|
-
///
|
|
32
|
-
/// </summary>
|
|
33
|
-
[Tooltip("")]
|
|
34
|
-
[SerializeField] protected string orderFieldName = "resolveOrder";
|
|
35
|
-
|
|
36
|
-
/// <summary>
|
|
37
|
-
///
|
|
38
|
-
/// </summary>
|
|
39
|
-
[Tooltip("")]
|
|
40
|
-
[SerializeField] protected DialogueComponentCollection<IResolvableDialogueComponent> resolvableCollection = new();
|
|
41
|
-
|
|
42
|
-
/// <summary>
|
|
43
|
-
///
|
|
44
|
-
/// </summary>
|
|
45
|
-
[FormerlySerializedAs("ResolvableComponents")]
|
|
46
|
-
[Tooltip("")]
|
|
47
|
-
[SerializeField] protected List<DialogueComponent> overrideComponents = new();
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
protected virtual void Awake() => resolvableCollection.Initialize(transform, orderFieldName, collectionID);
|
|
51
|
-
|
|
52
|
-
protected virtual void OnValidate() => resolvableCollection.Initialize(transform, orderFieldName, collectionID);
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
/// <inheritdoc/>
|
|
56
|
-
public override void StopDialogue() => StartCoroutine(EndDialogue());
|
|
57
|
-
|
|
58
|
-
/// <inheritdoc/>
|
|
59
|
-
public override IEnumerator EndDialogue(bool finishDialogue = true)
|
|
60
|
-
{
|
|
61
|
-
UnityEngine.Debug.Log($"REPORT: {ToString()}: Instant dialogue has started to resolve.");
|
|
62
|
-
|
|
63
|
-
yield return ResolveDialogueComponents();
|
|
64
|
-
|
|
65
|
-
yield return InstantDialogueFinisher.FinishDialogueRoutine(finishDialogue);
|
|
66
|
-
|
|
67
|
-
UnityEngine.Debug.Log($"REPORT: {ToString()}: Instant dialogue has resolved.");
|
|
68
|
-
|
|
69
|
-
yield break;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
/// <summary>
|
|
73
|
-
///
|
|
74
|
-
/// </summary>
|
|
75
|
-
protected virtual IEnumerator ResolveDialogueComponents()
|
|
76
|
-
{
|
|
77
|
-
IEnumerable componentList = overrideComponents.Count > 0 ? overrideComponents : resolvableCollection.components;
|
|
78
|
-
|
|
79
|
-
foreach (var component in componentList)
|
|
80
|
-
if (component != null && component is IResolvableDialogueComponent resolvable)
|
|
81
|
-
if (resolvable.UseRoutineToResolve())
|
|
82
|
-
yield return resolvable.ResolveRoutine();
|
|
83
|
-
else
|
|
84
|
-
resolvable.Resolve();
|
|
85
|
-
|
|
86
|
-
yield break;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
/// <inheritdoc/>
|
|
90
|
-
public override void FinishDialogue() => InstantDialogueFinisher.FinishDialogue();
|
|
91
|
-
}
|
|
1
|
+
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
+
using DREditor.Dialogues.Ending;
|
|
3
|
+
using DREditor.Dialogues.Finishing;
|
|
4
|
+
using System.Collections;
|
|
5
|
+
using System.Collections.Generic;
|
|
6
|
+
using UnityEngine;
|
|
7
|
+
using UnityEngine.Serialization;
|
|
8
|
+
|
|
9
|
+
namespace DREditor.Dialogues.Implementation
|
|
10
|
+
{
|
|
11
|
+
/// <summary>
|
|
12
|
+
///
|
|
13
|
+
/// </summary>
|
|
14
|
+
[ClassHeader(nameof(DialogueEnder) + ", " +
|
|
15
|
+
"\n\n")]
|
|
16
|
+
public class InstantDialogueEnder : DialogueEnder
|
|
17
|
+
{
|
|
18
|
+
/// <summary>
|
|
19
|
+
///
|
|
20
|
+
/// </summary>
|
|
21
|
+
[Tooltip("")]
|
|
22
|
+
[SerializeField] DialogueFinisher InstantDialogueFinisher = null;
|
|
23
|
+
|
|
24
|
+
/// <summary>
|
|
25
|
+
///
|
|
26
|
+
/// </summary>
|
|
27
|
+
[Tooltip("")]
|
|
28
|
+
[SerializeField] protected int collectionID = 1;
|
|
29
|
+
|
|
30
|
+
/// <summary>
|
|
31
|
+
///
|
|
32
|
+
/// </summary>
|
|
33
|
+
[Tooltip("")]
|
|
34
|
+
[SerializeField] protected string orderFieldName = "resolveOrder";
|
|
35
|
+
|
|
36
|
+
/// <summary>
|
|
37
|
+
///
|
|
38
|
+
/// </summary>
|
|
39
|
+
[Tooltip("")]
|
|
40
|
+
[SerializeField] protected DialogueComponentCollection<IResolvableDialogueComponent> resolvableCollection = new();
|
|
41
|
+
|
|
42
|
+
/// <summary>
|
|
43
|
+
///
|
|
44
|
+
/// </summary>
|
|
45
|
+
[FormerlySerializedAs("ResolvableComponents")]
|
|
46
|
+
[Tooltip("")]
|
|
47
|
+
[SerializeField] protected List<DialogueComponent> overrideComponents = new();
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
protected virtual void Awake() => resolvableCollection.Initialize(transform, orderFieldName, collectionID);
|
|
51
|
+
|
|
52
|
+
protected virtual void OnValidate() => resolvableCollection.Initialize(transform, orderFieldName, collectionID);
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
/// <inheritdoc/>
|
|
56
|
+
public override void StopDialogue() => StartCoroutine(EndDialogue());
|
|
57
|
+
|
|
58
|
+
/// <inheritdoc/>
|
|
59
|
+
public override IEnumerator EndDialogue(bool finishDialogue = true)
|
|
60
|
+
{
|
|
61
|
+
UnityEngine.Debug.Log($"REPORT: {ToString()}: Instant dialogue has started to resolve.");
|
|
62
|
+
|
|
63
|
+
yield return ResolveDialogueComponents();
|
|
64
|
+
|
|
65
|
+
yield return InstantDialogueFinisher.FinishDialogueRoutine(finishDialogue);
|
|
66
|
+
|
|
67
|
+
UnityEngine.Debug.Log($"REPORT: {ToString()}: Instant dialogue has resolved.");
|
|
68
|
+
|
|
69
|
+
yield break;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/// <summary>
|
|
73
|
+
///
|
|
74
|
+
/// </summary>
|
|
75
|
+
protected virtual IEnumerator ResolveDialogueComponents()
|
|
76
|
+
{
|
|
77
|
+
IEnumerable componentList = overrideComponents.Count > 0 ? overrideComponents : resolvableCollection.components;
|
|
78
|
+
|
|
79
|
+
foreach (var component in componentList)
|
|
80
|
+
if (component != null && component is IResolvableDialogueComponent resolvable)
|
|
81
|
+
if (resolvable.UseRoutineToResolve())
|
|
82
|
+
yield return resolvable.ResolveRoutine();
|
|
83
|
+
else
|
|
84
|
+
resolvable.Resolve();
|
|
85
|
+
|
|
86
|
+
yield break;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/// <inheritdoc/>
|
|
90
|
+
public override void FinishDialogue() => InstantDialogueFinisher.FinishDialogue();
|
|
91
|
+
}
|
|
92
92
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
fileFormatVersion: 2
|
|
2
|
-
guid: c1665a4e3e9abcc4b83a6548fd0f27a6
|
|
3
|
-
MonoImporter:
|
|
4
|
-
externalObjects: {}
|
|
5
|
-
serializedVersion: 2
|
|
6
|
-
defaultReferences: []
|
|
7
|
-
executionOrder: 0
|
|
8
|
-
icon: {instanceID: 0}
|
|
9
|
-
userData:
|
|
10
|
-
assetBundleName:
|
|
11
|
-
assetBundleVariant:
|
|
1
|
+
fileFormatVersion: 2
|
|
2
|
+
guid: c1665a4e3e9abcc4b83a6548fd0f27a6
|
|
3
|
+
MonoImporter:
|
|
4
|
+
externalObjects: {}
|
|
5
|
+
serializedVersion: 2
|
|
6
|
+
defaultReferences: []
|
|
7
|
+
executionOrder: 0
|
|
8
|
+
icon: {instanceID: 0}
|
|
9
|
+
userData:
|
|
10
|
+
assetBundleName:
|
|
11
|
+
assetBundleVariant:
|
|
@@ -1,133 +1,133 @@
|
|
|
1
|
-
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
-
using DREditor.Dialogues.Finishing;
|
|
3
|
-
using DREditor.EventObjects;
|
|
4
|
-
using System.Collections;
|
|
5
|
-
using System.Collections.Generic;
|
|
6
|
-
using UnityEngine;
|
|
7
|
-
|
|
8
|
-
namespace DREditor.Dialogues.Implementation
|
|
9
|
-
{
|
|
10
|
-
/// <summary>
|
|
11
|
-
///
|
|
12
|
-
/// </summary>
|
|
13
|
-
[ClassHeader(nameof(DialogueAssetFinisherBase) + ", " + nameof(DialogueFinisher) + ", " +
|
|
14
|
-
nameof(IEndDialogueEvent) + ", " + nameof(IDialogueFinisher) +
|
|
15
|
-
"\n\n")]
|
|
16
|
-
public class InstantDialogueFinisher : DialogueAssetFinisherBase
|
|
17
|
-
{
|
|
18
|
-
/// <summary>
|
|
19
|
-
///
|
|
20
|
-
/// </summary>
|
|
21
|
-
[Tooltip("")]
|
|
22
|
-
[SerializeField] BoolWithEvent inInstant = null;
|
|
23
|
-
|
|
24
|
-
/// <summary>
|
|
25
|
-
///
|
|
26
|
-
/// </summary>
|
|
27
|
-
[Tooltip("")]
|
|
28
|
-
[SerializeField] BoolWithEvent isGoingToMainMenu = null;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
/// <summary>
|
|
32
|
-
///
|
|
33
|
-
/// </summary>
|
|
34
|
-
[Header("")]
|
|
35
|
-
[Divider]
|
|
36
|
-
[Tooltip("")]
|
|
37
|
-
[SerializeField] protected int collectionID = 2;
|
|
38
|
-
|
|
39
|
-
/// <summary>
|
|
40
|
-
///
|
|
41
|
-
/// </summary>
|
|
42
|
-
[Tooltip("")]
|
|
43
|
-
[SerializeField] protected string orderFieldName = "finishOrder";
|
|
44
|
-
|
|
45
|
-
/// <summary>
|
|
46
|
-
///
|
|
47
|
-
/// </summary>
|
|
48
|
-
[Tooltip("")]
|
|
49
|
-
[SerializeField] protected DialogueComponentCollection<IFinishableDialogueComponent> finishableCollection = new();
|
|
50
|
-
|
|
51
|
-
/// <summary>
|
|
52
|
-
///
|
|
53
|
-
/// </summary>
|
|
54
|
-
[Tooltip("")]
|
|
55
|
-
[SerializeField] protected List<DialogueComponent> overrideComponents = new();
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
protected virtual void Awake() => finishableCollection.Initialize(transform, orderFieldName, collectionID);
|
|
59
|
-
|
|
60
|
-
protected virtual void OnValidate() => finishableCollection.Initialize(transform, orderFieldName, collectionID);
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
/// <inheritdoc/>
|
|
64
|
-
public override void FinishDialogue() => StartCoroutine(FinishDialogueRoutine());
|
|
65
|
-
|
|
66
|
-
/// <inheritdoc/>
|
|
67
|
-
public override IEnumerator FinishDialogueRoutine(bool finishDialogue = true)
|
|
68
|
-
{
|
|
69
|
-
yield return FinishDialogueComponents();
|
|
70
|
-
|
|
71
|
-
SetInstantValueFalse();
|
|
72
|
-
|
|
73
|
-
CallOnDialogueEnd(); // NOTE: It is unknown why this is called twice but in the past caused issues when removed.
|
|
74
|
-
|
|
75
|
-
SetNoLongerInDialogueValues();
|
|
76
|
-
|
|
77
|
-
if (finishDialogue)
|
|
78
|
-
MoveToOriginalGameplayState();
|
|
79
|
-
|
|
80
|
-
UnityEngine.Debug.Log($"REPORT: {ToString()}: Instant dialogue has finished.");
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
/// <summary>
|
|
84
|
-
///
|
|
85
|
-
/// </summary>
|
|
86
|
-
protected virtual void SetInstantValueFalse() => inInstant.Value = false;
|
|
87
|
-
|
|
88
|
-
/// <summary>
|
|
89
|
-
///
|
|
90
|
-
/// </summary>
|
|
91
|
-
protected virtual void MoveToOriginalGameplayState()
|
|
92
|
-
{
|
|
93
|
-
if (!isGoingToMainMenu.Value)
|
|
94
|
-
EnableMenuAccessIfNotInTrial();
|
|
95
|
-
|
|
96
|
-
CallOnDialogueEnd();
|
|
97
|
-
|
|
98
|
-
SetControlsBasedOnCurrentMode();
|
|
99
|
-
|
|
100
|
-
CallOnFinishedDialogue();
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
/// <summary>
|
|
104
|
-
///
|
|
105
|
-
/// </summary>
|
|
106
|
-
protected virtual IEnumerator FinishDialogueComponents()
|
|
107
|
-
{
|
|
108
|
-
IEnumerable componentList = overrideComponents.Count > 0 ? overrideComponents : finishableCollection.components;
|
|
109
|
-
|
|
110
|
-
foreach (DialogueComponent component in componentList)
|
|
111
|
-
if (component != null && component is IComplexFinishableDialogueComponent finishable)
|
|
112
|
-
if (finishable.UseCoroutine())
|
|
113
|
-
yield return finishable.OnFinishDialogueRoutine();
|
|
114
|
-
else
|
|
115
|
-
finishable.OnFinishDialogue();
|
|
116
|
-
else
|
|
117
|
-
yield return EvaluateFinishingDialogueComponent(component);
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
/// <summary>
|
|
121
|
-
///
|
|
122
|
-
/// </summary>
|
|
123
|
-
/// <param name="component"></param>
|
|
124
|
-
/// <returns></returns>
|
|
125
|
-
protected virtual IEnumerator EvaluateFinishingDialogueComponent(DialogueComponent component)
|
|
126
|
-
{
|
|
127
|
-
if (component != null && component is IFinishableDialogueComponent finishable)
|
|
128
|
-
finishable.OnFinishDialogue();
|
|
129
|
-
else if (component != null && component is IFinishableDialogueComponentRoutine finishableRoutine)
|
|
130
|
-
yield return finishableRoutine.OnFinishDialogueRoutine();
|
|
131
|
-
}
|
|
132
|
-
}
|
|
1
|
+
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
+
using DREditor.Dialogues.Finishing;
|
|
3
|
+
using DREditor.EventObjects;
|
|
4
|
+
using System.Collections;
|
|
5
|
+
using System.Collections.Generic;
|
|
6
|
+
using UnityEngine;
|
|
7
|
+
|
|
8
|
+
namespace DREditor.Dialogues.Implementation
|
|
9
|
+
{
|
|
10
|
+
/// <summary>
|
|
11
|
+
///
|
|
12
|
+
/// </summary>
|
|
13
|
+
[ClassHeader(nameof(DialogueAssetFinisherBase) + ", " + nameof(DialogueFinisher) + ", " +
|
|
14
|
+
nameof(IEndDialogueEvent) + ", " + nameof(IDialogueFinisher) +
|
|
15
|
+
"\n\n")]
|
|
16
|
+
public class InstantDialogueFinisher : DialogueAssetFinisherBase
|
|
17
|
+
{
|
|
18
|
+
/// <summary>
|
|
19
|
+
///
|
|
20
|
+
/// </summary>
|
|
21
|
+
[Tooltip("")]
|
|
22
|
+
[SerializeField] BoolWithEvent inInstant = null;
|
|
23
|
+
|
|
24
|
+
/// <summary>
|
|
25
|
+
///
|
|
26
|
+
/// </summary>
|
|
27
|
+
[Tooltip("")]
|
|
28
|
+
[SerializeField] BoolWithEvent isGoingToMainMenu = null;
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
/// <summary>
|
|
32
|
+
///
|
|
33
|
+
/// </summary>
|
|
34
|
+
[Header("")]
|
|
35
|
+
[Divider]
|
|
36
|
+
[Tooltip("")]
|
|
37
|
+
[SerializeField] protected int collectionID = 2;
|
|
38
|
+
|
|
39
|
+
/// <summary>
|
|
40
|
+
///
|
|
41
|
+
/// </summary>
|
|
42
|
+
[Tooltip("")]
|
|
43
|
+
[SerializeField] protected string orderFieldName = "finishOrder";
|
|
44
|
+
|
|
45
|
+
/// <summary>
|
|
46
|
+
///
|
|
47
|
+
/// </summary>
|
|
48
|
+
[Tooltip("")]
|
|
49
|
+
[SerializeField] protected DialogueComponentCollection<IFinishableDialogueComponent> finishableCollection = new();
|
|
50
|
+
|
|
51
|
+
/// <summary>
|
|
52
|
+
///
|
|
53
|
+
/// </summary>
|
|
54
|
+
[Tooltip("")]
|
|
55
|
+
[SerializeField] protected List<DialogueComponent> overrideComponents = new();
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
protected virtual void Awake() => finishableCollection.Initialize(transform, orderFieldName, collectionID);
|
|
59
|
+
|
|
60
|
+
protected virtual void OnValidate() => finishableCollection.Initialize(transform, orderFieldName, collectionID);
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
/// <inheritdoc/>
|
|
64
|
+
public override void FinishDialogue() => StartCoroutine(FinishDialogueRoutine());
|
|
65
|
+
|
|
66
|
+
/// <inheritdoc/>
|
|
67
|
+
public override IEnumerator FinishDialogueRoutine(bool finishDialogue = true)
|
|
68
|
+
{
|
|
69
|
+
yield return FinishDialogueComponents();
|
|
70
|
+
|
|
71
|
+
SetInstantValueFalse();
|
|
72
|
+
|
|
73
|
+
CallOnDialogueEnd(); // NOTE: It is unknown why this is called twice but in the past caused issues when removed.
|
|
74
|
+
|
|
75
|
+
SetNoLongerInDialogueValues();
|
|
76
|
+
|
|
77
|
+
if (finishDialogue)
|
|
78
|
+
MoveToOriginalGameplayState();
|
|
79
|
+
|
|
80
|
+
UnityEngine.Debug.Log($"REPORT: {ToString()}: Instant dialogue has finished.");
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/// <summary>
|
|
84
|
+
///
|
|
85
|
+
/// </summary>
|
|
86
|
+
protected virtual void SetInstantValueFalse() => inInstant.Value = false;
|
|
87
|
+
|
|
88
|
+
/// <summary>
|
|
89
|
+
///
|
|
90
|
+
/// </summary>
|
|
91
|
+
protected virtual void MoveToOriginalGameplayState()
|
|
92
|
+
{
|
|
93
|
+
if (!isGoingToMainMenu.Value)
|
|
94
|
+
EnableMenuAccessIfNotInTrial();
|
|
95
|
+
|
|
96
|
+
CallOnDialogueEnd();
|
|
97
|
+
|
|
98
|
+
SetControlsBasedOnCurrentMode();
|
|
99
|
+
|
|
100
|
+
CallOnFinishedDialogue();
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/// <summary>
|
|
104
|
+
///
|
|
105
|
+
/// </summary>
|
|
106
|
+
protected virtual IEnumerator FinishDialogueComponents()
|
|
107
|
+
{
|
|
108
|
+
IEnumerable componentList = overrideComponents.Count > 0 ? overrideComponents : finishableCollection.components;
|
|
109
|
+
|
|
110
|
+
foreach (DialogueComponent component in componentList)
|
|
111
|
+
if (component != null && component is IComplexFinishableDialogueComponent finishable)
|
|
112
|
+
if (finishable.UseCoroutine())
|
|
113
|
+
yield return finishable.OnFinishDialogueRoutine();
|
|
114
|
+
else
|
|
115
|
+
finishable.OnFinishDialogue();
|
|
116
|
+
else
|
|
117
|
+
yield return EvaluateFinishingDialogueComponent(component);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/// <summary>
|
|
121
|
+
///
|
|
122
|
+
/// </summary>
|
|
123
|
+
/// <param name="component"></param>
|
|
124
|
+
/// <returns></returns>
|
|
125
|
+
protected virtual IEnumerator EvaluateFinishingDialogueComponent(DialogueComponent component)
|
|
126
|
+
{
|
|
127
|
+
if (component != null && component is IFinishableDialogueComponent finishable)
|
|
128
|
+
finishable.OnFinishDialogue();
|
|
129
|
+
else if (component != null && component is IFinishableDialogueComponentRoutine finishableRoutine)
|
|
130
|
+
yield return finishableRoutine.OnFinishDialogueRoutine();
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
133
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
fileFormatVersion: 2
|
|
2
|
-
guid: 7d5f35d61725333409320817a5c6dac8
|
|
3
|
-
MonoImporter:
|
|
4
|
-
externalObjects: {}
|
|
5
|
-
serializedVersion: 2
|
|
6
|
-
defaultReferences: []
|
|
7
|
-
executionOrder: 0
|
|
8
|
-
icon: {instanceID: 0}
|
|
9
|
-
userData:
|
|
10
|
-
assetBundleName:
|
|
11
|
-
assetBundleVariant:
|
|
1
|
+
fileFormatVersion: 2
|
|
2
|
+
guid: 7d5f35d61725333409320817a5c6dac8
|
|
3
|
+
MonoImporter:
|
|
4
|
+
externalObjects: {}
|
|
5
|
+
serializedVersion: 2
|
|
6
|
+
defaultReferences: []
|
|
7
|
+
executionOrder: 0
|
|
8
|
+
icon: {instanceID: 0}
|
|
9
|
+
userData:
|
|
10
|
+
assetBundleName:
|
|
11
|
+
assetBundleVariant:
|
|
@@ -1,83 +1,83 @@
|
|
|
1
|
-
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
-
using DREditor.EventObjects;
|
|
3
|
-
using DREditor.Services;
|
|
4
|
-
using System.Collections;
|
|
5
|
-
using UnityEngine;
|
|
6
|
-
|
|
7
|
-
namespace DREditor.Dialogues.Implementation
|
|
8
|
-
{
|
|
9
|
-
/// <summary>
|
|
10
|
-
///
|
|
11
|
-
/// </summary>
|
|
12
|
-
[ClassHeader(nameof(PreparableDialogueStarter) +
|
|
13
|
-
"\n\n")]
|
|
14
|
-
public class InstantDialogueStarter : PreparableDialogueStarter
|
|
15
|
-
{
|
|
16
|
-
/// <summary>
|
|
17
|
-
///
|
|
18
|
-
/// </summary>
|
|
19
|
-
[Header("")]
|
|
20
|
-
[Divider]
|
|
21
|
-
[Tooltip("")]
|
|
22
|
-
[SerializeField] protected BoolWithEvent hasStartedDialogue = null;
|
|
23
|
-
|
|
24
|
-
/// <summary>
|
|
25
|
-
///
|
|
26
|
-
/// </summary>
|
|
27
|
-
[Tooltip("")]
|
|
28
|
-
[SerializeField] protected BoolWithEvent inDialogue = null;
|
|
29
|
-
|
|
30
|
-
/// <summary>
|
|
31
|
-
///
|
|
32
|
-
/// </summary>
|
|
33
|
-
[Tooltip("")]
|
|
34
|
-
[SerializeField] protected BoolWithEvent inInstant = null;
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
/// <inheritdoc/>
|
|
38
|
-
public override void StartDialogue<T>(SelectableObject actor, DialogueBase<T>[] dialogues, bool inleaving = false)
|
|
39
|
-
=> StartCoroutine(InstantDialogue(dialogues, inleaving));
|
|
40
|
-
|
|
41
|
-
public override void StartDialogue<T>(SelectableObject actor, DialogueBase<T> dialogue, bool inleaving = false)
|
|
42
|
-
=> StartCoroutine(InstantDialogue(new DialogueBase<T>[1] { dialogue }, inleaving));
|
|
43
|
-
|
|
44
|
-
/// <summary>
|
|
45
|
-
///
|
|
46
|
-
/// </summary>
|
|
47
|
-
/// <param name="dialogues"></param>
|
|
48
|
-
/// <param name="inleaving"></param>
|
|
49
|
-
protected virtual IEnumerator InstantDialogue<T2>(DialogueBase<T2>[] dialogues, bool inleaving = false)
|
|
50
|
-
where T2 : Line
|
|
51
|
-
{
|
|
52
|
-
SetValueWithEvents();
|
|
53
|
-
|
|
54
|
-
InvokeDialoguePreparationEvent();
|
|
55
|
-
|
|
56
|
-
UnityEngine.Debug.Log($"REPORT: {nameof(InstantDialogueStarter)}: " +
|
|
57
|
-
$"Starting to Prepare Dialogue.");
|
|
58
|
-
|
|
59
|
-
yield return PrepareDialogueComponents();
|
|
60
|
-
|
|
61
|
-
UnityEngine.Debug.Log($"REPORT: {nameof(InstantDialogueStarter)}: " +
|
|
62
|
-
$"Finished preparing dialogue.");
|
|
63
|
-
|
|
64
|
-
ServiceLocator.GetService<IDialogueManager>()
|
|
65
|
-
.GetReader()
|
|
66
|
-
.PlayDialogues(dialogues, inleaving);
|
|
67
|
-
|
|
68
|
-
yield break;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
/// <summary>
|
|
72
|
-
///
|
|
73
|
-
/// </summary>
|
|
74
|
-
protected virtual void SetValueWithEvents()
|
|
75
|
-
{
|
|
76
|
-
inDialogue.SetValue(true);
|
|
77
|
-
|
|
78
|
-
hasStartedDialogue.SetValue(true);
|
|
79
|
-
|
|
80
|
-
inInstant.SetValue(true);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
1
|
+
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
+
using DREditor.EventObjects;
|
|
3
|
+
using DREditor.Services;
|
|
4
|
+
using System.Collections;
|
|
5
|
+
using UnityEngine;
|
|
6
|
+
|
|
7
|
+
namespace DREditor.Dialogues.Implementation
|
|
8
|
+
{
|
|
9
|
+
/// <summary>
|
|
10
|
+
///
|
|
11
|
+
/// </summary>
|
|
12
|
+
[ClassHeader(nameof(PreparableDialogueStarter) +
|
|
13
|
+
"\n\n")]
|
|
14
|
+
public class InstantDialogueStarter : PreparableDialogueStarter
|
|
15
|
+
{
|
|
16
|
+
/// <summary>
|
|
17
|
+
///
|
|
18
|
+
/// </summary>
|
|
19
|
+
[Header("")]
|
|
20
|
+
[Divider]
|
|
21
|
+
[Tooltip("")]
|
|
22
|
+
[SerializeField] protected BoolWithEvent hasStartedDialogue = null;
|
|
23
|
+
|
|
24
|
+
/// <summary>
|
|
25
|
+
///
|
|
26
|
+
/// </summary>
|
|
27
|
+
[Tooltip("")]
|
|
28
|
+
[SerializeField] protected BoolWithEvent inDialogue = null;
|
|
29
|
+
|
|
30
|
+
/// <summary>
|
|
31
|
+
///
|
|
32
|
+
/// </summary>
|
|
33
|
+
[Tooltip("")]
|
|
34
|
+
[SerializeField] protected BoolWithEvent inInstant = null;
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
/// <inheritdoc/>
|
|
38
|
+
public override void StartDialogue<T>(SelectableObject actor, DialogueBase<T>[] dialogues, bool inleaving = false)
|
|
39
|
+
=> StartCoroutine(InstantDialogue(dialogues, inleaving));
|
|
40
|
+
|
|
41
|
+
public override void StartDialogue<T>(SelectableObject actor, DialogueBase<T> dialogue, bool inleaving = false)
|
|
42
|
+
=> StartCoroutine(InstantDialogue(new DialogueBase<T>[1] { dialogue }, inleaving));
|
|
43
|
+
|
|
44
|
+
/// <summary>
|
|
45
|
+
///
|
|
46
|
+
/// </summary>
|
|
47
|
+
/// <param name="dialogues"></param>
|
|
48
|
+
/// <param name="inleaving"></param>
|
|
49
|
+
protected virtual IEnumerator InstantDialogue<T2>(DialogueBase<T2>[] dialogues, bool inleaving = false)
|
|
50
|
+
where T2 : Line
|
|
51
|
+
{
|
|
52
|
+
SetValueWithEvents();
|
|
53
|
+
|
|
54
|
+
InvokeDialoguePreparationEvent();
|
|
55
|
+
|
|
56
|
+
UnityEngine.Debug.Log($"REPORT: {nameof(InstantDialogueStarter)}: " +
|
|
57
|
+
$"Starting to Prepare Dialogue.");
|
|
58
|
+
|
|
59
|
+
yield return PrepareDialogueComponents();
|
|
60
|
+
|
|
61
|
+
UnityEngine.Debug.Log($"REPORT: {nameof(InstantDialogueStarter)}: " +
|
|
62
|
+
$"Finished preparing dialogue.");
|
|
63
|
+
|
|
64
|
+
ServiceLocator.GetService<IDialogueManager>()
|
|
65
|
+
.GetReader()
|
|
66
|
+
.PlayDialogues(dialogues, inleaving);
|
|
67
|
+
|
|
68
|
+
yield break;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/// <summary>
|
|
72
|
+
///
|
|
73
|
+
/// </summary>
|
|
74
|
+
protected virtual void SetValueWithEvents()
|
|
75
|
+
{
|
|
76
|
+
inDialogue.SetValue(true);
|
|
77
|
+
|
|
78
|
+
hasStartedDialogue.SetValue(true);
|
|
79
|
+
|
|
80
|
+
inInstant.SetValue(true);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
83
|
}
|