Join Dan Violet Sagmiller for an in-depth discussion in this video Select on mouse click, part of Unity 5: Build a Real-Time Strategy Game.
- [Voiceover] So now we'll create a mouse manager.…This will check for mouse clicks.…Particularly, it will check to see which items…have been clicked on in the 3D space.…If that item is interactive, it'll call the Select function.…It'll also deselect any items that were previously selected,…will also handle multi-select with the Shift key.…It might sound like a lot, but we've…already done some of this architecture.…So, to get started, I'm gonna create a new script.…Now let's edit the Mouse Manager.…I know I'm gonna want a generic collection,…so I'm gonna add Generic right now.…
Next, I need a list, a list of the interactives,…all the selections we have.…So I'm gonna say, "private List<Interactive>…"Selections = new".…I don't need to initialize anything,…so I'm gonna get rid of the Start function.…In the Update, I'm basically gonna wanna see…where I can escape the Update function as soon as I can,…so as not to waste any additional processing.…So the first thing I'll check for, is if the user…isn't clicking the mouse button, then ignore this.…
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.