net.dreditor.roomloading 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/CheckThreeDModeDuringLoad.cs +63 -63
- package/CheckThreeDModeDuringLoad.cs.meta +11 -11
- package/DRERoomTransition.cs +115 -115
- package/DRERoomTransition.cs.meta +11 -11
- package/DREStartAloneScene.cs +178 -178
- package/DREStartAloneScene.cs.meta +11 -11
- package/DREditor.RoomLoading.asmdef +23 -23
- package/DREditor.RoomLoading.asmdef.meta +7 -7
- package/DialogueRoomLoader.cs +187 -187
- package/DialogueRoomLoader.cs.meta +11 -11
- package/FadeOnEndTransitionFromSave.cs +204 -204
- package/FadeOnEndTransitionFromSave.cs.meta +11 -11
- package/FadeOutGeneratePastOnDebugTest.cs +96 -96
- package/FadeOutGeneratePastOnDebugTest.cs.meta +11 -11
- package/FadeOutOnRoomLoad.cs +74 -74
- package/FadeOutOnRoomLoad.cs.meta +11 -11
- package/FreezeColorRoomTransition.cs +185 -185
- package/FreezeColorRoomTransition.cs.meta +11 -11
- package/IPostTransitionRoutine.cs +17 -17
- package/IPostTransitionRoutine.cs.meta +11 -11
- package/IRoomLoadResolver.cs +14 -14
- package/IRoomLoadResolver.cs.meta +11 -11
- package/IRoomLoadRoutine.cs +16 -16
- package/IRoomLoadRoutine.cs.meta +11 -11
- package/IRoomTransition.cs +38 -38
- package/IRoomTransition.cs.meta +11 -11
- package/ITeleporter.cs +23 -23
- package/ITeleporter.cs.meta +11 -11
- package/InstanceManagerBase.cs +130 -130
- package/InstanceManagerBase.cs.meta +11 -11
- package/KeepStateAfterObjective.cs +73 -73
- package/KeepStateAfterObjective.cs.meta +11 -11
- package/MoveEndOnDialogueFinish.cs +130 -130
- package/MoveEndOnDialogueFinish.cs.meta +11 -11
- package/PastPointData.cs +43 -43
- package/PastPointData.cs.meta +11 -11
- package/PrepareTPFDOnLoadingRoom.cs +67 -67
- package/PrepareTPFDOnLoadingRoom.cs.meta +11 -11
- package/ResolveRoomLoadStates.cs +94 -94
- package/ResolveRoomLoadStates.cs.meta +11 -11
- package/RoomChanger.cs +264 -264
- package/RoomChanger.cs.meta +11 -11
- package/RoomChangerBase.cs +84 -84
- package/RoomChangerBase.cs.meta +11 -11
- package/RoomChangerLoader.cs +89 -89
- package/RoomChangerLoader.cs.meta +11 -11
- package/RoomLoadComponent.cs +12 -12
- package/RoomLoadComponent.cs.meta +11 -11
- package/RoomLoadFinisher.cs +80 -80
- package/RoomLoadFinisher.cs.meta +11 -11
- package/RoomLoadOptionsAsset.cs +44 -44
- package/RoomLoadOptionsAsset.cs.meta +11 -11
- package/RoomLoader.cs +264 -264
- package/RoomLoader.cs.meta +11 -11
- package/RoomLoaderBase.cs +86 -86
- package/RoomLoaderBase.cs.meta +11 -11
- package/RoomLoaderDebugger.cs +150 -150
- package/RoomLoaderDebugger.cs.meta +11 -11
- package/RoomLoaderHolder.cs +9 -9
- package/RoomLoaderHolder.cs.meta +11 -11
- package/{Samples → Samples~}/BlackTransitionOnlyOption.asset +18 -18
- package/{Samples → Samples~}/BlackTransitionOnlyOption.asset.meta +8 -8
- package/{Samples → Samples~}/BlackTransitionToInvestigationOption.asset +18 -18
- package/{Samples → Samples~}/BlackTransitionToInvestigationOption.asset.meta +8 -8
- package/{Samples → Samples~}/Check_ThreeD_Mode_During_Load.prefab +49 -49
- package/{Samples → Samples~}/Check_ThreeD_Mode_During_Load.prefab.meta +7 -7
- package/{Samples → Samples~}/DRE_Start_Alone_Scene.prefab +148 -148
- package/{Samples → Samples~}/DRE_Start_Alone_Scene.prefab.meta +7 -7
- package/{Samples → Samples~}/Dialogue_Room_Loader.prefab +55 -55
- package/{Samples → Samples~}/Dialogue_Room_Loader.prefab.meta +7 -7
- package/{Samples → Samples~}/FadeOutBlackTransitionOption.asset +18 -18
- package/{Samples → Samples~}/FadeOutBlackTransitionOption.asset.meta +8 -8
- package/{Samples → Samples~}/Fade_On_End_Transition_From_Save.prefab +145 -145
- package/{Samples → Samples~}/Fade_On_End_Transition_From_Save.prefab.meta +7 -7
- package/{Samples → Samples~}/Fade_Out_Generate_Past_On_Debug_Test.prefab +139 -139
- package/{Samples → Samples~}/Fade_Out_Generate_Past_On_Debug_Test.prefab.meta +7 -7
- package/{Samples → Samples~}/Fade_Out_On_Room_Load.prefab +137 -137
- package/{Samples → Samples~}/Fade_Out_On_Room_Load.prefab.meta +7 -7
- package/{Samples → Samples~}/Freeze_Transition_Canvas.prefab +300 -300
- package/{Samples → Samples~}/Freeze_Transition_Canvas.prefab.meta +7 -7
- package/{Samples → Samples~}/IsLoadingToRoom.asset +19 -19
- package/{Samples → Samples~}/IsLoadingToRoom.asset.meta +8 -8
- package/{Samples → Samples~}/Move_End_On_Dialogue_Finish.prefab +52 -52
- package/{Samples → Samples~}/Move_End_On_Dialogue_Finish.prefab.meta +7 -7
- package/{Samples → Samples~}/OnFadingOutOfLoading.asset +15 -15
- package/{Samples → Samples~}/OnFadingOutOfLoading.asset.meta +8 -8
- package/{Samples → Samples~}/OnFinishedLoadingRoom.asset +14 -14
- package/{Samples → Samples~}/OnFinishedLoadingRoom.asset.meta +8 -8
- package/{Samples → Samples~}/OnLoadingThreeDRoom.asset +14 -14
- package/{Samples → Samples~}/OnLoadingThreeDRoom.asset.meta +8 -8
- package/{Samples → Samples~}/OnLoadingThreeDRoomListener.prefab +51 -51
- package/{Samples → Samples~}/OnLoadingThreeDRoomListener.prefab.meta +7 -7
- package/{Samples → Samples~}/On_Finished_Loading_Room_Listener.prefab +51 -51
- package/{Samples → Samples~}/On_Finished_Loading_Room_Listener.prefab.meta +7 -7
- package/{Samples → Samples~}/On_Finished_Loading_Room_No_Dialogue_Listener.prefab +51 -51
- package/{Samples → Samples~}/On_Finished_Loading_Room_No_Dialogue_Listener.prefab.meta +7 -7
- package/{Samples → Samples~}/On_Finished_Room_Transitions_Listener.prefab +51 -51
- package/{Samples → Samples~}/On_Finished_Room_Transitions_Listener.prefab.meta +7 -7
- package/{Samples → Samples~}/On_Loading_Room_Listener.prefab +51 -51
- package/{Samples → Samples~}/On_Loading_Room_Listener.prefab.meta +7 -7
- package/{Samples → Samples~}/On_Started_Changing_Room_Listener.prefab +51 -51
- package/{Samples → Samples~}/On_Started_Changing_Room_Listener.prefab.meta +7 -7
- package/{Samples → Samples~}/Prepare_TPFD_On_Room_Loading.prefab +142 -142
- package/{Samples → Samples~}/Prepare_TPFD_On_Room_Loading.prefab.meta +7 -7
- package/{Samples → Samples~}/Resolve_Room_Load_States.prefab +54 -54
- package/{Samples → Samples~}/Resolve_Room_Load_States.prefab.meta +7 -7
- package/{Samples → Samples~}/Room_Changer.prefab +143 -143
- package/{Samples → Samples~}/Room_Changer.prefab.meta +7 -7
- package/{Samples → Samples~}/Room_Changer_Loader.prefab +53 -53
- package/{Samples → Samples~}/Room_Changer_Loader.prefab.meta +7 -7
- package/{Samples → Samples~}/Room_Instance_Manager.prefab +78 -78
- package/{Samples → Samples~}/Room_Instance_Manager.prefab.meta +7 -7
- package/{Samples → Samples~}/Room_Load_Finisher.prefab +139 -139
- package/{Samples → Samples~}/Room_Load_Finisher.prefab.meta +7 -7
- package/{Samples → Samples~}/Room_Loader.prefab +584 -584
- package/{Samples → Samples~}/Room_Loader.prefab.meta +7 -7
- package/{Samples → Samples~}/Room_Loader_Event_Listeners.prefab +337 -337
- package/{Samples → Samples~}/Room_Loader_Event_Listeners.prefab.meta +7 -7
- package/{Samples → Samples~}/Room_Loading_System_ETemplate.prefab +398 -398
- package/{Samples → Samples~}/Room_Loading_System_ETemplate.prefab.meta +7 -7
- package/{Samples → Samples~}/SkipActivateControls.asset +19 -19
- package/{Samples → Samples~}/SkipActivateControls.asset.meta +8 -8
- package/{Samples → Samples~}/Skip_Controls_When_Loaded.prefab +156 -156
- package/{Samples → Samples~}/Skip_Controls_When_Loaded.prefab.meta +7 -7
- package/{Samples → Samples~}/TPFD_Room_Loader.prefab +215 -215
- package/{Samples → Samples~}/TPFD_Room_Loader.prefab.meta +7 -7
- package/{Samples → Samples~}/TeleportTransitionOptions.asset +18 -18
- package/{Samples → Samples~}/TeleportTransitionOptions.asset.meta +8 -8
- package/{Samples → Samples~}/Teleport_Room_Manager.prefab +84 -84
- package/{Samples → Samples~}/Teleport_Room_Manager.prefab.meta +7 -7
- package/{Samples → Samples~}/UI_Visibility_On_Scene_Events.prefab +316 -316
- package/{Samples → Samples~}/UI_Visibility_On_Scene_Events.prefab.meta +7 -7
- package/SkipControlsWhenLoaded.cs +65 -65
- package/SkipControlsWhenLoaded.cs.meta +11 -11
- package/TPFDRoomAnimation.cs +83 -83
- package/TPFDRoomAnimation.cs.meta +11 -11
- package/TPFDRoomLoader.cs +92 -92
- package/TPFDRoomLoader.cs.meta +11 -11
- package/TeleportRoomManager.cs +113 -113
- package/TeleportRoomManager.cs.meta +11 -11
- package/package.json +45 -40
- package/package.json.meta +7 -7
- package/Samples.meta +0 -8
|
@@ -1,205 +1,205 @@
|
|
|
1
|
-
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
-
using DREditor.EventObjects;
|
|
3
|
-
using DREditor.Fading;
|
|
4
|
-
using DREditor.Services;
|
|
5
|
-
using DREditor.UIHandling;
|
|
6
|
-
using System;
|
|
7
|
-
using System.Collections;
|
|
8
|
-
using System.Linq;
|
|
9
|
-
using UnityEngine;
|
|
10
|
-
|
|
11
|
-
namespace DREditor.RoomLoading
|
|
12
|
-
{
|
|
13
|
-
/// <summary>
|
|
14
|
-
///
|
|
15
|
-
/// </summary>
|
|
16
|
-
[ClassHeader(nameof(ISceneEventListener) + ", " + nameof(IToTitleScreen) +
|
|
17
|
-
"\n\n")]
|
|
18
|
-
public class FadeOnEndTransitionFromSave : MonoBehaviour, ISceneEventListener, IToTitleScreen
|
|
19
|
-
{
|
|
20
|
-
/// <summary>
|
|
21
|
-
///
|
|
22
|
-
/// </summary>
|
|
23
|
-
[Tooltip("")]
|
|
24
|
-
[SerializeField] protected SceneEvent onFadeOutComplete = null;
|
|
25
|
-
|
|
26
|
-
/// <summary>
|
|
27
|
-
///
|
|
28
|
-
/// </summary>
|
|
29
|
-
[Tooltip("")]
|
|
30
|
-
[SerializeField] protected SceneEvent onFadingOutOfLoading = null;
|
|
31
|
-
|
|
32
|
-
/// <summary>
|
|
33
|
-
///
|
|
34
|
-
/// </summary>
|
|
35
|
-
[Tooltip("")]
|
|
36
|
-
[SerializeField] protected BoolWithEvent isLoadingFile = null;
|
|
37
|
-
|
|
38
|
-
/// <summary>
|
|
39
|
-
///
|
|
40
|
-
/// </summary>
|
|
41
|
-
[Tooltip("")]
|
|
42
|
-
[SerializeField] protected BoolWithEvent screenIsDark = null;
|
|
43
|
-
|
|
44
|
-
/// <summary>
|
|
45
|
-
///
|
|
46
|
-
/// </summary>
|
|
47
|
-
[Tooltip("")]
|
|
48
|
-
[SerializeField] protected SceneEventListener onFinishedRoomTransitions = null;
|
|
49
|
-
|
|
50
|
-
/// <summary>
|
|
51
|
-
///
|
|
52
|
-
/// </summary>
|
|
53
|
-
[Tooltip("")]
|
|
54
|
-
[SerializeField] protected float loadingFileFadeOutTime = 0.3f;
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
/// <summary>
|
|
58
|
-
///
|
|
59
|
-
/// </summary>
|
|
60
|
-
protected bool subscribed = false;
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
protected virtual void OnEnable() => isLoadingFile.AddListener(OnLoadingFileStateChanged);
|
|
64
|
-
|
|
65
|
-
protected virtual void OnDisable() => isLoadingFile.RemoveListener(OnLoadingFileStateChanged);
|
|
66
|
-
|
|
67
|
-
/// <summary>
|
|
68
|
-
///
|
|
69
|
-
/// </summary>
|
|
70
|
-
/// <param name="loadingFile"></param>
|
|
71
|
-
protected virtual void OnLoadingFileStateChanged(bool loadingFile)
|
|
72
|
-
{
|
|
73
|
-
if (loadingFile)
|
|
74
|
-
SubscribeToEvents();
|
|
75
|
-
else
|
|
76
|
-
UnsubscribeToEvents();
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
/// <summary>
|
|
80
|
-
///
|
|
81
|
-
/// </summary>
|
|
82
|
-
protected virtual void SubscribeToEvents()
|
|
83
|
-
{
|
|
84
|
-
if (!subscribed)
|
|
85
|
-
{
|
|
86
|
-
onFadeOutComplete.RegisterListener(this);
|
|
87
|
-
|
|
88
|
-
onFinishedRoomTransitions.Response.AddListener(FadeOutOnTransitionsFinished);
|
|
89
|
-
|
|
90
|
-
subscribed = true;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
/// <summary>
|
|
95
|
-
///
|
|
96
|
-
/// </summary>
|
|
97
|
-
protected virtual void UnsubscribeToEvents()
|
|
98
|
-
{
|
|
99
|
-
if (subscribed)
|
|
100
|
-
{
|
|
101
|
-
onFadeOutComplete.UnregisterListener(this);
|
|
102
|
-
|
|
103
|
-
onFinishedRoomTransitions.Response.RemoveListener(FadeOutOnTransitionsFinished);
|
|
104
|
-
|
|
105
|
-
StopAllCoroutines();
|
|
106
|
-
|
|
107
|
-
subscribed = false;
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
/// <inheritdoc/>
|
|
112
|
-
public virtual void OnEventRaised() => OnEventInvoke(InvokeFadingOutOfLoading);
|
|
113
|
-
|
|
114
|
-
/// <summary>
|
|
115
|
-
///
|
|
116
|
-
/// </summary>
|
|
117
|
-
/// <param name="action"></param>
|
|
118
|
-
protected virtual void OnEventInvoke(Action action)
|
|
119
|
-
{
|
|
120
|
-
if (isLoadingFile.Value)
|
|
121
|
-
{
|
|
122
|
-
UnsubscribeToEvents();
|
|
123
|
-
|
|
124
|
-
action?.Invoke();
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
/// <summary>
|
|
129
|
-
///
|
|
130
|
-
/// </summary>
|
|
131
|
-
protected virtual void InvokeFadingOutOfLoading()
|
|
132
|
-
{
|
|
133
|
-
if (onFadingOutOfLoading != null)
|
|
134
|
-
onFadingOutOfLoading.Raise();
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
/// <summary>
|
|
138
|
-
///
|
|
139
|
-
/// </summary>
|
|
140
|
-
protected virtual void FadeOutOnTransitionsFinished() => OnEventInvoke(WaitForLoadingToFinish);
|
|
141
|
-
|
|
142
|
-
/// <summary>
|
|
143
|
-
///
|
|
144
|
-
/// </summary>
|
|
145
|
-
protected virtual void WaitForLoadingToFinish() => StartCoroutine(WaitForLoadingToFinishRoutine());
|
|
146
|
-
|
|
147
|
-
/// <summary>
|
|
148
|
-
///
|
|
149
|
-
/// </summary>
|
|
150
|
-
protected virtual IEnumerator WaitForLoadingToFinishRoutine()
|
|
151
|
-
{
|
|
152
|
-
yield return WaitForLoadingOrFadeToFinish();
|
|
153
|
-
|
|
154
|
-
yield return WaitForAnimationsToComplete();
|
|
155
|
-
|
|
156
|
-
InvokeFadingOutOfLoading();
|
|
157
|
-
|
|
158
|
-
FadeOutOfLoading();
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
/// <summary>
|
|
162
|
-
///
|
|
163
|
-
/// </summary>
|
|
164
|
-
protected virtual IEnumerator WaitForLoadingOrFadeToFinish()
|
|
165
|
-
{
|
|
166
|
-
while (isLoadingFile.Value && screenIsDark.Value)
|
|
167
|
-
yield return null;
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
/// <summary>
|
|
171
|
-
///
|
|
172
|
-
/// </summary>
|
|
173
|
-
protected virtual IEnumerator WaitForAnimationsToComplete()
|
|
174
|
-
{
|
|
175
|
-
var waitableAnimations = FindObjectsByType<MonoBehaviour>().OfType<IWaitAnimationCompleteOnLoad>();
|
|
176
|
-
|
|
177
|
-
foreach (var animation in waitableAnimations)
|
|
178
|
-
yield return animation.WaitForAnimationToComplete();
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
/// <summary>
|
|
182
|
-
///
|
|
183
|
-
/// </summary>
|
|
184
|
-
protected virtual void FadeOutOfLoading()
|
|
185
|
-
{
|
|
186
|
-
if (!ServiceLocator.HasService<GlobalFade>(out var globalFade) ||
|
|
187
|
-
!ServiceLocator.HasService<UIHandlerBase>(out var uiHandler))
|
|
188
|
-
return;
|
|
189
|
-
|
|
190
|
-
bool fadeOutOptions =
|
|
191
|
-
!ServiceLocator.HasService<RoomChangerBase>(out var roomChanger) ||
|
|
192
|
-
roomChanger.GetOptions() == null ||
|
|
193
|
-
roomChanger.GetOptions().fadeOutOnLoad;
|
|
194
|
-
|
|
195
|
-
if (screenIsDark.Value && !uiHandler.MovingToTitleScreen && fadeOutOptions)
|
|
196
|
-
globalFade.FadeOut(loadingFileFadeOutTime);
|
|
197
|
-
else
|
|
198
|
-
UnityEngine.Debug.Log("REPORT: Didn't Fade out of loading.");
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
/// <inheritdoc/>
|
|
203
|
-
public virtual void ToTitleScreen() => UnsubscribeToEvents();
|
|
204
|
-
}
|
|
1
|
+
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
+
using DREditor.EventObjects;
|
|
3
|
+
using DREditor.Fading;
|
|
4
|
+
using DREditor.Services;
|
|
5
|
+
using DREditor.UIHandling;
|
|
6
|
+
using System;
|
|
7
|
+
using System.Collections;
|
|
8
|
+
using System.Linq;
|
|
9
|
+
using UnityEngine;
|
|
10
|
+
|
|
11
|
+
namespace DREditor.RoomLoading
|
|
12
|
+
{
|
|
13
|
+
/// <summary>
|
|
14
|
+
///
|
|
15
|
+
/// </summary>
|
|
16
|
+
[ClassHeader(nameof(ISceneEventListener) + ", " + nameof(IToTitleScreen) +
|
|
17
|
+
"\n\n")]
|
|
18
|
+
public class FadeOnEndTransitionFromSave : MonoBehaviour, ISceneEventListener, IToTitleScreen
|
|
19
|
+
{
|
|
20
|
+
/// <summary>
|
|
21
|
+
///
|
|
22
|
+
/// </summary>
|
|
23
|
+
[Tooltip("")]
|
|
24
|
+
[SerializeField] protected SceneEvent onFadeOutComplete = null;
|
|
25
|
+
|
|
26
|
+
/// <summary>
|
|
27
|
+
///
|
|
28
|
+
/// </summary>
|
|
29
|
+
[Tooltip("")]
|
|
30
|
+
[SerializeField] protected SceneEvent onFadingOutOfLoading = null;
|
|
31
|
+
|
|
32
|
+
/// <summary>
|
|
33
|
+
///
|
|
34
|
+
/// </summary>
|
|
35
|
+
[Tooltip("")]
|
|
36
|
+
[SerializeField] protected BoolWithEvent isLoadingFile = null;
|
|
37
|
+
|
|
38
|
+
/// <summary>
|
|
39
|
+
///
|
|
40
|
+
/// </summary>
|
|
41
|
+
[Tooltip("")]
|
|
42
|
+
[SerializeField] protected BoolWithEvent screenIsDark = null;
|
|
43
|
+
|
|
44
|
+
/// <summary>
|
|
45
|
+
///
|
|
46
|
+
/// </summary>
|
|
47
|
+
[Tooltip("")]
|
|
48
|
+
[SerializeField] protected SceneEventListener onFinishedRoomTransitions = null;
|
|
49
|
+
|
|
50
|
+
/// <summary>
|
|
51
|
+
///
|
|
52
|
+
/// </summary>
|
|
53
|
+
[Tooltip("")]
|
|
54
|
+
[SerializeField] protected float loadingFileFadeOutTime = 0.3f;
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
/// <summary>
|
|
58
|
+
///
|
|
59
|
+
/// </summary>
|
|
60
|
+
protected bool subscribed = false;
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
protected virtual void OnEnable() => isLoadingFile.AddListener(OnLoadingFileStateChanged);
|
|
64
|
+
|
|
65
|
+
protected virtual void OnDisable() => isLoadingFile.RemoveListener(OnLoadingFileStateChanged);
|
|
66
|
+
|
|
67
|
+
/// <summary>
|
|
68
|
+
///
|
|
69
|
+
/// </summary>
|
|
70
|
+
/// <param name="loadingFile"></param>
|
|
71
|
+
protected virtual void OnLoadingFileStateChanged(bool loadingFile)
|
|
72
|
+
{
|
|
73
|
+
if (loadingFile)
|
|
74
|
+
SubscribeToEvents();
|
|
75
|
+
else
|
|
76
|
+
UnsubscribeToEvents();
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/// <summary>
|
|
80
|
+
///
|
|
81
|
+
/// </summary>
|
|
82
|
+
protected virtual void SubscribeToEvents()
|
|
83
|
+
{
|
|
84
|
+
if (!subscribed)
|
|
85
|
+
{
|
|
86
|
+
onFadeOutComplete.RegisterListener(this);
|
|
87
|
+
|
|
88
|
+
onFinishedRoomTransitions.Response.AddListener(FadeOutOnTransitionsFinished);
|
|
89
|
+
|
|
90
|
+
subscribed = true;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/// <summary>
|
|
95
|
+
///
|
|
96
|
+
/// </summary>
|
|
97
|
+
protected virtual void UnsubscribeToEvents()
|
|
98
|
+
{
|
|
99
|
+
if (subscribed)
|
|
100
|
+
{
|
|
101
|
+
onFadeOutComplete.UnregisterListener(this);
|
|
102
|
+
|
|
103
|
+
onFinishedRoomTransitions.Response.RemoveListener(FadeOutOnTransitionsFinished);
|
|
104
|
+
|
|
105
|
+
StopAllCoroutines();
|
|
106
|
+
|
|
107
|
+
subscribed = false;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/// <inheritdoc/>
|
|
112
|
+
public virtual void OnEventRaised() => OnEventInvoke(InvokeFadingOutOfLoading);
|
|
113
|
+
|
|
114
|
+
/// <summary>
|
|
115
|
+
///
|
|
116
|
+
/// </summary>
|
|
117
|
+
/// <param name="action"></param>
|
|
118
|
+
protected virtual void OnEventInvoke(Action action)
|
|
119
|
+
{
|
|
120
|
+
if (isLoadingFile.Value)
|
|
121
|
+
{
|
|
122
|
+
UnsubscribeToEvents();
|
|
123
|
+
|
|
124
|
+
action?.Invoke();
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/// <summary>
|
|
129
|
+
///
|
|
130
|
+
/// </summary>
|
|
131
|
+
protected virtual void InvokeFadingOutOfLoading()
|
|
132
|
+
{
|
|
133
|
+
if (onFadingOutOfLoading != null)
|
|
134
|
+
onFadingOutOfLoading.Raise();
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/// <summary>
|
|
138
|
+
///
|
|
139
|
+
/// </summary>
|
|
140
|
+
protected virtual void FadeOutOnTransitionsFinished() => OnEventInvoke(WaitForLoadingToFinish);
|
|
141
|
+
|
|
142
|
+
/// <summary>
|
|
143
|
+
///
|
|
144
|
+
/// </summary>
|
|
145
|
+
protected virtual void WaitForLoadingToFinish() => StartCoroutine(WaitForLoadingToFinishRoutine());
|
|
146
|
+
|
|
147
|
+
/// <summary>
|
|
148
|
+
///
|
|
149
|
+
/// </summary>
|
|
150
|
+
protected virtual IEnumerator WaitForLoadingToFinishRoutine()
|
|
151
|
+
{
|
|
152
|
+
yield return WaitForLoadingOrFadeToFinish();
|
|
153
|
+
|
|
154
|
+
yield return WaitForAnimationsToComplete();
|
|
155
|
+
|
|
156
|
+
InvokeFadingOutOfLoading();
|
|
157
|
+
|
|
158
|
+
FadeOutOfLoading();
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/// <summary>
|
|
162
|
+
///
|
|
163
|
+
/// </summary>
|
|
164
|
+
protected virtual IEnumerator WaitForLoadingOrFadeToFinish()
|
|
165
|
+
{
|
|
166
|
+
while (isLoadingFile.Value && screenIsDark.Value)
|
|
167
|
+
yield return null;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/// <summary>
|
|
171
|
+
///
|
|
172
|
+
/// </summary>
|
|
173
|
+
protected virtual IEnumerator WaitForAnimationsToComplete()
|
|
174
|
+
{
|
|
175
|
+
var waitableAnimations = FindObjectsByType<MonoBehaviour>().OfType<IWaitAnimationCompleteOnLoad>();
|
|
176
|
+
|
|
177
|
+
foreach (var animation in waitableAnimations)
|
|
178
|
+
yield return animation.WaitForAnimationToComplete();
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/// <summary>
|
|
182
|
+
///
|
|
183
|
+
/// </summary>
|
|
184
|
+
protected virtual void FadeOutOfLoading()
|
|
185
|
+
{
|
|
186
|
+
if (!ServiceLocator.HasService<GlobalFade>(out var globalFade) ||
|
|
187
|
+
!ServiceLocator.HasService<UIHandlerBase>(out var uiHandler))
|
|
188
|
+
return;
|
|
189
|
+
|
|
190
|
+
bool fadeOutOptions =
|
|
191
|
+
!ServiceLocator.HasService<RoomChangerBase>(out var roomChanger) ||
|
|
192
|
+
roomChanger.GetOptions() == null ||
|
|
193
|
+
roomChanger.GetOptions().fadeOutOnLoad;
|
|
194
|
+
|
|
195
|
+
if (screenIsDark.Value && !uiHandler.MovingToTitleScreen && fadeOutOptions)
|
|
196
|
+
globalFade.FadeOut(loadingFileFadeOutTime);
|
|
197
|
+
else
|
|
198
|
+
UnityEngine.Debug.Log("REPORT: Didn't Fade out of loading.");
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
/// <inheritdoc/>
|
|
203
|
+
public virtual void ToTitleScreen() => UnsubscribeToEvents();
|
|
204
|
+
}
|
|
205
205
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
fileFormatVersion: 2
|
|
2
|
-
guid: 83c21f080cb3a0946a367faf4ae0824b
|
|
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: 83c21f080cb3a0946a367faf4ae0824b
|
|
3
|
+
MonoImporter:
|
|
4
|
+
externalObjects: {}
|
|
5
|
+
serializedVersion: 2
|
|
6
|
+
defaultReferences: []
|
|
7
|
+
executionOrder: 0
|
|
8
|
+
icon: {instanceID: 0}
|
|
9
|
+
userData:
|
|
10
|
+
assetBundleName:
|
|
11
|
+
assetBundleVariant:
|
|
@@ -1,97 +1,97 @@
|
|
|
1
|
-
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
-
using DREditor.Dialogues.Events;
|
|
3
|
-
using DREditor.EventObjects;
|
|
4
|
-
using DREditor.Fading;
|
|
5
|
-
using DREditor.Services;
|
|
6
|
-
using System.Collections;
|
|
7
|
-
using UnityEngine;
|
|
8
|
-
|
|
9
|
-
namespace DREditor.RoomLoading
|
|
10
|
-
{
|
|
11
|
-
/// <summary>
|
|
12
|
-
///
|
|
13
|
-
/// </summary>
|
|
14
|
-
[ClassHeader("")]
|
|
15
|
-
public class FadeOutGeneratePastOnDebugTest : MonoBehaviour
|
|
16
|
-
{
|
|
17
|
-
/// <summary>
|
|
18
|
-
///
|
|
19
|
-
/// </summary>
|
|
20
|
-
[Tooltip("")]
|
|
21
|
-
[SerializeField] protected BoolWithEvent inMenu = null;
|
|
22
|
-
|
|
23
|
-
/// <summary>
|
|
24
|
-
///
|
|
25
|
-
/// </summary>
|
|
26
|
-
[Tooltip("")]
|
|
27
|
-
[SerializeField] protected SceneEvent onGeneratePastData = null;
|
|
28
|
-
|
|
29
|
-
/// <summary>
|
|
30
|
-
///
|
|
31
|
-
/// </summary>
|
|
32
|
-
[Tooltip("")]
|
|
33
|
-
[SerializeField] protected SceneEventListener onFinishedLoadingRoom = null;
|
|
34
|
-
|
|
35
|
-
/// <summary>
|
|
36
|
-
///
|
|
37
|
-
/// </summary>
|
|
38
|
-
[Tooltip("")]
|
|
39
|
-
[SerializeField] protected string debugEventString = "FadeOutGeneratePastOnDebugTest";
|
|
40
|
-
|
|
41
|
-
/// <summary>
|
|
42
|
-
///
|
|
43
|
-
/// </summary>
|
|
44
|
-
[Tooltip("")]
|
|
45
|
-
[SerializeField] protected float fadeOutDuration = 1;
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
/// <summary>
|
|
49
|
-
///
|
|
50
|
-
/// </summary>
|
|
51
|
-
protected virtual void OnEnable() => DialogueEventSystem.StartListening(debugEventString, DebugFadeOutGeneratePast);
|
|
52
|
-
|
|
53
|
-
/// <summary>
|
|
54
|
-
///
|
|
55
|
-
/// </summary>
|
|
56
|
-
protected virtual void OnDisable() => DialogueEventSystem.StopListening(debugEventString, DebugFadeOutGeneratePast);
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
/// <summary>
|
|
60
|
-
///
|
|
61
|
-
/// </summary>
|
|
62
|
-
public virtual void DebugFadeOutGeneratePast(object o = null)
|
|
63
|
-
=> onFinishedLoadingRoom.Response.AddListener(FadeOutGeneratePast);
|
|
64
|
-
|
|
65
|
-
/// <summary>
|
|
66
|
-
///
|
|
67
|
-
/// </summary>
|
|
68
|
-
protected virtual void FadeOutGeneratePast()
|
|
69
|
-
{
|
|
70
|
-
onFinishedLoadingRoom.Response.RemoveListener(FadeOutGeneratePast);
|
|
71
|
-
|
|
72
|
-
UnityEngine.Debug.Log("REPORT: Fading Out of black then Generating Past.");
|
|
73
|
-
|
|
74
|
-
if (ServiceLocator.GetService<GlobalFade>().IsDark)
|
|
75
|
-
ServiceLocator.GetService<GlobalFade>().FadeOut(fadeOutDuration);
|
|
76
|
-
|
|
77
|
-
StartCoroutine(WakeUpMonobehaviourControl());
|
|
78
|
-
|
|
79
|
-
if (onGeneratePastData != null)
|
|
80
|
-
onGeneratePastData.Raise();
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
/// <summary>
|
|
84
|
-
///
|
|
85
|
-
/// </summary>
|
|
86
|
-
protected virtual IEnumerator WakeUpMonobehaviourControl()
|
|
87
|
-
{
|
|
88
|
-
yield return null;
|
|
89
|
-
|
|
90
|
-
inMenu.Value = true;
|
|
91
|
-
|
|
92
|
-
yield return null;
|
|
93
|
-
|
|
94
|
-
inMenu.Value = false;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
1
|
+
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
+
using DREditor.Dialogues.Events;
|
|
3
|
+
using DREditor.EventObjects;
|
|
4
|
+
using DREditor.Fading;
|
|
5
|
+
using DREditor.Services;
|
|
6
|
+
using System.Collections;
|
|
7
|
+
using UnityEngine;
|
|
8
|
+
|
|
9
|
+
namespace DREditor.RoomLoading
|
|
10
|
+
{
|
|
11
|
+
/// <summary>
|
|
12
|
+
///
|
|
13
|
+
/// </summary>
|
|
14
|
+
[ClassHeader("")]
|
|
15
|
+
public class FadeOutGeneratePastOnDebugTest : MonoBehaviour
|
|
16
|
+
{
|
|
17
|
+
/// <summary>
|
|
18
|
+
///
|
|
19
|
+
/// </summary>
|
|
20
|
+
[Tooltip("")]
|
|
21
|
+
[SerializeField] protected BoolWithEvent inMenu = null;
|
|
22
|
+
|
|
23
|
+
/// <summary>
|
|
24
|
+
///
|
|
25
|
+
/// </summary>
|
|
26
|
+
[Tooltip("")]
|
|
27
|
+
[SerializeField] protected SceneEvent onGeneratePastData = null;
|
|
28
|
+
|
|
29
|
+
/// <summary>
|
|
30
|
+
///
|
|
31
|
+
/// </summary>
|
|
32
|
+
[Tooltip("")]
|
|
33
|
+
[SerializeField] protected SceneEventListener onFinishedLoadingRoom = null;
|
|
34
|
+
|
|
35
|
+
/// <summary>
|
|
36
|
+
///
|
|
37
|
+
/// </summary>
|
|
38
|
+
[Tooltip("")]
|
|
39
|
+
[SerializeField] protected string debugEventString = "FadeOutGeneratePastOnDebugTest";
|
|
40
|
+
|
|
41
|
+
/// <summary>
|
|
42
|
+
///
|
|
43
|
+
/// </summary>
|
|
44
|
+
[Tooltip("")]
|
|
45
|
+
[SerializeField] protected float fadeOutDuration = 1;
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
/// <summary>
|
|
49
|
+
///
|
|
50
|
+
/// </summary>
|
|
51
|
+
protected virtual void OnEnable() => DialogueEventSystem.StartListening(debugEventString, DebugFadeOutGeneratePast);
|
|
52
|
+
|
|
53
|
+
/// <summary>
|
|
54
|
+
///
|
|
55
|
+
/// </summary>
|
|
56
|
+
protected virtual void OnDisable() => DialogueEventSystem.StopListening(debugEventString, DebugFadeOutGeneratePast);
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
/// <summary>
|
|
60
|
+
///
|
|
61
|
+
/// </summary>
|
|
62
|
+
public virtual void DebugFadeOutGeneratePast(object o = null)
|
|
63
|
+
=> onFinishedLoadingRoom.Response.AddListener(FadeOutGeneratePast);
|
|
64
|
+
|
|
65
|
+
/// <summary>
|
|
66
|
+
///
|
|
67
|
+
/// </summary>
|
|
68
|
+
protected virtual void FadeOutGeneratePast()
|
|
69
|
+
{
|
|
70
|
+
onFinishedLoadingRoom.Response.RemoveListener(FadeOutGeneratePast);
|
|
71
|
+
|
|
72
|
+
UnityEngine.Debug.Log("REPORT: Fading Out of black then Generating Past.");
|
|
73
|
+
|
|
74
|
+
if (ServiceLocator.GetService<GlobalFade>().IsDark)
|
|
75
|
+
ServiceLocator.GetService<GlobalFade>().FadeOut(fadeOutDuration);
|
|
76
|
+
|
|
77
|
+
StartCoroutine(WakeUpMonobehaviourControl());
|
|
78
|
+
|
|
79
|
+
if (onGeneratePastData != null)
|
|
80
|
+
onGeneratePastData.Raise();
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/// <summary>
|
|
84
|
+
///
|
|
85
|
+
/// </summary>
|
|
86
|
+
protected virtual IEnumerator WakeUpMonobehaviourControl()
|
|
87
|
+
{
|
|
88
|
+
yield return null;
|
|
89
|
+
|
|
90
|
+
inMenu.Value = true;
|
|
91
|
+
|
|
92
|
+
yield return null;
|
|
93
|
+
|
|
94
|
+
inMenu.Value = false;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
97
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
fileFormatVersion: 2
|
|
2
|
-
guid: 9eb2d711effb2a1429ef0c1177b82cd3
|
|
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: 9eb2d711effb2a1429ef0c1177b82cd3
|
|
3
|
+
MonoImporter:
|
|
4
|
+
externalObjects: {}
|
|
5
|
+
serializedVersion: 2
|
|
6
|
+
defaultReferences: []
|
|
7
|
+
executionOrder: 0
|
|
8
|
+
icon: {instanceID: 0}
|
|
9
|
+
userData:
|
|
10
|
+
assetBundleName:
|
|
11
|
+
assetBundleVariant:
|