private void OnTriggerEnter2D(Collider2D collision) { if (collision.gameObject.CompareTag("Player")) { PlayerModel.ChangeHealth(-0.5f); } }
protected virtual void OnCollisionEnter2D(Collision2D collision) { if (collision.gameObject.CompareTag("Player")) { isInContact = true; PlayerModel.ChangeHealth(-0.5f); } }
public void UseFirstAidKit() { if (PlayerModel.AvailableFirstAidKits <= 0) { return; } PlayerModel.ChangeHealth(PlayerModel.FirstAidKitRegeneration); }
private void OnTriggerEnter2D(Collider2D collision) { if (collision.gameObject.CompareTag("Player")) { PlayerModel.ChangeHealth(-0.5f); CreateVatOfAcid(); } if (collision.gameObject.CompareTag("Wall")) { Destroy(gameObject); } }
private void OnTriggerEnter2D(Collider2D collision) { if (collision.gameObject.CompareTag("BasicEnemy")) { collision.gameObject.GetComponent <BasicEnemyAi>().ChangeEnemyHealth(-PlayerModel.Damage); } if (collision.gameObject.CompareTag("SpittingEnemy")) { collision.gameObject.GetComponent <SpittingEnemyAi>().ChangeEnemyHealth(-PlayerModel.Damage); } if (collision.gameObject.CompareTag("Boomer")) { collision.gameObject.GetComponent <BoomerAi>().ChangeEnemyHealth(-PlayerModel.Damage); } if (collision.gameObject.CompareTag("TrailEnemy")) { collision.gameObject.GetComponent <TrailEnemyAi>().ChangeEnemyHealth(-PlayerModel.Damage); } if (collision.gameObject.CompareTag("Player")) { PlayerModel.ChangeHealth(-0.5f); } }