using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
namespace BITKit.UX
{
///
/// Created by Vitens on 2020/12/11 20:48:35
///
/// Description :
/// 全屏背景图片等比例拉伸自适应
///
[ExecuteInEditMode]
public class UGUIBackgroundImageScaler : MonoBehaviour
{
//图片原大小(压缩前的)
[SerializeField] private Vector2 textureOriginSize = new Vector2(2048, 1024);
// Start is called before the first frame update
private void Start()
{
Scaler();
}
//适配
private void Scaler()
{
//当前画布尺寸
Vector2 canvasSize = gameObject.GetComponentInParent