using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;

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

        private void Start()
        {
            if ((float)Screen.height / Screen.width <= originalAspect)
            {
                return;
            }



            if (!Enum.TryParse<GameScenes>(SceneManager.GetActiveScene().name, out var scene))
            {
                return;
            }

            var camera = GetComponent<Camera>();
            switch (scene)
            {
                case GameScenes.CornField:
                    camera.orthographicSize = 13.5f;
                    break;
                case GameScenes.Main:
                    camera.orthographicSize = 14f;
                    break;
                case GameScenes.marketing:
                case GameScenes.Customize:
                    camera.orthographicSize = 13.5f;
                    break;
                case GameScenes.Title:
                    camera.orthographicSize = 13.5f;
                    break;
            }
        }
    }
}