Join Dan Violet Sagmiller for an in-depth discussion in this video Drone unit info, part of Unity 5: Build a Real-Time Strategy Game.
- [Voiceover] When I select a unit,…I want its information to display in the info bar.…This means that each unit…will need its own information.…To get that started, I'm going to go into the Scripts folder…and then into the interactions folder.…I'm going to right click and create a new script,…and I'm going to call it ShowUnitInfo.…And now I'll edit ShowUnitInfo.…Inside of the ShowUnitInfo,…the first thing we'll notice is…it's a MonoBehaviour.…I want this to be an Interaction.…This will react when we select a unit.…
We're also going to get rid…of the Start and Update functions.…We'll be using the Interactions Select and Deselect instead.…The fields we need are going to be the lines of text,…or particularly the information…we can build the lines of text with.…So what are some common information…that we'll need about a particular unit.…Well let's start with its name.…public string Name.…Next I would say its health,…how healthy is it, what's its maximum health?…So, public float MaxHealth…, CurrentHealth.…
Finally, let's get its profile picture.…
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?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
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.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.