void WrongAnswer() { GMAudioSource.Play(); shake.Shake(0.08f, 0.2f); // shakes screen slightly flash.Flash(); // Flashes a red screen timer.DecTime(); // Removs a set amount of time }
void OnCollisionEnter(Collision collision) { Debug.Log(collision.gameObject.name); if (collision.gameObject.name == "Bullet(Clone)") { RedFlash.Flash(); Destroy(collision.gameObject); } }
void WrongAnswer() { countConsecutiveCorrect = 0; GMAudioSource.clip = wrongAnswer; GMAudioSource.Play(); shake.Shake(0.08f, 0.2f); // shakes screen slightly flash.Flash(); // Flashes a red screen lives.DecLife(); // Removes a life }
void WrongAnswer(Stack <int> was) { Debug.Log("Wrong!"); shake.Shake(0.08f, 0.2f); flash.Flash(); // Move Kappa closer to screen Vector3 pos = kappa.transform.localPosition; pos.y -= 1.15f; kappa.transform.localPosition = pos; Vector3 scale = kappa.transform.localScale; scale.x += 0.16f; scale.y += 0.16f; kappa.transform.localScale = scale; // Decrement Life and Remove 1 Heart lives -= 1; Debug.Log("lives = " + lives); heartHolder.GetChild(lives).gameObject.SetActive(false); // Highlight slots with wrong answers in them Color colorRed; colorRed = Color.red; colorRed.a = 0.393f; while (was.Count > 0) { int cur = was.Pop(); currentSlots[cur].GetComponent <Image>().color = colorRed; } // Die opperation if life < 0 if (lives <= 0) { UI_Interface.SetActive(false); UI_DnD.SetActive(false); Pause_Menue.SetActive(false); itemView.SetActive(false); DieScreen.SetActive(true); } }