quantum-space-buddies/QSB/Utility/DebugCameraSettings.cs

33 lines
692 B
C#
Raw Normal View History

2021-12-30 13:55:41 +00:00
using UnityEngine;
namespace QSB.Utility
{
internal class DebugCameraSettings : MonoBehaviour
{
2022-01-18 15:50:20 -08:00
public static void UpdateFromDebugSetting()
2021-12-30 13:55:41 +00:00
{
2022-01-20 22:33:03 +00:00
if (QSBCore.DebugSettings.GreySkybox)
2021-12-30 13:55:41 +00:00
{
QSBSceneManager.OnSceneLoaded += OnSceneLoaded;
Camera.main.backgroundColor = Color.gray;
}
2022-01-18 15:50:20 -08:00
else
{
QSBSceneManager.OnSceneLoaded -= OnSceneLoaded;
Camera.main.backgroundColor = _origColor;
}
}
private static Color _origColor;
private void Start()
{
_origColor = Camera.main.backgroundColor;
UpdateFromDebugSetting();
2021-12-30 13:55:41 +00:00
}
2022-01-18 15:50:20 -08:00
private static void OnSceneLoaded(OWScene arg1, OWScene arg2, bool arg3)
2021-12-30 13:55:41 +00:00
=> Camera.main.backgroundColor = Color.gray;
}
}