Example #1
0
        void HandleTouchMapEnded(Vector3 touchPos)
        {
            int tileX = Mathf.FloorToInt(touchPos.x / _tileMap.tileSize);
            int tileZ = Mathf.FloorToInt(touchPos.z / _tileMap.tileSize);

            tileZ += 1;

            if (!dragging && singleTouchDown)
            {
                //Negate the z
                _dispatcher.AddPositionToSpawnQueue(new Vector2(tileX, tileZ));
                _dispatcher.SendIdleToPosition(tileX, tileZ);
            }
            else
            {
                dragging = false;
            }

            singleTouchDown = false;
        }