mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-01 03:32:38 +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();
|
public static bool IsInUniverse => CurrentScene.IsUniverseScene();
|
||||||
|
|
||||||
[Obsolete]
|
[Obsolete("TODO: remove after migration")]
|
||||||
public static event Action<OWScene, OWScene, bool> OnSceneLoaded;
|
public static event Action<OWScene, OWScene, bool> OnSceneLoaded;
|
||||||
[Obsolete]
|
[Obsolete("TODO: remove after migration")]
|
||||||
public static event Action<OWScene, OWScene> OnUniverseSceneLoaded;
|
public static event Action<OWScene, OWScene> OnUniverseSceneLoaded;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -30,6 +30,8 @@ public static class QSBSceneManager
|
|||||||
|
|
||||||
static QSBSceneManager()
|
static QSBSceneManager()
|
||||||
{
|
{
|
||||||
|
LoadManager.OnCompleteSceneLoad += OnCompleteSceneLoad;
|
||||||
|
|
||||||
LoadManager.OnStartSceneLoad += (originalScene, loadScene) =>
|
LoadManager.OnStartSceneLoad += (originalScene, loadScene) =>
|
||||||
{
|
{
|
||||||
DebugLog.DebugWrite($"PRE SCENE LOAD ({originalScene} -> {loadScene})", MessageType.Info);
|
DebugLog.DebugWrite($"PRE SCENE LOAD ({originalScene} -> {loadScene})", MessageType.Info);
|
||||||
@ -45,6 +47,18 @@ public static class QSBSceneManager
|
|||||||
DebugLog.DebugWrite("Scene Manager ready.", MessageType.Success);
|
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) =>
|
public static bool IsUniverseScene(this OWScene scene) =>
|
||||||
scene is OWScene.SolarSystem or OWScene.EyeOfTheUniverse;
|
scene is OWScene.SolarSystem or OWScene.EyeOfTheUniverse;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user