Danger
How do I use Danger
Below are practical examples compiled from projects for learning and reference purposes
Featured Snippets
Line | Code | Ex.. |
---|---|---|
102 | if (col.tag == "Enemy" || col.tag == "Danger") | 1 |
File name: PlayerControl.cs
Copy
100 void OnTriggerEnter(Collider col)
101 {
102 if (col.tag == "Enemy" || col.tag == "Danger")
103 {
104 GetDamage();
105 }
106 if (col.tag == "Bonus")
107 {
108 sounds.PlaySoundsPlayer(3);
109 GetBonusEffect(col.GetComponent
110 ui.ShowLives(lifeCurrent);
111 col.gameObject.SetActive(false);
112 }
113 }
Danger 89 lượt xem
Gõ tìm kiếm nhanh...