This commit is contained in:
DCFApixels 2025-02-28 09:28:47 +08:00
parent 6eb6e61d02
commit c91c27c1cb

View File

@ -57,8 +57,23 @@ namespace DCFApixels
if (camera == null) { return; } if (camera == null) { return; }
InitStatic(); InitStatic();
var zoom = GetCameraZoom(camera); var zoom = GetCameraZoom(camera);
var isSceneView = camera.name == "SceneCamera"; bool isSceneView = false;
//Handles.BeginGUI(); #if UNITY_EDITOR
isSceneView = camera.name == "SceneCamera";
#endif
if (isSceneView)
{
#if UNITY_EDITOR
Handles.BeginGUI();
#endif
}
else
{
GL.PushMatrix();
//GL.LoadPixelMatrix(0, Screen.width, Screen.height - (isSceneView ? 50 : 0), 0);
GL.LoadPixelMatrix(0, Screen.width, Screen.height, 0);
}
foreach (ref readonly var item in list) foreach (ref readonly var item in list)
{ {
_labelDummy.text = item.Value.Text; _labelDummy.text = item.Value.Text;
@ -73,8 +88,7 @@ namespace DCFApixels
{ {
Rect rect = WorldPointToSizedRect(camera, item.Value.Position, _labelDummy, _labelStyle); Rect rect = WorldPointToSizedRect(camera, item.Value.Position, _labelDummy, _labelStyle);
GL.PushMatrix();
GL.LoadPixelMatrix(0, Screen.width, Screen.height - (isSceneView ? 50 : 0), 0);
Color c = item.Value.Settings.BackgroundColor * GlobalColor; Color c = item.Value.Settings.BackgroundColor * GlobalColor;
@ -87,11 +101,21 @@ namespace DCFApixels
style.Draw(rect, _labelDummy, false, false, false, false); style.Draw(rect, _labelDummy, false, false, false, false);
GL.PopMatrix();
} }
} }
GUI.color = dfColor; GUI.color = dfColor;
DebugXAssets.Materials.Unlit.SetColor(ColorPropertyID, Color.white); DebugXAssets.Materials.Unlit.SetColor(ColorPropertyID, Color.white);
if (isSceneView)
{
#if UNITY_EDITOR
Handles.EndGUI();
#endif
}
else
{
GL.PopMatrix();
}
} }