コード例 #1
0
ファイル: scrDraggable.cs プロジェクト: dkrskl/animal_slice
 public void OnCollisionStay2D(Collision2D col)
 {
     if (!matched && gameObject.name + "_" == col.transform.name) // eğer ID ler uyuşuyorsa
     {
         if (Vector2.Distance(transform.position, col.transform.position) < 1 && controller.selectedObject.tag == "GameController")
         {
             matched            = true;
             transform.position = col.transform.position;
             GetComponent <PolygonCollider2D>().enabled = false;
             StartCoroutine(controller.CheckWinCondition()); // Eğer kazanmışsak kontrol edelim
         }
     }
 }