BloodAndGore/Assets/Scripts/Util/CameraHelper.cs

22 lines
580 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace Saltosion.OneWeapon {
public class CameraHelper : MonoBehaviour {
public Camera Camera;
[Range(1, 4)]
public int PixelScale = 2;
public int PixelsPerUnit = 32;
private int LastHeight = -1;
private void Update() {
if (LastHeight != Screen.height) {
Camera.orthographicSize = Screen.height * ((0.5f / PixelsPerUnit) / PixelScale);
LastHeight = Screen.height;
}
}
}
}