I have a board of tiles in my game in Unity and I have to select a sequence of tiles by moving the pressed mouse over the tiles like if I would select letters in a such game like on the screenshot. Please, hint me, how can I implement this functionality. I'm just a newby in Unity.
\$\begingroup\$
\$\endgroup\$
6
-
\$\begingroup\$ What is your build target? Mobile, like in the screenshot, or PC/Linux/Mac? \$\endgroup\$Stephan– Stephan2017-11-16 19:00:00 +00:00Commented Nov 16, 2017 at 19:00
-
\$\begingroup\$ Mobile, for Android and iOS. \$\endgroup\$Alexander– Alexander2017-11-16 19:07:23 +00:00Commented Nov 16, 2017 at 19:07
-
\$\begingroup\$ I think using the mouse-enter triggers to queue the object id into an array so you have the order is probably the route you'd want to look into. Do a search for mouse-over events. You should get some good examples. I know for a fact there are several youtube videos about object selection. \$\endgroup\$Stephan– Stephan2017-11-16 19:28:04 +00:00Commented Nov 16, 2017 at 19:28
-
\$\begingroup\$ if you know how to find those videos, please share them with me \$\endgroup\$Alexander– Alexander2017-11-16 19:35:15 +00:00Commented Nov 16, 2017 at 19:35
-
\$\begingroup\$ youtube.com/watch?v=VHeem-mywDk should get you started. Couple with that the check for mouse down and you know the difference between the mouse just passing over, and a selection attempt. \$\endgroup\$Stephan– Stephan2017-11-16 19:43:05 +00:00Commented Nov 16, 2017 at 19:43
|
Show 1 more comment
1 Answer
\$\begingroup\$
\$\endgroup\$
A solution for my problem is using this two methods OnMouseEnter() and OnMouseExit.
