using System.Collections; using System.Collections.Generic; using UnityEngine; public class UIBG : MonoBehaviour { // Start is called before the first frame update void Start() { } // Update is called once per frame void Update() { float bl = (float)Screen.width / 5760f; float bl2 = (float)Screen.height / 1620f; if(bl>bl2) { this.transform.localScale = new Vector3(bl2,bl2,bl2); }else { this.transform.localScale = new Vector3(bl, bl, bl); } } }