コード例 #1
0
ファイル: BottomController.cs プロジェクト: VegK/Arkanoid
 private void OnTriggerEnter(Collider other)
 {
     if (other.tag == "Ball")
     {
         if (!BallController.DestroyBall(other.gameObject))
         {
             PlayerController.Instance.Life--;
         }
     }
 }
コード例 #2
0
    private void OnTriggerEnter2D(Collider2D other)
    {
        BallController ballToRemove = other.GetComponent <BallController>();

        if (ballToRemove)
        {
            ballToRemove.DestroyBall();
        }
        else if (other.GetComponent <Collectible>())
        {
            Destroy(other);
        }
    }