示例#1
0
 private void OnTriggerEnter2D(Collider2D other)
 {
     explosion.start();
     screenShake.shake(shakeAmount, shakeDuration);
     Instantiate(explosionEffect, transform.position, explosionEffect.transform.rotation);
     Destroy(gameObject);
 }
示例#2
0
 private void OnTriggerEnter2D(Collider2D other)
 {
     if (!isActive || !other.CompareTag("Enemy"))
     {
         return;
     }
     explosion.start();
     screenShake.shake(shakeAmount, shakeDuration);
     Instantiate(explosionEffect, transform.position, explosionEffect.transform.rotation);
     Destroy(gameObject);
 }