12345678910111213141516171819 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.UI;
- [ExecuteInEditMode]
- public class BGUICheck : MonoBehaviour
- {
- // Update is called once per frame
- void Update()
- {
- float bl2 = (float)Screen.height / this.GetComponent<RawImage>().texture.height;
- this.GetComponent<RectTransform>().sizeDelta = new Vector2(this.GetComponent<RawImage>().texture.width, this.GetComponent<RawImage>().texture.height);
- this.transform.localScale = new Vector3(bl2, bl2, bl2);
-
- }
- }
|