BloodAndGore/Assets/Scripts/Utils/CameraHelper.cs

22 lines
580 B
C#
Raw Normal View History

2019-08-07 20:03:51 +02:00
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;
2019-08-07 20:03:51 +02:00
private void Update() {
if (LastHeight != Screen.height) {
Camera.orthographicSize = Screen.height * ((0.5f / PixelsPerUnit) / PixelScale);
LastHeight = Screen.height;
}
2019-08-07 20:03:51 +02:00
}
}
}