コード例 #1
0
    // Update is called once per frame

    private void OnCollisionEnter2D(Collision2D collision)
    {
        Debug.Log("black");
        if (collision.Equals(playerGoalBoundry))
        {
            Debug.Log("Sup");
        }
    }
コード例 #2
0
 void OnCollisionEnter2D(Collision2D collision)
 {
     if (!collision.Equals(ParentShip))
     {
         Destroy(gameObject);
         ParentShip.shotExists = false;
     }
 }
コード例 #3
0
 void OnCollisionEnter2D(Collision2D other)
 {
     if (other.transform.tag == "Ball")
     {
         if (PlayerPrefs.GetInt("Toggle Invincibility") == 0)
         {
             life--;
             plife--;
         }
         if (plife > -1)
         {
             other.transform.position = spawnPoint;
             other.Equals(null);
         }
         else
         {
             gameOver = true;
         }
     }
 }