ShowInformation
How do I use Show Information
Below are practical examples compiled from projects for learning and reference purposes
Featured Snippets
Line | Code | Ex.. |
---|---|---|
49 | ShowInformation("+"+_score.ToString()); | 1 |
84 | public void ShowInformation(string info) | 2 |
168 | ui.ShowInformation("+BULLET"); | 3 |
177 | ui.ShowInformation("LIFE MAX"); | 4 |
189 | ui.ShowInformation("SPEED MAX"); | 5 |
File name: UIgame.cs
Copy
45 public void IncreaseScore(int _score)
46 {
47 score += _score;
48 scoreText.text = score + "/" + maximumScore;
49 ShowInformation("+"+_score.ToString());
50
51 if (score >= maximumScore)
52 {
53 scoreAchived = true;
54 }
55
56 }
File name: UIgame.cs
Copy
84 public void ShowInformation(string info)
85 {
86 informationText.text = info;
87 StopCoroutine("ShowInfoForSomeTime");
88 StartCoroutine("ShowInfoForSomeTime");
89 }
File name: PlayerControl.cs
Copy
165 public void IncreaseBulletsByBonus(int bullets = 1)
166 {
167 maxBulletsOnScreen += bullets;
168 ui.ShowInformation("+BULLET");
169 }
File name: PlayerControl.cs
Copy
171 public void IncreaseCurrentLifeByBonus(int addLife = 1)
172 {
173 lifeCurrent += addLife;
174 if (lifeCurrent >= lifeMaximum)
175 {
176 lifeCurrent = lifeMaximum;
177 ui.ShowInformation("LIFE MAX");
178 }
179 else
180 ui.ShowInformation("+LIFE");
181 }
File name: PlayerControl.cs
Copy
183 public void IncreaseSpeedByBonus(int addSpeed = 1)
184 {
185 speedCurrent += addSpeed;
186 if (speedCurrent >= speedMaximum)
187 {
188 speedCurrent = speedMaximum;
189 ui.ShowInformation("SPEED MAX");
190 }
191 else
192 ui.ShowInformation("+SPEED");
193 }
ShowInformation 127 lượt xem
Gõ tìm kiếm nhanh...