DestroyBullet
How do I use Destroy Bullet
Below are practical examples compiled from projects for learning and reference purposes
Featured Snippets
Line | Code | Ex.. |
---|---|---|
26 | DestroyBullet (); | 1 |
33 | void DestroyBullet(){ | 2 |
File name: CannonBullet.cs
Copy
23 void Update () {
24 if (GameplayController.instance.gameInProgress) {
25 if (cannonShot && rigidBody2D.velocity.sqrMagnitude <= 0) {
26 DestroyBullet ();
27 }
28 }
29
30
31 }
File name: CannonBullet.cs
Copy
33 void DestroyBullet(){
34 Destroy (gameObject);
35 if (!isExplode) {
36 isExplode = true;
37 GameObject newExplosionEffect = Instantiate (explosionEffect, transform.position, Quaternion.identity) as GameObject;
38 Destroy (newExplosionEffect, 3f);
39 }
40 }
DestroyBullet 106 lượt xem
Gõ tìm kiếm nhanh...