using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class groy : MonoBehaviour {
void Awake()
{
//设置屏幕正方向在Home键右边
Screen.orientation = ScreenOrientation.LandscapeRight;
}
void Start ()
{
//设置屏幕自动旋转, 并置支持的方向
Screen.orientation = ScreenOrientation.AutoRotation;
Screen.autorotateToLandscapeLeft = true;
Screen.autorotateToLandscapeRight = true;
Screen.autorotateToPortrait = false;
Screen.autorotateToPortraitUpsideDown = false;
}
}
Unity 代码实现锁定手机横屏
最新推荐文章于 2024-07-24 14:19:25 发布