net.dreditor.endevents 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/CustomCallEndEventHandler.cs +57 -57
- package/CustomCallEndEventHandler.cs.meta +11 -11
- package/DREditor.EndEvents.asmdef +19 -19
- package/DREditor.EndEvents.asmdef.meta +7 -7
- package/DirectToEndEventHandler.cs +131 -131
- package/DirectToEndEventHandler.cs.meta +11 -11
- package/DirectToTransitionalEndEventHandler.cs +30 -30
- package/DirectToTransitionalEndEventHandler.cs.meta +11 -11
- package/MainMenuTransitionEndEventHandler.cs +48 -48
- package/MainMenuTransitionEndEventHandler.cs.meta +11 -11
- package/PauseOptionEndEventHandler.cs +46 -46
- package/PauseOptionEndEventHandler.cs.meta +11 -11
- package/PhaseChangeEndEventHandler.cs +55 -55
- package/PhaseChangeEndEventHandler.cs.meta +11 -11
- package/{Samples → Samples~}/Custom_Call_End_Event_Handler.prefab +47 -47
- package/{Samples → Samples~}/Custom_Call_End_Event_Handler.prefab.meta +7 -7
- package/{Samples → Samples~}/Direct_To_Transitional_End_Event_Handler.prefab +139 -139
- package/{Samples → Samples~}/Direct_To_Transitional_End_Event_Handler.prefab.meta +7 -7
- package/{Samples → Samples~}/Main_Menu_Transition_End_Event_Handler.prefab +63 -63
- package/{Samples → Samples~}/Main_Menu_Transition_End_Event_Handler.prefab.meta +7 -7
- package/{Samples → Samples~}/Pause_Option_End_Event_Handler.prefab +48 -48
- package/{Samples → Samples~}/Pause_Option_End_Event_Handler.prefab.meta +7 -7
- package/{Samples → Samples~}/PhaseChangeEndEventHandler.prefab +48 -48
- package/{Samples → Samples~}/PhaseChangeEndEventHandler.prefab.meta +7 -7
- package/{Samples → Samples~}/Scene_Transition_End_Event_Handler.prefab +54 -54
- package/{Samples → Samples~}/Scene_Transition_End_Event_Handler.prefab.meta +7 -7
- package/{Samples → Samples~}/SkipTrialSequences.asset +21 -21
- package/{Samples → Samples~}/SkipTrialSequences.asset.meta +8 -8
- package/{Samples → Samples~}/Skip_Sequence_End_Event_Handler.prefab +47 -47
- package/{Samples → Samples~}/Skip_Sequence_End_Event_Handler.prefab.meta +7 -7
- package/{Samples → Samples~}/Trigger_Flag_End_Event_Handler.prefab +46 -46
- package/{Samples → Samples~}/Trigger_Flag_End_Event_Handler.prefab.meta +7 -7
- package/{Samples → Samples~}/UpdateDirectTo.asset +15 -15
- package/{Samples → Samples~}/UpdateDirectTo.asset.meta +8 -8
- package/{Samples → Samples~}/Variable_End_Event_Handler.prefab +49 -49
- package/{Samples → Samples~}/Variable_End_Event_Handler.prefab.meta +7 -7
- package/SceneTransitionEndEventHandler.cs +169 -169
- package/SceneTransitionEndEventHandler.cs.meta +11 -11
- package/SkipSequenceEndEventHandler.cs +35 -35
- package/SkipSequenceEndEventHandler.cs.meta +11 -11
- package/TriggerFlagEndEventHandler.cs +41 -41
- package/TriggerFlagEndEventHandler.cs.meta +11 -11
- package/VariableEndEventHandler.cs +111 -111
- package/VariableEndEventHandler.cs.meta +11 -11
- package/package.json +43 -38
- package/package.json.meta +7 -7
- package/Samples.meta +0 -8
|
@@ -1,170 +1,170 @@
|
|
|
1
|
-
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
-
using DREditor.Dialogues;
|
|
3
|
-
using DREditor.Dialogues.Ending;
|
|
4
|
-
using DREditor.Dialogues.Events;
|
|
5
|
-
using DREditor.EventObjects;
|
|
6
|
-
using DREditor.Fading;
|
|
7
|
-
using DREditor.RoomLoading;
|
|
8
|
-
using DREditor.Saving;
|
|
9
|
-
using DREditor.Services;
|
|
10
|
-
using System;
|
|
11
|
-
using System.Collections;
|
|
12
|
-
using System.Collections.Generic;
|
|
13
|
-
using System.Linq;
|
|
14
|
-
using UnityEngine;
|
|
15
|
-
using UnityEngine.SceneManagement;
|
|
16
|
-
|
|
17
|
-
namespace DREditor.EndEvents
|
|
18
|
-
{
|
|
19
|
-
/// <summary>
|
|
20
|
-
///
|
|
21
|
-
/// </summary>
|
|
22
|
-
[ClassHeader(nameof(DialogueComponent) + ", " +
|
|
23
|
-
nameof(IDialogueEndEventRoutine) + ", " + nameof(IClearDialogueSaveData) + ", " + nameof(IDRESaveable) +
|
|
24
|
-
"\n\n")]
|
|
25
|
-
public class SceneTransitionEndEventHandler : DialogueComponent, IDialogueEndEventRoutine, IClearDialogueSaveData, IDRESaveable
|
|
26
|
-
{
|
|
27
|
-
/// <summary>
|
|
28
|
-
///
|
|
29
|
-
/// </summary>
|
|
30
|
-
[Tooltip("")]
|
|
31
|
-
[SerializeField] protected BoolWithEvent inLoading = null;
|
|
32
|
-
|
|
33
|
-
/// <summary>
|
|
34
|
-
///
|
|
35
|
-
/// </summary>
|
|
36
|
-
[Tooltip("")]
|
|
37
|
-
[SerializeField] protected SceneEvent moveToNextNaturalObjective = null;
|
|
38
|
-
|
|
39
|
-
/// <summary>
|
|
40
|
-
///
|
|
41
|
-
/// </summary>
|
|
42
|
-
[Tooltip("")]
|
|
43
|
-
[SerializeField] protected StringWithEvent moveToObjective = null;
|
|
44
|
-
|
|
45
|
-
/// <summary>
|
|
46
|
-
///
|
|
47
|
-
/// </summary>
|
|
48
|
-
[Tooltip("")]
|
|
49
|
-
[SerializeField] protected string transitionNumSaveKey = "TransitionNum";
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
/// <summary>
|
|
53
|
-
///
|
|
54
|
-
/// </summary>
|
|
55
|
-
[Header("")]
|
|
56
|
-
[Divider]
|
|
57
|
-
[Tooltip("")]
|
|
58
|
-
[SerializeField] protected float sceneTransitionToDarkFadeTime = 0.5f;
|
|
59
|
-
|
|
60
|
-
/// <summary>
|
|
61
|
-
///
|
|
62
|
-
/// </summary>
|
|
63
|
-
[Tooltip("")]
|
|
64
|
-
[SerializeField] protected string moveOnEndEventString = "MoveEndOnDialogueFinish";
|
|
65
|
-
|
|
66
|
-
/// <summary>
|
|
67
|
-
///
|
|
68
|
-
/// </summary>
|
|
69
|
-
[Tooltip("")]
|
|
70
|
-
[SerializeField] protected string fadeOutEventString = "FadeOutOnLoadSubscribe";
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
/// <summary>
|
|
74
|
-
///
|
|
75
|
-
/// </summary>
|
|
76
|
-
protected int saveTransitionNum = 0;
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
/// <summary>
|
|
80
|
-
///
|
|
81
|
-
/// </summary>
|
|
82
|
-
/// <param name="num"></param>
|
|
83
|
-
public virtual void SetSaveTransitionNum(int num) => saveTransitionNum = num;
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
/// <inheritdoc/>
|
|
87
|
-
public virtual IEnumerator EvaluateEndEvent<T>(DialogueBase<T> currentDialogue, Action exitParentEarly)
|
|
88
|
-
where T : Line
|
|
89
|
-
{
|
|
90
|
-
if (currentDialogue.SceneTransition.Enabled)
|
|
91
|
-
yield return SceneTransitionRoutine(currentDialogue);
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
/// <summary>
|
|
95
|
-
///
|
|
96
|
-
/// </summary>
|
|
97
|
-
/// <typeparam name="T"></typeparam>
|
|
98
|
-
/// <param name="currentDialogue"></param>
|
|
99
|
-
protected virtual IEnumerator SceneTransitionRoutine<T>(DialogueBase<T> currentDialogue)
|
|
100
|
-
where T : Line
|
|
101
|
-
{
|
|
102
|
-
if (currentDialogue.SceneTransition.ToDark)
|
|
103
|
-
yield return ServiceLocator.GetService<GlobalFade>().FadeToRoutine(sceneTransitionToDarkFadeTime);
|
|
104
|
-
|
|
105
|
-
EvaluateSceneTransitionOptions(currentDialogue);
|
|
106
|
-
|
|
107
|
-
if (!currentDialogue.SceneTransition.AtEnd && !currentDialogue.SceneTransition.ToMenu)
|
|
108
|
-
yield return MoveToScene(currentDialogue.SceneTransition.Scene);
|
|
109
|
-
else if (currentDialogue.SceneTransition.AtEnd)
|
|
110
|
-
DialogueEventSystem.TriggerEvent(moveOnEndEventString, currentDialogue.SceneTransition.AtEnd);
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
/// <summary>
|
|
114
|
-
///
|
|
115
|
-
/// </summary>
|
|
116
|
-
/// <typeparam name="T"></typeparam>
|
|
117
|
-
/// <param name="currentDialogue"></param>
|
|
118
|
-
protected virtual void EvaluateSceneTransitionOptions<T>(DialogueBase<T> currentDialogue)
|
|
119
|
-
where T : Line
|
|
120
|
-
{
|
|
121
|
-
if (!string.IsNullOrEmpty(currentDialogue.SceneTransition.MoveToObjective))
|
|
122
|
-
moveToObjective.SetValue(currentDialogue.SceneTransition.MoveToObjective);
|
|
123
|
-
|
|
124
|
-
if (currentDialogue.SceneTransition.MoveToNextNaturalObjective)
|
|
125
|
-
moveToNextNaturalObjective.Raise();
|
|
126
|
-
|
|
127
|
-
if (currentDialogue.SceneTransition.OnLoadNoDark)
|
|
128
|
-
DialogueEventSystem.TriggerEvent(fadeOutEventString);
|
|
129
|
-
|
|
130
|
-
if (!currentDialogue.SceneTransition.ToMenu && currentDialogue.DirectTo.Enabled)
|
|
131
|
-
ServiceLocator.GetService<TPFDRoomLoader>().SetMovingToTPFDMode();
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
/// <summary>
|
|
135
|
-
///
|
|
136
|
-
/// </summary>
|
|
137
|
-
/// <param name="scene"></param>
|
|
138
|
-
protected virtual IEnumerator MoveToScene(string scene)
|
|
139
|
-
{
|
|
140
|
-
UnityEngine.Debug.Log($"{ToString()}: CHANGING SCENE");
|
|
141
|
-
|
|
142
|
-
AsyncOperation asyncLoadOperation = SceneManager.LoadSceneAsync(scene);
|
|
143
|
-
|
|
144
|
-
Scene sceneToLoad = SceneManager.GetSceneByName(scene);
|
|
145
|
-
|
|
146
|
-
asyncLoadOperation.allowSceneActivation = false;
|
|
147
|
-
|
|
148
|
-
yield return new WaitUntil(() => asyncLoadOperation.progress >= 0.9f);
|
|
149
|
-
|
|
150
|
-
asyncLoadOperation.allowSceneActivation = true;
|
|
151
|
-
|
|
152
|
-
yield return new WaitUntil(() => sceneToLoad.isLoaded);
|
|
153
|
-
|
|
154
|
-
yield return new WaitUntil(() => !inLoading.Value);
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
/// <inheritdoc/>
|
|
159
|
-
public virtual void Save(Dictionary<string, object> saveData)
|
|
160
|
-
{
|
|
161
|
-
if (!ServiceLocator.GetService<IDialogueManager>().GetComponentsInChildren<DialogueComponent>().Contains(this))
|
|
162
|
-
return;
|
|
163
|
-
|
|
164
|
-
saveData.Set(transitionNumSaveKey, saveTransitionNum);
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
/// <inheritdoc/>
|
|
168
|
-
public virtual void ClearSaveData() => saveTransitionNum = 0;
|
|
169
|
-
}
|
|
1
|
+
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
+
using DREditor.Dialogues;
|
|
3
|
+
using DREditor.Dialogues.Ending;
|
|
4
|
+
using DREditor.Dialogues.Events;
|
|
5
|
+
using DREditor.EventObjects;
|
|
6
|
+
using DREditor.Fading;
|
|
7
|
+
using DREditor.RoomLoading;
|
|
8
|
+
using DREditor.Saving;
|
|
9
|
+
using DREditor.Services;
|
|
10
|
+
using System;
|
|
11
|
+
using System.Collections;
|
|
12
|
+
using System.Collections.Generic;
|
|
13
|
+
using System.Linq;
|
|
14
|
+
using UnityEngine;
|
|
15
|
+
using UnityEngine.SceneManagement;
|
|
16
|
+
|
|
17
|
+
namespace DREditor.EndEvents
|
|
18
|
+
{
|
|
19
|
+
/// <summary>
|
|
20
|
+
///
|
|
21
|
+
/// </summary>
|
|
22
|
+
[ClassHeader(nameof(DialogueComponent) + ", " +
|
|
23
|
+
nameof(IDialogueEndEventRoutine) + ", " + nameof(IClearDialogueSaveData) + ", " + nameof(IDRESaveable) +
|
|
24
|
+
"\n\n")]
|
|
25
|
+
public class SceneTransitionEndEventHandler : DialogueComponent, IDialogueEndEventRoutine, IClearDialogueSaveData, IDRESaveable
|
|
26
|
+
{
|
|
27
|
+
/// <summary>
|
|
28
|
+
///
|
|
29
|
+
/// </summary>
|
|
30
|
+
[Tooltip("")]
|
|
31
|
+
[SerializeField] protected BoolWithEvent inLoading = null;
|
|
32
|
+
|
|
33
|
+
/// <summary>
|
|
34
|
+
///
|
|
35
|
+
/// </summary>
|
|
36
|
+
[Tooltip("")]
|
|
37
|
+
[SerializeField] protected SceneEvent moveToNextNaturalObjective = null;
|
|
38
|
+
|
|
39
|
+
/// <summary>
|
|
40
|
+
///
|
|
41
|
+
/// </summary>
|
|
42
|
+
[Tooltip("")]
|
|
43
|
+
[SerializeField] protected StringWithEvent moveToObjective = null;
|
|
44
|
+
|
|
45
|
+
/// <summary>
|
|
46
|
+
///
|
|
47
|
+
/// </summary>
|
|
48
|
+
[Tooltip("")]
|
|
49
|
+
[SerializeField] protected string transitionNumSaveKey = "TransitionNum";
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
/// <summary>
|
|
53
|
+
///
|
|
54
|
+
/// </summary>
|
|
55
|
+
[Header("")]
|
|
56
|
+
[Divider]
|
|
57
|
+
[Tooltip("")]
|
|
58
|
+
[SerializeField] protected float sceneTransitionToDarkFadeTime = 0.5f;
|
|
59
|
+
|
|
60
|
+
/// <summary>
|
|
61
|
+
///
|
|
62
|
+
/// </summary>
|
|
63
|
+
[Tooltip("")]
|
|
64
|
+
[SerializeField] protected string moveOnEndEventString = "MoveEndOnDialogueFinish";
|
|
65
|
+
|
|
66
|
+
/// <summary>
|
|
67
|
+
///
|
|
68
|
+
/// </summary>
|
|
69
|
+
[Tooltip("")]
|
|
70
|
+
[SerializeField] protected string fadeOutEventString = "FadeOutOnLoadSubscribe";
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
/// <summary>
|
|
74
|
+
///
|
|
75
|
+
/// </summary>
|
|
76
|
+
protected int saveTransitionNum = 0;
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
/// <summary>
|
|
80
|
+
///
|
|
81
|
+
/// </summary>
|
|
82
|
+
/// <param name="num"></param>
|
|
83
|
+
public virtual void SetSaveTransitionNum(int num) => saveTransitionNum = num;
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
/// <inheritdoc/>
|
|
87
|
+
public virtual IEnumerator EvaluateEndEvent<T>(DialogueBase<T> currentDialogue, Action exitParentEarly)
|
|
88
|
+
where T : Line
|
|
89
|
+
{
|
|
90
|
+
if (currentDialogue.SceneTransition.Enabled)
|
|
91
|
+
yield return SceneTransitionRoutine(currentDialogue);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/// <summary>
|
|
95
|
+
///
|
|
96
|
+
/// </summary>
|
|
97
|
+
/// <typeparam name="T"></typeparam>
|
|
98
|
+
/// <param name="currentDialogue"></param>
|
|
99
|
+
protected virtual IEnumerator SceneTransitionRoutine<T>(DialogueBase<T> currentDialogue)
|
|
100
|
+
where T : Line
|
|
101
|
+
{
|
|
102
|
+
if (currentDialogue.SceneTransition.ToDark)
|
|
103
|
+
yield return ServiceLocator.GetService<GlobalFade>().FadeToRoutine(sceneTransitionToDarkFadeTime);
|
|
104
|
+
|
|
105
|
+
EvaluateSceneTransitionOptions(currentDialogue);
|
|
106
|
+
|
|
107
|
+
if (!currentDialogue.SceneTransition.AtEnd && !currentDialogue.SceneTransition.ToMenu)
|
|
108
|
+
yield return MoveToScene(currentDialogue.SceneTransition.Scene);
|
|
109
|
+
else if (currentDialogue.SceneTransition.AtEnd)
|
|
110
|
+
DialogueEventSystem.TriggerEvent(moveOnEndEventString, currentDialogue.SceneTransition.AtEnd);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/// <summary>
|
|
114
|
+
///
|
|
115
|
+
/// </summary>
|
|
116
|
+
/// <typeparam name="T"></typeparam>
|
|
117
|
+
/// <param name="currentDialogue"></param>
|
|
118
|
+
protected virtual void EvaluateSceneTransitionOptions<T>(DialogueBase<T> currentDialogue)
|
|
119
|
+
where T : Line
|
|
120
|
+
{
|
|
121
|
+
if (!string.IsNullOrEmpty(currentDialogue.SceneTransition.MoveToObjective))
|
|
122
|
+
moveToObjective.SetValue(currentDialogue.SceneTransition.MoveToObjective);
|
|
123
|
+
|
|
124
|
+
if (currentDialogue.SceneTransition.MoveToNextNaturalObjective)
|
|
125
|
+
moveToNextNaturalObjective.Raise();
|
|
126
|
+
|
|
127
|
+
if (currentDialogue.SceneTransition.OnLoadNoDark)
|
|
128
|
+
DialogueEventSystem.TriggerEvent(fadeOutEventString);
|
|
129
|
+
|
|
130
|
+
if (!currentDialogue.SceneTransition.ToMenu && currentDialogue.DirectTo.Enabled)
|
|
131
|
+
ServiceLocator.GetService<TPFDRoomLoader>().SetMovingToTPFDMode();
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/// <summary>
|
|
135
|
+
///
|
|
136
|
+
/// </summary>
|
|
137
|
+
/// <param name="scene"></param>
|
|
138
|
+
protected virtual IEnumerator MoveToScene(string scene)
|
|
139
|
+
{
|
|
140
|
+
UnityEngine.Debug.Log($"{ToString()}: CHANGING SCENE");
|
|
141
|
+
|
|
142
|
+
AsyncOperation asyncLoadOperation = SceneManager.LoadSceneAsync(scene);
|
|
143
|
+
|
|
144
|
+
Scene sceneToLoad = SceneManager.GetSceneByName(scene);
|
|
145
|
+
|
|
146
|
+
asyncLoadOperation.allowSceneActivation = false;
|
|
147
|
+
|
|
148
|
+
yield return new WaitUntil(() => asyncLoadOperation.progress >= 0.9f);
|
|
149
|
+
|
|
150
|
+
asyncLoadOperation.allowSceneActivation = true;
|
|
151
|
+
|
|
152
|
+
yield return new WaitUntil(() => sceneToLoad.isLoaded);
|
|
153
|
+
|
|
154
|
+
yield return new WaitUntil(() => !inLoading.Value);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
/// <inheritdoc/>
|
|
159
|
+
public virtual void Save(Dictionary<string, object> saveData)
|
|
160
|
+
{
|
|
161
|
+
if (!ServiceLocator.GetService<IDialogueManager>().GetComponentsInChildren<DialogueComponent>().Contains(this))
|
|
162
|
+
return;
|
|
163
|
+
|
|
164
|
+
saveData.Set(transitionNumSaveKey, saveTransitionNum);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/// <inheritdoc/>
|
|
168
|
+
public virtual void ClearSaveData() => saveTransitionNum = 0;
|
|
169
|
+
}
|
|
170
170
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
fileFormatVersion: 2
|
|
2
|
-
guid: 554a4fa30d95ec84d92de4e1ecfbc872
|
|
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: 554a4fa30d95ec84d92de4e1ecfbc872
|
|
3
|
+
MonoImporter:
|
|
4
|
+
externalObjects: {}
|
|
5
|
+
serializedVersion: 2
|
|
6
|
+
defaultReferences: []
|
|
7
|
+
executionOrder: 0
|
|
8
|
+
icon: {instanceID: 0}
|
|
9
|
+
userData:
|
|
10
|
+
assetBundleName:
|
|
11
|
+
assetBundleVariant:
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
-
using DREditor.Dialogues;
|
|
3
|
-
using DREditor.Dialogues.Ending;
|
|
4
|
-
using DREditor.EventObjects;
|
|
5
|
-
using System;
|
|
6
|
-
using UnityEngine;
|
|
7
|
-
|
|
8
|
-
namespace DREditor.EndEvents
|
|
9
|
-
{
|
|
10
|
-
/// <summary>
|
|
11
|
-
///
|
|
12
|
-
/// </summary>
|
|
13
|
-
[ClassHeader(nameof(DialogueComponent) + ", " + nameof(IDialogueEndEvent) +
|
|
14
|
-
"\n\n")]
|
|
15
|
-
public class SkipSequenceEndEventHandler : DialogueComponent, IDialogueEndEvent
|
|
16
|
-
{
|
|
17
|
-
/// <summary>
|
|
18
|
-
///
|
|
19
|
-
/// </summary>
|
|
20
|
-
[Tooltip("")]
|
|
21
|
-
[SerializeField] protected IntWithEvent skipTrialSequences = null;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
/// <inheritdoc/>
|
|
25
|
-
public virtual bool EvaluateEndEvent<T>(DialogueBase<T> currentDialogue, Action<DialogueCore[]> interruptDialogue)
|
|
26
|
-
where T : Line
|
|
27
|
-
{
|
|
28
|
-
if (!skipTrialSequences)
|
|
29
|
-
UnityEngine.Debug.LogError($"ALERT: The event field: {nameof(skipTrialSequences)} must be assigned!");
|
|
30
|
-
else if (currentDialogue is ITrialSequenceSkippable skippable)
|
|
31
|
-
skipTrialSequences.SetValue(skippable.Skip);
|
|
32
|
-
|
|
33
|
-
return false;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
1
|
+
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
+
using DREditor.Dialogues;
|
|
3
|
+
using DREditor.Dialogues.Ending;
|
|
4
|
+
using DREditor.EventObjects;
|
|
5
|
+
using System;
|
|
6
|
+
using UnityEngine;
|
|
7
|
+
|
|
8
|
+
namespace DREditor.EndEvents
|
|
9
|
+
{
|
|
10
|
+
/// <summary>
|
|
11
|
+
///
|
|
12
|
+
/// </summary>
|
|
13
|
+
[ClassHeader(nameof(DialogueComponent) + ", " + nameof(IDialogueEndEvent) +
|
|
14
|
+
"\n\n")]
|
|
15
|
+
public class SkipSequenceEndEventHandler : DialogueComponent, IDialogueEndEvent
|
|
16
|
+
{
|
|
17
|
+
/// <summary>
|
|
18
|
+
///
|
|
19
|
+
/// </summary>
|
|
20
|
+
[Tooltip("")]
|
|
21
|
+
[SerializeField] protected IntWithEvent skipTrialSequences = null;
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
/// <inheritdoc/>
|
|
25
|
+
public virtual bool EvaluateEndEvent<T>(DialogueBase<T> currentDialogue, Action<DialogueCore[]> interruptDialogue)
|
|
26
|
+
where T : Line
|
|
27
|
+
{
|
|
28
|
+
if (!skipTrialSequences)
|
|
29
|
+
UnityEngine.Debug.LogError($"ALERT: The event field: {nameof(skipTrialSequences)} must be assigned!");
|
|
30
|
+
else if (currentDialogue is ITrialSequenceSkippable skippable)
|
|
31
|
+
skipTrialSequences.SetValue(skippable.Skip);
|
|
32
|
+
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
36
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
fileFormatVersion: 2
|
|
2
|
-
guid: 387b78050203a4a4cb131953a89d74a1
|
|
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: 387b78050203a4a4cb131953a89d74a1
|
|
3
|
+
MonoImporter:
|
|
4
|
+
externalObjects: {}
|
|
5
|
+
serializedVersion: 2
|
|
6
|
+
defaultReferences: []
|
|
7
|
+
executionOrder: 0
|
|
8
|
+
icon: {instanceID: 0}
|
|
9
|
+
userData:
|
|
10
|
+
assetBundleName:
|
|
11
|
+
assetBundleVariant:
|
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
-
using DREditor.Dialogues;
|
|
3
|
-
using DREditor.Dialogues.Ending;
|
|
4
|
-
using DREditor.Progressing.Handling;
|
|
5
|
-
using DREditor.Services;
|
|
6
|
-
using System;
|
|
7
|
-
|
|
8
|
-
namespace DREditor.EndEvents
|
|
9
|
-
{
|
|
10
|
-
/// <summary>
|
|
11
|
-
///
|
|
12
|
-
/// </summary>
|
|
13
|
-
[ClassHeader(nameof(DialogueComponent) + ", " + nameof(IDialogueEndEvent) +
|
|
14
|
-
"\n\n")]
|
|
15
|
-
public class TriggerFlagEndEventHandler : DialogueComponent, IDialogueEndEvent
|
|
16
|
-
{
|
|
17
|
-
/// <inheritdoc/>
|
|
18
|
-
public virtual bool EvaluateEndEvent<T>(DialogueBase<T> currentDialogue, Action<DialogueCore[]> interruptDialogue)
|
|
19
|
-
where T : Line
|
|
20
|
-
{
|
|
21
|
-
TriggerDialogueFlag(currentDialogue);
|
|
22
|
-
|
|
23
|
-
return false;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
/// <summary>
|
|
27
|
-
///
|
|
28
|
-
/// </summary>
|
|
29
|
-
/// <typeparam name="T"></typeparam>
|
|
30
|
-
/// <param name="currentDialogue"></param>
|
|
31
|
-
protected virtual void TriggerDialogueFlag<T>(DialogueBase<T> currentDialogue)
|
|
32
|
-
{
|
|
33
|
-
if (currentDialogue.FlagTrigger != null && currentDialogue.FlagTrigger.Enabled)
|
|
34
|
-
{
|
|
35
|
-
TriggerFlag triggerFlag = currentDialogue.FlagTrigger;
|
|
36
|
-
|
|
37
|
-
ServiceLocator.GetService<FlagTriggerHandlerBase>()
|
|
38
|
-
.TriggerFlag(triggerFlag.Chapter, triggerFlag.Objective, triggerFlag.Flags);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
1
|
+
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
+
using DREditor.Dialogues;
|
|
3
|
+
using DREditor.Dialogues.Ending;
|
|
4
|
+
using DREditor.Progressing.Handling;
|
|
5
|
+
using DREditor.Services;
|
|
6
|
+
using System;
|
|
7
|
+
|
|
8
|
+
namespace DREditor.EndEvents
|
|
9
|
+
{
|
|
10
|
+
/// <summary>
|
|
11
|
+
///
|
|
12
|
+
/// </summary>
|
|
13
|
+
[ClassHeader(nameof(DialogueComponent) + ", " + nameof(IDialogueEndEvent) +
|
|
14
|
+
"\n\n")]
|
|
15
|
+
public class TriggerFlagEndEventHandler : DialogueComponent, IDialogueEndEvent
|
|
16
|
+
{
|
|
17
|
+
/// <inheritdoc/>
|
|
18
|
+
public virtual bool EvaluateEndEvent<T>(DialogueBase<T> currentDialogue, Action<DialogueCore[]> interruptDialogue)
|
|
19
|
+
where T : Line
|
|
20
|
+
{
|
|
21
|
+
TriggerDialogueFlag(currentDialogue);
|
|
22
|
+
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/// <summary>
|
|
27
|
+
///
|
|
28
|
+
/// </summary>
|
|
29
|
+
/// <typeparam name="T"></typeparam>
|
|
30
|
+
/// <param name="currentDialogue"></param>
|
|
31
|
+
protected virtual void TriggerDialogueFlag<T>(DialogueBase<T> currentDialogue)
|
|
32
|
+
{
|
|
33
|
+
if (currentDialogue.FlagTrigger != null && currentDialogue.FlagTrigger.Enabled)
|
|
34
|
+
{
|
|
35
|
+
TriggerFlag triggerFlag = currentDialogue.FlagTrigger;
|
|
36
|
+
|
|
37
|
+
ServiceLocator.GetService<FlagTriggerHandlerBase>()
|
|
38
|
+
.TriggerFlag(triggerFlag.Chapter, triggerFlag.Objective, triggerFlag.Flags);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
42
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
fileFormatVersion: 2
|
|
2
|
-
guid: 998a55388cf69194b9a1a4478edfc87e
|
|
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: 998a55388cf69194b9a1a4478edfc87e
|
|
3
|
+
MonoImporter:
|
|
4
|
+
externalObjects: {}
|
|
5
|
+
serializedVersion: 2
|
|
6
|
+
defaultReferences: []
|
|
7
|
+
executionOrder: 0
|
|
8
|
+
icon: {instanceID: 0}
|
|
9
|
+
userData:
|
|
10
|
+
assetBundleName:
|
|
11
|
+
assetBundleVariant:
|