net.dreditor.dialogues.implementation 0.0.0-stage → 0.1.6

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.
Files changed (100) hide show
  1. package/DREditor.Dialogues.Implementation.asmdef +16 -0
  2. package/DREditor.Dialogues.Implementation.asmdef.meta +7 -0
  3. package/DialogueAssetDataClearer.cs +50 -0
  4. package/DialogueAssetDataClearer.cs.meta +11 -0
  5. package/DialogueAssetEndEventHandler.cs +58 -0
  6. package/DialogueAssetEndEventHandler.cs.meta +11 -0
  7. package/DialogueAssetEnder.cs +240 -0
  8. package/DialogueAssetEnder.cs.meta +11 -0
  9. package/DialogueAssetFinisher.cs +90 -0
  10. package/DialogueAssetFinisher.cs.meta +11 -0
  11. package/DialogueAssetFinisherBase.cs +83 -0
  12. package/DialogueAssetFinisherBase.cs.meta +11 -0
  13. package/DialogueAssetManager.cs +66 -0
  14. package/DialogueAssetManager.cs.meta +11 -0
  15. package/DialogueAssetReader.cs +378 -0
  16. package/DialogueAssetReader.cs.meta +11 -0
  17. package/DialogueAssetStarter.cs +255 -0
  18. package/DialogueAssetStarter.cs.meta +11 -0
  19. package/DialogueAssetStarterDebugger.cs +41 -0
  20. package/DialogueAssetStarterDebugger.cs.meta +11 -0
  21. package/DialogueAssetWaiter.cs +94 -0
  22. package/DialogueAssetWaiter.cs.meta +11 -0
  23. package/DialogueLineReader.cs +392 -0
  24. package/DialogueLineReader.cs.meta +11 -0
  25. package/DialogueManager.cs +84 -0
  26. package/DialogueManager.cs.meta +11 -0
  27. package/DialogueNameSaver.cs +46 -0
  28. package/DialogueNameSaver.cs.meta +11 -0
  29. package/FastForwardToLine.cs +103 -0
  30. package/FastForwardToLine.cs.meta +11 -0
  31. package/InstantDialogueEnder.cs +92 -0
  32. package/InstantDialogueEnder.cs.meta +11 -0
  33. package/InstantDialogueFinisher.cs +133 -0
  34. package/InstantDialogueFinisher.cs.meta +11 -0
  35. package/InstantDialogueStarter.cs +83 -0
  36. package/InstantDialogueStarter.cs.meta +11 -0
  37. package/NotLeavingOnDialogueFinish.cs +45 -0
  38. package/NotLeavingOnDialogueFinish.cs.meta +11 -0
  39. package/PreparableDialogueStarter.cs +89 -0
  40. package/PreparableDialogueStarter.cs.meta +11 -0
  41. package/Samples/Dialogue_Asset_End_Event_Handler.prefab +685 -0
  42. package/Samples/Dialogue_Asset_End_Event_Handler.prefab.meta +7 -0
  43. package/Samples/Dialogue_Asset_Ender.prefab +858 -0
  44. package/Samples/Dialogue_Asset_Ender.prefab.meta +7 -0
  45. package/Samples/Dialogue_Asset_Finisher.prefab +301 -0
  46. package/Samples/Dialogue_Asset_Finisher.prefab.meta +7 -0
  47. package/Samples/Dialogue_Asset_Load_Identifier.prefab +48 -0
  48. package/Samples/Dialogue_Asset_Load_Identifier.prefab.meta +7 -0
  49. package/Samples/Dialogue_Asset_Loader.prefab +231 -0
  50. package/Samples/Dialogue_Asset_Loader.prefab.meta +7 -0
  51. package/Samples/Dialogue_Asset_Reader_DRE.prefab +511 -0
  52. package/Samples/Dialogue_Asset_Reader_DRE.prefab.meta +7 -0
  53. package/Samples/Dialogue_Asset_Reader_Shell.prefab +252 -0
  54. package/Samples/Dialogue_Asset_Reader_Shell.prefab.meta +7 -0
  55. package/Samples/Dialogue_Asset_Reader_Template.prefab +193 -0
  56. package/Samples/Dialogue_Asset_Reader_Template.prefab.meta +7 -0
  57. package/Samples/Dialogue_Asset_Starter.prefab +613 -0
  58. package/Samples/Dialogue_Asset_Starter.prefab.meta +7 -0
  59. package/Samples/Dialogue_Asset_Waiter.prefab +50 -0
  60. package/Samples/Dialogue_Asset_Waiter.prefab.meta +7 -0
  61. package/Samples/Dialogue_Events_Shell.prefab +458 -0
  62. package/Samples/Dialogue_Events_Shell.prefab.meta +7 -0
  63. package/Samples/Dialogue_Events_Template.prefab +302 -0
  64. package/Samples/Dialogue_Events_Template.prefab.meta +7 -0
  65. package/Samples/Dialogue_Line_Loader.prefab +1282 -0
  66. package/Samples/Dialogue_Line_Loader.prefab.meta +7 -0
  67. package/Samples/Dialogue_Line_Reader.prefab +3688 -0
  68. package/Samples/Dialogue_Line_Reader.prefab.meta +7 -0
  69. package/Samples/Dialogue_Name_Saver.prefab +48 -0
  70. package/Samples/Dialogue_Name_Saver.prefab.meta +7 -0
  71. package/Samples/Dialogue_System_Shell.prefab +325 -0
  72. package/Samples/Dialogue_System_Shell.prefab.meta +7 -0
  73. package/Samples/Dialogue_System_Template.prefab +1138 -0
  74. package/Samples/Dialogue_System_Template.prefab.meta +7 -0
  75. package/Samples/Fast_Forward_To_Line_Tool.prefab +53 -0
  76. package/Samples/Fast_Forward_To_Line_Tool.prefab.meta +7 -0
  77. package/Samples/Instant_Dialogue_Ender.prefab +141 -0
  78. package/Samples/Instant_Dialogue_Ender.prefab.meta +7 -0
  79. package/Samples/Instant_Dialogue_Finisher.prefab +172 -0
  80. package/Samples/Instant_Dialogue_Finisher.prefab.meta +7 -0
  81. package/Samples/Instant_Dialogue_Starter.prefab +55 -0
  82. package/Samples/Instant_Dialogue_Starter.prefab.meta +7 -0
  83. package/Samples/On_Loading_Through_Scene_Transition.prefab +48 -0
  84. package/Samples/On_Loading_Through_Scene_Transition.prefab.meta +7 -0
  85. package/Samples/Scene_Event_On_Text_Display.prefab +47 -0
  86. package/Samples/Scene_Event_On_Text_Display.prefab.meta +7 -0
  87. package/Samples/Trial_Dialogue_Asset_Reader.prefab +561 -0
  88. package/Samples/Trial_Dialogue_Asset_Reader.prefab.meta +7 -0
  89. package/Samples/Trial_Dialogue_Asset_Starter.prefab +239 -0
  90. package/Samples/Trial_Dialogue_Asset_Starter.prefab.meta +7 -0
  91. package/Samples/Trial_Dialogue_Line_Loader.prefab +941 -0
  92. package/Samples/Trial_Dialogue_Line_Loader.prefab.meta +7 -0
  93. package/Samples/Trial_Dialogue_Loader.prefab +232 -0
  94. package/Samples/Trial_Dialogue_Loader.prefab.meta +7 -0
  95. package/Samples/Tween_Waiter_Handler.prefab +46 -0
  96. package/Samples/Tween_Waiter_Handler.prefab.meta +7 -0
  97. package/Samples.meta +8 -0
  98. package/package.json +34 -6
  99. package/package.json.meta +7 -0
  100. package/README.md +0 -3
@@ -0,0 +1,16 @@
1
+ {
2
+ "name": "DREditor.Dialogues.Implementation",
3
+ "rootNamespace": "",
4
+ "references": [
5
+ "GUID:fc5395c2fab93a24d860742152a064ea"
6
+ ],
7
+ "includePlatforms": [],
8
+ "excludePlatforms": [],
9
+ "allowUnsafeCode": false,
10
+ "overrideReferences": false,
11
+ "precompiledReferences": [],
12
+ "autoReferenced": true,
13
+ "defineConstraints": [],
14
+ "versionDefines": [],
15
+ "noEngineReferences": false
16
+ }
@@ -0,0 +1,7 @@
1
+ fileFormatVersion: 2
2
+ guid: 23ceb7bda50f26d4e9225b3e246d2e49
3
+ AssemblyDefinitionImporter:
4
+ externalObjects: {}
5
+ userData:
6
+ assetBundleName:
7
+ assetBundleVariant:
@@ -0,0 +1,50 @@
1
+ //Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
2
+ using System.Collections.Generic;
3
+ using System.Linq;
4
+ using UnityEngine;
5
+
6
+ namespace DREditor.Dialogues.Implementation
7
+ {
8
+ /// <summary>
9
+ ///
10
+ /// </summary>
11
+ public class DialogueAssetDataClearer : DialogueDataClearer
12
+ {
13
+ /// <summary>
14
+ ///
15
+ /// </summary>
16
+ [Header("")]
17
+ [Divider]
18
+ [Tooltip("")]
19
+ [SerializeField] protected List<DialogueComponent> SavingExtensionClearComponents = new();
20
+
21
+
22
+ protected virtual void Awake()
23
+ {
24
+ var components = transform.root.GetComponentsInChildren<DialogueComponent>();
25
+
26
+ foreach (var component in components)
27
+ if (component is IClearDialogueSaveData && !SavingExtensionClearComponents.Contains(component))
28
+ SavingExtensionClearComponents.Add(component);
29
+ }
30
+
31
+ /// <inheritdoc/>
32
+ public override void ClearSaveData()
33
+ {
34
+ foreach (IClearDialogueSaveData saver in SavingExtensionClearComponents.OfType<IClearDialogueSaveData>())
35
+ saver?.ClearSaveData();
36
+ }
37
+
38
+
39
+ /// <summary>
40
+ ///
41
+ /// </summary>
42
+ [BehaviourButton]
43
+ public void Validate()
44
+ {
45
+ foreach(var component in SavingExtensionClearComponents)
46
+ if (component is not IClearDialogueSaveData)
47
+ UnityEngine.Debug.Log(component.gameObject.name + " is not a valid Component! Please Remove!");
48
+ }
49
+ }
50
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: eab03a7938d315a438adeae729a02a74
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -0,0 +1,58 @@
1
+ //Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
2
+ using DREditor.Dialogues.Ending;
3
+ using DREditor.EventObjects;
4
+ using System;
5
+ using System.Collections;
6
+ using System.Collections.Generic;
7
+ using UnityEngine;
8
+
9
+ namespace DREditor.Dialogues.Implementation
10
+ {
11
+ /// <summary>
12
+ ///
13
+ /// </summary>
14
+ [ClassHeader(nameof(DialogueEndEventHandler) + ", " + nameof(IDialogueInteruptable) + ", " + nameof(ISceneEventListener) +
15
+ "\n\n")]
16
+ public class DialogueAssetEndEventHandler : DialogueEndEventHandler
17
+ {
18
+ /// <summary>
19
+ ///
20
+ /// </summary>
21
+ [Tooltip("")]
22
+ [SerializeField] protected List<DialogueComponent> EndEventComponents = new();
23
+
24
+
25
+ /// <inheritdoc/>
26
+ public override IEnumerator EndDialogueEventOptions<T>(DialogueBase<T> currentDialogueCore, Action exitParentRoutine)
27
+ {
28
+ foreach (DialogueComponent component in EndEventComponents)
29
+ {
30
+ if (component == null)
31
+ continue;
32
+
33
+ if (component is IDialogueEndEventRoutine endEventRoutine)
34
+ {
35
+ bool stopEarly = false;
36
+
37
+ yield return endEventRoutine.EvaluateEndEvent(currentDialogueCore, () => stopEarly = true);
38
+
39
+ if (stopEarly)
40
+ {
41
+ exitParentRoutine?.Invoke();
42
+
43
+ yield break;
44
+ }
45
+ }
46
+
47
+ if (component is IDialogueEndEvent endEvent && endEvent.EvaluateEndEvent(currentDialogueCore, DialogueInterruptedInvoke))
48
+ {
49
+ exitParentRoutine?.Invoke();
50
+
51
+ yield break;
52
+ }
53
+ }
54
+
55
+ yield break;
56
+ }
57
+ }
58
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: 14e552fabda8da046bb21c27fec5e915
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -0,0 +1,240 @@
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 DREditor.EventObjects;
5
+ using DREditor.Services;
6
+ using System;
7
+ using System.Collections;
8
+ using System.Collections.Generic;
9
+ using System.Linq;
10
+ using UnityEngine;
11
+ using UnityEngine.Serialization;
12
+
13
+ namespace DREditor.Dialogues.Implementation
14
+ {
15
+ /// <summary>
16
+ ///
17
+ /// </summary>
18
+ [ClassHeader(nameof(DialogueEnder) + ", " + nameof(IToTitleScreen) +
19
+ "\n\n")]
20
+ public class DialogueAssetEnder : DialogueEnder, IToTitleScreen
21
+ {
22
+ /// <summary>
23
+ ///
24
+ /// </summary>
25
+ [Header("")]
26
+ [Divider]
27
+ [Tooltip("")]
28
+ [SerializeField] protected BoolWithEvent isWaiting = null;
29
+
30
+ /// <summary>
31
+ ///
32
+ /// </summary>
33
+ [Tooltip("")]
34
+ [SerializeField] protected BoolWithEvent isGoingToMainMenu = null;
35
+
36
+ /// <summary>
37
+ ///
38
+ /// </summary>
39
+ [Tooltip("")]
40
+ [SerializeField] protected BoolWithEvent inDialogue = null;
41
+
42
+ /// <summary>
43
+ ///
44
+ /// </summary>
45
+ [Tooltip("")]
46
+ [SerializeField] protected BoolWithEvent inInstant = null;
47
+
48
+ /// <summary>
49
+ ///
50
+ /// </summary>
51
+ [Tooltip("")]
52
+ [SerializeField] protected BoolWithEvent inTrialMode = null;
53
+
54
+
55
+ /// <summary>
56
+ ///
57
+ /// </summary>
58
+ [Header("")]
59
+ [Divider]
60
+ [Tooltip("")]
61
+ [SerializeField] protected DialogueEnder InstantDialogueEnder = null;
62
+
63
+ /// <summary>
64
+ ///
65
+ /// </summary>
66
+ [Tooltip("")]
67
+ [SerializeField] protected DialogueFinisher DialogueFinisher = null;
68
+
69
+
70
+ /// <summary>
71
+ ///
72
+ /// </summary>
73
+ [Header("")]
74
+ [Divider]
75
+ [Tooltip("")]
76
+ [SerializeField] protected List<DialogueComponent> EarlyResolvableComponents = new();
77
+
78
+ /// <summary>
79
+ ///
80
+ /// </summary>
81
+ [Tooltip("")]
82
+ [SerializeField] protected int collectionID = 1;
83
+
84
+ /// <summary>
85
+ ///
86
+ /// </summary>
87
+ [Tooltip("")]
88
+ [SerializeField] protected string orderFieldName = "resolveOrder";
89
+
90
+ /// <summary>
91
+ ///
92
+ /// </summary>
93
+ [Tooltip("")]
94
+ [SerializeField] protected DialogueComponentCollection<IResolvableDialogueComponent> resolvableCollection = new();
95
+
96
+ /// <summary>
97
+ ///
98
+ /// </summary>
99
+ [FormerlySerializedAs("ResolvableComponents")]
100
+ [Tooltip("")]
101
+ [SerializeField] protected List<DialogueComponent> overrideComponents = new();
102
+
103
+
104
+ protected virtual void Awake() => resolvableCollection.Initialize(transform, orderFieldName, collectionID);
105
+
106
+ protected virtual void OnValidate() => resolvableCollection.Initialize(transform, orderFieldName, collectionID);
107
+
108
+
109
+ /// <inheritdoc/>
110
+ public override void StopDialogue() => StartCoroutine(EndDialogue());
111
+
112
+ /// <inheritdoc/>
113
+ public override IEnumerator EndDialogue(bool useDialogueFinisher = true)
114
+ {
115
+ UnityEngine.Debug.Log($"REPORT: {nameof(DialogueAssetEnder)}: Ending Dialogue process started.");
116
+
117
+ yield return ResolveDialogueComponentsEarly();
118
+
119
+
120
+ bool stopEarly = false;
121
+
122
+ yield return CheckStopProcessEarly(useDialogueFinisher, () => { stopEarly = true; });
123
+
124
+ if (stopEarly)
125
+ yield break;
126
+
127
+
128
+ yield return ResolveDialogueComponents();
129
+
130
+ ResolveDialogueEventHandler();
131
+
132
+ if (useDialogueFinisher)
133
+ FinishDialogue();
134
+
135
+ yield break;
136
+ }
137
+
138
+ /// <summary>
139
+ ///
140
+ /// </summary>
141
+ /// <returns></returns>
142
+ protected virtual IEnumerator ResolveDialogueComponentsEarly()
143
+ {
144
+ foreach (var component in EarlyResolvableComponents)
145
+ if (component != null && component is IEarlyResolvableDialogueComponent resolvable)
146
+ yield return resolvable.ResolveEarly();
147
+
148
+ yield break;
149
+ }
150
+
151
+ /// <summary>
152
+ ///
153
+ /// </summary>
154
+ /// <param name="finishDialogue"></param>
155
+ /// <param name="stopEarlyCallback"></param>
156
+ /// <returns></returns>
157
+ /// <remarks></remarks>
158
+ protected virtual IEnumerator CheckStopProcessEarly(bool finishDialogue = true, Action stopEarlyCallback = null)
159
+ {
160
+ if (isWaiting.Value)
161
+ {
162
+ isWaiting.Value = false;
163
+
164
+ stopEarlyCallback?.Invoke();
165
+
166
+ yield break;
167
+ }
168
+
169
+ if (inInstant.Value)
170
+ {
171
+ if (InstantDialogueEnder != null && InstantDialogueEnder != this)
172
+ {
173
+ yield return InstantDialogueEnder.EndDialogue(finishDialogue);
174
+
175
+ stopEarlyCallback?.Invoke();
176
+
177
+ yield break;
178
+ }
179
+ else
180
+ {
181
+ UnityEngine.Debug.LogWarning($"ALERT: {nameof(DialogueAssetEnder)}: The alternate Dialogue Ender" +
182
+ " was either null or recursively implemented. Using Default.");
183
+
184
+ inInstant.Value = false;
185
+ }
186
+ }
187
+
188
+ yield break;
189
+ }
190
+
191
+ /// <summary>
192
+ ///
193
+ /// </summary>
194
+ protected virtual IEnumerator ResolveDialogueComponents()
195
+ {
196
+ IEnumerable componentList = overrideComponents.Count > 0 ? overrideComponents :
197
+ resolvableCollection.components.OrderBy(com => com.Order);
198
+
199
+ foreach (var component in componentList)
200
+ if (component != null && component is IResolvableDialogueComponent resolvable)
201
+ if (resolvable.UseRoutineToResolve())
202
+ yield return resolvable.ResolveRoutine();
203
+ else
204
+ resolvable.Resolve();
205
+
206
+ yield break;
207
+ }
208
+
209
+ /// <inheritdoc/>
210
+ public override void FinishDialogue() => DialogueFinisher.FinishDialogue();
211
+
212
+
213
+ /// <inheritdoc/>
214
+ public virtual void ToTitleScreen() => ResetDialogueIfNotInTrial();
215
+
216
+ /// <summary>
217
+ ///
218
+ /// </summary>
219
+ protected virtual void ResetDialogueIfNotInTrial()
220
+ {
221
+ if (inDialogue.Value && !inTrialMode.Value)
222
+ {
223
+ UnityEngine.Debug.Log($"REPORT: {nameof(DialogueAssetEnder)}: " +
224
+ $"Stopping dialogue to reset the system.");
225
+
226
+ SetGoingToMainMenuModeOn();
227
+
228
+ StopDialogue();
229
+ }
230
+ else
231
+ UnityEngine.Debug.Log($"REPORT: {nameof(DialogueAssetEnder)}: " +
232
+ $"Gameplay wasn't in dialogue so not resetting when going to title screen");
233
+ }
234
+
235
+ /// <summary>
236
+ ///
237
+ /// </summary>
238
+ protected virtual void SetGoingToMainMenuModeOn() => isGoingToMainMenu.SetValue(true);
239
+ }
240
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: 2baeef8e8d6ed7449b113718cb9c3c85
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -0,0 +1,90 @@
1
+ //Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
2
+ using DREditor.Dialogues.Finishing;
3
+ using System;
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
+ public class DialogueAssetFinisher : DialogueAssetFinisherBase, IInstantDialogueFinisherSubscriber
14
+ {
15
+ /// <summary>
16
+ ///
17
+ /// </summary>
18
+ [Header("")]
19
+
20
+ [Tooltip("")]
21
+ [SerializeField] protected DialogueFinisher InstantDialogueFinisher = null;
22
+
23
+ /// <summary>
24
+ ///
25
+ /// </summary>
26
+ [Tooltip("")]
27
+ [SerializeField] protected int collectionID = 1;
28
+
29
+ /// <summary>
30
+ ///
31
+ /// </summary>
32
+ [Tooltip("")]
33
+ [SerializeField] protected string orderFieldName = "finishOrder";
34
+
35
+ /// <summary>
36
+ ///
37
+ /// </summary>
38
+ [Tooltip("")]
39
+ [SerializeField] protected DialogueComponentCollection<IFinishableDialogueComponent> finishableCollection = new();
40
+
41
+ /// <summary>
42
+ ///
43
+ /// </summary>
44
+ [Tooltip("")]
45
+ [SerializeField] protected List<DialogueComponent> overrideComponents = new();
46
+
47
+
48
+ protected virtual void Awake() => finishableCollection.Initialize(transform, orderFieldName, collectionID);
49
+
50
+ protected virtual void OnValidate() => finishableCollection.Initialize(transform, orderFieldName, collectionID);
51
+
52
+
53
+ /// <inheritdoc/>
54
+ public override void FinishDialogue()
55
+ {
56
+ EnableMenuAccessIfNotInTrial();
57
+
58
+ CallOnDialogueEnd();
59
+
60
+ SetNoLongerInDialogueValues();
61
+
62
+ FinishDialogueComponents();
63
+
64
+ SetControlsBasedOnCurrentMode();
65
+
66
+ CallOnFinishedDialogue();
67
+ }
68
+
69
+ /// <summary>
70
+ ///
71
+ /// </summary>
72
+ protected virtual void FinishDialogueComponents()
73
+ {
74
+ IEnumerable componentList = overrideComponents.Count > 0 ? overrideComponents : finishableCollection.components;
75
+
76
+ foreach (DialogueComponent finishable in componentList)
77
+ if (finishable != null && finishable is IFinishableDialogueComponent component)
78
+ component.OnFinishDialogue();
79
+ }
80
+
81
+
82
+ /// <inheritdoc/>
83
+ public void SubscribeToOnFinishOfInstantDialogue(Action function)
84
+ => InstantDialogueFinisher.SubscribeToOnFinishOfDialogue(function);
85
+
86
+ /// <inheritdoc/>
87
+ public void UnsubscribeToOnFinishOfInstantDialogue(Action function)
88
+ => InstantDialogueFinisher.UnsubscribeToOnFinishOfDialogue(function);
89
+ }
90
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: 8b648d3c8dda2c241ac71a736fe16dcf
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -0,0 +1,83 @@
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.Generic;
5
+ using UnityEngine;
6
+
7
+ namespace DREditor.Dialogues.Implementation
8
+ {
9
+ /// <summary>
10
+ ///
11
+ /// </summary>
12
+ public abstract class DialogueAssetFinisherBase : DialogueFinisher
13
+ {
14
+ /// <summary>
15
+ ///
16
+ /// </summary>
17
+ [Header("")]
18
+
19
+ [Tooltip("")]
20
+ [SerializeField] protected BoolWithEvent hasStartedDialogue = null;
21
+
22
+ /// <summary>
23
+ ///
24
+ /// </summary>
25
+ [Tooltip("")]
26
+ [SerializeField] protected BoolWithEvent inDialogue = null;
27
+
28
+ /// <summary>
29
+ ///
30
+ /// </summary>
31
+ [Tooltip("")]
32
+ [SerializeField] protected BoolWithEvent hasMenuAccess = null;
33
+
34
+ /// <summary>
35
+ ///
36
+ /// </summary>
37
+ [Tooltip("")]
38
+ [SerializeField] protected BoolWithEvent inTrialMode = null;
39
+
40
+ /// <summary>
41
+ ///
42
+ /// </summary>
43
+ [Tooltip("")]
44
+ [SerializeField] protected BoolWithEvent isWaitingForDialogueToFinish = null;
45
+
46
+ /// <summary>
47
+ ///
48
+ /// </summary>
49
+ [Tooltip("")]
50
+ [SerializeField] protected SceneEvent SetControlsUIBasedOnCurrentMode = null;
51
+
52
+ /// <summary>
53
+ ///
54
+ /// </summary>
55
+ [Tooltip("")]
56
+ [SerializeField] protected List<DialogueComponent> FinishableComponents = new();
57
+
58
+
59
+ /// <summary>
60
+ ///
61
+ /// </summary>
62
+ protected virtual void SetNoLongerInDialogueValues()
63
+ {
64
+ hasStartedDialogue.SetValue(false);
65
+
66
+ inDialogue.SetValue(false);
67
+ }
68
+
69
+ /// <summary>
70
+ ///
71
+ /// </summary>
72
+ protected virtual void EnableMenuAccessIfNotInTrial()
73
+ {
74
+ if (!inTrialMode.Value && !isWaitingForDialogueToFinish.Value)
75
+ hasMenuAccess.SetValue(true);
76
+ }
77
+
78
+ /// <summary>
79
+ ///
80
+ /// </summary>
81
+ protected virtual void SetControlsBasedOnCurrentMode() => SetControlsUIBasedOnCurrentMode.Raise();
82
+ }
83
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: a0847024e358975489b95ca08e5db8ce
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -0,0 +1,66 @@
1
+ //Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
2
+ using DREditor.Services;
3
+ using UnityEngine;
4
+
5
+ namespace DREditor.Dialogues.Implementation
6
+ {
7
+ /// <summary>
8
+ ///
9
+ /// </summary>
10
+ public class DialogueAssetManager : DialogueManager
11
+ {
12
+ /// <summary>
13
+ ///
14
+ /// </summary>
15
+ [Header("")]
16
+ [Divider]
17
+ [Tooltip("")]
18
+ [SerializeField] protected bool registerOnEnable = true;
19
+
20
+ /// <summary>
21
+ ///
22
+ /// </summary>
23
+ [Tooltip("")]
24
+ [SerializeField] protected bool destroyIfRegistrationExists = true;
25
+
26
+
27
+ /// <summary>
28
+ ///
29
+ /// </summary>
30
+ protected virtual void OnEnable()
31
+ {
32
+ RegisterAsCurrentlyUsed();
33
+
34
+ CheckDestroyOnExisting();
35
+ }
36
+
37
+ /// <summary>
38
+ ///
39
+ /// </summary>
40
+ public virtual void RegisterAsCurrentlyUsed()
41
+ {
42
+ if (registerOnEnable && !ServiceLocator.HasService<IDialogueManager>())
43
+ ServiceLocator.Register<IDialogueManager>(this);
44
+ }
45
+
46
+ /// <summary>
47
+ ///
48
+ /// </summary>
49
+ protected virtual void CheckDestroyOnExisting()
50
+ {
51
+ if (destroyIfRegistrationExists && ServiceLocator.HasService(out IDialogueManager current) &&
52
+ current != (this as IDialogueManager) && gameObject != null)
53
+ Destroy(gameObject);
54
+ }
55
+
56
+ /// <summary>
57
+ ///
58
+ /// </summary>
59
+ protected virtual void OnDisable() => UnRegisterAsCurrentlyUsed();
60
+
61
+ /// <summary>
62
+ ///
63
+ /// </summary>
64
+ public virtual void UnRegisterAsCurrentlyUsed() => ServiceLocator.Unregister<IDialogueManager>(this);
65
+ }
66
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: 88f933ae4e7fdf14ea52861bf5a36c53
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant: