或者你看下我的cs脚本,是不是错误了,我贴出来using UnityEngine;using System.Collections;public class t1 : MonoBehaviour {// Use this for initializationvoid Awake(){//设置屏幕正方向在Home键右边Screen.orientation = ScreenOrientation.LandscapeRight;}void Start () {//设置屏幕自动旋转, 并置支持的方向Screen.orientation = ScreenOrientation.AutoRotation;Screen.autorotateToLandscapeLeft = true;Screen.autorotateToLandscapeRight = true;Screen.autorotateToPortrait = false;Screen.autorotateToPortraitUpsideDown = false;}// Update is called once per framevoid Update () {AndroidJavaClass jc = new AndroidJavaClass (“com.unity3d.player.UnityPlayer”);AndroidJavaObject jo = jc.GetStatic (“currentActivity”);if (GUI.Button(new Rect(10, 10, 300, 100),”test”)) {jo.Call (“Max”);}}void OnGUI(){AndroidJavaClass jc = new AndroidJavaClass (“com.unity3d.player.UnityPlayer”);AndroidJavaObject jo = jc.GetStatic (“currentActivity”);if (GUI.Button(new Rect(10, 10, 300, 100),”test”)) {jo.Call (“Max”);}}}
max unity 方向_Unity3D研究院之设置自动旋转屏幕默认旋转方向
最新推荐文章于 2024-07-24 14:19:25 发布