示例#1
0
 private void OnCollisionEnter2D(Collision2D collision)
 {
     if (collision.gameObject.TryGetComponent <Wall>(out Wall wall))
     {
         CollisionToDestroy--;
         if (CollisionToDestroy <= 0)
         {
             BallDestroyer.DestroyBall(gameObject);
         }
     }
 }
示例#2
0
    IEnumerator CheckLifeTime()
    {
        yield return(new WaitForSeconds(LifeTime));

        BallDestroyer.DestroyBall(gameObject);
    }