- Home /
Question by
scribblenaughts · Jan 07, 2019 at 08:36 PM ·
c#canvasguitext
How do i display the enemy wave names?
i have 10 waves in my game and i want to display the wave names. how do i display the 10 different level names? e.g "level 1 - annoying dog" and "level 2 - dog invasion"
i also want the text to appear on a canvas because the canvas follows the player. ( The FOV is rather small in comparison to the world)
screenshot-3.png
(4.8 kB)
screenshot-2.png
(10.0 kB)
Comment
Best Answer
Answer by MichaI · Jan 07, 2019 at 11:22 PM
You can just use Canvas UI Text, put your level names into an array and set text value on every wave to coresponding value from the array.
Something like this:
using UnityEngine; using UnityEngine.UI; ... private final string[] levelNames = {"level 1 - annoying dog", "level 2 - dog invasion", ...}; public Text waveNameText; ... waveNameText.text = levelNames[nextWave]; ...
@$$anonymous$$ichal So I need to create just one text object and change what it says through this code?
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
How do I change scene with two ui canvas text 2 Answers