mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2024-12-29 03:28:26 +00:00
obsolete
This commit is contained in:
parent
55287814e7
commit
bedf50262f
@ -12,9 +12,9 @@ public static class QSBSceneManager
|
||||
|
||||
public static bool IsInUniverse => CurrentScene.IsUniverseScene();
|
||||
|
||||
[Obsolete]
|
||||
[Obsolete("TODO: remove after migration")]
|
||||
public static event Action<OWScene, OWScene, bool> OnSceneLoaded;
|
||||
[Obsolete]
|
||||
[Obsolete("TODO: remove after migration")]
|
||||
public static event Action<OWScene, OWScene> OnUniverseSceneLoaded;
|
||||
|
||||
/// <summary>
|
||||
@ -30,6 +30,8 @@ public static class QSBSceneManager
|
||||
|
||||
static QSBSceneManager()
|
||||
{
|
||||
LoadManager.OnCompleteSceneLoad += OnCompleteSceneLoad;
|
||||
|
||||
LoadManager.OnStartSceneLoad += (originalScene, loadScene) =>
|
||||
{
|
||||
DebugLog.DebugWrite($"PRE SCENE LOAD ({originalScene} -> {loadScene})", MessageType.Info);
|
||||
@ -45,6 +47,18 @@ public static class QSBSceneManager
|
||||
DebugLog.DebugWrite("Scene Manager ready.", MessageType.Success);
|
||||
}
|
||||
|
||||
[Obsolete("TODO: remove after migration")]
|
||||
private static void OnCompleteSceneLoad(OWScene oldScene, OWScene newScene)
|
||||
{
|
||||
var universe = newScene.IsUniverseScene();
|
||||
|
||||
OnSceneLoaded?.SafeInvoke(oldScene, newScene, universe);
|
||||
if (universe)
|
||||
{
|
||||
OnUniverseSceneLoaded?.SafeInvoke(oldScene, newScene);
|
||||
}
|
||||
}
|
||||
|
||||
public static bool IsUniverseScene(this OWScene scene) =>
|
||||
scene is OWScene.SolarSystem or OWScene.EyeOfTheUniverse;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user