Join Dan Violet Sagmiller for an in-depth discussion in this video Live unit info, part of Build a Real-Time Strategy Game with Unity 5.
- [Voiceover] Our drones can attack each other,…but we don't get to see it unless we re-select a unit.…We'll upgrade that so if the unit is selected,…it will refresh their data.…To get to this, I'm gonna go into the Scripts folder,…and then into the Interactions folder,…and from here,…I'll edit the Show Unit Info.…In Show Unit Info, the first thing I'm gonna do…is add a boolean variable up at the top…to define whether or not we should show the data.…The first thing is bool show equals false,…so it's private.…
Next, if this is selected,…instead of actually displaying the data right away,…I'm gonna close this method out,…and just say show equals true.…Then I'll create a new method, void update.…At the beginning of void update,…since it's constantly gonna be displaying the information,…we of course only want this to happen…if we're currently selected.…So I'll say if not show…then return.…
Finally, when we deselect this unit,…I want to tell it to not show anymore,…show equals false.…So now with that saved,…I'm going to return to Unity,…
AuthorDan Violet Sagmiller
- Adding player positions and start info
- Loading prebuilt levels
- Adding camera moves
- Adding a unit
- Supporting navigation
- Adding unit owners and player objects
- Importing and setting up a HUD map
- Adding unit info and credits
- Creating HUD actions
- Building a command base
- Adding artificial intelligence
- Adding battle actions
Skill Level Intermediate
Unity 5: 2D Essential Training (2015)with Jesse Freeman3h 22m Intermediate
1. Initial Setup
2. Adding a Unit
3. Navigation Mesh
4. Unit Owner
5. HUD Map
6. Unit Info & Credits
7. HUD Actions
8. Command Base
9. Base AI
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.