bad-piggies-0.1.3-porting/Assets/Scripts/Assembly-CSharp/BackgroundScaler.cs

17 lines
358 B
C#
Raw Normal View History

2024-02-24 22:40:44 -05:00
using UnityEngine;
public class BackgroundScaler : MonoBehaviour
{
private Vector3 originalScale;
private void Awake()
{
originalScale = base.transform.localScale;
}
private void Update()
{
base.transform.localScale = new Vector3(originalScale.x * (float)Screen.width / (float)Screen.height / 1.3333334f, originalScale.y, originalScale.z);
}
}