Esempio n. 1
0
 private static bool TryGetDebugDragable(out IDebugDragable dragable)
 {
     try {
         return(GameSystems.Raycaster.TryGetTarget(out dragable));
     }
     // ReSharper disable once EmptyGeneralCatchClause
     catch {
         dragable = null;
         return(false);
     }
 }
Esempio n. 2
0
        public void OnRelease()
        {
            if (currentDragable == null)
            {
                return;
            }

            var mouseWorldPoint = Systems.Input.MouseWorldPoint;
            var targetPoint     = mouseWorldPoint + offset;

            currentDragable.SetDebugDraggerGlobals(targetPoint, averagedVelocity);
            currentDragable = null;
        }
Esempio n. 3
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);
        }