예제 #1
0
 public Block ResetDrop()
 {
     if (originalContainer == null)
     {
         return(DropAt(originalPosition));
     }
     else
     {
         originalContainer.OnDrop();
         return(null);
     }
 }
예제 #2
0
    private void Update()
    {
        if (IsHolding() && isEnabled)
        {
            held.transform.position = OffsetMousePosition();

            if (Input.GetMouseButtonUp(0))
            {
                // Notify potential of dropped item
                if (potential != null)
                {
                    potential.OnDrop();
                }
                else
                {
                    // No potential means it was dropped directly on the canvas
                    Drop();
                }
            }
        }
    }