好多新内容

This commit is contained in:
2026-07-22 05:35:53 +08:00
parent b5d1cdcbc5
commit 15649d02f8
128 changed files with 5956 additions and 673 deletions
+11
View File
@@ -6,6 +6,10 @@ public class CameraLetterbox : MonoBehaviour
{
public float targetAspect = 16f / 9f;
// 关闭时相机填满整个屏幕(跟随用户分辨率,无黑边);开启时回退到旧的 16:9 锁定加黑边行为。
// 透视相机填满屏幕会按 Hor+ 水平扩展视野,不会拉伸变形。
public bool lockAspect = false;
private int lastWidth;
private int lastHeight;
@@ -29,6 +33,13 @@ public class CameraLetterbox : MonoBehaviour
void ApplyLetterbox()
{
Camera cam = GetComponent<Camera>();
if (!lockAspect)
{
cam.rect = new Rect(0f, 0f, 1f, 1f);
return;
}
float screenAspect = (float)Screen.width / Screen.height;
float scaleHeight = screenAspect / targetAspect;