IInterractWithBullet
How do I use I Interract With Bullet
Below are practical examples compiled from projects for learning and reference purposes
Featured Snippets
Line | Code | Ex.. |
---|---|---|
33 |
col.GetComponent |
1 |
37 |
col.GetComponent |
2 |
File name: EnemyBullet.cs
Copy
29 void OnTriggerEnter(Collider col)
30 {
31 if (col.tag == "Player")
32 {
33 col.GetComponent
34 }
35 }
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 }
IInterractWithBullet 104 lượt xem
Gõ tìm kiếm nhanh...