Ejemplo n.º 1
0
        public void Update()
        {
            if (currentDragable == null)
            {
                return;
            }

            // Set the velocity
            var mouseWorldPoint = Systems.Input.MouseWorldPoint;
            var velocity        = currentDragable.GetDebugDraggerPosition() - offset - mouseWorldPoint;

            AverageVelocity(-velocity, sampleTime);

            var targetPoint = mouseWorldPoint + offset;

            currentDragable.SetDebugDraggerGlobals(targetPoint, Vector2.zero);
        }
Ejemplo n.º 2
0
        public void OnPress()
        {
            if (!TryGetDebugDragable(out var dragable))
            {
                return;
            }

            currentDragable  = dragable;
            averagedVelocity = Vector2.zero;

            var mouseWorldPoint = Systems.Input.MouseWorldPoint;
            var currentPoint    = currentDragable.GetDebugDraggerPosition();

            offset = currentPoint - mouseWorldPoint;
            currentDragable.SetDebugDraggerGlobals(currentPoint, Vector2.zero);
        }