예제 #1
0
 private void OnCollisionEnter2D(Collision2D collision)
 {
     if (collision.gameObject.CompareTag("Player"))
     {
         Destroy(this.gameObject);
         UIScript.ChangeTime(timeLoss);
     }
 }
예제 #2
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.CompareTag("Player"))
     {
         UIScript.ChangeTime((float)value);
         Destroy(this.gameObject);
     }
 }
예제 #3
0
 private void Explode()
 {
     timer += Time.deltaTime;
     if (timer >= explode)
     {
         timer = 0.0f;
         Destroy(this.gameObject);
         UIScript.ChangeTime(timeLoss);
     }
 }