mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2024-12-29 12:21:25 +00:00
38 lines
764 B
C#
38 lines
764 B
C#
using UnityEngine;
|
|
|
|
namespace QSB.Utility;
|
|
|
|
public class DebugCameraSettings : MonoBehaviour, IAddComponentOnStart
|
|
{
|
|
public static void UpdateFromDebugSetting()
|
|
{
|
|
if (QSBCore.DebugSettings.GreySkybox)
|
|
{
|
|
QSBSceneManager.OnSceneLoaded += OnSceneLoaded;
|
|
if (Camera.main)
|
|
{
|
|
Camera.main.backgroundColor = Color.gray;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
QSBSceneManager.OnSceneLoaded -= OnSceneLoaded;
|
|
if (Camera.main)
|
|
{
|
|
Camera.main.backgroundColor = _origColor;
|
|
}
|
|
}
|
|
}
|
|
|
|
private static Color _origColor;
|
|
|
|
private void Awake()
|
|
{
|
|
_origColor = Camera.main.backgroundColor;
|
|
UpdateFromDebugSetting();
|
|
Destroy(this);
|
|
}
|
|
|
|
private static void OnSceneLoaded(OWScene arg1, OWScene arg2, bool arg3)
|
|
=> Camera.main.backgroundColor = Color.gray;
|
|
} |