Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/habrador/unity-select-units-within-rectangle-tutorial
Unity tutorial on how to select units within rectangle
https://github.com/habrador/unity-select-units-within-rectangle-tutorial
gamedev opensource unity unity-tutorial unity3d
Last synced: about 1 month ago
JSON representation
Unity tutorial on how to select units within rectangle
- Host: GitHub
- URL: https://github.com/habrador/unity-select-units-within-rectangle-tutorial
- Owner: Habrador
- License: mit
- Created: 2020-04-20T07:48:59.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-07-13T11:18:52.000Z (over 4 years ago)
- Last Synced: 2024-08-03T05:15:02.209Z (5 months ago)
- Topics: gamedev, opensource, unity, unity-tutorial, unity3d
- Language: C#
- Homepage: https://www.habrador.com/tutorials/select-units-within-rectangle/
- Size: 114 KB
- Stars: 25
- Watchers: 2
- Forks: 9
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Select units within rectangle
Source code for Unity tutorial on how to select units within rectangle. Notice that the code is not exactly as in the tutorial because I've learned one or two things but the idea is the same. The main difference you should change is that border of the selection square has to be 2 pixels wide, or you will see some flickering.
![Closest point on line segment](/_media/select-units-within-square.png?raw=true)
YouTube video showing the result:
[![Select units in Unity video](http://img.youtube.com/vi/DXsF87vbwYU/0.jpg)](http://www.youtube.com/watch?v=DXsF87vbwYU "Select units in Unity video")
Link to the tutorial: https://www.habrador.com/tutorials/select-units-within-rectangle/
If you also want to highlight the units you selected with some rectangle around it, the idea is basically the same. This is a good tutorial on the topic: https://www.youtube.com/watch?v=2Tgqr1_ajqE