quantum-space-buddies/QSB/Utility/DebugCameraSettings.cs
2022-01-18 16:10:05 -08:00

33 lines
678 B
C#

using UnityEngine;
namespace QSB.Utility
{
internal class DebugCameraSettings : MonoBehaviour
{
public static void UpdateFromDebugSetting()
{
if (QSBCore.GreySkybox)
{
QSBSceneManager.OnSceneLoaded += OnSceneLoaded;
Camera.main.backgroundColor = Color.gray;
}
else
{
QSBSceneManager.OnSceneLoaded -= OnSceneLoaded;
Camera.main.backgroundColor = _origColor;
}
}
private static Color _origColor;
private void Start()
{
_origColor = Camera.main.backgroundColor;
UpdateFromDebugSetting();
}
private static void OnSceneLoaded(OWScene arg1, OWScene arg2, bool arg3)
=> Camera.main.backgroundColor = Color.gray;
}
}