Fungus.Draggable2D.DoBeginDrag C# (CSharp) Method

DoBeginDrag() protected method

protected DoBeginDrag ( ) : void
return void
        protected virtual void DoBeginDrag()
        {
            // Offset the object so that the drag is anchored to the exact point where the user clicked it
            float x = Input.mousePosition.x;
            float y = Input.mousePosition.y;
            delta = Camera.main.ScreenToWorldPoint(new Vector3(x, y, 10f)) - transform.position;
            delta.z = 0f;

            startingPosition = transform.position;

            EventDispatcher.Raise(new DragStarted.DragStartedEvent(this));
        }