Exemple #1
0
 private void OnTriggerEnter2D(Collider2D collider)
 {
     if (collider.tag == GameConstant.ITEM_TAG)
     {
         Destroy(collider.gameObject);
         gameStage.DestroyItem();
     }
 }
Exemple #2
0
 private void OnCollisionEnter2D(Collision2D col)
 {
     if (col.gameObject.tag == GameConstant.POLYGON_TAG)
     {
         if (!isColldied)
         {
             isColldied         = true;
             spriteRender.color = Color.red;
             gameStage.DestroyItem();
         }
     }
 }
Exemple #3
0
 void OnCollisionEnter2D(Collision2D coll)
 {
     if (coll.gameObject.tag == GameConstant.POLYGON_TAG)
     {
         if (!isCollided)
         {
             if (spriteRender != null)
             {
                 spriteRender.color = Color.red;
             }
             gameStage.DestroyItem();
             isCollided = true;
         }
     }
 }