Simplify Singleton in RendererUIManager

This commit is contained in:
copecone committed 2026-10-07 11:47:40 +09:00
1 parent b43c8be5dc
commit a523efd4fc
2 files changed
+3 -18

No files matched your search

+1 -1
View File
@@ -131,7 +131,7 @@ public static class scnGamePatch
var isLooping = __instance.levelData.miscSettings.GetBool("loopVideo");
// Initialize player. If targetTexture is null (CameraFarPlane mode), it will build a quad in front of targetCamera.
player.Init(videoPath, __instance.videoBG?.targetTexture, isLooping, targetCamera, __instance.videoBG.gameObject);
player.Init(videoPath, __instance.videoBG.targetTexture, isLooping, targetCamera, __instance.videoBG.gameObject);
return false; // Skip original UpdateVideo
}
+2 -17
View File
@@ -50,20 +50,7 @@ internal sealed class RendererFontProvider : IFontProvider
internal class RendererUIManager : MonoBehaviour
{
private static RendererUIManager? _instance;
public static RendererUIManager Instance
{
get
{
if (_instance != null) return _instance;
var go = new GameObject("RendererUIManager");
DontDestroyOnLoad(go);
_instance = go.AddComponent<RendererUIManager>();
return _instance;
}
}
public static RendererUIManager Instance = null!;
public static O5Context Context => Instance._context;
public O5WindowManager WindowManager => _windowManager;
@@ -72,7 +59,7 @@ internal class RendererUIManager : MonoBehaviour
private O5WindowManager _windowManager = null!;
private void Awake() {
_instance = this;
Instance = this;
_context = new O5Context(
config: new O5Config {
@@ -118,7 +105,5 @@ internal class RendererUIManager : MonoBehaviour
private void OnDestroy() {
_windowManager.Dispose();
_context.Dispose();
if (_instance == this) _instance = null;
}
}