ShootOrPauseControls
How do I use Shoot Or Pause Controls
Below are practical examples compiled from projects for learning and reference purposes
Featured Snippets
Line | Code | Ex.. |
---|---|---|
41 | ShootOrPauseControls(); | 1 |
49 | void ShootOrPauseControls() | 2 |
File name: PlayerControl.cs
Copy
49 void ShootOrPauseControls()
50 {
51 if (!SystemScr.paused)
52 {
53 if (Input.GetMouseButtonDown(0) || Input.GetKeyDown(KeyCode.Space))
54 {
55 GameObject p_bullet = pools.GetPoolableObject("p_bullet");
56
57 if (p_bullet != null && maxBulletsOnScreen > 0)
58 {
59 sounds.PlaySoundsPlayer(0);
60 p_bullet.SetActive(true);
61 p_bullet.GetComponent
62 }
63 }
64 }
65 if (Input.GetKeyDown(KeyCode.Escape))
66 {
67 ui.Pause_btn();
68 }
69 }
ShootOrPauseControls 126 lượt xem
Gõ tìm kiếm nhanh...