using UnityEngine;
using UnityEngine.UI;

namespace MyGame.Scripts
{
    [RequireComponent(typeof(CanvasScaler))]
    public class CanvasScalerChanger : MonoBehaviour
    {
        private float originalAspect = 1334f / 750;

        private void Start()
        {
            // 16:9より縦長の場合UIを変更する
            if ((float)Screen.height / Screen.width <= originalAspect)
            {
                return;
            }
            GetComponent<CanvasScaler>().matchWidthOrHeight = 0;
        }
    }
}