void OnCollisionEnter2D(Collision2D col) { if (LayerUtil.IsInLayerMask(collisionMask, col.gameObject.layer)) { GameState.DecrementHealth(); } }
void OnCollisionEnter2D(Collision2D col) { if (LayerUtil.IsInLayerMask(collisionMask, col.gameObject.layer)) { lifeEnemy -= 10; if (lifeEnemy <= 0) { Destroy(gameObject); } } }