30 lines
613 B
C#
30 lines
613 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.SceneManagement;
|
|
|
|
public class AutoOrientation : MonoBehaviour
|
|
{
|
|
// Start is called before the first frame update
|
|
void Start()
|
|
{
|
|
Debug.Log($"Screen.width = {Screen.width}");
|
|
Debug.Log($"Screen.width = {Screen.height}");
|
|
|
|
if(Screen.width > Screen.height)
|
|
{
|
|
Debug.Log("这是横屏");
|
|
}
|
|
else
|
|
{
|
|
Debug.Log("这是竖屏");
|
|
}
|
|
}
|
|
|
|
// Update is called once per frame
|
|
void Update()
|
|
{
|
|
|
|
}
|
|
}
|