예제 #1
0
        void OnMouseUp()
        {
            var position = transform.position;

            _beingDragged = false;
            /* transform.position = ClampPosition(position); */
            SlidingPuzzle._grid.AlignTransform(transform);
            lastSnap = position;
            SlidingPuzzle.RegisterObstacle(transform, false);
        }
예제 #2
0
        void OnMouseDown()
        {
            var touchPoint = Camera.main.ScreenToWorldPoint(Input.mousePosition);
            var position   = transform.position;
            var scale      = transform.lossyScale;

            _beingDragged = true;
            touchOffset   = touchPoint - position;
            lastSnap      = position;
            _bounds       = SlidingPuzzle.CalculateSlidingBounds(position, scale);

            SlidingPuzzle.RegisterObstacle(transform, true);
        }
예제 #3
0
 void Start()
 {
     _beingDragged = false;
     SlidingPuzzle.RegisterObstacle(transform, false);
 }