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