void Update() { if (grounded && Input.GetKeyDown(KeyCode.Space)) { Jump(); } if (powerBar.GetFillamount() == 1.0f && Input.GetKeyUp(KeyCode.Alpha4) && !resetCamera) { resetCamera = true; StartCoroutine(ZoomInCamera(audioFiles[0], 0.75f, 2.0f)); } }
// Update is called once per frame void Update() { if (Input.GetKeyDown(KeyCode.Alpha1)) { SetDemonstration(0); } if (Input.GetKeyDown(KeyCode.Alpha2)) { SetDemonstration(1); } if (Input.GetKeyDown(KeyCode.Alpha3)) { SetDemonstration(2); } //Set new target for spotlight if (spotlight.ReachedTarget()) { spotlight.SetTarget(new Vector3(Random.Range(-10, 10), spotlight.transform.position.y, spotlight.transform.position.z)); spotlight.SetSpeed(Random.Range(0.1f, 0.9f)); } //Check if the player is in the spotlight if not drop approval. if (spotlight.InSpotLight(GameObject.Find("Dan").transform.position)) { powerBar.ChangeBar(0.001f); } else { powerBar.ChangeBar(0); } cooldown -= 0.01f; if (cooldown < 0) { t.text = ""; } if (powerBar.GetFillamount() == 1) { instructions.text = "PRESS 4"; } else { instructions.text = ""; } }
// Update is called once per frame void Update() { if (fullReset) { if (statBar.GetFillamount() < 0.94f) { statBar.TempChangeBar(0.05f); } else { fullReset = false; } } if (!playerFailed && statBar.GetFillamount() == 0.0f) { statBar.gameObject.SetActive(false); emotionRenderer.sprite = null; gameObject.GetComponent <SpriteRenderer>().color = new Color32(255, 255, 255, 50); failureRenderer.enabled = true; playerFailed = true; GameManager.gameManager.activeDuders--; } }