There is a match3 toy. For the mouse, the code was (the script hangs on the cube, the cube object is the same for everyone, only the color is changed))
void OnMouseDown() { //само действие } Works. I tried for the touchpad to do so
public void fortouch() { if (Input.touchCount > 0 && Input.GetTouch(0).phase == TouchPhase.Began) { // само действие }} fortouch itself is hung in Update. When we start the game, by pressing the screen, a large pile of dice is immediately allocated, although in Array there is only room for two.
The question is actually such - how to make the same touches on the touchscreen as if it were a mouse click? The resources for all the cubes are the same, they differ only in colors, maybe this is a snag for the failure of my code for the wheelbarrow? When there were no heaps of identical objects on the scene, it seemed to work fine. But the mouse does not interfere?