IEnumerator Loading() { loading = true; loadPanel.SetActive(true); player.AllowMove(false); cam.AllowMove(false); Interact.allowInput = false; PauseM.HideCursor(); mainCam.enabled = true; loadtText.text = "Loading"; float t = UnityEngine.Random.Range(2, 5); mainCam.transform.rotation = Quaternion.identity; string dot = "."; while (t > 0) { t -= 1; loadtText.text += dot; yield return(new WaitForSeconds(1f)); } loadPanel.SetActive(false); yield return(new WaitForSeconds(1)); player.AllowMove(true); cam.AllowMove(true); Interact.allowInput = true; CheckAvailability(); StartCoroutine(BreakDown()); }
public void Return() //back to game { Interact.allowInput = true; bookPanel.SetActive(false); fpc.AllowMove(true); pc.AllowMove(true); Interact.allowInput = true; PauseM.HideCursor(); }
IEnumerator Loading()// the loading screen { loading = true; loadPanel.SetActive(true); player.AllowMove(false); cam.AllowMove(false); Interact.allowInput = false; PauseM.HideCursor(); mainCam.enabled = true; secCam.enabled = false; load.text = "Loading"; float t = UnityEngine.Random.Range(2, 5); mainCam.transform.rotation = Quaternion.identity; string dot = "."; while (t > 0) { t -= 1; load.text += dot; yield return(new WaitForSeconds(1f)); } loadPanel.SetActive(false); yield return(new WaitForSeconds(.4f)); player.AllowMove(true); cam.AllowMove(true); Interact.allowInput = true; timer.text = "Press Enter to open the kitcken!"; loading = false; openKitchen = false; while (!openKitchen) { openKitchen = Input.GetKeyDown(KeyCode.Return) | Input.GetKeyDown(KeyCode.KeypadEnter); yield return(null); } StartShift(); }