Fixed small issues found in playtesting

This commit is contained in:
Pasha Bibko
2026-01-29 13:54:10 +00:00
parent 13af242e69
commit 69fd62b3ac
8 changed files with 39 additions and 14 deletions

View File

@@ -0,0 +1,33 @@
using UnityEngine;
public class CamRatioFixer : MonoBehaviour
{
public Camera cam;
void Update()
{
float targetAspect = 16f / 9f;
float windowAspect = (float)Screen.width / Screen.height;
float scale = windowAspect / targetAspect;
if (scale < 1f)
{
cam.rect = new Rect(
0,
(1f - scale) / 2f,
1f,
scale
);
}
else
{
float width = 1f / scale;
cam.rect = new Rect(
(1f - width) / 2f,
0,
width,
1f
);
}
}
}