net.dreditor.roomloading 0.0.0-stage → 0.1.7
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 +64 -0
- package/CheckThreeDModeDuringLoad.cs.meta +11 -0
- package/DRERoomTransition.cs +116 -0
- package/DRERoomTransition.cs.meta +11 -0
- package/DREStartAloneScene.cs +179 -0
- package/DREStartAloneScene.cs.meta +11 -0
- package/DREditor.RoomLoading.asmdef +24 -0
- package/DREditor.RoomLoading.asmdef.meta +7 -0
- package/DialogueRoomLoader.cs +188 -0
- package/DialogueRoomLoader.cs.meta +11 -0
- package/FadeOnEndTransitionFromSave.cs +205 -0
- package/FadeOnEndTransitionFromSave.cs.meta +11 -0
- package/FadeOutGeneratePastOnDebugTest.cs +97 -0
- package/FadeOutGeneratePastOnDebugTest.cs.meta +11 -0
- package/FadeOutOnRoomLoad.cs +75 -0
- package/FadeOutOnRoomLoad.cs.meta +11 -0
- package/FreezeColorRoomTransition.cs +186 -0
- package/FreezeColorRoomTransition.cs.meta +11 -0
- package/IPostTransitionRoutine.cs +17 -0
- package/IPostTransitionRoutine.cs.meta +11 -0
- package/IRoomLoadResolver.cs +15 -0
- package/IRoomLoadResolver.cs.meta +11 -0
- package/IRoomLoadRoutine.cs +17 -0
- package/IRoomLoadRoutine.cs.meta +11 -0
- package/IRoomTransition.cs +39 -0
- package/IRoomTransition.cs.meta +11 -0
- package/ITeleporter.cs +24 -0
- package/ITeleporter.cs.meta +11 -0
- package/InstanceManagerBase.cs +131 -0
- package/InstanceManagerBase.cs.meta +11 -0
- package/KeepStateAfterObjective.cs +74 -0
- package/KeepStateAfterObjective.cs.meta +11 -0
- package/MoveEndOnDialogueFinish.cs +131 -0
- package/MoveEndOnDialogueFinish.cs.meta +11 -0
- package/PastPointData.cs +44 -0
- package/PastPointData.cs.meta +11 -0
- package/PrepareTPFDOnLoadingRoom.cs +68 -0
- package/PrepareTPFDOnLoadingRoom.cs.meta +11 -0
- package/ResolveRoomLoadStates.cs +95 -0
- package/ResolveRoomLoadStates.cs.meta +11 -0
- package/RoomChanger.cs +265 -0
- package/RoomChanger.cs.meta +11 -0
- package/RoomChangerBase.cs +85 -0
- package/RoomChangerBase.cs.meta +11 -0
- package/RoomChangerLoader.cs +90 -0
- package/RoomChangerLoader.cs.meta +11 -0
- package/RoomLoadComponent.cs +13 -0
- package/RoomLoadComponent.cs.meta +11 -0
- package/RoomLoadFinisher.cs +81 -0
- package/RoomLoadFinisher.cs.meta +11 -0
- package/RoomLoadOptionsAsset.cs +45 -0
- package/RoomLoadOptionsAsset.cs.meta +11 -0
- package/RoomLoader.cs +265 -0
- package/RoomLoader.cs.meta +11 -0
- package/RoomLoaderBase.cs +87 -0
- package/RoomLoaderBase.cs.meta +11 -0
- package/RoomLoaderDebugger.cs +151 -0
- package/RoomLoaderDebugger.cs.meta +11 -0
- package/RoomLoaderHolder.cs +10 -0
- package/RoomLoaderHolder.cs.meta +11 -0
- package/Samples~/BlackTransitionOnlyOption.asset +18 -0
- package/Samples~/BlackTransitionOnlyOption.asset.meta +8 -0
- package/Samples~/BlackTransitionToInvestigationOption.asset +18 -0
- package/Samples~/BlackTransitionToInvestigationOption.asset.meta +8 -0
- package/Samples~/Check_ThreeD_Mode_During_Load.prefab +49 -0
- package/Samples~/Check_ThreeD_Mode_During_Load.prefab.meta +7 -0
- package/Samples~/DRE_Start_Alone_Scene.prefab +148 -0
- package/Samples~/DRE_Start_Alone_Scene.prefab.meta +7 -0
- package/Samples~/Dialogue_Room_Loader.prefab +55 -0
- package/Samples~/Dialogue_Room_Loader.prefab.meta +7 -0
- package/Samples~/FadeOutBlackTransitionOption.asset +18 -0
- package/Samples~/FadeOutBlackTransitionOption.asset.meta +8 -0
- package/Samples~/Fade_On_End_Transition_From_Save.prefab +145 -0
- package/Samples~/Fade_On_End_Transition_From_Save.prefab.meta +7 -0
- package/Samples~/Fade_Out_Generate_Past_On_Debug_Test.prefab +139 -0
- package/Samples~/Fade_Out_Generate_Past_On_Debug_Test.prefab.meta +7 -0
- package/Samples~/Fade_Out_On_Room_Load.prefab +137 -0
- package/Samples~/Fade_Out_On_Room_Load.prefab.meta +7 -0
- package/Samples~/Freeze_Transition_Canvas.prefab +300 -0
- package/Samples~/Freeze_Transition_Canvas.prefab.meta +7 -0
- package/Samples~/IsLoadingToRoom.asset +19 -0
- package/Samples~/IsLoadingToRoom.asset.meta +8 -0
- package/Samples~/Move_End_On_Dialogue_Finish.prefab +52 -0
- package/Samples~/Move_End_On_Dialogue_Finish.prefab.meta +7 -0
- package/Samples~/OnFadingOutOfLoading.asset +15 -0
- package/Samples~/OnFadingOutOfLoading.asset.meta +8 -0
- package/Samples~/OnFinishedLoadingRoom.asset +14 -0
- package/Samples~/OnFinishedLoadingRoom.asset.meta +8 -0
- package/Samples~/OnLoadingThreeDRoom.asset +14 -0
- package/Samples~/OnLoadingThreeDRoom.asset.meta +8 -0
- package/Samples~/OnLoadingThreeDRoomListener.prefab +51 -0
- package/Samples~/OnLoadingThreeDRoomListener.prefab.meta +7 -0
- package/Samples~/On_Finished_Loading_Room_Listener.prefab +51 -0
- package/Samples~/On_Finished_Loading_Room_Listener.prefab.meta +7 -0
- package/Samples~/On_Finished_Loading_Room_No_Dialogue_Listener.prefab +51 -0
- package/Samples~/On_Finished_Loading_Room_No_Dialogue_Listener.prefab.meta +7 -0
- package/Samples~/On_Finished_Room_Transitions_Listener.prefab +51 -0
- package/Samples~/On_Finished_Room_Transitions_Listener.prefab.meta +7 -0
- package/Samples~/On_Loading_Room_Listener.prefab +51 -0
- package/Samples~/On_Loading_Room_Listener.prefab.meta +7 -0
- package/Samples~/On_Started_Changing_Room_Listener.prefab +51 -0
- package/Samples~/On_Started_Changing_Room_Listener.prefab.meta +7 -0
- package/Samples~/Prepare_TPFD_On_Room_Loading.prefab +142 -0
- package/Samples~/Prepare_TPFD_On_Room_Loading.prefab.meta +7 -0
- package/Samples~/Resolve_Room_Load_States.prefab +54 -0
- package/Samples~/Resolve_Room_Load_States.prefab.meta +7 -0
- package/Samples~/Room_Changer.prefab +143 -0
- package/Samples~/Room_Changer.prefab.meta +7 -0
- package/Samples~/Room_Changer_Loader.prefab +53 -0
- package/Samples~/Room_Changer_Loader.prefab.meta +7 -0
- package/Samples~/Room_Instance_Manager.prefab +78 -0
- package/Samples~/Room_Instance_Manager.prefab.meta +7 -0
- package/Samples~/Room_Load_Finisher.prefab +139 -0
- package/Samples~/Room_Load_Finisher.prefab.meta +7 -0
- package/Samples~/Room_Loader.prefab +584 -0
- package/Samples~/Room_Loader.prefab.meta +7 -0
- package/Samples~/Room_Loader_Event_Listeners.prefab +337 -0
- package/Samples~/Room_Loader_Event_Listeners.prefab.meta +7 -0
- package/Samples~/Room_Loading_System_ETemplate.prefab +398 -0
- package/Samples~/Room_Loading_System_ETemplate.prefab.meta +7 -0
- package/Samples~/SkipActivateControls.asset +19 -0
- package/Samples~/SkipActivateControls.asset.meta +8 -0
- package/Samples~/Skip_Controls_When_Loaded.prefab +156 -0
- package/Samples~/Skip_Controls_When_Loaded.prefab.meta +7 -0
- package/Samples~/TPFD_Room_Loader.prefab +215 -0
- package/Samples~/TPFD_Room_Loader.prefab.meta +7 -0
- package/Samples~/TeleportTransitionOptions.asset +18 -0
- package/Samples~/TeleportTransitionOptions.asset.meta +8 -0
- package/Samples~/Teleport_Room_Manager.prefab +84 -0
- package/Samples~/Teleport_Room_Manager.prefab.meta +7 -0
- package/Samples~/UI_Visibility_On_Scene_Events.prefab +316 -0
- package/Samples~/UI_Visibility_On_Scene_Events.prefab.meta +7 -0
- package/SkipControlsWhenLoaded.cs +66 -0
- package/SkipControlsWhenLoaded.cs.meta +11 -0
- package/TPFDRoomAnimation.cs +84 -0
- package/TPFDRoomAnimation.cs.meta +11 -0
- package/TPFDRoomLoader.cs +93 -0
- package/TPFDRoomLoader.cs.meta +11 -0
- package/TeleportRoomManager.cs +114 -0
- package/TeleportRoomManager.cs.meta +11 -0
- package/package.json +43 -4
- package/package.json.meta +7 -0
- package/README.md +0 -3
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
+
using System;
|
|
3
|
+
using UnityEngine;
|
|
4
|
+
|
|
5
|
+
namespace DREditor.RoomLoading
|
|
6
|
+
{
|
|
7
|
+
/// <summary>
|
|
8
|
+
///
|
|
9
|
+
/// </summary>
|
|
10
|
+
[Serializable]
|
|
11
|
+
[CreateAssetMenu(menuName = "DREditor/Room Loading/Room Load Options", fileName = "Room Load Options")]
|
|
12
|
+
public class RoomLoadOptionsAsset : ScriptableObject
|
|
13
|
+
{
|
|
14
|
+
/// <summary>
|
|
15
|
+
///
|
|
16
|
+
/// </summary>
|
|
17
|
+
[Tooltip("")]
|
|
18
|
+
public bool toInvestigation = false;
|
|
19
|
+
|
|
20
|
+
/// <summary>
|
|
21
|
+
///
|
|
22
|
+
/// </summary>
|
|
23
|
+
[Tooltip("")]
|
|
24
|
+
public bool blackTransition = false;
|
|
25
|
+
|
|
26
|
+
/// <summary>
|
|
27
|
+
///
|
|
28
|
+
/// </summary>
|
|
29
|
+
[Tooltip("")]
|
|
30
|
+
public bool fadeOutOnLoad = false;
|
|
31
|
+
|
|
32
|
+
/// <summary>
|
|
33
|
+
///
|
|
34
|
+
/// </summary>
|
|
35
|
+
[Tooltip("")]
|
|
36
|
+
public int toWaypoint = -1;
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
/// <summary>
|
|
40
|
+
///
|
|
41
|
+
/// </summary>
|
|
42
|
+
/// <param name="toWaypoint"></param>
|
|
43
|
+
public virtual void SetWaypoint(int toWaypoint) => this.toWaypoint = toWaypoint;
|
|
44
|
+
}
|
|
45
|
+
}
|
package/RoomLoader.cs
ADDED
|
@@ -0,0 +1,265 @@
|
|
|
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 System.Collections.Generic;
|
|
8
|
+
using System.Linq;
|
|
9
|
+
using UnityEngine;
|
|
10
|
+
using UnityEngine.SceneManagement;
|
|
11
|
+
|
|
12
|
+
namespace DREditor.RoomLoading
|
|
13
|
+
{
|
|
14
|
+
/// <summary>
|
|
15
|
+
///
|
|
16
|
+
/// </summary>
|
|
17
|
+
[ClassHeader(nameof(ServiceHolder<RoomLoaderBase>) + " for type: " + nameof(RoomLoaderBase) +
|
|
18
|
+
"\n\n")]
|
|
19
|
+
public class RoomLoader : RoomLoaderBase
|
|
20
|
+
{
|
|
21
|
+
/// <summary>
|
|
22
|
+
///
|
|
23
|
+
/// </summary>
|
|
24
|
+
[Tooltip("")]
|
|
25
|
+
[SerializeField] protected SceneEvent onSetPlayerState = null;
|
|
26
|
+
|
|
27
|
+
/// <summary>
|
|
28
|
+
///
|
|
29
|
+
/// </summary>
|
|
30
|
+
[Tooltip("")]
|
|
31
|
+
[SerializeField] protected SceneEvent setControlsUIBasedOnCurrentMode = null;
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
/// <summary>
|
|
35
|
+
///
|
|
36
|
+
/// </summary>
|
|
37
|
+
[Header("")]
|
|
38
|
+
[Divider]
|
|
39
|
+
[Tooltip("")]
|
|
40
|
+
[SerializeField] bool debugLoadRoomOnStart = false;
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
/// <summary>
|
|
44
|
+
///
|
|
45
|
+
/// </summary>
|
|
46
|
+
[Header("")]
|
|
47
|
+
[Divider]
|
|
48
|
+
[Tooltip("")]
|
|
49
|
+
[SerializeField] protected List<RoomLoadComponent> roomLoadRoutines = new();
|
|
50
|
+
|
|
51
|
+
/// <summary>
|
|
52
|
+
///
|
|
53
|
+
/// </summary>
|
|
54
|
+
[Tooltip("")]
|
|
55
|
+
[SerializeField] protected List<RoomLoadComponent> roomLoadResolvers = new();
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
/// <summary>
|
|
59
|
+
///
|
|
60
|
+
/// </summary>
|
|
61
|
+
[Header("")]
|
|
62
|
+
[Divider]
|
|
63
|
+
[Tooltip("")]
|
|
64
|
+
[SerializeField] protected BoolWithEvent isLoadingToRoom = null;
|
|
65
|
+
|
|
66
|
+
/// <summary>
|
|
67
|
+
///
|
|
68
|
+
/// </summary>
|
|
69
|
+
[Tooltip("")]
|
|
70
|
+
[SerializeField] protected BoolWithEvent inDialogue = null;
|
|
71
|
+
|
|
72
|
+
/// <summary>
|
|
73
|
+
///
|
|
74
|
+
/// </summary>
|
|
75
|
+
[Tooltip("")]
|
|
76
|
+
[SerializeField] protected BoolWithEvent inTrialMode = null;
|
|
77
|
+
|
|
78
|
+
/// <summary>
|
|
79
|
+
///
|
|
80
|
+
/// </summary>
|
|
81
|
+
[Tooltip("")]
|
|
82
|
+
[SerializeField] protected BoolWithEvent skipActivateControls = null;
|
|
83
|
+
|
|
84
|
+
/// <summary>
|
|
85
|
+
///
|
|
86
|
+
/// </summary>
|
|
87
|
+
[Tooltip("")]
|
|
88
|
+
[SerializeField] protected BoolWithEvent isLoadingFile = null;
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
/// <summary>
|
|
92
|
+
///
|
|
93
|
+
/// </summary>
|
|
94
|
+
[Header("")]
|
|
95
|
+
[Divider]
|
|
96
|
+
[Tooltip("")]
|
|
97
|
+
[SerializeField] protected float setPlayerPositionBufferTime = 0.1f;
|
|
98
|
+
|
|
99
|
+
/// <summary>
|
|
100
|
+
///
|
|
101
|
+
/// </summary>
|
|
102
|
+
[Tooltip("")]
|
|
103
|
+
[SerializeField] protected string enableMonoControlsEvent = "EnableControlMonobehaviour";
|
|
104
|
+
|
|
105
|
+
/// <summary>
|
|
106
|
+
///
|
|
107
|
+
/// </summary>
|
|
108
|
+
[Tooltip("")]
|
|
109
|
+
[SerializeField] protected string disableControlsEvent = "DisableAbility";
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
/// <summary>
|
|
113
|
+
///
|
|
114
|
+
/// </summary>
|
|
115
|
+
protected virtual void Start()
|
|
116
|
+
{
|
|
117
|
+
if (debugLoadRoomOnStart)
|
|
118
|
+
LoadRoom(SceneManager.GetActiveScene(), LoadSceneMode.Single);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/// <inheritdoc/>
|
|
122
|
+
public override void AllowRoomsToLoad() => SceneManager.sceneLoaded += LoadRoom;
|
|
123
|
+
|
|
124
|
+
/// <inheritdoc/>
|
|
125
|
+
public override void DoNotAllowRoomsToLoad() => SceneManager.sceneLoaded -= LoadRoom;
|
|
126
|
+
|
|
127
|
+
/// <summary>
|
|
128
|
+
///
|
|
129
|
+
/// </summary>
|
|
130
|
+
/// <param name="scene"></param>
|
|
131
|
+
/// <param name="mode"></param>
|
|
132
|
+
protected virtual void LoadRoom(Scene scene, LoadSceneMode mode) => StartCoroutine(LoadIntoRoom(scene));
|
|
133
|
+
|
|
134
|
+
/// <summary>
|
|
135
|
+
///
|
|
136
|
+
/// </summary>
|
|
137
|
+
/// <param name="scene"></param>
|
|
138
|
+
protected virtual IEnumerator LoadIntoRoom(Scene scene)
|
|
139
|
+
{
|
|
140
|
+
if (AlreadyLoadingRoom(scene.name))
|
|
141
|
+
yield break;
|
|
142
|
+
|
|
143
|
+
isLoadingToRoom.SetValue(true);
|
|
144
|
+
|
|
145
|
+
onLoadingRoom.Raise();
|
|
146
|
+
|
|
147
|
+
DialogueEventSystem.TriggerEvent(disableControlsEvent);
|
|
148
|
+
|
|
149
|
+
onSetPlayerState.Raise();
|
|
150
|
+
|
|
151
|
+
yield return new WaitForSeconds(setPlayerPositionBufferTime);
|
|
152
|
+
|
|
153
|
+
yield return OnRoomLoadRoutines();
|
|
154
|
+
|
|
155
|
+
yield return DisplayEndTransitions();
|
|
156
|
+
|
|
157
|
+
OnRoomLoadResolvers();
|
|
158
|
+
|
|
159
|
+
EnableControlsFinishLoadingFile();
|
|
160
|
+
|
|
161
|
+
FinishRoomLoadingEvents();
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/// <summary>
|
|
165
|
+
///
|
|
166
|
+
/// </summary>
|
|
167
|
+
/// <param name="sceneName"></param>
|
|
168
|
+
/// <returns></returns>
|
|
169
|
+
protected virtual bool AlreadyLoadingRoom(string sceneName)
|
|
170
|
+
{
|
|
171
|
+
if (isLoadingToRoom.Value)
|
|
172
|
+
UnityEngine.Debug.LogWarning($"ALERT: {gameObject.name}: The game is already fading into the desired room.");
|
|
173
|
+
else
|
|
174
|
+
UnityEngine.Debug.Log($"REPORT: {gameObject.name}: Scene: " + sceneName + " is now Loading");
|
|
175
|
+
|
|
176
|
+
return isLoadingToRoom.Value;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/// <summary>
|
|
180
|
+
///
|
|
181
|
+
/// </summary>
|
|
182
|
+
protected virtual IEnumerator DisplayEndTransitions()
|
|
183
|
+
{
|
|
184
|
+
bool notLoadingIntoTrialOrDialogueFile = !isLoadingFile.Value && !inTrialMode.Value && !inDialogue.Value;
|
|
185
|
+
|
|
186
|
+
if (notLoadingIntoTrialOrDialogueFile && !ServiceLocator.GetService<GlobalFade>().IsDark)
|
|
187
|
+
yield return ServiceLocator.GetService<IRoomTransition>().EndTransitionRoutine();
|
|
188
|
+
|
|
189
|
+
yield return DisplayPostTransitions();
|
|
190
|
+
|
|
191
|
+
onFinishedRoomTransitions.Raise();
|
|
192
|
+
|
|
193
|
+
UnityEngine.Debug.Log($"REPORT: {gameObject.name}: Room Transitions finished, finishing up loading.");
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/// <summary>
|
|
197
|
+
///
|
|
198
|
+
/// </summary>
|
|
199
|
+
protected virtual IEnumerator DisplayPostTransitions()
|
|
200
|
+
{
|
|
201
|
+
if (FindObjectsByType<MonoBehaviour>().OfType<IPostTransitionRoutine>() is IPostTransitionRoutine[] result)
|
|
202
|
+
foreach (IPostTransitionRoutine postTransition in result)
|
|
203
|
+
yield return postTransition.PostTransitionRoutine();
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/// <summary>
|
|
207
|
+
///
|
|
208
|
+
/// </summary>
|
|
209
|
+
protected virtual void EnableControlsFinishLoadingFile()
|
|
210
|
+
{
|
|
211
|
+
if (!inTrialMode.Value && !skipActivateControls.Value)
|
|
212
|
+
DialogueEventSystem.TriggerEvent(enableMonoControlsEvent);
|
|
213
|
+
|
|
214
|
+
if (isLoadingFile.Value)
|
|
215
|
+
isLoadingFile.SetValue(false);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
/// <summary>
|
|
219
|
+
///
|
|
220
|
+
/// </summary>
|
|
221
|
+
protected virtual IEnumerator OnRoomLoadRoutines()
|
|
222
|
+
{
|
|
223
|
+
foreach (RoomLoadComponent roomLoadComponent in roomLoadRoutines)
|
|
224
|
+
if (roomLoadComponent is IRoomLoadRoutine roomLoadRoutine)
|
|
225
|
+
yield return roomLoadRoutine.OnRoomLoadRoutine();
|
|
226
|
+
else
|
|
227
|
+
UnityEngine.Debug.LogWarning($"ALERT: {gameObject.name}: " +
|
|
228
|
+
$"{roomLoadComponent.name} does not inherit the specified interface.");
|
|
229
|
+
|
|
230
|
+
yield break;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
/// <summary>
|
|
234
|
+
///
|
|
235
|
+
/// </summary>
|
|
236
|
+
protected virtual void OnRoomLoadResolvers()
|
|
237
|
+
{
|
|
238
|
+
foreach (RoomLoadComponent roomLoadComponent in roomLoadResolvers)
|
|
239
|
+
if (roomLoadComponent is IRoomLoadResolver roomLoadResolver)
|
|
240
|
+
roomLoadResolver.OnRoomLoadResolve();
|
|
241
|
+
else
|
|
242
|
+
UnityEngine.Debug.LogWarning($"ALERT: {gameObject.name}: " +
|
|
243
|
+
$"{roomLoadComponent.name} does not inherit the specified interface.");
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
/// <summary>
|
|
247
|
+
///
|
|
248
|
+
/// </summary>
|
|
249
|
+
protected virtual void FinishRoomLoadingEvents()
|
|
250
|
+
{
|
|
251
|
+
UnityEngine.Debug.Log($"REPORT: {gameObject.name}: Finished loading room.");
|
|
252
|
+
|
|
253
|
+
onFinishedLoadingRoom.Raise();
|
|
254
|
+
|
|
255
|
+
if (!inDialogue.Value)
|
|
256
|
+
{
|
|
257
|
+
onFinishedLoadingRoomNoDialogue.Raise();
|
|
258
|
+
|
|
259
|
+
setControlsUIBasedOnCurrentMode.Raise();
|
|
260
|
+
}
|
|
261
|
+
else
|
|
262
|
+
UnityEngine.Debug.Log($"REPORT: {gameObject.name}: End of RoomLoader with In Dialogue True.");
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
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.Generic;
|
|
5
|
+
using UnityEngine;
|
|
6
|
+
|
|
7
|
+
namespace DREditor.RoomLoading
|
|
8
|
+
{
|
|
9
|
+
/// <summary>
|
|
10
|
+
///
|
|
11
|
+
/// </summary>
|
|
12
|
+
public abstract class RoomLoaderBase : ServiceHolder<RoomLoaderBase>, ISceneEventListener, IToTitleScreen
|
|
13
|
+
{
|
|
14
|
+
/// <summary>
|
|
15
|
+
///
|
|
16
|
+
/// </summary>
|
|
17
|
+
[Header("")]
|
|
18
|
+
[Space]
|
|
19
|
+
[Header("")]
|
|
20
|
+
[Divider]
|
|
21
|
+
[Tooltip("")]
|
|
22
|
+
[SerializeField] protected List<SceneEvent> allowRoomsToLoadOn = new();
|
|
23
|
+
|
|
24
|
+
/// <summary>
|
|
25
|
+
///
|
|
26
|
+
/// </summary>
|
|
27
|
+
[Space]
|
|
28
|
+
|
|
29
|
+
[Tooltip("")]
|
|
30
|
+
[SerializeField] protected SceneEvent onLoadingRoom = null;
|
|
31
|
+
|
|
32
|
+
/// <summary>
|
|
33
|
+
///
|
|
34
|
+
/// </summary>
|
|
35
|
+
[Tooltip("")]
|
|
36
|
+
[SerializeField] protected SceneEvent onFinishedRoomTransitions = null;
|
|
37
|
+
|
|
38
|
+
/// <summary>
|
|
39
|
+
///
|
|
40
|
+
/// </summary>
|
|
41
|
+
[Tooltip("")]
|
|
42
|
+
[SerializeField] protected SceneEvent onFinishedLoadingRoom = null;
|
|
43
|
+
|
|
44
|
+
/// <summary>
|
|
45
|
+
///
|
|
46
|
+
/// </summary>
|
|
47
|
+
[Tooltip("")]
|
|
48
|
+
[SerializeField] protected SceneEvent onFinishedLoadingRoomNoDialogue = null;
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
/// <summary>
|
|
52
|
+
///
|
|
53
|
+
/// </summary>
|
|
54
|
+
protected virtual void OnEnable()
|
|
55
|
+
{
|
|
56
|
+
foreach(SceneEvent sceneEvent in allowRoomsToLoadOn)
|
|
57
|
+
sceneEvent.RegisterListener(this);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/// <summary>
|
|
61
|
+
///
|
|
62
|
+
/// </summary>
|
|
63
|
+
protected virtual void OnDisable()
|
|
64
|
+
{
|
|
65
|
+
foreach (SceneEvent sceneEvent in allowRoomsToLoadOn)
|
|
66
|
+
sceneEvent.UnregisterListener(this);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
/// <summary>
|
|
71
|
+
///
|
|
72
|
+
/// </summary>
|
|
73
|
+
public abstract void AllowRoomsToLoad();
|
|
74
|
+
|
|
75
|
+
/// <summary>
|
|
76
|
+
///
|
|
77
|
+
/// </summary>
|
|
78
|
+
public abstract void DoNotAllowRoomsToLoad();
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
/// <inheritdoc/>
|
|
82
|
+
public virtual void OnEventRaised() => AllowRoomsToLoad();
|
|
83
|
+
|
|
84
|
+
/// <inheritdoc/>
|
|
85
|
+
public virtual void ToTitleScreen() => DoNotAllowRoomsToLoad();
|
|
86
|
+
}
|
|
87
|
+
}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
+
using DREditor.EventObjects;
|
|
3
|
+
using DREditor.Gates;
|
|
4
|
+
using UnityEngine;
|
|
5
|
+
|
|
6
|
+
namespace DREditor.RoomLoading
|
|
7
|
+
{
|
|
8
|
+
/// <summary>
|
|
9
|
+
///
|
|
10
|
+
/// </summary>
|
|
11
|
+
[ClassHeader("")]
|
|
12
|
+
public class RoomLoaderDebugger : MonoBehaviour
|
|
13
|
+
{
|
|
14
|
+
/// <summary>
|
|
15
|
+
///
|
|
16
|
+
/// </summary>
|
|
17
|
+
[Tooltip("")]
|
|
18
|
+
[SerializeField] protected TransformWithEvent playerSpawnPoint = null;
|
|
19
|
+
|
|
20
|
+
/// <summary>
|
|
21
|
+
///
|
|
22
|
+
/// </summary>
|
|
23
|
+
[Tooltip("")]
|
|
24
|
+
[SerializeField] protected SceneEvent onSetPlayerState = null;
|
|
25
|
+
|
|
26
|
+
/// <summary>
|
|
27
|
+
///
|
|
28
|
+
/// </summary>
|
|
29
|
+
[Tooltip("")]
|
|
30
|
+
[SerializeField] protected SceneEvent onFinishedRoomTransitions = null;
|
|
31
|
+
|
|
32
|
+
/// <summary>
|
|
33
|
+
///
|
|
34
|
+
/// </summary>
|
|
35
|
+
[Tooltip("")]
|
|
36
|
+
[SerializeField] protected SceneEvent onFinishedLoadingRoomNoDialogue = null;
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
/// <summary>
|
|
40
|
+
///
|
|
41
|
+
/// </summary>
|
|
42
|
+
[Header("")]
|
|
43
|
+
[Divider]
|
|
44
|
+
[Tooltip("")]
|
|
45
|
+
[SerializeField] bool debugTestOnLoad = false;
|
|
46
|
+
|
|
47
|
+
/// <summary>
|
|
48
|
+
///
|
|
49
|
+
/// </summary>
|
|
50
|
+
[Tooltip("")]
|
|
51
|
+
[SerializeField] bool debugMoveArea = false;
|
|
52
|
+
|
|
53
|
+
/// <summary>
|
|
54
|
+
///
|
|
55
|
+
/// </summary>
|
|
56
|
+
[Tooltip("")]
|
|
57
|
+
[SerializeField] bool debugLoadPositionFromGate = false;
|
|
58
|
+
|
|
59
|
+
/// <summary>
|
|
60
|
+
///
|
|
61
|
+
/// </summary>
|
|
62
|
+
[Tooltip("")]
|
|
63
|
+
[SerializeField] Gate debugToGate = null;
|
|
64
|
+
|
|
65
|
+
/// <summary>
|
|
66
|
+
///
|
|
67
|
+
/// </summary>
|
|
68
|
+
[Tooltip("")]
|
|
69
|
+
[SerializeField] Gate debugFromGate = null;
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
/// <summary>
|
|
73
|
+
///
|
|
74
|
+
/// </summary>
|
|
75
|
+
[Header("")]
|
|
76
|
+
[Divider]
|
|
77
|
+
[Tooltip("")]
|
|
78
|
+
[SerializeField] protected RoomChangerBase roomChanger = null;
|
|
79
|
+
|
|
80
|
+
/// <summary>
|
|
81
|
+
///
|
|
82
|
+
/// </summary>
|
|
83
|
+
[Tooltip("")]
|
|
84
|
+
[SerializeField] protected RoomLoaderBase roomLoader = null;
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
/// <summary>
|
|
88
|
+
///
|
|
89
|
+
/// </summary>
|
|
90
|
+
protected virtual void Start() => DebugRoomLoader();
|
|
91
|
+
|
|
92
|
+
/// <summary>
|
|
93
|
+
///
|
|
94
|
+
/// </summary>
|
|
95
|
+
protected virtual void DebugRoomLoader()
|
|
96
|
+
{
|
|
97
|
+
if (debugMoveArea || debugTestOnLoad || debugLoadPositionFromGate)
|
|
98
|
+
roomLoader.AllowRoomsToLoad();
|
|
99
|
+
|
|
100
|
+
if (debugTestOnLoad)
|
|
101
|
+
DebugTestOnLoad();
|
|
102
|
+
|
|
103
|
+
if (debugLoadPositionFromGate)
|
|
104
|
+
DebugLoadPositionFromGate(debugToGate, debugFromGate);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/// <summary>
|
|
108
|
+
///
|
|
109
|
+
/// </summary>
|
|
110
|
+
/// <param name="debugToGate"></param>
|
|
111
|
+
/// <param name="debugFromGate"></param>
|
|
112
|
+
protected virtual void DebugLoadPositionFromGate(Gate debugToGate, Gate debugFromGate)
|
|
113
|
+
{
|
|
114
|
+
if (debugToGate != null && debugFromGate != null)
|
|
115
|
+
roomChanger.SetDestination(debugToGate);
|
|
116
|
+
else
|
|
117
|
+
UnityEngine.Debug.LogError($"ALERT: ERROR: {ToString()}: Debugging when DebugToGate or FromGate hasn't been filled!");
|
|
118
|
+
|
|
119
|
+
GateFrom fromG = debugToGate.GetFromLocation(debugFromGate);
|
|
120
|
+
|
|
121
|
+
if (fromG != null)
|
|
122
|
+
SetSpawnPositionAndRotation(fromG.position, fromG.rotation);
|
|
123
|
+
else
|
|
124
|
+
SetSpawnPositionAndRotation(Vector3.zero, Vector3.zero);
|
|
125
|
+
|
|
126
|
+
onSetPlayerState.Raise();
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/// <summary>
|
|
130
|
+
///
|
|
131
|
+
/// </summary>
|
|
132
|
+
/// <param name="position"></param>
|
|
133
|
+
/// <param name="rotation"></param>
|
|
134
|
+
protected virtual void SetSpawnPositionAndRotation(Vector3 position, Vector3 rotation)
|
|
135
|
+
=> playerSpawnPoint.SetValue(new(position, Quaternion.Euler(rotation)));
|
|
136
|
+
|
|
137
|
+
/// <summary>
|
|
138
|
+
///
|
|
139
|
+
/// </summary>
|
|
140
|
+
protected virtual void DebugTestOnLoad()
|
|
141
|
+
{
|
|
142
|
+
UnityEngine.Debug.LogWarning($"ALERT: {ToString()}: DebugTestOnLoad is ON in debugging. This should only be on to test" +
|
|
143
|
+
" OnLoad Events/Triggers, otherwise it should be turned OFF. \n DO NOT USE THIS TO TEST " +
|
|
144
|
+
"AN ROOM SAVE, THE ONLOAD CALLS ARE CALLED ON START WHEN THIS IS ACTIVE.");
|
|
145
|
+
|
|
146
|
+
onFinishedRoomTransitions.Raise();
|
|
147
|
+
|
|
148
|
+
onFinishedLoadingRoomNoDialogue.Raise();
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
+
using DREditor.Services;
|
|
3
|
+
|
|
4
|
+
namespace DREditor.RoomLoading
|
|
5
|
+
{
|
|
6
|
+
/// <summary>
|
|
7
|
+
///
|
|
8
|
+
/// </summary>
|
|
9
|
+
public class RoomLoaderHolder : ServiceHolder<RoomLoaderHolder> { }
|
|
10
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
%YAML 1.1
|
|
2
|
+
%TAG !u! tag:unity3d.com,2011:
|
|
3
|
+
--- !u!114 &11400000
|
|
4
|
+
MonoBehaviour:
|
|
5
|
+
m_ObjectHideFlags: 0
|
|
6
|
+
m_CorrespondingSourceObject: {fileID: 0}
|
|
7
|
+
m_PrefabInstance: {fileID: 0}
|
|
8
|
+
m_PrefabAsset: {fileID: 0}
|
|
9
|
+
m_GameObject: {fileID: 0}
|
|
10
|
+
m_Enabled: 1
|
|
11
|
+
m_EditorHideFlags: 0
|
|
12
|
+
m_Script: {fileID: 11500000, guid: e6f2e58ae8a9c27469b399a474b71cad, type: 3}
|
|
13
|
+
m_Name: BlackTransitionOnlyOption
|
|
14
|
+
m_EditorClassIdentifier:
|
|
15
|
+
toInvestigation: 0
|
|
16
|
+
blackTransition: 1
|
|
17
|
+
fadeOutOnLoad: 0
|
|
18
|
+
toWaypoint: -1
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
%YAML 1.1
|
|
2
|
+
%TAG !u! tag:unity3d.com,2011:
|
|
3
|
+
--- !u!114 &11400000
|
|
4
|
+
MonoBehaviour:
|
|
5
|
+
m_ObjectHideFlags: 0
|
|
6
|
+
m_CorrespondingSourceObject: {fileID: 0}
|
|
7
|
+
m_PrefabInstance: {fileID: 0}
|
|
8
|
+
m_PrefabAsset: {fileID: 0}
|
|
9
|
+
m_GameObject: {fileID: 0}
|
|
10
|
+
m_Enabled: 1
|
|
11
|
+
m_EditorHideFlags: 0
|
|
12
|
+
m_Script: {fileID: 11500000, guid: e6f2e58ae8a9c27469b399a474b71cad, type: 3}
|
|
13
|
+
m_Name: BlackTransitionToInvestigationOption
|
|
14
|
+
m_EditorClassIdentifier:
|
|
15
|
+
toInvestigation: 1
|
|
16
|
+
blackTransition: 1
|
|
17
|
+
fadeOutOnLoad: 0
|
|
18
|
+
toWaypoint: -1
|