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