using System.Collections; using System.Collections.Generic; using UnityEngine; public class UI : MonoBehaviour { //机器人 bool StateOfJQR; public GameObject jqr; public GameObject ipad; //窗帘 private void Awake() { StateOfJQR = false; } public void JQR() { if (StateOfJQR) { StateOfJQR = false; jqr.GetComponent().updateState(); } else { StateOfJQR = true; jqr.GetComponent().updateState(); } } private void Update() { if (Input.GetKeyDown(KeyCode.Escape)) { print("按下esc"); ipad.SetActive(false); GameManager.GetInstance().IsPlayerMove = true; GameManager.GetInstance().IsOpenUI = false; } if (Input.GetKeyDown(KeyCode.M)&&GameManager.GetInstance().IsHasIpad) { print("打开ipad"); GameManager.GetInstance().IsPlayerMove = false; GameManager.GetInstance().IsOpenUI = true; ipad.SetActive(true); //Resetipad(); } } private void Resetipad() { } }