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); } } }