BulletIsOff
How do I use Bullet Is Off
Below are practical examples compiled from projects for learning and reference purposes
Featured Snippets
Line | Code | Ex.. |
---|---|---|
25 | BulletIsOff(); | 1 |
37 | void BulletIsOff() | 2 |
46 | BulletIsOff(); | 3 |
25 | BulletIsOff(); | 4 |
33 | BulletIsOff(); | 5 |
42 | void BulletIsOff() | 6 |
File name: EnemyBullet.cs
Copy
21 void OnTriggerExit(Collider col)
22 {
23 if (col.tag == "SpawnBorders")
24 {
25 BulletIsOff();
26 }
27 }
File name: EnemyBullet.cs
Copy
37 void BulletIsOff()
38 {
39 rb.velocity = Vector3.zero;
40 gameObject.SetActive(false);
41 }
File name: EnemyBullet.cs
Copy
43 IEnumerator BulletLifeTime()
44 {
45 yield return new WaitForSeconds(10);
46 BulletIsOff();
47 }
File name: PlayerBullet.cs
Copy
21 void OnTriggerExit(Collider col)
22 {
23 if (col.tag == "SpawnBorders")
24 {
25 BulletIsOff();
26 }
27 }
File name: PlayerBullet.cs
Copy
29 void OnTriggerEnter(Collider col)
30 {
31 if (col.tag == "Building")
32 {
33 BulletIsOff();
34 }
35 else if (col.tag == "Enemy")
36 {
37 col.GetComponent
38 BulletIsOff();
39 }
40 }
File name: PlayerBullet.cs
Copy
42 void BulletIsOff()
43 {
44 PlayerControl.maxBulletsOnScreen++;
45 rb.velocity = Vector3.zero;
46 gameObject.SetActive(false);
47 }
BulletIsOff 105 lượt xem
Gõ tìm kiếm nhanh...