generated from VR-Sexe/Unity3DTemplate
32 lines
886 B
C#
32 lines
886 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class UIRotation : MonoBehaviour
|
|
{
|
|
public GameObject canvas1;
|
|
public GameObject canvas2;
|
|
public GameObject stepup1;
|
|
public GameObject card1;
|
|
// Start is called before the first frame update
|
|
void Start()
|
|
{
|
|
}
|
|
|
|
// Update is called once per frame
|
|
void Update()
|
|
{
|
|
|
|
if(Input.deviceOrientation == DeviceOrientation.LandscapeLeft || Input.deviceOrientation == DeviceOrientation.LandscapeRight) {
|
|
canvas1.SetActive(false);
|
|
canvas2.SetActive(true);
|
|
} else if(Input.deviceOrientation == DeviceOrientation.Portrait) {
|
|
canvas1.SetActive(true);
|
|
card1.SetActive(true);
|
|
stepup1.SetActive(false);
|
|
canvas2.SetActive(false);
|
|
}
|
|
}
|
|
}
|