void OnTriggerEnter2D(Collider2D col) { if (col.gameObject.tag == "Bottom") { gameOverScript.GameOver(); } if (col.gameObject.tag == "Flag") { gameManager.GetComponent <StageClearScript>().stageClear(); } if (col.gameObject.tag == "CheckPoint") { Sound.LoadSe("checkPoint", "passedCheckPoint"); Sound.PlaySe("checkPoint"); col.gameObject.GetComponent <SpriteRenderer> ().color = Color.green; GameManagerScript.passedCheckPoint = true; } if (col.gameObject.tag == "Message") { messageScript.getMessage(col.gameObject.name); } }
public void ShowGameOverPanel() { if (gameOver != null) { gameOver.GameOver(currentScore, currentSStars, isUnstable); } }
void OnTriggerEnter2D(Collider2D cl) { if (cl.gameObject.tag == "Box" && !bonuses.bonus3) { gameOv.GameOver(); } }
void LoseToManyBoxes() { if (box2 && transform.localPosition.y > 8.5f) { go.GameOver(); gameObject.SetActive(false); } }
private void DeathWait5Seconds() { if (OnEndDeath != null) { OnEndDeath(); } gameOverController.GameOver(); }
void OnCollisionEnter2D(Collision2D col) { if (!muteki) { if (col.gameObject.transform.parent != null && col.gameObject.transform.parent.gameObject.tag == "Enemy" && !col.gameObject.GetComponent <BatScript> ().getBubbledFlag()) { animator.enabled = false; playerSprite.sprite = almostStumble; gameOverScript.GameOver(); } } else { if (col.gameObject.transform.parent != null && col.gameObject.transform.parent.gameObject.tag == "Enemy") { Destroy(col.gameObject); } } if (col.gameObject.tag == "Star") { Destroy(col.gameObject); Sound.PlayBgm("muteki"); walkSpeed *= 2; muteki = true; animator.SetBool("Invisible", true); Invoke("invincibleOver", 8); } if (col.gameObject.tag == "Obstacle") { directionChange(); } print(rotateExtent); if (rotateExtent > 70 && rotateExtent < 290) { if (col.gameObject.tag == "Ground" || col.gameObject.tag == "Line") { gameOverScript.GameOver(); } } }
public void ModifyValue(int modifier) { value = Mathf.Clamp(value + modifier, 0, maxValue); bar.fillAmount = (float)value / maxValue; bar.color = Colorx.Slerp(new Color(0.75f, 0.1f, 0.1f), new Color(0.35f, 0.67f, 0.35f), bar.fillAmount); if (value <= 0) { gameOver.GameOver(gameObject.tag); } }
public void decreaseHealth() { health -= 10; updateHealth(health); if (health <= 0) { Instantiate(PlayerExplosion, player.transform.position, player.transform.rotation); Destroy(player.gameObject, 0.1f); gameOverScript.GameOver(); } }
public void DamagePlayer(int dmg) { PLAYER_HITPOINTS = PLAYER_HITPOINTS - dmg; hpslider.value = PLAYER_HITPOINTS; damagetaken++; if (PLAYER_HITPOINTS <= 0) { //Player Dead Debug.Log("Player Died"); gameover.GameOver(); } }
private void Update() { timer -= Time.deltaTime; timer = Mathf.Clamp(timer, 0, 300); float min = Mathf.FloorToInt(timer / 60); float sec = Mathf.FloorToInt(timer % 60); timeText.text = DateTime.Now.ToString(); timerText.text = string.Format("{0:00}:{1:00}", min, sec); if (timer <= 0) { gameOver.SetActive(true); gameOverScript.GameOver(infectAi.getInfected, infectAi.getNoMask, "Time's Up"); } if (infectAi.getInfected == 0 && infectAi.getNoMask == 0) { gameOver.SetActive(true); gameOverScript.GameOver(infectAi.getInfected, infectAi.getNoMask, "Congraulations"); } }
public void TakeDamage(int damageAmount) { if (!isDead) { health -= Mathf.Clamp(damageAmount - defence, 1, damageAmount); GetComponent <SpriteRenderer>().color = Color.red; GetComponent <SpriteRenderer>().DOColor(Color.white, 0.2f); screenFlash.TakeDamage(); soundScript.OnGettingHit(); hud.UpdateHealth(); if (health <= 0) { soundScript.OnDeath(); DeathAnimation(); GetComponent <PlayerMovement>().enabled = false; gameOver.GameOver(); isDead = true; enabled = false; } } }
public void TakeDamage(int damageAmount) { if (!isDead) { // Reduce our health taking our defence in mind // An attack will always do 1 damage health -= Mathf.Clamp(damageAmount - defence, 1, damageAmount); soundScript.OnGettingHit(); hud.UpdateHealth(); // If the health drops to 0 or lower the player dies if (health <= 0) { soundScript.OnDeath(); GetComponent <PlayerMovement>().enabled = false; gameOver.GameOver(); isDead = true; enabled = false; } } }
void Die() { GameOverCall.GameOver(); //Destroy(gameObject); }
void OnTriggerEnter2D(Collider2D col) { gameOverScript.GameOver(); }