You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
114 lines
2.6 KiB
114 lines
2.6 KiB
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using System.Threading;
|
|
using UnityEngine;
|
|
using UnityEngine.SceneManagement;
|
|
using UnityEngine.UI;
|
|
|
|
public class key : MonoBehaviour
|
|
{
|
|
// Start is called before the first frame update
|
|
|
|
public Transform ob1;
|
|
public Transform ob2;
|
|
public Transform ob3;
|
|
|
|
public Text ur;
|
|
|
|
public bool s=false;
|
|
|
|
void Start()
|
|
{
|
|
Application.targetFrameRate = 60;
|
|
|
|
Screen.SetResolution(1280,720,true);
|
|
|
|
Application.targetFrameRate = 100;
|
|
|
|
for (int i = 0; i < QualitySettings.names.Length; i++)
|
|
{
|
|
Debug.Log("»ÖÊÀàÐÍÓÐÕâЩ£º" + QualitySettings.names[i].ToString());
|
|
|
|
}
|
|
|
|
ur.text = Screen.currentResolution.width+"x"+Screen.currentResolution.height;
|
|
}
|
|
|
|
// Update is called once per frame
|
|
void Update()
|
|
{
|
|
if (Input.GetKeyDown(KeyCode.Alpha1)) {
|
|
if (ob1.gameObject.activeInHierarchy)
|
|
{
|
|
ob1.gameObject.SetActive(false);
|
|
}
|
|
else {
|
|
ob1.gameObject.SetActive(true);
|
|
}
|
|
}
|
|
if (Input.GetKeyDown(KeyCode.Alpha2))
|
|
{
|
|
if (ob2.gameObject.activeInHierarchy)
|
|
{
|
|
ob2.gameObject.SetActive(false);
|
|
}
|
|
else
|
|
{
|
|
ob2.gameObject.SetActive(true);
|
|
}
|
|
}
|
|
if (Input.GetKeyDown(KeyCode.Alpha3))
|
|
{
|
|
if (ob3.gameObject.activeInHierarchy)
|
|
{
|
|
ob3.gameObject.SetActive(false);
|
|
}
|
|
else
|
|
{
|
|
ob3.gameObject.SetActive(true);
|
|
}
|
|
}
|
|
|
|
if (Input.GetKeyDown(KeyCode.Alpha0))
|
|
{
|
|
|
|
SceneManager.LoadScene("main");
|
|
}
|
|
|
|
if (Input.GetKeyDown(KeyCode.Alpha4))
|
|
{
|
|
QualitySettings.SetQualityLevel(1, true);
|
|
Debug.Log("q1");
|
|
}
|
|
|
|
if (Input.GetKeyDown(KeyCode.Alpha5))
|
|
{
|
|
QualitySettings.SetQualityLevel(3, true);
|
|
Debug.Log("q3");
|
|
}
|
|
|
|
if (Input.GetKeyDown(KeyCode.Alpha6))
|
|
{
|
|
QualitySettings.SetQualityLevel(5, true);
|
|
Debug.Log("q5");
|
|
}
|
|
|
|
if (Input.GetKeyDown(KeyCode.Alpha6))
|
|
{
|
|
if (s)
|
|
{
|
|
s = false;
|
|
}
|
|
else {
|
|
s= true;
|
|
}
|
|
}
|
|
|
|
if(s) {
|
|
ob1.Rotate(Vector3.up, Time.deltaTime * 100f);
|
|
ob2.Rotate(Vector3.forward, Time.deltaTime * 100f);
|
|
ob3.Rotate(Vector3.left, Time.deltaTime * 100f);
|
|
}
|
|
}
|
|
}
|